dion 2004/09/06 21:11:05
Modified: jelly/src/test/org/apache/commons/jelly/expression
TestExpressions.java
Log:
Ant style expressions work from JEXL 1.0
Revision Changes Path
1.15 +10 -11
jakarta-commons/jelly/src/test/org/apache/commons/jelly/expression/TestExpressions.java
Index: TestExpressions.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/expression/TestExpressions.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- TestExpressions.java 5 Sep 2004 12:28:58 -0000 1.14
+++ TestExpressions.java 7 Sep 2004 04:11:05 -0000 1.15
@@ -67,7 +67,7 @@
assertExpression("${maven.some.madeup.name}", null);
assertExpression("cheese ${maven.some.madeup.name}pizza", "cheese pizza");
assertExpression("ham and ${maven.home.foo} pizza", "ham and cheese pizza");
-// assertExpression("${maven.home.foo.length()}", "6");
+ assertExpression("${maven.home.foo.length()}", new Integer(6));
}
public void testNotConditions() throws Exception {
@@ -88,32 +88,31 @@
}
public void testNotConditionsWithDot() throws Exception {
- // ##### re-enable commented out lines once the Jexl release is complete!
context.setVariable("x.a", Boolean.TRUE);
context.setVariable("x.b", Boolean.FALSE);
context.setVariable("x.c", "true");
context.setVariable("x.d", "false");
assertExpression("${x.a}", Boolean.TRUE);
- //assertExpression("${!x.a}", Boolean.FALSE);
+ assertExpression("${!x.a}", Boolean.FALSE);
assertExpression("${x.b}", Boolean.FALSE);
- //assertExpression("${!x.b}", Boolean.TRUE);
+ assertExpression("${!x.b}", Boolean.TRUE);
assertExpression("${x.c}", "true");
- //assertExpression("${!x.c}", Boolean.FALSE);
+ assertExpression("${!x.c}", Boolean.FALSE);
assertExpression("${x.d}", "false");
- //assertExpression("${!x.d}", Boolean.TRUE);
+ assertExpression("${!x.d}", Boolean.TRUE);
}
public void testNull() throws Exception {
- // ##### re-enable commented out lines once the Jexl release is complete!
context.setVariable("something.blank", "");
context.setVariable("something.ok", "cheese");
- //assertExpression("${something.blank.length() == 0}", Boolean.TRUE);
- //assertExpression("${something.blank == ''}", Boolean.TRUE);
- //assertExpression("${something.ok != null}", Boolean.TRUE);
- //assertExpression("${something.ok != ''}", Boolean.TRUE);
+ assertExpression("${something.blank.length() == 0}", Boolean.TRUE);
+ assertExpression("${something.blank == ''}", Boolean.TRUE);
+ assertExpression("${something.ok != null}", Boolean.TRUE);
+ assertExpression("${something.ok != ''}", Boolean.TRUE);
+ // null is a reserved word
//assertExpression("${something.null != ''}", Boolean.FALSE);
assertExpression("${unknown == null}", Boolean.TRUE);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]