Author: danielf Date: Sun Jan 23 08:51:10 2005 New Revision: 126218 URL: http://svn.apache.org/viewcvs?view=rev&rev=126218 Log: Test case for checking if jx:set works. This far it works for a simple assignement but not for one using a hashmap. Added: cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet-output.xml cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet.xml Modified: cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java
Modified: cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java?view=diff&rev=126218&p1=cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java&r1=126217&p2=cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java&r2=126218 ============================================================================== --- cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java (original) +++ cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java Sun Jan 23 08:51:10 2005 @@ -115,4 +115,11 @@ assertEqual(load(outputURI), generate(JX, inputURI, EMPTY_PARAMS)); } + + public void testJXSet() throws Exception { + String inputURI = docBase + "jxSet.xml"; + String outputURI = docBase + "jxSet-output.xml"; + + assertEqual(load(outputURI), generate(JX, inputURI, EMPTY_PARAMS)); + } } Added: cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet-output.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet-output.xml?view=auto&rev=126218 ============================================================================== --- (empty file) +++ cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet-output.xml Sun Jan 23 08:51:10 2005 @@ -0,0 +1,13 @@ +<?xml version="1.0"?> + +<root> + + <test1> + foo + </test1> + + <test2> + bar + </test2> + +</root> Added: cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet.xml?view=auto&rev=126218 ============================================================================== --- (empty file) +++ cocoon/trunk/src/blocks/template/test/org/apache/cocoon/template/jxtg/jxSet.xml Sun Jan 23 08:51:10 2005 @@ -0,0 +1,16 @@ +<?xml version="1.0"?> + +<root xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"> + + <test1> + <jx:set var="var1" value="foo"/> + <jx:out value="${var1}"/> + </test1> + + <test2> + <jx:set var="map" value="${java.util.HashMap()}"/> + <jx:set var="ignored" value="${map.put('foo', 'bar')}"/> + <jx:out value="${map.foo}"/> + </test2> + +</root>
