cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r1203347 - /cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/directory/DirectoryGeneratorTestCase.java
Date Thu, 17 Nov 2011 19:58:29 GMT
Author: thorsten
Date: Thu Nov 17 19:58:28 2011
New Revision: 1203347

URL: http://svn.apache.org/viewvc?rev=1203347&view=rev
Log:
Making sure that the directory test will pass on jenkins as well as on the local deploy, ommitting
the .svn dir from the listing

Modified:
    cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/directory/DirectoryGeneratorTestCase.java

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/directory/DirectoryGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/directory/DirectoryGeneratorTestCase.java?rev=1203347&r1=1203346&r2=1203347&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/directory/DirectoryGeneratorTestCase.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/directory/DirectoryGeneratorTestCase.java
Thu Nov 17 19:58:28 2011
@@ -21,6 +21,8 @@ import static org.custommonkey.xmlunit.X
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.cocoon.pipeline.NonCachingPipeline;
 import org.apache.cocoon.pipeline.Pipeline;
@@ -36,15 +38,27 @@ public final class DirectoryGeneratorTes
     public void testPipelineWithDirectoryGGenerator() throws Exception {
         Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
         URL testResource = this.getClass().getResource("test.txt");
-        pipeline.addComponent(new DirectoryGenerator((new File(testResource.toURI())).getParentFile()));
+        File parentFile = (new File(testResource.toURI())).getParentFile();
+        DirectoryGenerator generator = new DirectoryGenerator();
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("exclude", new String("^.svn"));
+        parameters.put("source", parentFile.toURI().toURL());
+        generator.setConfiguration(parameters );
+        pipeline.addComponent(generator);
         pipeline.addComponent(new XMLSerializer());
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         pipeline.setup(baos);
         pipeline.execute();
 
-        // we have 4 files in the test dir and one directory (.svn). Makes a total of 6 nodes
(incl. root)!
-        CountingNodeTester countingNodeTester = new CountingNodeTester(6);
+        /*
+         * we have 4 files in the test dir and one directory (.svn). 
+         * Makes a total of 6 nodes (incl. root)! 
+         * 
+         * However since we pass the exclude parameter and do no
+         * list .svn we should have 5 nodes.
+         */
+        CountingNodeTester countingNodeTester = new CountingNodeTester(5);
 
         String string = new String(baos.toByteArray());
         assertNodeTestPasses(string, countingNodeTester, Node.ELEMENT_NODE);



Mime
View raw message