Author: danielf
Date: Sun May  1 15:07:06 2005
New Revision: 165553

URL: http://svn.apache.org/viewcvs?rev=165553&view=rev
Log:
Test accessing a sitemap from BlockManager. Various modifications of conf files.

Added:
    
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap
   (with props)
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/test.xml   
(with props)
Modified:
    cocoon/trunk/src/test/org/apache/cocoon/SitemapTestCase.java
    
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.java
    
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.xconf
    
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/COB-INF/block.xml
    cocoon/trunk/src/test/org/apache/cocoon/components/blocks/wiring.xml

Modified: cocoon/trunk/src/test/org/apache/cocoon/SitemapTestCase.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/SitemapTestCase.java?rev=165553&r1=165552&r2=165553&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/SitemapTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/SitemapTestCase.java Sun May  1 
15:07:06 2005
@@ -177,12 +177,17 @@
 
     }
 
-    protected byte[] process(String uri) throws Exception {
+    protected MockEnvironment getEnvironment(String uri) {
         MockEnvironment env = new MockEnvironment();
         env.setURI("", uri);
         this.request.setEnvironment(env);
         env.setObjectModel(this.objectmodel);
 
+       return env;
+    }
+
+    protected byte[] process(String uri) throws Exception {
+        MockEnvironment env = getEnvironment(uri);
         this.cocoon.process(env);
         getLogger().info("Output: " + new String(env.getOutput(), "UTF-8"));
 

Modified: 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.java?rev=165553&r1=165552&r2=165553&view=diff
==============================================================================
--- 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.java
 (original)
+++ 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.java
 Sun May  1 15:07:06 2005
@@ -17,10 +17,19 @@
 
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.cocoon.SitemapTestCase;
+import org.apache.cocoon.environment.mock.MockEnvironment;
 
 public class BlockManagerTestCase extends SitemapTestCase {
-    public void testConfigure() throws ServiceException {
+    public void testCreate() throws ServiceException {
         BlockManager block = (BlockManager)this.lookup(BlockManager.ROLE);
+        this.release(block);
+    }
+
+    public void testPipeline() throws Exception {
+        BlockManager block = (BlockManager)this.lookup(BlockManager.ROLE);
+        MockEnvironment env = getEnvironment("test");
+        block.process(env);
+        getLogger().info("Output: " + new String(env.getOutput(), "UTF-8"));
         this.release(block);
     }
 }

Modified: 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.xconf
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.xconf?rev=165553&r1=165552&r2=165553&view=diff
==============================================================================
--- 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.xconf
 (original)
+++ 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/BlockManagerTestCase.xconf
 Sun May  1 15:07:06 2005
@@ -29,6 +29,10 @@
 
   <xmlizer/>
 
+  <source-resolver/>
+
+  <fam/>
+
   <source-factories>
     <component-instance 
class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource"/>
     <component-instance 
class="org.apache.cocoon.components.source.impl.ContextSourceFactory" 
name="context"/>
@@ -38,7 +42,7 @@
 
   <component role="org.apache.cocoon.components.blocks.BlockManager"
              class="org.apache.cocoon.components.blocks.BlockManager"
-             id="test1id" location="test1">
+             id="test1id" location="test1/">
     <mount path="/test1/"/>
     <connections>
       <connection name="test2" block="test2id"/>

Modified: 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/COB-INF/block.xml
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/COB-INF/block.xml?rev=165553&r1=165552&r2=165553&view=diff
==============================================================================
--- 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/COB-INF/block.xml
 (original)
+++ 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/COB-INF/block.xml
 Sun May  1 15:07:06 2005
@@ -28,7 +28,7 @@
          implementation="stable"/>
   <license href="http://www.apache.org/licenses/";>Apache License 2.0</license>
   <author href="http://cocoon.apache.org";>Apache Cocoon community</author>
-  <sitemap src="sitemap.xmap"/>
+  <sitemap src="block-sitemap.xmap"/>
   <properties>
     <property name="foo">
       <default>baz</default>

Added: 
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=165553&view=auto
==============================================================================
--- 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap
 (added)
+++ 
cocoon/trunk/src/test/org/apache/cocoon/components/blocks/test1/block-sitemap.xmap
 Sun May  1 15:07:06 2005
@@ -0,0 +1,57 @@
+<?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:components>
+    <map:generators default="file">
+      <map:generator name="file" 
src="org.apache.cocoon.generation.FileGenerator"/>
+    </map:generators>
+
+    <map:transformers default="xslt">
+      <map:transformer name="xslt" 
src="org.apache.cocoon.transformation.TraxTransformer">
+        <xslt-processor-role>xalan</xslt-processor-role>
+      </map:transformer>
+    </map:transformers>
+
+    <map:serializers default="xml">
+      <map:serializer mime-type="text/xml" name="xml" 
src="org.apache.cocoon.serialization.XMLSerializer"/>
+    </map:serializers>
+
+    <map:matchers default="wildcard">
+      <map:matcher name="wildcard" 
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
+    </map:matchers>
+
+    <map:pipes default="noncaching">
+      <map:pipe name="noncaching" 
src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
+      </map:pipe>
+    </map:pipes>
+  </map:components>
+
+  <map:pipelines>
+    <map:pipeline>
+
+      <map:match pattern="test">
+        <map:generate type="file" src="test.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

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

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

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

Modified: cocoon/trunk/src/test/org/apache/cocoon/components/blocks/wiring.xml
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/components/blocks/wiring.xml?rev=165553&r1=165552&r2=165553&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/components/blocks/wiring.xml 
(original)
+++ cocoon/trunk/src/test/org/apache/cocoon/components/blocks/wiring.xml Sun 
May  1 15:07:06 2005
@@ -18,7 +18,7 @@
         xsi:schemaLocation="http://apache.org/cocoon/blocks/wiring/1.0 
wiring-schema-1.0.xsd"
 >
 
-  <block id="test1id" location="./test1">
+  <block id="test1id" location="./test1/">
     <mount path="/test1/"/>
     <connections>
       <connection name="test2" block="test2id"/>
@@ -28,6 +28,6 @@
     </properties>
   </block>
 
-  <block id="test2id" location="./test2"/>
+  <block id="test2id" location="./test2/"/>
 
 </wiring>


Reply via email to