camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] git commit: Use dynamic port in tests
Date Fri, 15 Nov 2013 09:11:37 GMT
Use dynamic port in tests


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f9a87ee3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f9a87ee3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f9a87ee3

Branch: refs/heads/master
Commit: f9a87ee30b2c00e7511f2c90bc1dda48c74f8a93
Parents: 8f9aba0
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Nov 15 10:12:05 2013 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Nov 15 10:13:08 2013 +0100

----------------------------------------------------------------------
 .../apache/camel/component/rmi/RmiConcurrencyTest.java  |  1 -
 .../component/rmi/RmiIllegalArgumentExceptionTest.java  | 12 +++++++++---
 .../org/apache/camel/component/rmi/RmiRouteTest.java    |  2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f9a87ee3/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiConcurrencyTest.java
b/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiConcurrencyTest.java
index 60fc1b0..5428ba7 100644
--- a/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiConcurrencyTest.java
+++ b/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiConcurrencyTest.java
@@ -43,7 +43,6 @@ public class RmiConcurrencyTest extends CamelTestSupport {
         return port;
     }
 
-
     @Override
     protected JndiRegistry createRegistry() throws Exception {
         if (classPathHasSpaces()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/f9a87ee3/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiIllegalArgumentExceptionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiIllegalArgumentExceptionTest.java
b/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiIllegalArgumentExceptionTest.java
index d6f0e56..e2ef31e 100644
--- a/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiIllegalArgumentExceptionTest.java
+++ b/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiIllegalArgumentExceptionTest.java
@@ -24,6 +24,7 @@ import java.rmi.registry.LocateRegistry;
 import org.apache.camel.CamelExecutionException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
@@ -34,8 +35,13 @@ public class RmiIllegalArgumentExceptionTest extends CamelTestSupport {
 
     private static boolean created;
 
+    private int port;
+
     protected int getPort() {
-        return 37545;
+        if (port == 0) {
+            port = AvailablePortFinder.getNextAvailable(37502);
+        }
+        return port;
     }
 
     @Override
@@ -81,12 +87,12 @@ public class RmiIllegalArgumentExceptionTest extends CamelTestSupport
{
             @Override
             public void configure() throws Exception {
                 // setup the jmi server endpoint
-                RmiEndpoint echo = (RmiEndpoint)endpoint("rmi://localhost:37545/echo");
+                RmiEndpoint echo = (RmiEndpoint)endpoint("rmi://localhost:" + getPort() +
"/echo");
                 echo.setRemoteInterfaces(IEcho.class);
                 from(echo).to("bean:echo");
 
                 // and our route where we call the server
-                from("direct:echo").to("rmi://localhost:37545/echo?method=foo").to("mock:result");
+                from("direct:echo").to("rmi://localhost:" + getPort() + "/echo?method=foo").to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f9a87ee3/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiRouteTest.java
b/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiRouteTest.java
index 40367ae..717e509 100644
--- a/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiRouteTest.java
+++ b/components/camel-rmi/src/test/java/org/apache/camel/component/rmi/RmiRouteTest.java
@@ -39,7 +39,7 @@ public class RmiRouteTest extends TestSupport {
 
     protected int getPort() {
         if (port == 0) {
-            port = AvailablePortFinder.getNextAvailable(37502);
+            port = AvailablePortFinder.getNextAvailable(37503);
         }
         return port;
     }


Mime
View raw message