cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [16/19] git commit: Fix test failure with Jetty update.
Date Thu, 30 Oct 2014 19:29:05 GMT
Fix test failure with Jetty update.


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

Branch: refs/heads/master
Commit: 6efe475ad57f042ffc9547f1bb258ab4e16a3f3e
Parents: c1c75b0
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Oct 30 14:44:48 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Oct 30 14:44:48 2014 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java    | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6efe475a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
index 7afd9e8..0046b75 100644
--- a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
+++ b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
@@ -24,7 +24,6 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.net.ServerSocket;
 import java.util.Arrays;
 import java.util.List;
 
@@ -47,6 +46,7 @@ import org.apache.cxf.tools.wsdlto.WSDLToJava;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.UniqueBodyValidator;
 import org.apache.cxf.wsdl11.WSDLRuntimeException;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.server.handler.ResourceHandler;
 
 import org.junit.Test;
@@ -486,10 +486,7 @@ public class CodeGenBugTest extends AbstractCodeGenTest {
 
     @Test
     public void testHelloWorldExternalBindingFile() throws Exception {
-        ServerSocket sock = new ServerSocket(0);
-        int port = sock.getLocalPort();
-        Server server = new Server(port);
-        sock.close();
+        Server server = new Server(0);
 
         ResourceHandler reshandler = new ResourceHandler();
         reshandler.setResourceBase(getLocation("/wsdl2java_wsdl/"));
@@ -497,6 +494,7 @@ public class CodeGenBugTest extends AbstractCodeGenTest {
         // 'add' it.
         server.setHandler(reshandler);
         server.start();
+        int port = ((ServerConnector)server.getConnectors()[0]).getLocalPort();
         env.put(ToolConstants.CFG_WSDLURL, "http://localhost:" 
             + port + "/hello_world.wsdl");
         env.put(ToolConstants.CFG_BINDING, "http://localhost:"


Mime
View raw message