You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2017/02/01 15:31:35 UTC
[1/3] cxf git commit: Also check policies in the AssertionInfoMap for
equality
Repository: cxf
Updated Branches:
refs/heads/master 3450d3854 -> e26586ee4
Also check policies in the AssertionInfoMap for equality
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e26586ee
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e26586ee
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e26586ee
Branch: refs/heads/master
Commit: e26586ee47bc1f733aaf1439b5421e5e4ee63a00
Parents: 1cded5a
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Feb 1 15:30:15 2017 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Feb 1 15:30:44 2017 +0000
----------------------------------------------------------------------
.../src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/e26586ee/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
index bc2e0cb..fd3e848 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
@@ -102,7 +102,7 @@ public class AssertionInfoMap extends HashMap<QName, Collection<AssertionInfo>>
Collection<AssertionInfo> ail = getAssertionInfo(ass.getName());
boolean found = false;
for (AssertionInfo ai : ail) {
- if (ai.getAssertion().equal(ass)) {
+ if (ai.getAssertion().equal(ass) || ai.getAssertion().equals(ass)) {
found = true;
if (!ai.isAsserted() && !ass.isOptional()) {
errors.add(ass.getName());
[2/3] cxf git commit: Get databinding systests to run on random ports
Posted by co...@apache.org.
Get databinding systests to run on random ports
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1cded5a8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1cded5a8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1cded5a8
Branch: refs/heads/master
Commit: 1cded5a8f0eb3e7475a8b28e5eaf19b1f4016c55
Parents: ef13d2b
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Feb 1 15:25:54 2017 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Feb 1 15:30:44 2017 +0000
----------------------------------------------------------------------
.../databinding/src/test/resources/jaxbCustomValidators.xml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/1cded5a8/systests/databinding/src/test/resources/jaxbCustomValidators.xml
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/resources/jaxbCustomValidators.xml b/systests/databinding/src/test/resources/jaxbCustomValidators.xml
index 6466c9e..688cc53 100644
--- a/systests/databinding/src/test/resources/jaxbCustomValidators.xml
+++ b/systests/databinding/src/test/resources/jaxbCustomValidators.xml
@@ -25,11 +25,13 @@ under the License.
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
<!-- Services -->
<jaxws:server
id="testServer"
serviceClass="org.apache.cxf.systest.jaxb.validators.HelloWorld"
- address="http://localhost:9000/Hello">
+ address="http://localhost:${testutil.ports.CustomValidatorJAXBTest}/Hello">
<jaxws:serviceBean>
<bean class="org.apache.cxf.systest.jaxb.validators.HelloWorldImpl"/>
</jaxws:serviceBean>
@@ -48,7 +50,7 @@ under the License.
<jaxws:client
id="testClient"
serviceClass="org.apache.cxf.systest.jaxb.validators.HelloWorld"
- address="http://localhost:9000/Hello">
+ address="http://localhost:${testutil.ports.CustomValidatorJAXBTest}/Hello">
</jaxws:client>
[3/3] cxf git commit: Get WS-Transfer system tests running on random
ports
Posted by co...@apache.org.
Get WS-Transfer system tests running on random ports
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ef13d2b2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ef13d2b2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ef13d2b2
Branch: refs/heads/master
Commit: ef13d2b2f8f7b67b7351030a3a097377435371c5
Parents: 3450d38
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Feb 1 15:25:41 2017 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Feb 1 15:30:44 2017 +0000
----------------------------------------------------------------------
systests/ws-transfer/pom.xml | 6 +++
.../systest/ws/transfer/CreateStudentTest.java | 21 ++++++----
.../systest/ws/transfer/CreateTeacherTest.java | 20 ++++++----
.../cxf/systest/ws/transfer/DeleteTest.java | 12 ++++--
.../apache/cxf/systest/ws/transfer/GetTest.java | 10 +++--
.../apache/cxf/systest/ws/transfer/PutTest.java | 12 ++++--
.../cxf/systest/ws/transfer/TestUtils.java | 42 +++++++++-----------
7 files changed, 74 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/pom.xml
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/pom.xml b/systests/ws-transfer/pom.xml
index f032f51..93a0e7b 100644
--- a/systests/ws-transfer/pom.xml
+++ b/systests/ws-transfer/pom.xml
@@ -56,6 +56,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-testutils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateStudentTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateStudentTest.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateStudentTest.java
index 2f9feaa..36bacf8 100644
--- a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateStudentTest.java
+++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateStudentTest.java
@@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.ws.soap.SOAPFaultException;
import org.w3c.dom.Document;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.ws.transfer.Create;
import org.apache.cxf.ws.transfer.CreateResponse;
import org.apache.cxf.ws.transfer.Representation;
@@ -34,11 +35,15 @@ import org.junit.Test;
public class CreateStudentTest {
+ static final String PORT = TestUtil.getPortNumber(CreateStudentTest.class);
+ static final String PORT2 = TestUtil.getPortNumber(CreateStudentTest.class, 2);
+
+ static final String RESOURCE_STUDENTS_URL = "http://localhost:" + PORT + "/ResourceStudents";
@BeforeClass
public static void beforeClass() {
- TestUtils.createStudentsServers();
- TestUtils.createTeachersServers();
+ TestUtils.createStudentsServers(PORT, PORT2);
+ TestUtils.createTeachersServers(PORT2);
}
@AfterClass
@@ -55,10 +60,10 @@ public class CreateStudentTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
- Assert.assertEquals(TestUtils.RESOURCE_STUDENTS_URL,
+ Assert.assertEquals(RESOURCE_STUDENTS_URL,
response.getResourceCreated().getAddress().getValue());
}
@@ -70,10 +75,10 @@ public class CreateStudentTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentPartialXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
- Assert.assertEquals(TestUtils.RESOURCE_STUDENTS_URL,
+ Assert.assertEquals(RESOURCE_STUDENTS_URL,
response.getResourceCreated().getAddress().getValue());
}
@@ -85,7 +90,7 @@ public class CreateStudentTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentWrongXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
rf.create(request);
}
@@ -97,7 +102,7 @@ public class CreateStudentTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(randomXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
rf.create(request);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateTeacherTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateTeacherTest.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateTeacherTest.java
index 9a67b9a..02e4296 100644
--- a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateTeacherTest.java
+++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/CreateTeacherTest.java
@@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.ws.soap.SOAPFaultException;
import org.w3c.dom.Document;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.ws.transfer.Create;
import org.apache.cxf.ws.transfer.CreateResponse;
import org.apache.cxf.ws.transfer.Representation;
@@ -34,10 +35,15 @@ import org.junit.Test;
public class CreateTeacherTest {
+ static final String PORT = TestUtil.getPortNumber(CreateStudentTest.class);
+ static final String PORT2 = TestUtil.getPortNumber(CreateStudentTest.class, 2);
+
+ static final String RESOURCE_TEACHERS_URL = "http://localhost:" + PORT2 + "/ResourceTeachers";
+
@BeforeClass
public static void beforeClass() {
- TestUtils.createStudentsServers();
- TestUtils.createTeachersServers();
+ TestUtils.createStudentsServers(PORT, PORT2);
+ TestUtils.createTeachersServers(PORT2);
}
@AfterClass
@@ -54,10 +60,10 @@ public class CreateTeacherTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
- Assert.assertEquals(TestUtils.RESOURCE_TEACHERS_URL,
+ Assert.assertEquals(RESOURCE_TEACHERS_URL,
response.getResourceCreated().getAddress().getValue());
}
@@ -69,10 +75,10 @@ public class CreateTeacherTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherPartialXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
CreateResponse response = rf.create(request);
- Assert.assertEquals(TestUtils.RESOURCE_TEACHERS_URL,
+ Assert.assertEquals(RESOURCE_TEACHERS_URL,
response.getResourceCreated().getAddress().getValue());
}
@@ -84,7 +90,7 @@ public class CreateTeacherTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherWrongXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
rf.create(request);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/DeleteTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/DeleteTest.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/DeleteTest.java
index b25a944..57fcbd1 100644
--- a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/DeleteTest.java
+++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/DeleteTest.java
@@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.ws.soap.SOAPFaultException;
import org.w3c.dom.Document;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.ws.transfer.Create;
import org.apache.cxf.ws.transfer.CreateResponse;
import org.apache.cxf.ws.transfer.Delete;
@@ -36,10 +37,13 @@ import org.junit.Test;
public class DeleteTest {
+ static final String PORT = TestUtil.getPortNumber(CreateStudentTest.class);
+ static final String PORT2 = TestUtil.getPortNumber(CreateStudentTest.class, 2);
+
@Before
public void before() {
- TestUtils.createStudentsServers();
- TestUtils.createTeachersServers();
+ TestUtils.createStudentsServers(PORT, PORT2);
+ TestUtils.createTeachersServers(PORT2);
}
@After
@@ -101,7 +105,7 @@ public class DeleteTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
return rf.create(request);
}
@@ -112,7 +116,7 @@ public class DeleteTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
return rf.create(request);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/GetTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/GetTest.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/GetTest.java
index 65fdce7..5e10099 100644
--- a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/GetTest.java
+++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/GetTest.java
@@ -24,6 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.apache.cxf.ws.transfer.Create;
import org.apache.cxf.ws.transfer.Get;
@@ -38,16 +39,19 @@ import org.junit.Test;
public class GetTest {
+ static final String PORT = TestUtil.getPortNumber(CreateStudentTest.class);
+ static final String PORT2 = TestUtil.getPortNumber(CreateStudentTest.class, 2);
+
private static EndpointReferenceType studentRef;
private static EndpointReferenceType teacherRef;
@BeforeClass
public static void beforeClass() throws XMLStreamException {
- TestUtils.createStudentsServers();
- TestUtils.createTeachersServers();
+ TestUtils.createStudentsServers(PORT, PORT2);
+ TestUtils.createTeachersServers(PORT2);
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
Document createStudentXML = StaxUtils.read(
GetTest.class.getResourceAsStream("/xml/createStudent.xml"));
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/PutTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/PutTest.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/PutTest.java
index ec906b6..2195e93 100644
--- a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/PutTest.java
+++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/PutTest.java
@@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.ws.soap.SOAPFaultException;
import org.w3c.dom.Document;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.ws.transfer.Create;
import org.apache.cxf.ws.transfer.CreateResponse;
import org.apache.cxf.ws.transfer.Put;
@@ -35,10 +36,13 @@ import org.junit.Test;
public class PutTest {
+ static final String PORT = TestUtil.getPortNumber(CreateStudentTest.class);
+ static final String PORT2 = TestUtil.getPortNumber(CreateStudentTest.class, 2);
+
@Before
public void before() {
- TestUtils.createStudentsServers();
- TestUtils.createTeachersServers();
+ TestUtils.createStudentsServers(PORT, PORT2);
+ TestUtils.createTeachersServers(PORT2);
}
@After
@@ -112,7 +116,7 @@ public class PutTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createStudentXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
return rf.create(request);
}
@@ -123,7 +127,7 @@ public class PutTest {
request.setRepresentation(new Representation());
request.getRepresentation().setAny(createTeacherXML.getDocumentElement());
- ResourceFactory rf = TestUtils.createResourceFactoryClient();
+ ResourceFactory rf = TestUtils.createResourceFactoryClient(PORT);
return rf.create(request);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/ef13d2b2/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/TestUtils.java
----------------------------------------------------------------------
diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/TestUtils.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/TestUtils.java
index 90645d3..e194d99 100644
--- a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/TestUtils.java
+++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/TestUtils.java
@@ -47,12 +47,6 @@ import org.apache.cxf.ws.transfer.validationtransformation.XSLTResourceTransform
*/
public final class TestUtils {
- public static final String RESOURCE_STUDENTS_URL = "http://localhost:8080/ResourceStudents";
-
- public static final String RESOURCE_FACTORY_URL = "http://localhost:8080/ResourceFactory";
-
- public static final String RESOURCE_TEACHERS_URL = "http://localhost:8081/ResourceTeachers";
-
private static Server resourceFactoryServer;
private static Server studentsResourceServer;
@@ -65,10 +59,10 @@ public final class TestUtils {
}
- protected static ResourceFactory createResourceFactoryClient() {
+ protected static ResourceFactory createResourceFactoryClient(String port) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory.class);
- factory.setAddress(RESOURCE_FACTORY_URL);
+ factory.setAddress("http://localhost:" + port + "/ResourceFactory");
return (ResourceFactory) factory.create();
}
@@ -86,14 +80,14 @@ public final class TestUtils {
return proxy;
}
- protected static void createStudentsServers() {
+ protected static void createStudentsServers(String port, String port2) {
UIDManager.reset();
ResourceManager studentsResourceManager = new MemoryResourceManager();
- resourceFactoryServer = createResourceFactory(studentsResourceManager);
- studentsResourceServer = createStudentsResource(studentsResourceManager);
+ resourceFactoryServer = createResourceFactory(studentsResourceManager, port, port2);
+ studentsResourceServer = createStudentsResource(studentsResourceManager, port);
}
- protected static void createTeachersServers() {
+ protected static void createTeachersServers(String port) {
ResourceManager teachersResourceManager = new MemoryResourceManager();
ResourceRemote resource = new ResourceRemote();
resource.setManager(teachersResourceManager);
@@ -102,8 +96,8 @@ public final class TestUtils {
new XSLTResourceTransformer(
new StreamSource(TestUtils.class.getResourceAsStream("/xslt/teacherDefaultValues.xsl")),
new TeacherResourceValidator())));
- teachersResourceFactoryServer = createTeachersResourceFactoryEndpoint(resource);
- teachersResourceServer = createTeacherResourceEndpoint(resource);
+ teachersResourceFactoryServer = createTeachersResourceFactoryEndpoint(resource, port);
+ teachersResourceServer = createTeacherResourceEndpoint(resource, port);
}
protected static void destroyStudentsServers() {
@@ -116,10 +110,12 @@ public final class TestUtils {
teachersResourceServer.destroy();
}
- private static Server createResourceFactory(ResourceManager resourceManager) {
+ private static Server createResourceFactory(ResourceManager resourceManager, String port, String port2) {
ResourceFactoryImpl resourceFactory = new ResourceFactoryImpl();
resourceFactory.setResourceResolver(
- new MyResourceResolver(RESOURCE_STUDENTS_URL, resourceManager, RESOURCE_TEACHERS_URL));
+ new MyResourceResolver("http://localhost:" + port + "/ResourceStudents",
+ resourceManager,
+ "http://localhost:" + port2 + "/ResourceTeachers"));
resourceFactory.getResourceTypeIdentifiers().add(
new XSDResourceTypeIdentifier(
new StreamSource(TestUtils.class.getResourceAsStream("/schema/studentCreate.xsd")),
@@ -134,12 +130,12 @@ public final class TestUtils {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory.class);
factory.setServiceBean(resourceFactory);
- factory.setAddress(RESOURCE_FACTORY_URL);
+ factory.setAddress("http://localhost:" + port + "/ResourceFactory");
return factory.create();
}
- private static Server createStudentsResource(ResourceManager resourceManager) {
+ private static Server createStudentsResource(ResourceManager resourceManager, String port) {
ResourceLocal resourceLocal = new ResourceLocal();
resourceLocal.setManager(resourceManager);
resourceLocal.getResourceTypeIdentifiers().add(
@@ -151,23 +147,23 @@ public final class TestUtils {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(Resource.class);
factory.setServiceBean(resourceLocal);
- factory.setAddress(RESOURCE_STUDENTS_URL);
+ factory.setAddress("http://localhost:" + port + "/ResourceStudents");
return factory.create();
}
- private static Server createTeachersResourceFactoryEndpoint(ResourceRemote resource) {
+ private static Server createTeachersResourceFactoryEndpoint(ResourceRemote resource, String port) {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(ResourceFactory.class);
factory.setServiceBean(resource);
- factory.setAddress(RESOURCE_TEACHERS_URL + TransferConstants.RESOURCE_REMOTE_SUFFIX);
+ factory.setAddress("http://localhost:" + port + "/ResourceTeachers" + TransferConstants.RESOURCE_REMOTE_SUFFIX);
return factory.create();
}
- private static Server createTeacherResourceEndpoint(ResourceRemote resource) {
+ private static Server createTeacherResourceEndpoint(ResourceRemote resource, String port) {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(Resource.class);
factory.setServiceBean(resource);
- factory.setAddress(RESOURCE_TEACHERS_URL);
+ factory.setAddress("http://localhost:" + port + "/ResourceTeachers");
return factory.create();
}