svn commit: r666952 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r666952 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java

davsclaus-2
Author: davsclaus
Date: Wed Jun 11 22:01:48 2008
New Revision: 666952

URL: http://svn.apache.org/viewvc?rev=666952&view=rev
Log:
polished unit test

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java?rev=666952&r1=666951&r2=666952&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/DirectoryCreateIssueTest.java Wed Jun 11 22:01:48 2008
@@ -26,27 +26,18 @@
 import org.apache.camel.TestSupport;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.log4j.Logger;
 
 /**
  * @author Albert Moraal
  * @version $Revision$
  */
 public class DirectoryCreateIssueTest extends TestSupport {
-    private static final Logger LOG = Logger.getLogger(DirectoryCreateIssueTest.class);
     private CamelContext context;
     private ProducerTemplate template;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-
-        // The following code is removed
-        // if you want to enable debugging, add the src/test/ide-resources directory to your IDE classpath
-/*
-        BasicConfigurator.configure();
-        Logger.getRootLogger().setLevel(Level.DEBUG);
-*/
         context = new DefaultCamelContext();
         context.start();
         template = context.createProducerTemplate();
@@ -64,23 +55,23 @@
         final int numFiles = 10;
 
         context.addRoutes(
-                new RouteBuilder() {
-                    @Override
-                    public void configure() {
-                        String[] destinations = new String[numFiles];
-                        for (int i = 0; i < numFiles; i++) {
-                            destinations[i] = "seda:file" + i;
-
-                            from("seda:file" + i)
-                                    .setHeader(FileComponent.HEADER_FILE_NAME,
-                                            constant("file" + i + ".txt"))
-                                    .to("file://" + path + "/?append=false&noop=true");
-                        }
-
-                        from("seda:testFileCreatedAsDir")
-                                .to(destinations);
+            new RouteBuilder() {
+                @Override
+                public void configure() {
+                    String[] destinations = new String[numFiles];
+                    for (int i = 0; i < numFiles; i++) {
+                        destinations[i] = "seda:file" + i;
+
+                        from("seda:file" + i)
+                            .setHeader(FileComponent.HEADER_FILE_NAME,
+                                constant("file" + i + ".txt"))
+                            .to("file://" + path + "/?append=false&noop=true");
                     }
+
+                    from("seda:testFileCreatedAsDir")
+                        .to(destinations);
                 }
+            }
         );
 
         deleteDirectory(new File("a"));
@@ -92,11 +83,14 @@
             }
         });
 
+        // must sleep for some time to make sure runs on all platforms
         Thread.sleep(8 * 1000);
+
         for (int i = 0; i < numFiles; i++) {
             assertTrue((new File(path + "/file" + i + ".txt")).isFile());
         }
     }
+
 }