Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon van der Zanden2014-08-20 13:20:26 +0000
committerSimon van der Zanden2014-08-20 13:22:52 +0000
commit44c50c9cfe77bc96ee91305b5dd619f6fcdbe49f (patch)
tree679d5dfc8bed677ddc14f365482ec15c1dfb6313 /org.eclipse.jubula.client.core.functions
parenta308175e3d2a87595e370a5121100b64c5b033b3 (diff)
downloadorg.eclipse.jubula.core-44c50c9cfe77bc96ee91305b5dd619f6fcdbe49f.tar.gz
org.eclipse.jubula.core-44c50c9cfe77bc96ee91305b5dd619f6fcdbe49f.tar.xz
org.eclipse.jubula.core-44c50c9cfe77bc96ee91305b5dd619f6fcdbe49f.zip
Sprint task - changed location of functions into new bundle
Signed-off-by: Simon van der Zanden <simon.vanderzanden@bredex.de>
Diffstat (limited to 'org.eclipse.jubula.client.core.functions')
-rw-r--r--org.eclipse.jubula.client.core.functions/META-INF/MANIFEST.MF5
-rw-r--r--org.eclipse.jubula.client.core.functions/plugin.xml196
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/AddFunctionEvaluator.java34
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64DecodeFunctionEvaluator.java25
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64EncodeFunctionEvaluator.java25
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/CentralTestDataSetValueFunctionEvaluator.java273
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/DivideFunctionEvaluator.java33
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/FormateDateEvaluator.java47
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ModifyDateEvaluator.java65
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/MultiplyFunctionEvaluator.java33
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NodeAttributeEvaluator.java56
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NowEvaluator.java23
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ParseDateEvaluator.java34
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RandomIntegerFunctionEvaluator.java26
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RoundFunctionEvaluator.java37
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/StringReplaceAllFunctionEvaluator.java39
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/SubtractFunctionEvaluator.java31
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/TruncateFunctionEvaluator.java39
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/UUIDFunctionEvaluator.java23
19 files changed, 1044 insertions, 0 deletions
diff --git a/org.eclipse.jubula.client.core.functions/META-INF/MANIFEST.MF b/org.eclipse.jubula.client.core.functions/META-INF/MANIFEST.MF
index 8329263a3..19be0a84b 100644
--- a/org.eclipse.jubula.client.core.functions/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.client.core.functions/META-INF/MANIFEST.MF
@@ -5,5 +5,10 @@ Bundle-SymbolicName: org.eclipse.jubula.client.core.functions;singleton:=true
Bundle-Version: 2.4.0.qualifier
Bundle-Vendor: Eclipse Jubula
Bundle-Localization: plugin
+Require-Bundle: org.eclipse.jubula.tools;bundle-version="[2.4.0,2.5.0)",
+ org.apache.commons.lang;bundle-version="[2.4.0,3.0.0)",
+ org.apache.commons.codec;bundle-version="[1.3.0,2.0.0)",
+ org.eclipse.jubula.client.core;bundle-version="[2.4.0,2.5.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
+
diff --git a/org.eclipse.jubula.client.core.functions/plugin.xml b/org.eclipse.jubula.client.core.functions/plugin.xml
index 8d9d3325c..8100fe995 100644
--- a/org.eclipse.jubula.client.core.functions/plugin.xml
+++ b/org.eclipse.jubula.client.core.functions/plugin.xml
@@ -8,4 +8,200 @@
http://www.eclipse.org/legal/epl-v10.html
-->
<plugin>
+ <extension
+ point="org.eclipse.jubula.client.core.functions">
+ <function
+ class="org.eclipse.jubula.client.core.functions.AddFunctionEvaluator"
+ evaluator="local"
+ name="add">
+ <varArg
+ defaultArgumentCount="2"
+ type="number">
+ </varArg>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.RoundFunctionEvaluator"
+ evaluator="local"
+ name="round">
+ <parameter
+ name="toRound"
+ type="number">
+ </parameter>
+ <parameter
+ name="precision"
+ type="number">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.DivideFunctionEvaluator"
+ evaluator="local"
+ name="div">
+ <parameter
+ name="dividend"
+ type="number">
+ </parameter>
+ <parameter
+ name="divisor"
+ type="number">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.MultiplyFunctionEvaluator"
+ evaluator="local"
+ name="mult">
+ <varArg
+ defaultArgumentCount="2"
+ type="number">
+ </varArg>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.SubtractFunctionEvaluator"
+ evaluator="local"
+ name="sub">
+ <parameter
+ name="minuend"
+ type="number">
+ </parameter>
+ <parameter
+ name="subtrahend"
+ type="number">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.TruncateFunctionEvaluator"
+ evaluator="local"
+ name="trunc">
+ <parameter
+ name="toTruncate"
+ type="number">
+ </parameter>
+ <parameter
+ name="precision"
+ type="number">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.NowEvaluator"
+ evaluator="local"
+ name="now">
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.ModifyDateEvaluator"
+ evaluator="local"
+ name="modifyDate">
+ <parameter
+ name="date"
+ type="string">
+ </parameter>
+ <parameter
+ name="offset"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.ParseDateEvaluator"
+ evaluator="local"
+ name="parseDate">
+ <parameter
+ name="dateString"
+ type="string">
+ </parameter>
+ <parameter
+ name="formatString"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.FormateDateEvaluator"
+ evaluator="local"
+ name="formatDate">
+ <parameter
+ name="date"
+ type="string">
+ </parameter>
+ <parameter
+ name="formatString"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.NodeAttributeEvaluator"
+ evaluator="local"
+ name="getNodeAttribute">
+ <parameter
+ name="attributeName"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.CentralTestDataSetValueFunctionEvaluator"
+ evaluator="local"
+ name="getCentralTestDataSetValue">
+ <parameter
+ name="dataSetName"
+ type="string">
+ </parameter>
+ <parameter
+ name="keyColumnName"
+ type="string">
+ </parameter>
+ <parameter
+ name="entryKey"
+ type="string">
+ </parameter>
+ <parameter
+ name="columnName"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.StringReplaceAllFunctionEvaluator"
+ evaluator="local"
+ name="replaceAll">
+ <parameter
+ name="string"
+ type="string">
+ </parameter>
+ <parameter
+ name="regex"
+ type="string">
+ </parameter>
+ <parameter
+ name="replacement"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.UUIDFunctionEvaluator"
+ evaluator="local"
+ name="uuid">
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.RandomIntegerFunctionEvaluator"
+ evaluator="local"
+ name="randomInt">
+ <parameter
+ name="exclusiveMaxValue"
+ type="number">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.Base64EncodeFunctionEvaluator"
+ evaluator="local"
+ name="base64Encode">
+ <parameter
+ name="string"
+ type="string">
+ </parameter>
+ </function>
+ <function
+ class="org.eclipse.jubula.client.core.functions.Base64DecodeFunctionEvaluator"
+ evaluator="local"
+ name="base64Decode">
+ <parameter
+ name="string"
+ type="string">
+ </parameter>
+ </function>
+ </extension>
</plugin>
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/AddFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/AddFunctionEvaluator.java
new file mode 100644
index 000000000..a6fca8c3e
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/AddFunctionEvaluator.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+
+/**
+ * Function that adds 0..n numbers.
+ */
+public class AddFunctionEvaluator implements IFunctionEvaluator {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) {
+
+ double result = 0;
+
+ for (String arg : arguments) {
+ result += Double.parseDouble(arg);
+ }
+
+ return String.valueOf(result);
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64DecodeFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64DecodeFunctionEvaluator.java
new file mode 100644
index 000000000..f8e0ecb3f
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64DecodeFunctionEvaluator.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+/**
+ * Function that decodes a base 64 string into a string
+ */
+public class Base64DecodeFunctionEvaluator extends AbstractFunctionEvaluator {
+ /** {@inheritDoc} */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 1);
+ return new String(Base64.decodeBase64(arguments[0].getBytes()));
+ }
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64EncodeFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64EncodeFunctionEvaluator.java
new file mode 100644
index 000000000..50b211d34
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/Base64EncodeFunctionEvaluator.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+/**
+ * Function that encodes a given string into a base 64 string
+ */
+public class Base64EncodeFunctionEvaluator extends AbstractFunctionEvaluator {
+ /** {@inheritDoc} */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 1);
+ return new String(Base64.encodeBase64(arguments[0].getBytes()));
+ }
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/CentralTestDataSetValueFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/CentralTestDataSetValueFunctionEvaluator.java
new file mode 100644
index 000000000..204cb7e5a
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/CentralTestDataSetValueFunctionEvaluator.java
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2013 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+package org.eclipse.jubula.client.core.functions;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.eclipse.jubula.client.core.ClientTest;
+import org.eclipse.jubula.client.core.businessprocess.ITestExecutionEventListener;
+import org.eclipse.jubula.client.core.businessprocess.TestDataCubeBP;
+import org.eclipse.jubula.client.core.businessprocess.TestExecution;
+import org.eclipse.jubula.client.core.businessprocess.TestExecutionEvent;
+import org.eclipse.jubula.client.core.businessprocess.TestExecutionEvent.State;
+import org.eclipse.jubula.client.core.model.IParamDescriptionPO;
+import org.eclipse.jubula.client.core.model.ITDManager;
+import org.eclipse.jubula.client.core.model.ITestDataCubePO;
+import org.eclipse.jubula.client.core.model.ITestDataPO;
+import org.eclipse.jubula.client.core.persistence.GeneralStorage;
+import org.eclipse.jubula.client.core.utils.ExecObject;
+import org.eclipse.jubula.client.core.utils.GuiParamValueConverter;
+import org.eclipse.jubula.client.core.utils.NullValidator;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+import org.eclipse.jubula.tools.messagehandling.MessageIDs;
+
+/**
+ * This function returns the String value of a cell of a central central test
+ * data set. Therefore you need to define an unique key for this central test
+ * data set. You can get the cell value using the parameters DATA_SET_NAME,
+ * ENTRY_KEY, COLUMN_NAME.
+ *
+ * @author BREDEX GmbH
+ */
+public class CentralTestDataSetValueFunctionEvaluator
+ extends AbstractFunctionEvaluator {
+ /**
+ * a map of the data cubes
+ */
+ private static final Map<String, ITestDataCubePO> DATA_CUBES =
+ new HashMap<String, ITestDataCubePO>();
+ /**
+ * the parameter descriptions
+ */
+ private static final Map<ITestDataCubePO,
+ Map<String, IParamDescriptionPO>> PARAM_DESCRIPTIONS =
+ new HashMap<ITestDataCubePO, Map<String, IParamDescriptionPO>>();
+ /**
+ * the unique key map
+ */
+ private static final Map<IParamDescriptionPO,
+ Map<String, Integer>> UNIQUE_KEYS =
+ new HashMap<IParamDescriptionPO, Map<String, Integer>>();
+
+ /**
+ * Add listener that refresh the caching of central test data sets every time the test
+ * execution starts
+ */
+ static {
+ ClientTest.instance()
+ .addTestExecutionEventListener(new ITestExecutionEventListener() {
+ public void stateChanged(TestExecutionEvent event) {
+ if (event.getState() == State.TEST_EXEC_RESULT_TREE_READY) {
+ registerDataCubes();
+ PARAM_DESCRIPTIONS.clear();
+ UNIQUE_KEYS.clear();
+ }
+ }
+ public void endTestExecution() {
+ PARAM_DESCRIPTIONS.clear();
+ UNIQUE_KEYS.clear();
+ }
+ });
+ }
+
+ /**
+ * Register all central test data sets that are available and create a cache with the
+ * name of the central test data set as key
+ */
+ private static void registerDataCubes() {
+ DATA_CUBES.clear();
+ ITestDataCubePO[] allTestDataCubesFor = TestDataCubeBP
+ .getAllTestDataCubesFor(GeneralStorage.getInstance()
+ .getProject());
+ for (ITestDataCubePO testDataCubePO : allTestDataCubesFor) {
+ DATA_CUBES.put(testDataCubePO.getName(), testDataCubePO);
+ }
+ }
+
+ /**
+ * Register all columns in a central test data set and create a cache with the name of
+ * the column as key
+ *
+ * @param dataSet
+ * the data table, that has different columns
+ * @return a map with all columns for this central test data sets
+ */
+ private static Map<String, IParamDescriptionPO> registerParamDescription(
+ ITestDataCubePO dataSet) {
+
+ Map<String, IParamDescriptionPO> paramDescriptionsForOneDataSet =
+ new HashMap<String, IParamDescriptionPO>();
+ for (IParamDescriptionPO description : dataSet.getParameterList()) {
+ paramDescriptionsForOneDataSet.put(description.getName(),
+ description);
+ }
+ PARAM_DESCRIPTIONS.put(dataSet, paramDescriptionsForOneDataSet);
+ return paramDescriptionsForOneDataSet;
+ }
+
+ /**
+ * Register all key values for a key column of a specific central test data set.
+ *
+ * @param dataSet
+ * central test data set that contains keys and columns
+ * @param keyColumn
+ * Column where the key is stored
+ * @param lang
+ * language to get the key value
+ * @return a map specific for the column containing the row number for a
+ * given key
+ * @throws InvalidDataException
+ */
+ private static Map<String, Integer> registerUniqueKeyMap(
+ ITestDataCubePO dataSet, IParamDescriptionPO keyColumn, Locale lang)
+ throws InvalidDataException {
+ Map<String, Integer> keyMap;
+ keyMap = new HashMap<String, Integer>();
+ ITDManager dataManager = dataSet.getDataManager();
+ for (int i = 0; i < dataManager.getDataSetCount(); i++) {
+ ITestDataPO cell = dataManager.getCell(i, keyColumn);
+ String cellValue = cell.getValue(lang);
+ if (keyMap.get(cellValue) != null) {
+ throw new InvalidDataException("The key '" + cellValue //$NON-NLS-1$
+ + "' for column '" + keyColumn.getName() //$NON-NLS-1$
+ + "' is not unique in central test data set '" + dataSet.getName() //$NON-NLS-1$
+ + "'!", MessageIDs.E_FUNCTION_EVAL_ERROR); //$NON-NLS-1$
+ }
+ keyMap.put(cellValue, i);
+ }
+ UNIQUE_KEYS.put(keyColumn, keyMap);
+ return keyMap;
+ }
+
+ /** {@inheritDoc} */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 4);
+ ITestDataCubePO dataSet = validateDataSetName(arguments[0]);
+ Locale lang = TestExecution.getInstance().getLocale();
+ IParamDescriptionPO keyColumn = validateColumnName(dataSet,
+ arguments[1]);
+ int entryKey = validateEntryKey(dataSet, keyColumn, arguments[2], lang);
+ IParamDescriptionPO column = validateColumnName(dataSet, arguments[3]);
+ return getDataSetValue(dataSet, entryKey, column, lang);
+ }
+
+ /**
+ * return the value of a central test data set cell identified by the given parameters
+ *
+ * @param dataSet
+ * where the value is stored
+ * @param row
+ * number of the given row
+ * @param column
+ * descriptor for the column
+ * @param lang
+ * language to get the key value
+ * @return value as a string, if it is another function it would be
+ * validated too
+ * @throws InvalidDataException
+ */
+ private static String getDataSetValue(ITestDataCubePO dataSet, int row,
+ IParamDescriptionPO column, Locale lang)
+ throws InvalidDataException {
+ String dataSetValue = dataSet.getDataManager().getCell(row, column)
+ .getValue(lang);
+ return new GuiParamValueConverter(dataSetValue, dataSet, lang, null,
+ new NullValidator()).getExecutionString(
+ new ArrayList<ExecObject>(), lang);
+ }
+
+ /**
+ * Validate and return descriptor of a central test data set column. Cache will be used
+ * if available. After resolving any key from the given central test data set, all
+ * columns in this set should be cached.
+ *
+ * @param dataSet
+ * that contains value
+ * @param columnName
+ * unique name of the column in this central test data set
+ * @return descriptor for this column
+ * @throws InvalidDataException
+ */
+ private static IParamDescriptionPO validateColumnName(
+ ITestDataCubePO dataSet, String columnName)
+ throws InvalidDataException {
+ Map<String, IParamDescriptionPO> map = PARAM_DESCRIPTIONS
+ .get(dataSet);
+ if (map == null) {
+ map = registerParamDescription(dataSet);
+ }
+ IParamDescriptionPO column = map.get(columnName);
+ if (column != null) {
+ return column;
+ }
+ throw new InvalidDataException("Column '" + columnName //$NON-NLS-1$
+ + "' is not available in central test data set '" + dataSet.getName() + "'!", //$NON-NLS-1$ //$NON-NLS-2$
+ MessageIDs.E_FUNCTION_EVAL_ERROR);
+ }
+
+ /**
+ * Validates if a given key is available in a central test data set and returns the row
+ * number. This method uses keys from a cache if available. If not the key
+ * will be load and put to cache.
+ *
+ * @param dataSet
+ * that contains key
+ * @param keyColumn
+ * that contains key
+ * @param key
+ * unique key
+ * @param lang
+ * language for key value
+ * @return row number
+ * @throws InvalidDataException
+ */
+ private static int validateEntryKey(ITestDataCubePO dataSet,
+ IParamDescriptionPO keyColumn, String key, Locale lang)
+ throws InvalidDataException {
+ Map<String, Integer> keyMap = UNIQUE_KEYS.get(keyColumn);
+ if (keyMap == null) {
+ keyMap = registerUniqueKeyMap(dataSet, keyColumn, lang);
+ }
+ Integer row = keyMap.get(key);
+ if (row != null) {
+ return row;
+ }
+ throw new InvalidDataException("Key '" + key //$NON-NLS-1$
+ + "' is not available in column '" + keyColumn.getName() //$NON-NLS-1$
+ + "' in central test data set '" //$NON-NLS-1$
+ + dataSet.getName() + "'!", //$NON-NLS-1$
+ MessageIDs.E_FUNCTION_EVAL_ERROR);
+ }
+
+ /**
+ * Returns a given central test data set using the cache if central test data set exists
+ *
+ * @param dataSetName
+ * unique name of the central test data set
+ * @return central test data set with the given name
+ * @throws InvalidDataException
+ */
+ private static ITestDataCubePO validateDataSetName(String dataSetName)
+ throws InvalidDataException {
+ ITestDataCubePO dataCube = DATA_CUBES.get(dataSetName);
+ if (dataCube != null) {
+ return dataCube;
+ }
+
+ throw new InvalidDataException("Central test data set '" + dataSetName //$NON-NLS-1$
+ + "' is not available!", MessageIDs.E_FUNCTION_EVAL_ERROR); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/DivideFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/DivideFunctionEvaluator.java
new file mode 100644
index 000000000..0ff359c1b
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/DivideFunctionEvaluator.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+/**
+ * Function that divides 2 numbers.
+ */
+public class DivideFunctionEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ *
+ * {@inheritDoc}
+ * @throws InvalidDataException
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ double dividend = Double.parseDouble(arguments[0]);
+ double divisor = Double.parseDouble(arguments[1]);
+
+ return String.valueOf(dividend / divisor);
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/FormateDateEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/FormateDateEvaluator.java
new file mode 100644
index 000000000..083d1edd0
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/FormateDateEvaluator.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import java.util.Date;
+
+import org.apache.commons.lang.time.DateFormatUtils;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+import org.eclipse.jubula.tools.messagehandling.MessageIDs;
+
+/**
+ * @author BREDEX GmbH
+ *
+ */
+public final class FormateDateEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ try {
+ Long dateTime = Long.valueOf(arguments[0]);
+ if (dateTime < 0) {
+ throw new InvalidDataException("value to small: " + dateTime, //$NON-NLS-1$
+ MessageIDs.E_TOO_SMALL_VALUE);
+ }
+ Date date = new Date(dateTime);
+
+ return DateFormatUtils.format(date, arguments[1]);
+ } catch (NumberFormatException e) {
+ throw new InvalidDataException("not an integer: " + arguments[0], //$NON-NLS-1$
+ MessageIDs.E_BAD_INT);
+
+ }
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ModifyDateEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ModifyDateEvaluator.java
new file mode 100644
index 000000000..c23dd5633
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ModifyDateEvaluator.java
@@ -0,0 +1,65 @@
+/**
+ *
+ */
+package org.eclipse.jubula.client.core.functions;
+
+import java.util.Date;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+import org.eclipse.jubula.tools.messagehandling.MessageIDs;
+
+/**
+ * @author BREDEX GmbH
+ *
+ */
+public final class ModifyDateEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ try {
+ long dateTime = Long.parseLong(arguments[0]);
+ if (dateTime < 0) {
+ throw new InvalidDataException("value to small: " + dateTime, //$NON-NLS-1$
+ MessageIDs.E_TOO_SMALL_VALUE);
+ }
+ String opString = arguments[1];
+ int opStringLength = opString.length();
+ if (opStringLength < 2) {
+ throw new InvalidDataException("illegal value: " + opString, //$NON-NLS-1$
+ MessageIDs.E_WRONG_PARAMETER_VALUE);
+ }
+ String op = opString.substring(opStringLength - 1, opStringLength);
+ String offsetString = opString.substring(0, opStringLength - 1);
+ try {
+ int offset = Integer.parseInt(offsetString);
+ Date date = new Date(dateTime);
+ Date result = null;
+ if (op.equalsIgnoreCase("d")) { //$NON-NLS-1$
+ result = DateUtils.addDays(date, offset);
+ } else if (op.equalsIgnoreCase("m")) { //$NON-NLS-1$
+ result = DateUtils.addMonths(date, offset);
+ } else if (op.equalsIgnoreCase("y")) { //$NON-NLS-1$
+ result = DateUtils.addYears(date, offset);
+ } else {
+ throw new InvalidDataException("illegal offset format: " //$NON-NLS-1$
+ + arguments[1], MessageIDs.E_WRONG_PARAMETER_VALUE);
+ }
+ return String.valueOf(result.getTime());
+ } catch (NumberFormatException e) {
+ throw new InvalidDataException("illegal offset format: " //$NON-NLS-1$
+ + arguments[1], MessageIDs.E_WRONG_PARAMETER_VALUE);
+ }
+
+ } catch (NumberFormatException e) {
+ throw new InvalidDataException("not an integer: " + arguments[0], //$NON-NLS-1$
+ MessageIDs.E_BAD_INT);
+ }
+
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/MultiplyFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/MultiplyFunctionEvaluator.java
new file mode 100644
index 000000000..3a2617231
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/MultiplyFunctionEvaluator.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+
+/**
+ * Function that multiplies 0..n numbers.
+ */
+public class MultiplyFunctionEvaluator implements IFunctionEvaluator {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) {
+ double result = 1;
+
+ for (String arg : arguments) {
+ result *= Double.parseDouble(arg);
+ }
+
+ return String.valueOf(result);
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NodeAttributeEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NodeAttributeEvaluator.java
new file mode 100644
index 000000000..c0ea247fe
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NodeAttributeEvaluator.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import org.eclipse.jubula.client.core.model.INodePO;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+import org.eclipse.jubula.tools.messagehandling.MessageIDs;
+
+/**
+ * @author BREDEX GmbH
+ */
+public class NodeAttributeEvaluator extends AbstractFunctionEvaluator {
+ /**
+ * the comment attribute name
+ */
+ private static final String COMMENT_ATTRIBUTE = "comment"; //$NON-NLS-1$
+
+ /**
+ * the name attribute name
+ */
+ private static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 1);
+ String arg0 = arguments[0].toLowerCase();
+ String attributeValue = null;
+ FunctionContext context = getContext();
+ if (context != null) {
+ INodePO node = context.getNode();
+ if (NAME_ATTRIBUTE.equals(arg0)) {
+ attributeValue = node.getName();
+ } else if (COMMENT_ATTRIBUTE.equals(arg0)) {
+ attributeValue = node.getComment();
+ } else {
+ throw new InvalidDataException("Unkown attribute: " //$NON-NLS-1$
+ + arg0, MessageIDs.E_FUNCTION_EVAL_ERROR);
+ }
+ } else {
+ throw new InvalidDataException(
+ "Function is being called without a node context!" //$NON-NLS-1$
+ , MessageIDs.E_FUNCTION_EVAL_ERROR);
+ }
+ return attributeValue;
+ }
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NowEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NowEvaluator.java
new file mode 100644
index 000000000..461b65960
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NowEvaluator.java
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.eclipse.jubula.client.core.functions;
+
+import java.util.Date;
+
+/**
+ * @author BREDEX GmbH
+ *
+ */
+public final class NowEvaluator implements IFunctionEvaluator {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) {
+ Date now = new Date();
+ return String.valueOf(now.getTime());
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ParseDateEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ParseDateEvaluator.java
new file mode 100644
index 000000000..4b2f9dd9b
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/ParseDateEvaluator.java
@@ -0,0 +1,34 @@
+/**
+ *
+ */
+package org.eclipse.jubula.client.core.functions;
+
+import java.text.ParseException;
+import java.util.Date;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+import org.eclipse.jubula.tools.messagehandling.MessageIDs;
+
+/**
+ * @author BREDEX GmbH
+ *
+ */
+public final class ParseDateEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ try {
+ Date result = DateUtils.parseDate(arguments[0],
+ new String[] { arguments[1] });
+ return String.valueOf(result.getTime());
+ } catch (ParseException e) {
+ throw new InvalidDataException("parsing failed, reason: " //$NON-NLS-1$
+ + e.getMessage(), MessageIDs.E_WRONG_PARAMETER_VALUE);
+ }
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RandomIntegerFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RandomIntegerFunctionEvaluator.java
new file mode 100644
index 000000000..a593211d1
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RandomIntegerFunctionEvaluator.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import org.apache.commons.lang.math.RandomUtils;
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+/**
+ * Function that generates a random integer
+ */
+public class RandomIntegerFunctionEvaluator extends AbstractFunctionEvaluator {
+ /** {@inheritDoc} */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 1);
+ int exclusiveMaxValue = Integer.parseInt(arguments[0]);
+ return String.valueOf(RandomUtils.nextInt(exclusiveMaxValue));
+ }
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RoundFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RoundFunctionEvaluator.java
new file mode 100644
index 000000000..b4c00bc77
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/RoundFunctionEvaluator.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+/**
+ * Function that rounds a number to a given number of decimal places.
+ */
+public class RoundFunctionEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ BigDecimal toRound = new BigDecimal(arguments[0]);
+ int precision = Integer.parseInt(arguments[1]);
+
+ BigDecimal rounded =
+ toRound.setScale(precision, RoundingMode.HALF_UP);
+
+ return rounded.toPlainString();
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/StringReplaceAllFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/StringReplaceAllFunctionEvaluator.java
new file mode 100644
index 000000000..ebb526535
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/StringReplaceAllFunctionEvaluator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+import org.eclipse.jubula.tools.messagehandling.MessageIDs;
+
+/**
+ * Function that performs a string replaceAll
+ */
+public class StringReplaceAllFunctionEvaluator
+ extends AbstractFunctionEvaluator {
+ /** {@inheritDoc} */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 3);
+ final String string = arguments[0];
+ final String regex = arguments[1];
+ final String replacement = arguments[2];
+
+ String replacedString = string;
+ try {
+ replacedString = string.replaceAll(regex, replacement);
+ } catch (PatternSyntaxException e) {
+ throw new InvalidDataException(e.getLocalizedMessage(),
+ MessageIDs.E_FUNCTION_EVAL_ERROR);
+ }
+ return replacedString;
+ }
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/SubtractFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/SubtractFunctionEvaluator.java
new file mode 100644
index 000000000..a2e908d1c
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/SubtractFunctionEvaluator.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+/**
+ * Function that subtracts number from another.
+ */
+public class SubtractFunctionEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ double minuend = Double.parseDouble(arguments[0]);
+ double subtrahend = Double.parseDouble(arguments[1]);
+
+ return String.valueOf(minuend - subtrahend);
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/TruncateFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/TruncateFunctionEvaluator.java
new file mode 100644
index 000000000..730a6a6c0
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/TruncateFunctionEvaluator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+import org.eclipse.jubula.tools.exception.InvalidDataException;
+
+
+/**
+ * Function that truncates a number a certain number of characters after the
+ * decimal point.
+ */
+public class TruncateFunctionEvaluator extends AbstractFunctionEvaluator {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(String[] arguments) throws InvalidDataException {
+ validateParamCount(arguments, 2);
+ BigDecimal toTruncate = new BigDecimal(arguments[0]);
+ int precision = Integer.parseInt(arguments[1]);
+
+ BigDecimal truncated =
+ toTruncate.setScale(precision, RoundingMode.DOWN);
+
+ return truncated.toPlainString();
+ }
+
+}
diff --git a/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/UUIDFunctionEvaluator.java b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/UUIDFunctionEvaluator.java
new file mode 100644
index 000000000..691620eb3
--- /dev/null
+++ b/org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/UUIDFunctionEvaluator.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2012 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.functions;
+
+import java.util.UUID;
+
+/**
+ * Function that generates a random Java UUID
+ */
+public class UUIDFunctionEvaluator implements IFunctionEvaluator {
+ /** {@inheritDoc} */
+ public String evaluate(String[] arguments) {
+ return UUID.randomUUID().toString();
+ }
+}

Back to the top