camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1332533 - in /camel/trunk/camel-core/src/test/java/org/apache/camel: processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java processor/RouteStartupOrderSuspendResumeTest.java util/jndi/JndiTest.java
Date Tue, 01 May 2012 06:52:12 GMT
Author: davsclaus
Date: Tue May  1 06:52:12 2012
New Revision: 1332533

URL: http://svn.apache.org/viewvc?rev=1332533&view=rev
Log:
Fixed some tests on windows. Make sure to close resource to not lock file.

Modified:
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/util/jndi/JndiTest.java

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java?rev=1332533&r1=1332532&r2=1332533&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeNoAutoStartupTest.java
Tue May  1 06:52:12 2012
@@ -48,7 +48,7 @@ public class RouteStartupOrderSuspendRes
         List<RouteStartupOrder> order = dcc.getRouteStartupOrder();
 
         assertEquals(3, order.size());
-        assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
         assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
         assertEquals("direct://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
     }
@@ -75,12 +75,12 @@ public class RouteStartupOrderSuspendRes
         List<RouteStartupOrder> order = dcc.getRouteStartupOrder();
 
         assertEquals(4, order.size());
-        assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
         assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
         assertEquals("direct://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
 
         // however its started manually so its started after the auto started
-        assertEquals("seda://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://baz", order.get(3).getRoute().getEndpoint().getEndpointUri());
     }
 
     @Override
@@ -88,13 +88,13 @@ public class RouteStartupOrderSuspendRes
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").routeId("B").startupOrder(2).to("seda:foo");
+                from("direct:start").routeId("B").startupOrder(2).to("direct:foo");
 
-                from("seda:foo").routeId("A").startupOrder(1).to("mock:result");
+                from("direct:foo").routeId("A").startupOrder(1).to("mock:result");
 
-                from("direct:bar").routeId("D").startupOrder(9).to("seda:bar");
+                from("direct:bar").routeId("D").startupOrder(9).to("direct:baz");
 
-                from("seda:bar").routeId("C").noAutoStartup().startupOrder(5).to("mock:other");
+                from("direct:baz").routeId("C").noAutoStartup().startupOrder(5).to("mock:other");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeTest.java?rev=1332533&r1=1332532&r2=1332533&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderSuspendResumeTest.java
Tue May  1 06:52:12 2012
@@ -45,9 +45,9 @@ public class RouteStartupOrderSuspendRes
         List<RouteStartupOrder> order = dcc.getRouteStartupOrder();
 
         assertEquals(4, order.size());
-        assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
         assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
-        assertEquals("seda://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://baz", order.get(2).getRoute().getEndpoint().getEndpointUri());
         assertEquals("direct://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());
     }
 
@@ -56,13 +56,13 @@ public class RouteStartupOrderSuspendRes
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").routeId("B").startupOrder(2).to("seda:foo");
+                from("direct:start").routeId("B").startupOrder(2).to("direct:foo");
 
-                from("seda:foo").routeId("A").startupOrder(1).to("mock:result");
+                from("direct:foo").routeId("A").startupOrder(1).to("mock:result");
 
-                from("direct:bar").routeId("D").startupOrder(9).to("seda:bar");
+                from("direct:bar").routeId("D").startupOrder(9).to("direct:bar");
 
-                from("seda:bar").routeId("C").startupOrder(5).to("mock:other");
+                from("direct:baz").routeId("C").startupOrder(5).to("mock:other");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/util/jndi/JndiTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/jndi/JndiTest.java?rev=1332533&r1=1332532&r2=1332533&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/util/jndi/JndiTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/util/jndi/JndiTest.java Tue May
 1 06:52:12 2012
@@ -25,6 +25,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
 import org.apache.camel.TestSupport;
+import org.apache.camel.util.IOHelper;
 
 /**
  * @version 
@@ -34,11 +35,14 @@ public class JndiTest extends TestSuppor
 
     public static Context createInitialContext() throws Exception {
         InputStream in = JndiTest.class.getClassLoader().getResourceAsStream("jndi-example.properties");
-        assertNotNull("Cannot find jndi-example.properties on the classpath!", in);
-        Properties properties = new Properties();
-        properties.load(in);
-        return new InitialContext(new Hashtable<Object, Object>(properties));
-
+        try{
+            assertNotNull("Cannot find jndi-example.properties on the classpath!", in);
+            Properties properties = new Properties();
+            properties.load(in);
+            return new InitialContext(new Hashtable<Object, Object>(properties));
+        } finally {
+            IOHelper.close(in);
+        }
     }
 
     public void testLookupOfSimpleName() throws Exception {



Mime
View raw message