Author: andygumbrecht
Date: Fri May 2 13:07:28 2014
New Revision: 1591895
URL: http://svn.apache.org/r1591895
Log:
Use random ports to avoid unnecessary failures.
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
tomee/tomee/branches/tomee-1.6.0.2/server/openejb-cxf/src/test/java/org/apache/openejb/server/cxf/CxfJaxWsProviderTest.java
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
Fri May 2 13:07:28 2014
@@ -33,11 +33,17 @@ public class CalculatorTest {
private static EJBContainer container;
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
@BeforeClass
public static void setUp() throws Exception {
final Properties properties = new Properties();
properties.setProperty("openejb.embedded.remotable", "true");
+ //Just for this test we change the default port from 4204 to avoid
conflicts
+ properties.setProperty("httpejbd.port", "" + port);
+
container = EJBContainer.createEJBContainer(properties);
}
@@ -57,7 +63,7 @@ public class CalculatorTest {
@Test
public void wsdlExists() throws Exception {
- final URL url = new
URL("http://127.0.0.1:4204/simple-webservice-without-interface/Calculator?wsdl");
+ final URL url = new URL("http://localhost:" + port +
"/simple-webservice-without-interface/Calculator?wsdl");
assertTrue(IOUtils.readLines(url.openStream()).size() > 0);
assertTrue(IOUtils.readLines(url.openStream()).toString().contains("CalculatorWsService"));
}
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
Fri May 2 13:07:28 2014
@@ -30,10 +30,17 @@ import static org.junit.Assert.assertNot
public class CalculatorTest {
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
@BeforeClass
public static void setUp() throws Exception {
Properties properties = new Properties();
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
+
// properties.setProperty("httpejbd.print", "true");
// properties.setProperty("httpejbd.indent.xml", "true");
// properties.setProperty("logging.level.OpenEJB.server.http", "FINE");
@@ -43,7 +50,7 @@ public class CalculatorTest {
@Test
public void test() throws Exception {
Service calculatorService = Service.create(
- new
URL("http://127.0.0.1:4204/simple-webservice/Calculator?wsdl"),
+ new
URL("http://localhost:" + port + "/simple-webservice/Calculator?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorService"));
assertNotNull(calculatorService);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
Fri May 2 13:07:28 2014
@@ -28,14 +28,20 @@ import java.util.Properties;
public class TelephoneTest extends TestCase {
//START SNIPPET: setup
+
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("ejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
@Override
protected void setUp() throws Exception {
final Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4202 to
avoid conflicts
+ properties.setProperty("ejbd.port", port);
+
// Uncomment these properties to change the defaults
- //properties.setProperty("ejbd.port", "4202");
//properties.setProperty("ejbd.bind", "localhost");
//properties.setProperty("ejbd.threads", "200");
//properties.setProperty("ejbd.disabled", "false");
@@ -54,7 +60,7 @@ public class TelephoneTest extends TestC
public void testTalkOverLocalNetwork() throws Exception {
final Properties properties = new Properties();
- properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
+ properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
final InitialContext localContext = new InitialContext(properties);
final Telephone telephone = (Telephone)
localContext.lookup("TelephoneBeanRemote");
@@ -83,7 +89,7 @@ public class TelephoneTest extends TestC
public void testTalkOverRemoteNetwork() throws Exception {
final Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
- properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:" +
Integer.parseInt(System.getProperty("ejbd.port", "4201")));
+ properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:" +
port);
final InitialContext remoteContext = new InitialContext(properties);
final Telephone telephone = (Telephone)
remoteContext.lookup("TelephoneBeanRemote");
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
Fri May 2 13:07:28 2014
@@ -34,12 +34,18 @@ public class AttachmentTest extends Test
//START SNIPPET: setup
private InitialContext initialContext;
+
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
protected void setUp() throws Exception {
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
initialContext = new InitialContext(properties);
}
@@ -53,7 +59,7 @@ public class AttachmentTest extends Test
//START SNIPPET: webservice
public void testAttachmentViaWsInterface() throws Exception {
Service service = Service.create(
- new
URL("http://127.0.0.1:4204/webservice-attachments/AttachmentImpl?wsdl"),
+ new URL("http://localhost:" + port
+ "/webservice-attachments/AttachmentImpl?wsdl"),
new
QName("http://superbiz.org/wsdl", "AttachmentWsService"));
assertNotNull(service);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
Fri May 2 13:07:28 2014
@@ -30,10 +30,17 @@ import static org.junit.Assert.assertNot
public class CalculatorTest {
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
@BeforeClass
public static void setUp() throws Exception {
Properties properties = new Properties();
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
+
//properties.setProperty("httpejbd.print", "true");
//properties.setProperty("httpejbd.indent.xml", "true");
EJBContainer.createEJBContainer(properties);
@@ -42,7 +49,7 @@ public class CalculatorTest {
@Test
public void testCalculatorViaWsInterface() throws Exception {
final Service calculatorService = Service.create(
- new
URL("http://127.0.0.1:4204/webservice-handlerchain/Calculator?wsdl"),
+ new
URL("http://localhost:" + port + "webservice-handlerchain/Calculator?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorService"));
assertNotNull(calculatorService);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
Fri May 2 13:07:28 2014
@@ -31,10 +31,17 @@ import static org.junit.Assert.assertNot
public class CalculatorTest {
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
@BeforeClass
public static void setUp() throws Exception {
Properties properties = new Properties();
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
+
// properties.setProperty("httpejbd.print", "true");
// properties.setProperty("httpejbd.indent.xml", "true");
EJBContainer.createEJBContainer(properties);
@@ -43,7 +50,7 @@ public class CalculatorTest {
@Test
public void outParams() throws Exception {
final Service calculatorService = Service.create(
- new
URL("http://127.0.0.1:4204/webservice-holder/Calculator?wsdl"),
+ new
URL("http://localhost:" + port + "/webservice-holder/Calculator?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorService"));
assertNotNull(calculatorService);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
Fri May 2 13:07:28 2014
@@ -31,6 +31,9 @@ public class InheritanceTest extends Tes
//START SNIPPET: setup
private InitialContext initialContext;
+
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
protected void setUp() throws Exception {
@@ -46,6 +49,9 @@ public class InheritanceTest extends Tes
p.put("wakeBoardDatabaseUnmanaged.JtaManaged", "false");
p.put("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ p.put("httpejbd.port", "" + port);
initialContext = new InitialContext(p);
}
@@ -59,7 +65,7 @@ public class InheritanceTest extends Tes
//START SNIPPET: webservice
public void testInheritanceViaWsInterface() throws Exception {
Service service = Service.create(
- new
URL("http://127.0.0.1:4204/webservice-inheritance/WakeRiderImpl?wsdl"),
+ new URL("http://localhost:" + port
+ "/webservice-inheritance/WakeRiderImpl?wsdl"),
new
QName("http://superbiz.org/wsdl", "InheritanceWsService"));
assertNotNull(service);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
Fri May 2 13:07:28 2014
@@ -30,11 +30,17 @@ public class CalculatorTest extends Test
//START SNIPPET: setup
private InitialContext initialContext;
+
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
protected void setUp() throws Exception {
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
initialContext = new InitialContext(properties);
}
@@ -47,7 +53,7 @@ public class CalculatorTest extends Test
*/
//START SNIPPET: webservice
public void testCalculatorViaWsInterface() throws Exception {
- URL url = new
URL("http://127.0.0.1:4204/webservice-security/CalculatorImpl?wsdl");
+ URL url = new URL("http://localhost:" + port +
"/webservice-security/CalculatorImpl?wsdl");
QName calcServiceQName = new QName("http://superbiz.org/wsdl",
"CalculatorWsService");
Service calcService = Service.create(url, calcServiceQName);
assertNotNull(calcService);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
Fri May 2 13:07:28 2014
@@ -45,11 +45,18 @@ import java.util.Properties;
public class CalculatorTest extends TestCase {
//START SNIPPET: setup
+
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
@Override
protected void setUp() throws Exception {
final Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
new InitialContext(properties);
}
@@ -57,7 +64,7 @@ public class CalculatorTest extends Test
//START SNIPPET: webservice
public void testCalculatorViaWsInterface() throws Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImpl?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port + "/webservice-ws-security/CalculatorImpl?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
@@ -87,7 +94,7 @@ public class CalculatorTest extends Test
}
public void testCalculatorViaWsInterfaceWithTimestamp1way() throws
Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImplTimestamp1way?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port + "/webservice-ws-security/CalculatorImplTimestamp1way?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
@@ -115,7 +122,7 @@ public class CalculatorTest extends Test
}
public void testCalculatorViaWsInterfaceWithTimestamp2ways() throws
Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImplTimestamp2ways?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port + "/webservice-ws-security/CalculatorImplTimestamp2ways?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
@@ -149,7 +156,7 @@ public class CalculatorTest extends Test
}
public void testCalculatorViaWsInterfaceWithUsernameTokenPlainPassword()
throws Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImplUsernameTokenPlainPassword?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port +
"/webservice-ws-security/CalculatorImplUsernameTokenPlainPassword?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
@@ -188,7 +195,7 @@ public class CalculatorTest extends Test
}
public void testCalculatorViaWsInterfaceWithUsernameTokenHashedPassword()
throws Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImplUsernameTokenHashedPassword?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port +
"/webservice-ws-security/CalculatorImplUsernameTokenHashedPassword?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
@@ -227,7 +234,7 @@ public class CalculatorTest extends Test
}
public void
testCalculatorViaWsInterfaceWithUsernameTokenPlainPasswordEncrypt() throws
Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImplUsernameTokenPlainPasswordEncrypt?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port +
"/webservice-ws-security/CalculatorImplUsernameTokenPlainPasswordEncrypt?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
@@ -269,7 +276,7 @@ public class CalculatorTest extends Test
}
public void testCalculatorViaWsInterfaceWithSign() throws Exception {
- final Service calcService = Service.create(new
URL("http://127.0.0.1:4204/webservice-ws-security/CalculatorImplSign?wsdl"),
+ final Service calcService = Service.create(new URL("http://localhost:"
+ port + "/webservice-ws-security/CalculatorImplSign?wsdl"),
new
QName("http://superbiz.org/wsdl", "CalculatorWsService"));
assertNotNull(calcService);
Modified:
tomee/tomee/branches/tomee-1.6.0.2/server/openejb-cxf/src/test/java/org/apache/openejb/server/cxf/CxfJaxWsProviderTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.6.0.2/server/openejb-cxf/src/test/java/org/apache/openejb/server/cxf/CxfJaxWsProviderTest.java?rev=1591895&r1=1591894&r2=1591895&view=diff
==============================================================================
---
tomee/tomee/branches/tomee-1.6.0.2/server/openejb-cxf/src/test/java/org/apache/openejb/server/cxf/CxfJaxWsProviderTest.java
(original)
+++
tomee/tomee/branches/tomee-1.6.0.2/server/openejb-cxf/src/test/java/org/apache/openejb/server/cxf/CxfJaxWsProviderTest.java
Fri May 2 13:07:28 2014
@@ -38,12 +38,18 @@ public class CxfJaxWsProviderTest extend
//START SNIPPET: setup
private InitialContext initialContext;
+
+ //Random port to avoid test conflicts
+ private static final int port =
Integer.parseInt(System.getProperty("httpejbd.port", "" +
org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
protected void setUp() throws Exception {
Properties properties = new Properties();
properties.setProperty(DeploymentFilterable.CLASSPATH_INCLUDE,
".*openejb-cxf.*");
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.core.LocalInitialContextFactory");
properties.setProperty("openejb.embedded.remotable", "true");
+
+ //Just for this test we change the default port from 4204 to
avoid conflicts
+ properties.setProperty("httpejbd.port", "" + port);
initialContext = new InitialContext(properties);
}
@@ -52,13 +58,13 @@ public class CxfJaxWsProviderTest extend
public void test00_runCheckedException() {
try {
AuthenticatorService withHandler = Service.create(
- new
URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBean?wsdl"),
+ new URL("http://localhost:" + port +
"/openejb-cxf/AuthenticatorServiceBean?wsdl"),
new QName("http://superbiz.org/wsdl",
"AuthenticatorServiceBeanService"))
.getPort(AuthenticatorService.class);
assertNotNull(withHandler);
AuthenticatorService noHandler = Service.create(
- new
URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBeanNoHandler?wsdl"),
+ new URL("http://localhost:" + port +
"/openejb-cxf/AuthenticatorServiceBeanNoHandler?wsdl"),
new QName("http://superbiz.org/wsdl",
"AuthenticatorServiceBeanNoHandlerService"))
.getPort(AuthenticatorService.class);
assertNotNull(noHandler);
@@ -91,13 +97,13 @@ public class CxfJaxWsProviderTest extend
public void test01_runRuntimeException() {
try {
AuthenticatorService withHandler = Service.create(
- new
URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBean?wsdl"),
+ new URL("http://localhost:" + port +
"/openejb-cxf/AuthenticatorServiceBean?wsdl"),
new QName("http://superbiz.org/wsdl",
"AuthenticatorServiceBeanService"))
.getPort(AuthenticatorService.class);
assertNotNull(withHandler);
AuthenticatorService noHandler = Service.create(
- new
URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBeanNoHandler?wsdl"),
+ new URL("http://localhost:" + port +
"/openejb-cxf/AuthenticatorServiceBeanNoHandler?wsdl"),
new QName("http://superbiz.org/wsdl",
"AuthenticatorServiceBeanNoHandlerService"))
.getPort(AuthenticatorService.class);
assertNotNull(noHandler);