You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by da...@apache.org on 2005/05/30 21:55:04 UTC

svn commit: r179141 - in /cocoon/trunk/src/test/org/apache/cocoon/components/blocks: BlocksManagerTestCase.java blocks-sitemap.xmap test1/block-sitemap.xmap test1/sub/ test1/sub/sitemap.xmap test1/sub/test.xml

Author: danielf
Date: Mon May 30 12:55:03 2005
New Revision: 179141

URL: http://svn.apache.org/viewcvs?rev=179141&view=rev
Log:
Added test cases for testing the block protocol in subsitemaps, especially the relative protocol.

Added:
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap   (with props)
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/test.xml   (with props)
Modified:
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlocksManagerTestCase.java
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/blocks-sitemap.xmap
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap

Modified: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlocksManagerTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlocksManagerTestCase.java?rev=179141&r1=179140&r2=179141&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlocksManagerTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlocksManagerTestCase.java Mon May 30 12:55:03 2005
@@ -42,15 +42,27 @@
         this.release(blocks);
     }
 
-    public void testBlocksSource() throws Exception {
-        process("test");
-    }
-
     public void testBlockSource1() throws Exception {
-        process("test2");
+        pipeTest("test", "test1/test.xml");
     }
 
     public void testBlockSource2() throws Exception {
-        process("test3");
+        pipeTest("test2", "test2/test.xml");
+    }
+
+    public void testBlockSource3() throws Exception {
+        pipeTest("test3", "test1/test.xml");
+    }
+
+    public void testBlockSourceSub1() throws Exception {
+        pipeTest("sub/test", "test1/sub/test.xml");
+    }
+
+    public void testBlockSourceSub2() throws Exception {
+        pipeTest("sub/test2", "test1/sub/test.xml");
+    }
+
+    public void testBlockSourceSub3() throws Exception {
+        pipeTest("sub/test3", "test1/test.xml");
     }
 }

Modified: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/blocks-sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/blocks-sitemap.xmap?rev=179141&r1=179140&r2=179141&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/blocks-sitemap.xmap (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/blocks-sitemap.xmap Mon May 30 12:55:03 2005
@@ -37,7 +37,7 @@
   <map:pipelines>
     <map:pipeline>
 
-      <map:match pattern="*">
+      <map:match pattern="**">
         <map:read src="blocks:/test1/{1}"/>
       </map:match>
 

Modified: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap?rev=179141&r1=179140&r2=179141&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap Mon May 30 12:55:03 2005
@@ -66,6 +66,10 @@
         <map:serialize type="xml"/>
       </map:match>
 
+      <map:match pattern="sub/**">
+        <map:mount uri-prefix="sub" src="sub/"/>
+      </map:match>
+
     </map:pipeline>
   </map:pipelines>
 </map:sitemap>

Added: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap?rev=179141&view=auto
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap (added)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap Mon May 30 12:55:03 2005
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- SVN $Id$ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:pipelines>
+    <map:pipeline>
+
+      <map:match pattern="test">
+        <map:generate type="file" src="test.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <map:match pattern="test2">
+        <map:generate type="file" src="block:./test"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <map:match pattern="test3">
+        <map:generate type="file" src="block:/test"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

Propchange: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/test.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/test.xml?rev=179141&view=auto
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/test.xml (added)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/test.xml Mon May 30 12:55:03 2005
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><sub/>
\ No newline at end of file

Propchange: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native