Search in sources :

Example 21 with Configuration

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

the class LogTestBase method config.

@Configuration
public Option[] config() throws IOException {
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP, BUNDLE_JAR_DEFAULT);
    final File bundleFile = new File(bundleFileName);
    if (!bundleFile.canRead()) {
        throw new IllegalArgumentException("Cannot read from bundle file " + bundleFileName + " specified in the " + BUNDLE_JAR_SYS_PROP + " system property. Try building the project first " + "with 'mvn clean install -Pide -DskipTests'");
    }
    return options(// the current project (the bundle under test)
    CoreOptions.bundle(bundleFile.toURI().toString()), repository("https://repository.apache.org/snapshots/").id("apache-snapshots").allowSnapshots(), mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice").versionAsInProject(), LogTestBase.webSupport(), mavenBundle("org.apache.sling", "org.apache.sling.commons.log").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.http.jetty").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.webconsole").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.inventory").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.metatype").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.scr").versionAsInProject(), mavenBundle("commons-io", "commons-io").versionAsInProject(), wrappedBundle(mavenBundle("commons-fileupload", "commons-fileupload").versionAsInProject()), LogTestBase.configAdmin(), addPaxExamSpecificOptions(), addCodeCoverageOption(), addDebugOptions(), addExtraOptions(), addDefaultOptions());
}
Also used : File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration)

Example 22 with Configuration

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

the class DataSourceTestBase method config.

@Configuration
public Option[] config() throws IOException {
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP, BUNDLE_JAR_DEFAULT);
    final File bundleFile = new File(bundleFileName);
    if (!bundleFile.canRead()) {
        throw new IllegalArgumentException("Cannot read from bundle file " + bundleFileName + " specified in the " + BUNDLE_JAR_SYS_PROP + " system property. Try building the project first " + "with 'mvn clean install -Pide -DskipTests'");
    }
    return options(// the current project (the bundle under test)
    CoreOptions.bundle(bundleFile.toURI().toString()), mavenBundle("com.h2database", "h2").versionAsInProject(), wrappedBundle(mavenBundle("commons-beanutils", "commons-beanutils-core").versionAsInProject()), mavenBundle("org.slf4j", "slf4j-simple").versionAsInProject().noStart(), mavenBundle("org.apache.felix", "org.apache.felix.scr").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(), junitBundles(), systemProperty("pax.exam.osgi.unresolved.fail").value("fail"), systemPackage("com.sun.tools.attach"), cleanCaches(), addCodeCoverageOption(), addDebugOptions());
}
Also used : File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration)

Example 23 with Configuration

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

the class ServerConfiguration method config.

@Configuration
public Option[] config() {
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP, BUNDLE_JAR_DEFAULT);
    final File bundleFile = new File(bundleFileName);
    if (!bundleFile.canRead()) {
        throw new IllegalArgumentException("Cannot read from bundle file " + bundleFileName + " specified in the " + BUNDLE_JAR_SYS_PROP + " system property");
    }
    Option[] base = options(// the current project (the bundle under test)
    CoreOptions.bundle(bundleFile.toURI().toString()), mavenBundle("org.ops4j.pax.logging", "pax-logging-api", "1.7.0").startLevel(2), mavenBundle("org.ops4j.pax.logging", "pax-logging-service", "1.7.0").startLevel(2), mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(), mavenBundle("org.apache.felix", "org.apache.felix.http.jetty").versionAsInProject().startLevel(3), mavenBundle("org.apache.felix", "org.apache.felix.http.whiteboard").versionAsInProject().startLevel(5), mavenBundle("org.apache.felix", "org.apache.felix.scr").versionAsInProject(), mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon").versionAsInProject(), systemProperty("pax.exam.osgi.unresolved.fail").value("fail"), systemProperty("org.osgi.service.http.port").value(getServerPort()), cleanCaches(), createTestBundle(), addCodeCoverageOption());
    final Option vmOption = (paxRunnerVmOption != null) ? CoreOptions.vmOption(paxRunnerVmOption) : null;
    return OptionUtils.combine(base, vmOption);
}
Also used : Option(org.ops4j.pax.exam.Option) File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration)

Example 24 with Configuration

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

the class LogTestBase method config.

@Configuration
public Option[] config() throws IOException {
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP, BUNDLE_JAR_DEFAULT);
    final File bundleFile = new File(bundleFileName);
    if (!bundleFile.canRead()) {
        throw new IllegalArgumentException("Cannot read from bundle file " + bundleFileName + " specified in the " + BUNDLE_JAR_SYS_PROP + " system property. Try building the project first " + "with 'mvn clean install -Pide -DskipTests'");
    }
    return options(// the current project (the bundle under test)
    CoreOptions.bundle(bundleFile.toURI().toString()), mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), addPaxExamSpecificOptions(), addCodeCoverageOption(), addDebugOptions(), addExtraOptions(), addDefaultOptions());
}
Also used : File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration)

Example 25 with Configuration

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

the class BasicSTSIntegrationTest method getConfig.

@Configuration
public Option[] getConfig() {
    String port = TestUtil.getPortNumber(BasicSTSIntegrationTest.class);
    System.setProperty("BasicSTSIntegrationTest.PORT", port);
    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 stsFeatures = // 
    maven().groupId(// 
    "org.apache.cxf.services.sts.systests").artifactId(// 
    "cxf-services-sts-systests-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("BasicSTSIntegrationTest.PORT").value(port), copy("clientKeystore.properties"), copy("clientstore.jks"), copy("etc/org.ops4j.pax.logging.cfg"), editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", port), when(localRepository != null).useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepository)), features(stsFeatures, "cxf-sts-service"), configureConsole().ignoreLocalConsole().ignoreRemoteShell() };
}
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