Search in sources :

Example 6 with Configuration

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

the class KarafTestSupport method config.

@Configuration
public Option[] config() {
    MavenArtifactUrlReference karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz");
    String httpPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_HTTP_PORT), Integer.parseInt(MAX_HTTP_PORT)));
    String rmiRegistryPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_RMI_REG_PORT), Integer.parseInt(MAX_RMI_REG_PORT)));
    String rmiServerPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_RMI_SERVER_PORT), Integer.parseInt(MAX_RMI_SERVER_PORT)));
    String sshPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_SSH_PORT), Integer.parseInt(MAX_SSH_PORT)));
    return new Option[] { //KarafDistributionOption.debugConfiguration("8889", true),
    karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new File("target/exam")), // enable JMX RBAC security, thanks to the KarafMBeanServerBuilder
    configureSecurity().disableKarafMBeanServerBuilder(), configureConsole().ignoreLocalConsole(), keepRuntimeFolder(), logLevel(LogLevel.INFO), mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject(), mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(), replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("/etc/org.ops4j.pax.logging.cfg")), editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "updateSnapshots", "none"), editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", httpPort), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort), editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort), editConfigurationFilePut("etc/system.properties", "spring31.version", System.getProperty("spring31.version")), editConfigurationFilePut("etc/system.properties", "spring32.version", System.getProperty("spring32.version")), editConfigurationFilePut("etc/system.properties", "spring40.version", System.getProperty("spring40.version")), editConfigurationFilePut("etc/system.properties", "spring41.version", System.getProperty("spring41.version")), editConfigurationFilePut("etc/system.properties", "spring42.version", System.getProperty("spring42.version")), editConfigurationFilePut("etc/system.properties", "spring43.version", System.getProperty("spring43.version")) };
}
Also used : Option(org.ops4j.pax.exam.Option) KarafDistributionOption.replaceConfigurationFile(org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile) File(java.io.File) MavenArtifactUrlReference(org.ops4j.pax.exam.options.MavenArtifactUrlReference) Configuration(org.ops4j.pax.exam.Configuration) KarafDistributionOption.karafDistributionConfiguration(org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration)

Example 7 with Configuration

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

the class JavaSecurityTest method config.

