commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r406152 - /jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java
Date Sat, 13 May 2006 21:35:13 GMT
Author: polx
Date: Sat May 13 14:35:11 2006
New Revision: 406152

URL: http://svn.apache.org/viewcvs?rev=406152&view=rev
Log:
Added a test for $${xx} to be output as ${x}.
This is used by some but was not tested.
This is important for JELLY-187.
paul

Modified:
    jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java

Modified: jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java?rev=406152&r1=406151&r2=406152&view=diff
==============================================================================
--- jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java
(original)
+++ jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java
Sat May 13 14:35:11 2006
@@ -69,6 +69,17 @@
         assertExpression("ham and ${maven.home.foo} pizza", "ham and cheese pizza");
         assertExpression("${maven.home.foo.length()}", new Integer(6));
     }
+    
+    /** tests that $${xx} is output as ${xx}. This trick is ued
+        by several plugins to generate other jelly files or ant files.
+        The maven ant plugin is one of them. */
+    public void testExpressionsEvalOutput() throws Exception {
+        String expressionText = "ham and $${maven.home.foo} pizza";
+        Expression expression = CompositeExpression.parse(expressionText, factory);
+        assertTrue( "Created a valid expression for: " + expressionText, expression != null
);
+        String value = (String) expression.evaluate(context);
+        assertEquals("$${xx} should output ${xx}","ham and ${maven.home.foo} pizza",value);
+    }
 
     public void testNotConditions() throws Exception {
         context.setVariable("a", Boolean.TRUE);



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message