Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 3847be0cd -> 86553f170
Updating XKMS tests to use random ports # Conflicts: # services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/21cff8dd Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/21cff8dd Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/21cff8dd Branch: refs/heads/3.1.x-fixes Commit: 21cff8ddaac5e8dd3b2eb7a4546cf1588497eee8 Parents: 3847be0 Author: Colm O hEigeartaigh <[email protected]> Authored: Mon May 29 13:12:50 2017 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Mon May 29 13:13:38 2017 +0100 ---------------------------------------------------------------------- services/xkms/xkms-itests/pom.xml | 6 ++++++ .../cxf/xkms/itests/BasicIntegrationTest.java | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/21cff8dd/services/xkms/xkms-itests/pom.xml ---------------------------------------------------------------------- diff --git a/services/xkms/xkms-itests/pom.xml b/services/xkms/xkms-itests/pom.xml index 462b75a..bc0ba5c 100644 --- a/services/xkms/xkms-itests/pom.xml +++ b/services/xkms/xkms-itests/pom.xml @@ -114,6 +114,12 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-testutils</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> </dependencies> <build> <plugins> http://git-wip-us.apache.org/repos/asf/cxf/blob/21cff8dd/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java ---------------------------------------------------------------------- diff --git a/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java b/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java index e1f3cc1..f50dee8 100644 --- a/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java +++ b/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java @@ -23,6 +23,7 @@ import java.util.Iterator; import javax.inject.Inject; +import org.apache.cxf.testutil.common.TestUtil; import org.apache.cxf.xkms.model.extensions.ResultDetails; import org.apache.cxf.xkms.model.xkms.LocateResultType; import org.apache.cxf.xkms.model.xkms.MessageExtensionAbstractType; @@ -47,9 +48,6 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceCo @ExamReactorStrategy(PerClass.class) public class BasicIntegrationTest { - private static final String HTTP_PORT = "9191"; - private static final String XKMS_ENDPOINT = "http://localhost:" + HTTP_PORT + "/cxf/XKMS"; - // Adding apache snapshots as cxf trunk may contain snapshot dependencies //private static final String REPOS = "http://repo1.maven.org/maven2@id=central, " // + "http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases@id=apache-snapshots "; @@ -59,7 +57,15 @@ public class BasicIntegrationTest { @Configuration public Option[] getConfig() { +<<<<<<< HEAD String karafVersion = System.getProperty("karaf.version", "3.0.4"); +======= + String port = TestUtil.getPortNumber(BasicIntegrationTest.class); + System.setProperty("BasicIntegrationTest.PORT", port); + String xkmsEndpoint = "http://localhost:" + port + "/cxf/XKMS"; + + String karafVersion = System.getProperty("karaf.version", "4.0.8"); +>>>>>>> da59b25117... Updating XKMS tests to use random ports String localRepository = System.getProperty("localRepository"); MavenArtifactUrlReference karafUrl = maven() // .groupId("org.apache.karaf") // @@ -76,6 +82,7 @@ public class BasicIntegrationTest { karafDistributionConfiguration().frameworkUrl(karafUrl).karafVersion(karafVersion) .unpackDirectory(new File("target/paxexam/unpack/")).useDeployFolder(false), systemProperty("java.awt.headless").value("true"), + systemProperty("BasicIntegrationTest.PORT").value(port), copy("data/xkms/certificates/trusted_cas/root.cer"), copy("data/xkms/certificates/trusted_cas/wss40CA.cer"), @@ -84,8 +91,8 @@ public class BasicIntegrationTest { copy("data/xkms/certificates/http___localhost_8080_services_TestService.cer"), copy("etc/org.ops4j.pax.logging.cfg"), //editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", REPOS), - editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT), - editConfigurationFilePut("etc/org.apache.cxf.xkms.client.cfg", "xkms.endpoint", XKMS_ENDPOINT), + editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", port), + editConfigurationFilePut("etc/org.apache.cxf.xkms.client.cfg", "xkms.endpoint", xkmsEndpoint), when(localRepository != null) .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository",