@Configuration
public Option[] config() {
    String version = MavenUtils.getArtifactVersion("org.apache.felix", "org.apache.felix.framework.security");
    String url = maven("org.apache.felix", "org.apache.felix.framework.security", version).getURL();
    Path temp;
    try {
        temp = Files.createTempFile("org.apache.felix.framework.security-" + version + "-", ".jar");
        System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");
        try (InputStream is = new URL(url).openStream()) {
            Files.copy(is, temp, StandardCopyOption.REPLACE_EXISTING);
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    List<Option> options = new ArrayList<>(Arrays.asList(super.config()));
    // Add some extra options used by this test...
    options.addAll(Arrays.asList(editConfigurationFilePut("etc/system.properties", "java.security.policy", "${karaf.etc}/all.policy"), editConfigurationFilePut("etc/system.properties", "org.osgi.framework.security", "osgi"), editConfigurationFilePut("etc/system.properties", "org.osgi.framework.trust.repositories", "${karaf.etc}/trustStore.ks"), editConfigurationFilePut("etc/startup.properties", "mvn:org.apache.felix/org.apache.felix.framework.security/" + version, "1"), replaceConfigurationFile("system/org/apache/felix/org.apache.felix.framework.security/" + version + "/org.apache.felix.framework.security-" + version + ".jar", temp.toFile())));
    return options.toArray(new Option[] {});
}
Also used : Path(java.nio.file.Path) InputStream(java.io.InputStream) KarafDistributionOption(org.ops4j.pax.exam.karaf.options.KarafDistributionOption) StandardCopyOption(java.nio.file.StandardCopyOption) Option(org.ops4j.pax.exam.Option) IOException(java.io.IOException) URL(java.net.URL) Configuration(org.ops4j.pax.exam.Configuration)

Example 8 with Configuration

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

the class AbstractJobHandlingTest method config.

@Configuration
public Option[] config() {
    final String buildDir = System.getProperty(SYS_PROP_BUILD_DIR, DEFAULT_BUILD_DIR);
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
    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");
    }
    String localRepo = System.getProperty("maven.repo.local", "");
    final String jackrabbitVersion = "2.13.1";
    final String oakVersion = "1.5.7";
    final String slingHome = new File(buildDir + File.separatorChar + "sling_" + System.currentTimeMillis()).getAbsolutePath();
    return options(frameworkProperty("sling.home").value(slingHome), frameworkProperty("repository.home").value(slingHome + File.separatorChar + "repository"), when(localRepo.length() > 0).useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)), when(System.getProperty(PORT_CONFIG) != null).useOptions(systemProperty(PORT_CONFIG).value(System.getProperty(PORT_CONFIG))), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), ConfigurationAdminOptions.newConfiguration("org.apache.felix.jaas.ConfigurationSpi").create(true).put("jaas.defaultRealmName", "jackrabbit.oak").put("jaas.configProviderName", "FelixJaasProvider").asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory").create(true).put("jaas.controlFlag", "optional").put("jaas.classname", "org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule").put("jaas.ranking", 300).asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory").create(true).put("jaas.controlFlag", "required").put("jaas.classname", "org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl").asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory").create(true).put("jaas.controlFlag", "sufficient").put("jaas.classname", "org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule").put("jaas.ranking", 200).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.authentication.AuthenticationConfigurationImpl").create(true).put("org.apache.jackrabbit.oak.authentication.configSpiName", "FelixJaasProvider").asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.user.UserConfigurationImpl").create(true).put("groupsPath", "/home/groups").put("usersPath", "/home/users").put("defaultPath", "1").put("importBehavior", "besteffort").asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName").create(true).put("enabledActions", new String[] { "org.apache.jackrabbit.oak.spi.security.user.action.AccessControlAction" }).put("userPrivilegeNames", new String[] { "jcr:all" }).put("groupPrivilegeNames", new String[] { "jcr:read" }).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider").create(true).put("length", 21).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService").create(true).put("name", "Default NodeStore").asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended").create(true).put("user.mapping", "org.apache.sling.event=admin").asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.sling.jcr.resource.internal.JcrSystemUserValidator").create(true).put("allow.only.system.user", "false").asOption(), // logging
    systemProperty("pax.exam.logging").value("none"), mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "4.0.6"), mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.0.6"), mavenBundle("org.slf4j", "slf4j-api", "1.7.13"), mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.13"), mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.13"), mavenBundle("commons-io", "commons-io", "2.4"), mavenBundle("commons-fileupload", "commons-fileupload", "1.3.1"), mavenBundle("commons-collections", "commons-collections", "3.2.2"), mavenBundle("commons-codec", "commons-codec", "1.10"), mavenBundle("commons-lang", "commons-lang", "2.6"), mavenBundle("org.apache.commons", "commons-lang3", "3.5"), mavenBundle("commons-pool", "commons-pool", "1.6"), mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.concurrent", "1.3.4_1"), mavenBundle("org.apache.geronimo.bundles", "commons-httpclient", "3.1_1"), mavenBundle("org.apache.tika", "tika-core", "1.9"), mavenBundle("org.apache.tika", "tika-bundle", "1.9"), // infrastructure
    mavenBundle("org.apache.felix", "org.apache.felix.http.servlet-api", "1.1.2"), mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "3.1.6"), mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.4.8"), mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.0.6"), mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.8.10"), mavenBundle("org.apache.felix", "org.apache.felix.inventory", "1.0.4"), mavenBundle("org.apache.felix", "org.apache.felix.metatype", "1.1.2"), // sling
    mavenBundle("org.apache.sling", "org.apache.sling.settings", "1.3.8"), mavenBundle("org.apache.sling", "org.apache.sling.commons.osgi", "2.3.0"), mavenBundle("org.apache.sling", "org.apache.sling.commons.mime", "2.1.8"), mavenBundle("org.apache.sling", "org.apache.sling.commons.classloader", "1.3.2"), mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon", "1.0.0"), mavenBundle("org.apache.sling", "org.apache.sling.commons.scheduler", "2.4.14"), mavenBundle("org.apache.sling", "org.apache.sling.commons.threads", "3.2.4"), mavenBundle("org.apache.sling", "org.apache.sling.auth.core", "1.3.12"), mavenBundle("org.apache.sling", "org.apache.sling.discovery.api", "1.0.2"), mavenBundle("org.apache.sling", "org.apache.sling.discovery.commons", "1.0.20"), mavenBundle("org.apache.sling", "org.apache.sling.discovery.standalone", "1.0.2"), mavenBundle("org.apache.sling", "org.apache.sling.api", "2.14.2"), mavenBundle("org.apache.sling", "org.apache.sling.resourceresolver", "1.4.18"), mavenBundle("org.apache.sling", "org.apache.sling.adapter", "2.1.10"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.resource", "2.8.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.classloader", "3.2.2"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.contentloader", "2.2.4"), mavenBundle("org.apache.sling", "org.apache.sling.engine", "2.6.2"), mavenBundle("org.apache.sling", "org.apache.sling.serviceusermapper", "1.3.2"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.jcr-wrapper", "2.0.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.api", "2.4.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.base", "2.4.0"), mavenBundle("com.google.guava", "guava", "15.0"), mavenBundle("org.apache.jackrabbit", "jackrabbit-api", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-commons", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-spi", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-spi-commons", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-rmi", jackrabbitVersion), mavenBundle("org.apache.felix", "org.apache.felix.jaas", "0.0.4"), mavenBundle("org.apache.jackrabbit", "oak-core", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-commons", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-lucene", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-blob", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-jcr", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-segment", oakVersion), mavenBundle("org.apache.sling", "org.apache.sling.jcr.oak.server", "1.1.0"), mavenBundle("org.apache.sling", "org.apache.sling.testing.tools", "1.0.17-SNAPSHOT"), mavenBundle("org.apache.httpcomponents", "httpcore-osgi", "4.1.2"), mavenBundle("org.apache.httpcomponents", "httpclient-osgi", "4.1.2"), // @see setup() where the bundle is finally started - after reconfig
    CoreOptions.bundle(bundleFile.toURI().toString()).start(false), junitBundles());
}
Also used : File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration) JobManagerConfiguration(org.apache.sling.event.impl.jobs.config.JobManagerConfiguration)

