cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r896413 - in /cocoon/cocoon3/trunk: cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/MatcherTest.java cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
Date Wed, 06 Jan 2010 12:07:54 GMT
Author: reinhard
Date: Wed Jan  6 12:07:54 2010
New Revision: 896413

URL: http://svn.apache.org/viewvc?rev=896413&view=rev
Log:
COCOON3-48 add failing test case (but prefixed it with 'ignored' so that the build runs through)
add a test case for named matcher parameters

Modified:
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/MatcherTest.java
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/MatcherTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/MatcherTest.java?rev=896413&r1=896412&r2=896413&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/MatcherTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/MatcherTest.java
Wed Jan  6 12:07:54 2010
@@ -122,4 +122,17 @@
         this.assertXPath("/html/body/p[text() = '8']", "");
     }
 
+    public void testNamedMatcher() throws Exception {
+        this.loadXmlPage("named-matcher/1?param_a=1&param_b=1");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/xml", this.response.getContentType());
+        this.assertXPath("/html/body/p", "1");
+    }
+
+    public void ignored_testDeepRelativeMatcher() throws Exception {
+        this.loadXmlPage("deep-relative-matcher/1?param_a=1&param_b=1");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/xml", this.response.getContentType());
+        this.assertXPath("/html/body/p", "1");
+    }
 }

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap?rev=896413&r1=896412&r2=896413&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap Wed Jan  6
12:07:54 2010
@@ -307,6 +307,32 @@
           </map:when>
         </map:select>
         <map:serialize />
+      </map:match>     
+      
+      <!-- named matcher -->
+      <map:match wildcard="named-matcher/{a}" name="m1">
+        <map:match value="{jexl:cocoon.request.param_a}" equals="1">
+          <map:match value="{jexl:cocoon.request.param_b}" equals="1">
+            <map:generate src="sax-pipeline/simple.xml" />
+            <map:transform src="sax-pipeline/simple.xslt">
+              <map:parameter name="myParam" value="{map:m1/a}" />
+            </map:transform>
+            <map:serialize />
+          </map:match>        
+        </map:match>
+      </map:match>
+      
+      <!-- deep relative matcher --> 
+      <map:match wildcard="deep-relative-matcher/{a}">
+        <map:match value="{jexl:cocoon.request.param_a}" equals="1">
+          <map:match value="{jexl:cocoon.request.param_b}" equals="1">
+            <map:generate src="sax-pipeline/simple.xml" />
+            <map:transform src="sax-pipeline/simple.xslt">
+              <map:parameter name="myParam" value="{map:../../a}" />
+            </map:transform>
+            <map:serialize />
+          </map:match>        
+        </map:match>
       </map:match>      
     </map:pipeline>    
 



Mime
View raw message