Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-09-01 09:24:59 +0000
committerMarkus Tiede2014-09-01 09:24:59 +0000
commitad659e20ab44d5fbdc6ade4eecb4cc95a2a0f6a2 (patch)
treeb8ad8dc214d70f2a9a6d04cba962a506286b0c1e /org.eclipse.jubula.client.core.functions
parent09499e8831aad1be1d22356c89a719ba89e0f9d1 (diff)
downloadorg.eclipse.jubula.core-ad659e20ab44d5fbdc6ade4eecb4cc95a2a0f6a2.tar.gz
org.eclipse.jubula.core-ad659e20ab44d5fbdc6ade4eecb4cc95a2a0f6a2.tar.xz
org.eclipse.jubula.core-ad659e20ab44d5fbdc6ade4eecb4cc95a2a0f6a2.zip
Non-sprint task - minor enhancement for getAttributeFunction: extended with retrieval of taskId and raw description text.
Diffstat (limited to 'org.eclipse.jubula.client.core.functions')
-rw-r--r--org.eclipse.jubula.client.core.functions/src/org/eclipse/jubula/client/core/functions/NodeAttributeEvaluator.java45
1 files changed, 27 insertions, 18 deletions
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
index c0ea247fe..35c036ce3 100644
--- 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
@@ -18,33 +18,42 @@ import org.eclipse.jubula.tools.messagehandling.MessageIDs;
* @author BREDEX GmbH
*/
public class NodeAttributeEvaluator extends AbstractFunctionEvaluator {
- /**
- * the comment attribute name
- */
+ /** the comment attribute name */
private static final String COMMENT_ATTRIBUTE = "comment"; //$NON-NLS-1$
- /**
- * the name attribute name
- */
+ /** the name attribute name */
private static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$
+
+ /** the description attribute name */
+ private static final String DESCRIPTION_ATTRIBUTE = "description"; //$NON-NLS-1$
+
+ /** the taskId attribute name */
+ private static final String TASK_ID_ATTRIBUTE = "taskId"; //$NON-NLS-1$
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String evaluate(String[] arguments) throws InvalidDataException {
validateParamCount(arguments, 1);
- String arg0 = arguments[0].toLowerCase();
+ final String attributeName = 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);
+ switch (attributeName) {
+ case NAME_ATTRIBUTE:
+ attributeValue = node.getName();
+ break;
+ case COMMENT_ATTRIBUTE:
+ attributeValue = node.getComment();
+ break;
+ case DESCRIPTION_ATTRIBUTE:
+ attributeValue = node.getDescription();
+ break;
+ case TASK_ID_ATTRIBUTE:
+ attributeValue = node.getTaskId();
+ break;
+ default:
+ throw new InvalidDataException("Unkown attribute: " //$NON-NLS-1$
+ + attributeName, MessageIDs.E_FUNCTION_EVAL_ERROR);
}
} else {
throw new InvalidDataException(
@@ -53,4 +62,4 @@ public class NodeAttributeEvaluator extends AbstractFunctionEvaluator {
}
return attributeValue;
}
-}
+} \ No newline at end of file

Back to the top