Example 9 with Configuration

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

the class ResourceBundleProviderIT method config.

@Configuration
public Option[] config() {
    final String buildDir = System.getProperty(SYS_PROP_BUILD_DIR, DEFAULT_BUILD_DIR);
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
    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");
    }
    String localRepo = System.getProperty("maven.repo.local", "");
    final String jackrabbitVersion = "2.13.1";
    final String oakVersion = "1.5.7";
    final String slingHome = new File(buildDir + File.separatorChar + "sling_" + System.currentTimeMillis()).getAbsolutePath();
    return options(frameworkProperty("sling.home").value(slingHome), frameworkProperty("repository.home").value(slingHome + File.separatorChar + "repository"), when(localRepo.length() > 0).useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)), when(System.getProperty(PORT_CONFIG) != null).useOptions(systemProperty(PORT_CONFIG).value(System.getProperty(PORT_CONFIG))), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), ConfigurationAdminOptions.newConfiguration("org.apache.felix.jaas.ConfigurationSpi").create(true).put("jaas.defaultRealmName", "jackrabbit.oak").put("jaas.configProviderName", "FelixJaasProvider").asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory").create(true).put("jaas.controlFlag", "optional").put("jaas.classname", "org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule").put("jaas.ranking", 300).asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory").create(true).put("jaas.controlFlag", "required").put("jaas.classname", "org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl").asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.felix.jaas.Configuration.factory").create(true).put("jaas.controlFlag", "sufficient").put("jaas.classname", "org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule").put("jaas.ranking", 200).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.authentication.AuthenticationConfigurationImpl").create(true).put("org.apache.jackrabbit.oak.authentication.configSpiName", "FelixJaasProvider").asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.user.UserConfigurationImpl").create(true).put("groupsPath", "/home/groups").put("usersPath", "/home/users").put("defaultPath", "1").put("importBehavior", "besteffort").asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName").create(true).put("enabledActions", new String[] { "org.apache.jackrabbit.oak.spi.security.user.action.AccessControlAction" }).put("userPrivilegeNames", new String[] { "jcr:all" }).put("groupPrivilegeNames", new String[] { "jcr:read" }).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider").create(true).put("length", 21).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService").create(true).put("name", "Default NodeStore").asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.sling.resourceresolver.impl.observation.OsgiObservationBridge").create(true).put("enabled", true).asOption(), ConfigurationAdminOptions.factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended").create(true).put("user.mapping", new String[] { "org.apache.sling.i18n=sling-i18n" }).asOption(), ConfigurationAdminOptions.newConfiguration("org.apache.sling.jcr.repoinit.impl.RepositoryInitializer").put("references", new String[] { references() }).asOption(), // logging
    systemProperty("pax.exam.logging").value("none"), mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "4.0.6"), mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.0.6"), mavenBundle("org.slf4j", "slf4j-api", "1.7.13"), mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.13"), mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.13"), mavenBundle("commons-io", "commons-io", "2.4"), mavenBundle("commons-fileupload", "commons-fileupload", "1.3.1"), mavenBundle("commons-collections", "commons-collections", "3.2.2"), mavenBundle("commons-codec", "commons-codec", "1.10"), mavenBundle("commons-lang", "commons-lang", "2.6"), mavenBundle("org.apache.commons", "commons-lang3", "3.5"), mavenBundle("commons-pool", "commons-pool", "1.6"), mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.concurrent", "1.3.4_1"), mavenBundle("org.apache.geronimo.bundles", "commons-httpclient", "3.1_1"), mavenBundle("org.apache.tika", "tika-core", "1.9"), mavenBundle("org.apache.tika", "tika-bundle", "1.9"), // infrastructure
    mavenBundle("org.apache.felix", "org.apache.felix.http.servlet-api", "1.1.2"), mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "3.1.6"), mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.4.4"), mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.0.4"), mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.8.10"), mavenBundle("org.apache.felix", "org.apache.felix.inventory", "1.0.4"), mavenBundle("org.apache.felix", "org.apache.felix.metatype", "1.1.2"), // sling
    mavenBundle("org.apache.sling", "org.apache.sling.settings", "1.3.8"), mavenBundle("org.apache.sling", "org.apache.sling.commons.osgi", "2.3.0"), mavenBundle("org.apache.sling", "org.apache.sling.commons.mime", "2.1.8"), mavenBundle("org.apache.sling", "org.apache.sling.commons.classloader", "1.3.2"), mavenBundle("org.apache.sling", "org.apache.sling.commons.scheduler", "2.4.14"), mavenBundle("org.apache.sling", "org.apache.sling.commons.threads", "3.2.4"), mavenBundle("org.apache.sling", "org.apache.sling.auth.core", "1.3.12"), mavenBundle("org.apache.sling", "org.apache.sling.discovery.api", "1.0.2"), mavenBundle("org.apache.sling", "org.apache.sling.discovery.commons", "1.0.20"), mavenBundle("org.apache.sling", "org.apache.sling.discovery.standalone", "1.0.2"), mavenBundle("org.apache.sling", "org.apache.sling.api", "2.14.2"), mavenBundle("org.apache.sling", "org.apache.sling.resourceresolver", "1.4.18"), mavenBundle("org.apache.sling", "org.apache.sling.adapter", "2.1.10"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.resource", "2.8.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.classloader", "3.2.2"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.contentloader", "2.2.4"), mavenBundle("org.apache.sling", "org.apache.sling.engine", "2.6.2"), mavenBundle("org.apache.sling", "org.apache.sling.serviceusermapper", "1.3.2"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.jcr-wrapper", "2.0.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.api", "2.4.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.base", "2.4.0"), mavenBundle("org.apache.sling", "org.apache.sling.jcr.repoinit", "1.1.0"), mavenBundle("org.apache.sling", "org.apache.sling.repoinit.parser", "1.1.0"), mavenBundle("org.apache.sling", "org.apache.sling.provisioning.model", "1.4.2"), mavenBundle("com.google.guava", "guava", "15.0"), mavenBundle("org.apache.jackrabbit", "jackrabbit-api", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-commons", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-spi", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-spi-commons", jackrabbitVersion), mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-rmi", jackrabbitVersion), mavenBundle("org.apache.felix", "org.apache.felix.jaas", "0.0.4"), mavenBundle("org.apache.jackrabbit", "oak-core", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-commons", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-lucene", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-blob", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-jcr", oakVersion), mavenBundle("org.apache.jackrabbit", "oak-segment", oakVersion), mavenBundle("org.apache.sling", "org.apache.sling.jcr.oak.server", "1.1.0"), mavenBundle("org.apache.sling", "org.apache.sling.testing.tools", "1.0.17-SNAPSHOT"), mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon", "1.0.0"), mavenBundle("org.apache.httpcomponents", "httpcore-osgi", "4.1.2"), mavenBundle("org.apache.httpcomponents", "httpclient-osgi", "4.1.2"), junitBundles(), CoreOptions.bundle(bundleFile.toURI().toString()));
}
Also used : File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration)

Example 10 with Configuration

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

the class DynamicClassLoaderIT method configuration.

@Configuration
public static Option[] configuration() {
    final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP);
    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");
    }
    return options(provision(CoreOptions.bundle(bundleFile.toURI().toString()), mavenBundle("org.ops4j.pax.tinybundles", "tinybundles", "1.0.0"), mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "2.1.2"), mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.2.14"), mavenBundle("org.ops4j.pax.url", "pax-url-mvn", "1.3.5")), // with build server issue
    new DirectURLJUnitBundlesOption(), systemProperty("pax.exam.invoker").value("junit"), bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link"));
}
Also used : File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration)

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