camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r801886 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java components/camel-jms/src/test/java/org/apache/camel/component/jms/FileRouteToJmsToFileTest.java
Date Fri, 07 Aug 2009 05:27:36 GMT
Author: davsclaus
Date: Fri Aug  7 05:27:36 2009
New Revision: 801886

URL: http://svn.apache.org/viewvc?rev=801886&view=rev
Log:
Fixed unit tests reported by hudson

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/FileRouteToJmsToFileTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java?rev=801886&r1=801885&r2=801886&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java Fri Aug
 7 05:27:36 2009
@@ -102,6 +102,10 @@
     }
 
     public boolean hasHeaders() {
+        if (!hasPopulatedHeaders()) {
+            // force creating headers
+            getHeaders();
+        }
         return headers != null && !headers.isEmpty();
     }
 

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/FileRouteToJmsToFileTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/FileRouteToJmsToFileTest.java?rev=801886&r1=801885&r2=801886&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/FileRouteToJmsToFileTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/FileRouteToJmsToFileTest.java
Fri Aug  7 05:27:36 2009
@@ -29,7 +29,6 @@
 import org.junit.Test;
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
-
 /**
  * Unit test that we can do file over JMS to file.
  */
@@ -40,13 +39,16 @@
     @Test
     public void testRouteFileToFile() throws Exception {
         deleteDirectory("target/file2file");
+
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
 
         template.sendBodyAndHeader("file://target/file2file/in", "Hello World", Exchange.FILE_NAME,
"hello.txt");
 
         assertMockEndpointsSatisfied();
-        Thread.sleep(100);
+
+        // sleep a little to let the file be written
+        Thread.sleep(1000);
 
         File file = new File("./target/file2file/out/hello.txt");
         file = file.getAbsoluteFile();



Mime
View raw message