Skip to content

Commit f669afa

Browse files
committed
Make sure the test server ports do not collide
1 parent 382a6d9 commit f669afa

339 files changed

Lines changed: 1560 additions & 1549 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/delegation/STSServer.java renamed to services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/delegation/DelegationSTSServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.apache.cxf.bus.spring.SpringBusFactory;
2222
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
2323

24-
public class STSServer extends AbstractBusTestServerBase {
24+
public class DelegationSTSServer extends AbstractBusTestServerBase {
2525

2626
protected void run() {
2727
setBus(new SpringBusFactory().createBus(getClass().getResource("cxf-sts-transport.xml")));

services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/delegation/SAMLDelegationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
*/
6464
public class SAMLDelegationTest extends AbstractBusClientServerTestBase {
6565

66-
private static final String STSPORT = allocatePort(STSServer.class);
66+
private static final String STSPORT = allocatePort(DelegationSTSServer.class);
6767

6868
private static final String SAML2_TOKEN_TYPE =
6969
"http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0";
@@ -80,7 +80,7 @@ public static void startServers() throws Exception {
8080
"Server failed to launch",
8181
// run the server in the same process
8282
// set this to false to fork
83-
launchServer(STSServer.class, true)
83+
launchServer(DelegationSTSServer.class, true)
8484
);
8585
}
8686

services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@
116116
<property name="relationships" ref="relationships"/>
117117
<property name="samlRealmCodec" ref="samlRealmCodec"/>
118118
</bean>
119-
<jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTS" implementor="#transportSTSProviderBean" address="https://localhost:${testutil.ports.STSServer}/SecurityTokenService/Transport" wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/delegation/ws-trust-1.4-service.wsdl" serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_Port" depends-on="ClientAuthHttpsSettings">
119+
<jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTS" implementor="#transportSTSProviderBean" address="https://localhost:${testutil.ports.DelegationSTSServer}/SecurityTokenService/Transport" wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/delegation/ws-trust-1.4-service.wsdl" serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_Port" depends-on="ClientAuthHttpsSettings">
120120
<jaxws:properties>
121121
<entry key="security.callback-handler" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
122122
</jaxws:properties>
123123
</jaxws:endpoint>
124-
<jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTSUT" implementor="#transportUTSTSProviderBean" address="https://localhost:${testutil.ports.STSServer}/SecurityTokenService/TransportUT" wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/delegation/ws-trust-1.4-service.wsdl" serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_UT_Port" depends-on="ClientAuthHttpsSettings">
124+
<jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTSUT" implementor="#transportUTSTSProviderBean" address="https://localhost:${testutil.ports.DelegationSTSServer}/SecurityTokenService/TransportUT" wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/delegation/ws-trust-1.4-service.wsdl" serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_UT_Port" depends-on="ClientAuthHttpsSettings">
125125
<jaxws:properties>
126126
<entry key="security.callback-handler" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
127127
</jaxws:properties>
128128
</jaxws:endpoint>
129129

130130
<httpj:engine-factory id="ClientAuthHttpsSettings" bus="cxf">
131-
<httpj:engine port="${testutil.ports.STSServer}">
131+
<httpj:engine port="${testutil.ports.DelegationSTSServer}">
132132
<httpj:tlsServerParameters>
133133
<sec:keyManagers keyPassword="sspass">
134134
<sec:keyStore type="jks" password="sspass" resource="keys/servicestore.jks"/>

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceAsteriskTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
import static org.junit.Assert.assertTrue;
4848

4949
public class JAXRSClientServerUserResourceAsteriskTest extends AbstractClientServerTestBase {
50-
public static final String PORT = allocatePort(Server.class);
50+
public static final String PORT = allocatePort(UserResourceAsteriskServer.class);
5151
public static final String CONTEXT = "/jetty/*/asterisk";
5252

53-
public static class Server extends AbstractServerTestServerBase {
53+
public static class UserResourceAsteriskServer extends AbstractServerTestServerBase {
5454
@Override
5555
protected org.apache.cxf.endpoint.Server createServer(Bus bus) throws Exception {
5656
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
@@ -93,14 +93,14 @@ protected org.apache.cxf.endpoint.Server createServer(Bus bus) throws Exception
9393
}
9494

9595
public static void main(String[] args) throws Exception {
96-
new Server().start();
96+
new UserResourceAsteriskServer().start();
9797
}
9898
}
9999

100100
@BeforeClass
101101
public static void startServers() throws Exception {
102102
AbstractResourceInfo.clearAllMaps();
103-
assertTrue("server did not launch correctly", launchServer(Server.class));
103+
assertTrue("server did not launch correctly", launchServer(UserResourceAsteriskServer.class));
104104
}
105105

106106
@Test

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceDefaultTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
import static org.junit.Assert.assertTrue;
7474

7575
public class JAXRSClientServerUserResourceDefaultTest extends AbstractBusClientServerTestBase {
76-
public static final String PORT = allocatePort(Server.class);
76+
public static final String PORT = allocatePort(UserResourceDefaultServer.class);
7777

78-
public static class Server extends AbstractServerTestServerBase {
78+
public static class UserResourceDefaultServer extends AbstractServerTestServerBase {
7979

8080
@Override
8181
protected org.apache.cxf.endpoint.Server createServer(Bus bus) throws Exception {
@@ -122,15 +122,15 @@ protected org.apache.cxf.endpoint.Server createServer(Bus bus) throws Exception
122122
}
123123

124124
public static void main(String[] args) throws Exception {
125-
new Server().start();
125+
new UserResourceDefaultServer().start();
126126
}
127127
}
128128

129129
@BeforeClass
130130
public static void startServers() throws Exception {
131131
AbstractResourceInfo.clearAllMaps();
132132
assertTrue("server did not launch correctly",
133-
launchServer(Server.class, true));
133+
launchServer(UserResourceDefaultServer.class, true));
134134
createStaticBus();
135135
}
136136

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
import static org.junit.Assert.assertTrue;
4848

4949
public class JAXRSClientServerUserResourceTest extends AbstractClientServerTestBase {
50-
public static final String PORT = allocatePort(Server.class);
50+
public static final String PORT = allocatePort(UserResourceServer.class);
5151

52-
public static class Server extends AbstractServerTestServerBase {
52+
public static class UserResourceServer extends AbstractServerTestServerBase {
5353

5454
@Override
5555
protected org.apache.cxf.endpoint.Server createServer(Bus bus) throws Exception {
@@ -93,15 +93,15 @@ protected org.apache.cxf.endpoint.Server createServer(Bus bus) throws Exception
9393
}
9494

9595
public static void main(String[] args) throws Exception {
96-
new Server().start();
96+
new UserResourceServer().start();
9797
}
9898
}
9999

100100
@BeforeClass
101101
public static void startServers() throws Exception {
102102
AbstractResourceInfo.clearAllMaps();
103103
assertTrue("server did not launch correctly",
104-
launchServer(Server.class, true));
104+
launchServer(UserResourceServer.class, true));
105105
}
106106

107107
@Test

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUnicodeTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@
3131
import static org.junit.Assert.assertEquals;
3232

3333
public class JAXRSUnicodeTest extends AbstractBusClientServerTestBase {
34-
public static final int PORT = SpringServer.PORT;
34+
public static final int PORT = SpringUnicodeServer.PORT;
3535

3636
@BeforeClass
3737
public static void beforeClass() throws Exception {
3838
// must be 'in-process' to communicate with inner class in single JVM
3939
// and to spawn class SpringServer w/o using main() method
40-
launchServer(SpringServer.class, true);
40+
launchServer(SpringUnicodeServer.class, true);
4141
}
4242
@Ignore
43-
public static class SpringServer extends AbstractSpringServer {
44-
public static final int PORT = allocatePortAsInt(SpringServer.class);
45-
public SpringServer() {
43+
public static class SpringUnicodeServer extends AbstractSpringServer {
44+
public static final int PORT = allocatePortAsInt(SpringUnicodeServer.class);
45+
public SpringUnicodeServer() {
4646
super("/jaxrs_unicode", PORT);
4747
}
4848
}

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUriInfoMatchTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@
3838
import static org.junit.Assert.assertEquals;
3939

4040
public class JAXRSUriInfoMatchTest extends AbstractClientServerTestBase {
41-
public static final int PORT = SpringServer.PORT;
41+
public static final int PORT = SpringUriInfoMatchServer.PORT;
4242
@BeforeClass
4343
public static void beforeClass() throws Exception {
4444
// must be 'in-process' to communicate with inner class in single JVM
4545
// and to spawn class SpringServer w/o using main() method
46-
launchServer(SpringServer.class, true);
46+
launchServer(SpringUriInfoMatchServer.class, true);
4747
}
4848

4949
@Ignore
50-
public static class SpringServer extends AbstractSpringServer {
51-
public static final int PORT = allocatePortAsInt(SpringServer.class);
52-
public SpringServer() {
50+
public static class SpringUriInfoMatchServer extends AbstractSpringServer {
51+
public static final int PORT = allocatePortAsInt(SpringUriInfoMatchServer.class);
52+
public SpringUriInfoMatchServer() {
5353
super("/jaxrs_uriinfo_match", "/match", PORT);
5454
}
5555
}

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSUriInfoTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
import static org.junit.Assert.assertEquals;
3535

3636
public class JAXRSUriInfoTest extends AbstractClientServerTestBase {
37-
public static final int PORT = SpringServer.PORT;
37+
public static final int PORT = SpringUriInfoServer.PORT;
3838
@BeforeClass
3939
public static void beforeClass() throws Exception {
4040
// must be 'in-process' to communicate with inner class in single JVM
4141
// and to spawn class SpringServer w/o using main() method
42-
launchServer(SpringServer.class, true);
42+
launchServer(SpringUriInfoServer.class, true);
4343
}
4444

4545
@Ignore
46-
public static class SpringServer extends AbstractSpringServer {
47-
public static final int PORT = allocatePortAsInt(SpringServer.class);
48-
public SpringServer() {
46+
public static class SpringUriInfoServer extends AbstractSpringServer {
47+
public static final int PORT = allocatePortAsInt(SpringUriInfoServer.class);
48+
public SpringUriInfoServer() {
4949
super("/jaxrs_uriinfo", "/app", PORT);
5050
}
5151
}

systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/cors/CrossOriginSimpleTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
*
6464
*/
6565
public class CrossOriginSimpleTest extends AbstractBusClientServerTestBase {
66-
public static final int PORT = SpringServer.PORT;
66+
public static final int PORT = SpringCrossOriginSimpleServer.PORT;
6767
private WebClient configClient;
6868

6969
@BeforeClass
7070
public static void startServers() throws Exception {
71-
assertTrue("server did not launch correctly", launchServer(SpringServer.class, true));
71+
assertTrue("server did not launch correctly", launchServer(SpringCrossOriginSimpleServer.class, true));
7272
}
7373

7474
@Before
@@ -572,10 +572,10 @@ public void testAnnotatedLocalPreflightNoGo() throws Exception {
572572
}
573573

574574
@Ignore
575-
public static class SpringServer extends AbstractSpringServer {
576-
public static final int PORT = allocatePortAsInt(SpringServer.class);
575+
public static class SpringCrossOriginSimpleServer extends AbstractSpringServer {
576+
public static final int PORT = allocatePortAsInt(SpringCrossOriginSimpleServer.class);
577577

578-
public SpringServer() {
578+
public SpringCrossOriginSimpleServer() {
579579
super("/jaxrs_cors", PORT);
580580
}
581581
}

0 commit comments

Comments
 (0)