Search in sources :

Example 26 with Configuration

use of org.ops4j.pax.exam.Configuration in project cxf by apache.

the class BasicIntegrationTest method getConfig.

@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().groupId(// 
    "org.apache.karaf").artifactId(// 
    "apache-karaf").version(karafVersion).type("tar.gz");
    MavenArtifactUrlReference xkmsFeatures = // 
    maven().groupId(// 
    "org.apache.cxf.services.xkms").artifactId(// 
    "cxf-services-xkms-features").versionAsInProject().type("xml");
    return new Option[] { 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"), copy("data/xkms/certificates/cas/alice.cer"), copy("data/xkms/certificates/dave.cer"), 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", 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", localRepository)), features(xkmsFeatures, "cxf-xkms-service", "cxf-xkms-client", "cxf-xkms-ldap"), configureConsole().ignoreLocalConsole() // org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder(),
    // CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005")
    };
}
Also used : Option(org.ops4j.pax.exam.Option) File(java.io.File) KarafDistributionOption.replaceConfigurationFile(org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile) MavenArtifactUrlReference(org.ops4j.pax.exam.options.MavenArtifactUrlReference) Configuration(org.ops4j.pax.exam.Configuration) KarafDistributionOption.karafDistributionConfiguration(org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration)

Aggregations

Configuration (org.ops4j.pax.exam.Configuration)26 Option (org.ops4j.pax.exam.Option)19 File (java.io.File)13 InputStream (java.io.InputStream)4 KarafDistributionOption.karafDistributionConfiguration (org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration)4 KarafDistributionOption.replaceConfigurationFile (org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile)3 MavenArtifactUrlReference (org.ops4j.pax.exam.options.MavenArtifactUrlReference)3 ArrayList (java.util.ArrayList)2 IOException (java.io.IOException)1 URL (java.net.URL)1 Path (java.nio.file.Path)1 StandardCopyOption (java.nio.file.StandardCopyOption)1 Properties (java.util.Properties)1 JobManagerConfiguration (org.apache.sling.event.impl.jobs.config.JobManagerConfiguration)1 CoreOptions.vmOption (org.ops4j.pax.exam.CoreOptions.vmOption)1 KarafDistributionOption (org.ops4j.pax.exam.karaf.options.KarafDistributionOption)1 KarafDistributionOption.debugConfiguration (org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration)1 VersionResolver (org.ops4j.pax.exam.options.MavenUrlReference.VersionResolver)1