Repository: cxf Updated Branches: refs/heads/master e17a9fc01 -> da59b2511
Updating XKMS tests to use random ports Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/da59b251 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/da59b251 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/da59b251 Branch: refs/heads/master Commit: da59b25117e3a4fb73ed283d760bf11a67b67a90 Parents: e17a9fc 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:08 2017 +0100 ---------------------------------------------------------------------- services/xkms/xkms-itests/pom.xml | 6 ++++++ .../apache/cxf/xkms/itests/BasicIntegrationTest.java | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/da59b251/services/xkms/xkms-itests/pom.xml ---------------------------------------------------------------------- diff --git a/services/xkms/xkms-itests/pom.xml b/services/xkms/xkms-itests/pom.xml index 896b1cb..0175faf 100644 --- a/services/xkms/xkms-itests/pom.xml +++ b/services/xkms/xkms-itests/pom.xml @@ -119,6 +119,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/da59b251/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 6e201b9..be4a054 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,6 +57,10 @@ public class BasicIntegrationTest { @Configuration public Option[] getConfig() { + 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"); String localRepository = System.getProperty("localRepository"); MavenArtifactUrlReference karafUrl = maven() // @@ -76,6 +78,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 +87,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",
