cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r179997 - in /cocoon/trunk/src/test/org/apache/cocoon/components/blocks: BlocksManagerTestCase.java test1/block-sitemap.xmap test1/sub/block-paths.xsl test1/sub/path-expected.xml test1/sub/sitemap.xmap
Date Sat, 04 Jun 2005 15:07:37 GMT
Author: danielf
Date: Sat Jun  4 08:07:36 2005
New Revision: 179997

URL: http://svn.apache.org/viewcvs?rev=179997&view=rev
Log:
Test the block path module.

Added:
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/block-paths.xsl  
(with props)
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/path-expected.xml
  (with props)
Modified:
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlocksManagerTestCase.java
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/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=179997&r1=179996&r2=179997&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 Sat
Jun  4 08:07:36 2005
@@ -89,4 +89,8 @@
     public void testBlockProperty() throws Exception {
         pipeTest("ext/prop", "test3/prop-expected.xml");
     }
+
+    public void testAbsolutize() throws Exception {
+        pipeTest("sub/abs", "test1/sub/path-expected.xml");
+    }
 }

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=179997&r1=179996&r2=179997&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 Sat
Jun  4 08:07:36 2005
@@ -28,6 +28,10 @@
       <component-instance class="org.apache.cocoon.components.source.impl.BlockSourceFactory"
name="block"/>
     </source-factories>
 
+    <input-modules>
+      <component-instance name="block-path"  class="org.apache.cocoon.components.modules.input.BlockPathModule"/>
+    </input-modules>
+
     <map:generators default="file">
       <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator"/>
     </map:generators>

Added: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/block-paths.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/block-paths.xsl?rev=179997&view=auto
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/block-paths.xsl (added)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/block-paths.xsl Sat
Jun  4 08:07:36 2005
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<!-- $Id:$ -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:param name="abs"/>
+  <xsl:param name="rel"/>
+  <xsl:param name="other"/>
+
+  <xsl:template match="/">
+    <properties abs="{$abs}" rel="{$rel}" other="{$other}"/>
+  </xsl:template>
+
+</xsl:stylesheet>

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

Added: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/path-expected.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/path-expected.xml?rev=179997&view=auto
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/path-expected.xml
(added)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/path-expected.xml
Sat Jun  4 08:07:36 2005
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><properties other="/test2/test" rel="/test1/sub/test"
abs="/test1/test"/>
\ No newline at end of file

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

Modified: 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=179997&r1=179996&r2=179997&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/sub/sitemap.xmap Sat Jun
 4 08:07:36 2005
@@ -36,6 +36,16 @@
         <map:serialize/>
       </map:match>
 
+      <map:match pattern="abs">
+        <map:generate src="test.xml"/>
+        <map:transform src="block-paths.xsl">
+          <map:parameter name="abs" value="{block-path:/test}"/>
+          <map:parameter name="rel" value="{block-path:./test}"/>
+          <map:parameter name="other" value="{block-path:test2:/test}"/>
+        </map:transform>
+        <map:serialize/>
+      </map:match>
+
     </map:pipeline>
   </map:pipelines>
 </map:sitemap>



Mime
View raw message