cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Allocating unique ports to WebSocket tests
Date Tue, 11 Mar 2014 21:27:37 GMT
Repository: cxf
Updated Branches:
  refs/heads/master add1748d8 -> 8d5c44636


Allocating unique ports to WebSocket tests


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

Branch: refs/heads/master
Commit: 8d5c4463672c87b945223d963fe020cdd9dd70e8
Parents: add1748
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Mar 11 21:26:51 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Mar 11 21:26:51 2014 +0000

----------------------------------------------------------------------
 .../systest/jaxrs/websocket/BookServerWebSocket.java   |  4 +++-
 .../JAXRSClientServerWebSocketSpringTest.java          |  7 ++++++-
 .../JAXRSClientServerWebSocketSpringWebAppTest.java    |  8 +++++---
 .../websocket/JAXRSClientServerWebSocketTest.java      | 13 ++++++++-----
 .../test/resources/jaxrs_websocket/beans-embedded.xml  |  2 +-
 5 files changed, 23 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8d5c4463/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
index e9bd712..32bbb7a 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/BookServerWebSocket.java
@@ -27,7 +27,9 @@ import org.apache.cxf.systest.jaxrs.BookStorePerRequest;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
     
 public class BookServerWebSocket extends AbstractBusTestServerBase {
-    public static final String PORT = allocatePort(BookServerWebSocket.class);
+    public static final String PORT = allocatePort(BookServerWebSocket.class, 1);
+    public static final String PORT_SPRING = allocatePort(BookServerWebSocket.class, 2);
+    public static final String PORT_WAR = allocatePort(BookServerWebSocket.class, 3);
      
     org.apache.cxf.endpoint.Server server;
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/8d5c4463/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringTest.java
index cd41fec..26f96c1 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringTest.java
@@ -24,11 +24,12 @@ import org.junit.BeforeClass;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+
 /**
  * JAXRSClientServerWebSocket test with jaxrs:server using the embedded jetty server.
  */
 public class JAXRSClientServerWebSocketSpringTest extends JAXRSClientServerWebSocketTest
{
-    public static final String PORT = BookServerWebSocket.PORT;
+    private static final String PORT = BookServerWebSocket.PORT_SPRING;
     @BeforeClass
     public static void startServers() throws Exception {
 
@@ -40,4 +41,8 @@ public class JAXRSClientServerWebSocketSpringTest extends JAXRSClientServerWebSo
         
     }
 
+    protected String getPort() {
+        return PORT;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/8d5c4463/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringWebAppTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringWebAppTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringWebAppTest.java
index 4522d99..b6d20a9 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringWebAppTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketSpringWebAppTest.java
@@ -34,14 +34,13 @@ import org.junit.BeforeClass;
  * JAXRSClientServerWebSocket test with jaxrs:server using the jetty webapp server.
  */
 public class JAXRSClientServerWebSocketSpringWebAppTest extends JAXRSClientServerWebSocketTest
{
-    public static final String PORT = BookServerWebSocket.PORT;
-
+    private static final String PORT = BookServerWebSocket.PORT_WAR;
     @BeforeClass
     public static void startServers() throws Exception {
         org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server();
 
         SelectChannelConnector connector = new SelectChannelConnector();
-        connector.setPort(Integer.parseInt(PORT));
+        connector.setPort(Integer.parseInt(BookServerWebSocket.PORT_WAR));
         server.setConnectors(new Connector[] {connector});
 
         WebAppContext webappcontext = new WebAppContext();
@@ -62,4 +61,7 @@ public class JAXRSClientServerWebSocketSpringWebAppTest extends JAXRSClientServe
 
     }
 
+    protected String getPort() {
+        return PORT;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/8d5c4463/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
index 9a5aa8c..b437af1 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/JAXRSClientServerWebSocketTest.java
@@ -28,7 +28,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestBase {
-    public static final String PORT = BookServerWebSocket.PORT;
+    private static final String PORT = BookServerWebSocket.PORT;
     
     @BeforeClass
     public static void startServers() throws Exception {
@@ -39,7 +39,7 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
     
     @Test
     public void testBookWithWebSocket() throws Exception {
-        String address = "ws://localhost:" + PORT + "/web/bookstore";
+        String address = "ws://localhost:" + getPort() + "/web/bookstore";
 
         WebSocketTestClient wsclient = new WebSocketTestClient(address, 1);
         wsclient.connect();
@@ -101,7 +101,7 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
     
     @Test
     public void testBookWithWebSocketServletStream() throws Exception {
-        String address = "ws://localhost:" + PORT + "/web/bookstore";
+        String address = "ws://localhost:" + getPort() + "/web/bookstore";
 
         WebSocketTestClient wsclient = new WebSocketTestClient(address, 1);
         wsclient.connect();
@@ -122,7 +122,7 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
     
     @Test
     public void testWrongMethod() throws Exception {
-        String address = "ws://localhost:" + PORT + "/web/bookstore";
+        String address = "ws://localhost:" + getPort() + "/web/bookstore";
 
         WebSocketTestClient wsclient = new WebSocketTestClient(address, 1);
         wsclient.connect();
@@ -141,7 +141,7 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
     
     @Test
     public void testPathRestriction() throws Exception {
-        String address = "ws://localhost:" + PORT + "/web/bookstore";
+        String address = "ws://localhost:" + getPort() + "/web/bookstore";
 
         WebSocketTestClient wsclient = new WebSocketTestClient(address, 1);
         wsclient.connect();
@@ -227,4 +227,7 @@ public class JAXRSClientServerWebSocketTest extends AbstractBusClientServerTestB
         }
     }
     
+    protected String getPort() {
+        return PORT;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/8d5c4463/systests/jaxrs/src/test/resources/jaxrs_websocket/beans-embedded.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/jaxrs_websocket/beans-embedded.xml b/systests/jaxrs/src/test/resources/jaxrs_websocket/beans-embedded.xml
index 03c5c5a..dfb3fd3 100644
--- a/systests/jaxrs/src/test/resources/jaxrs_websocket/beans-embedded.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs_websocket/beans-embedded.xml
@@ -36,7 +36,7 @@
         
     <bean class="org.apache.cxf.systest.jaxrs.websocket.BookStoreWebSocket" id="serviceBean"/>
 
-    <jaxrs:server id="bookservice" address="ws://localhost:${testutil.ports.BookServerWebSocket}/">
+    <jaxrs:server id="bookservice" address="ws://localhost:${testutil.ports.org.apache.cxf.systest.jaxrs.websocket.BookServerWebSocket.2}/">
         <jaxrs:serviceBeans>
             <ref bean="serviceBean"/>
         </jaxrs:serviceBeans>


Mime
View raw message