2006/unicorn/src/org/w3c/unicorn UnicornCall.java,1.12,1.13

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv13961/src/org/w3c/unicorn

Modified Files:
	UnicornCall.java 
Log Message:
new test condition "parameter"
+ new task: "Custom Task"
+ renamed new-tasklist.xml -> tasklist.xml

Index: UnicornCall.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/UnicornCall.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- UnicornCall.java	10 Sep 2009 08:32:41 -0000	1.12
+++ UnicornCall.java	16 Sep 2009 11:57:24 -0000	1.13
@@ -785,6 +785,18 @@
 				XPathExpression xpe = xpath.compile(xpathStr);
 				passed = (Boolean) xpe.evaluate(doc, XPathConstants.BOOLEAN);
 			}
+		} else if (cond.getType().equals(EnumCondType.PARAMETER)) {
+			passed = false;
+			if (!mapOfStringParameter.containsKey(cond.getParameter())) {
+				cond.setResult(passed);
+				return passed;
+			}
+			
+			String[] parameterValues = mapOfStringParameter.get(cond.getParameter());
+			for (int i=0; i<parameterValues.length; i++)
+				if (parameterValues[i].equals(cond.getValue()))
+					passed = true;
+			
 		}
 
 		cond.setResult(passed);

Received on Wednesday, 16 September 2009 11:57:40 UTC