You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by po...@apache.org on 2006/05/13 23:35:13 UTC

svn commit: r406152 - /jakarta/commons/proper/jelly/trunk/src/test/org/apache/commons/jelly/expression/TestExpressions.java

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