org.ops4j.pax.exam.Configuration Java Examples
The following examples show how to use
org.ops4j.pax.exam.Configuration.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RewriterTestSupport.java From sling-whiteboard with Apache License 2.0 | 6 votes |
@Configuration public Option[] configuration() { return new Option[]{ baseConfiguration(), quickstart(), // Sling Rewriter testBundle("bundle.filename"), slingCommonsHtml(), factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended") .put("user.mapping", new String[]{"org.apache.sling.rewriter=sling-readall"}) .asOption(), factoryConfiguration("org.apache.sling.resource.presence.internal.ResourcePresenter") .put("path", "/content/rewriter") .asOption(), // testing mavenBundle().groupId("org.jsoup").artifactId("jsoup").versionAsInProject(), mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(), slingResourcePresence(), junitBundles() }; }
Example #2
Source File: IgniteOsgiServiceTest.java From ignite with Apache License 2.0 | 6 votes |
/** * @return Config. */ @Configuration public Option[] bundleDelegatingConfig() { List<Option> options = new ArrayList<>(Arrays.asList(baseConfig())); // Add bundles we require. options.add( streamBundle(bundle() .add(BasicIgniteTestActivator.class) .add(TestOsgiFlags.class) .add(TestOsgiFlagsImpl.class) .set(Constants.BUNDLE_SYMBOLICNAME, BasicIgniteTestActivator.class.getSimpleName()) .set(Constants.BUNDLE_ACTIVATOR, BasicIgniteTestActivator.class.getName()) .set(Constants.EXPORT_PACKAGE, "org.apache.ignite.osgi.activators") .set(Constants.DYNAMICIMPORT_PACKAGE, "*") .build(withBnd()))); // Uncomment this if you'd like to debug inside the container. // options.add(KarafDistributionOption.debugConfiguration()); return CoreOptions.options(options.toArray(new Option[0])); }
Example #3
Source File: OsgiBundleTest.java From netty4.0.27Learn with Apache License 2.0 | 6 votes |
@Configuration public final Option[] config() { final Collection<Option> options = new ArrayList<Option>(); options.add(systemProperty("pax.exam.osgi.unresolved.fail").value("true")); options.addAll(Arrays.asList(junitBundles())); options.add(mavenBundle("com.barchart.udt", "barchart-udt-bundle").versionAsInProject()); options.add(wrappedBundle(mavenBundle("org.rxtx", "rxtx").versionAsInProject())); for (String name : BUNDLES) { options.add(mavenBundle(GROUP, name).versionAsInProject()); } return options.toArray(new Option[0]); }
Example #4
Source File: PendingCapabilityDelayedOSGiTest.java From carbon-kernel with Apache License 2.0 | 6 votes |
/** * This configuration registers Runtime, Deployer and Transport Capabilities. * org.wso2.carbon.sample.transport.custom3.CustomTransportServiceCapabilityProvider registers three instances of * org.wso2.carbon.sample.transport.custom3.Custom3Transport with two seconds delay. Hence the server startup * should be delayed until all the Transports are available. * * @return the bundle configurations that will be used for this test case. */ @Configuration public Option[] createConfiguration() { return new Option[] { copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.transport.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle( maven().artifactId("org.wso2.carbon.sample.transport.file").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.mss").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.deployer.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.dbs.deployer").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.order.resolver").groupId("org.wso2.carbon") .versionAsInProject()) }; }
Example #5
Source File: KarafCommandsRequirementsTest.java From roboconf-platform with Apache License 2.0 | 6 votes |
@Override @Configuration public Option[] config() throws Exception { List<Option> options = new ArrayList<> (); options.addAll( Arrays.asList( super.config())); // Deploy the agent's bundles (we need them because of this stupid probe). // If we'd run this test alone (e.g. "mvn clean test -Dtest=*Requi*"), then // we would not need these bundles. But when we run ALL the tests here, // we need them. Stupid PAX probe. String roboconfVersion = ItUtils.findRoboconfVersion(); options.add( mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-plugin-api" ) .version( roboconfVersion ) .start()); options.add( mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-agent" ) .version( roboconfVersion ) .start()); return options.toArray( new Option[ options.size()]); }
Example #6
Source File: OffHeapOsgiTest.java From ehcache3 with Apache License 2.0 | 6 votes |
@Configuration public Option[] individualModules() { return options( gradleBundle("org.ehcache.modules:api"), gradleBundle("org.ehcache.modules:core"), gradleBundle("org.ehcache.modules:impl"), gradleBundle("org.terracotta.management:management-model"), gradleBundle("org.terracotta.management:sequence-generator"), wrappedGradleBundle("org.terracotta:statistics"), wrappedGradleBundle("org.ehcache:sizeof"), wrappedGradleBundle("org.terracotta:offheap-store"), wrappedGradleBundle("org.terracotta:terracotta-utilities-tools"), baseConfiguration("OffHeapOsgiTest", "individualModules") ); }
Example #7
Source File: JmsAppenderTest.java From karaf-decanter with Apache License 2.0 | 6 votes |
@Configuration public Option[] config() { String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf"); Option[] options = new Option[]{ KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "decanter.version", System.getProperty("decanter.version")), KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "activemq.version", System.getProperty("activemq.version")), KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresRepositories", "mvn:org.apache.karaf.features/framework/" + karafVersion + "/xml/features," + "mvn:org.apache.karaf.features/spring/" + karafVersion + "/xml/features," + "mvn:org.apache.karaf.features/spring-legacy/" + karafVersion + "/xml/features," + "mvn:org.apache.karaf.features/enterprise/" + karafVersion + "/xml/features," + "mvn:org.apache.karaf.features/enterprise-legacy/" + karafVersion + "/xml/features," + "mvn:org.apache.karaf.features/standard/" + karafVersion + "/xml/features," + "mvn:org.apache.activemq/activemq-karaf/" + System.getProperty("activemq.version") + "/xml/features," + "mvn:org.apache.karaf.decanter/apache-karaf-decanter/" + System.getProperty("decanter.version") + "/xml/features"), KarafDistributionOption.editConfigurationFileExtend("etc/org.apache.karaf.features.cfg", "featuresBoot", "aries-blueprint,activemq-broker-noweb"), KarafDistributionOption.replaceConfigurationFile("etc/activemq.xml", getConfigFile("/etc/activemq.xml")) }; return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new); }
Example #8
Source File: Jsr107OsgiTest.java From ehcache3 with Apache License 2.0 | 6 votes |
@Configuration public Option[] individualModules() { return options( gradleBundle("org.ehcache.modules:impl"), gradleBundle("org.ehcache.modules:xml"), jaxbConfiguration(), gradleBundle("org.ehcache.modules:107"), gradleBundle("org.ehcache.modules:core"), gradleBundle("org.ehcache.modules:api"), gradleBundle("javax.cache:cache-api"), gradleBundle("org.terracotta.management:management-model"), gradleBundle("org.terracotta.management:sequence-generator"), wrappedGradleBundle("org.terracotta:statistics"), wrappedGradleBundle("org.ehcache:sizeof"), wrappedGradleBundle("org.terracotta:offheap-store"), wrappedGradleBundle("org.terracotta:terracotta-utilities-tools"), baseConfiguration("Jsr107OsgiTest", "individualModules") ); }
Example #9
Source File: SampleStartupOrderResolverOSGiTest.java From carbon-kernel with Apache License 2.0 | 6 votes |
@Configuration public Option[] createConfiguration() { return new Option[] { copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.mss").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.deployer.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.dbs.deployer").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.transport.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.transport.http").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.order.resolver").groupId("org.wso2.carbon") .versionAsInProject()) }; }
Example #10
Source File: ByteSizedOnHeapOsgiTest.java From ehcache3 with Apache License 2.0 | 6 votes |
@Configuration public Option[] individualModules() { return options( gradleBundle("org.ehcache.modules:impl"), gradleBundle("org.ehcache.modules:core"), gradleBundle("org.ehcache.modules:api"), gradleBundle("org.terracotta.management:management-model"), gradleBundle("org.terracotta.management:sequence-generator"), wrappedGradleBundle("org.terracotta:statistics"), wrappedGradleBundle("org.ehcache:sizeof"), wrappedGradleBundle("org.terracotta:offheap-store"), wrappedGradleBundle("org.terracotta:terracotta-utilities-tools"), baseConfiguration("ByteSizedOnHeapOsgiTest", "individualModules") ); }
Example #11
Source File: DistributionZipTest.java From carbon-kernel with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { String basedir = System.getProperty("basedir"); if (basedir == null) { basedir = Paths.get(".").toString(); } return new Option[] { carbonDistribution( Paths.get(basedir, "..", "test-distribution", "target", "wso2carbon-kernel-test-" + System.getProperty("carbon.kernel.version") + ".zip")) }; }
Example #12
Source File: TransactionalOsgiTest.java From ehcache3 with Apache License 2.0 | 5 votes |
@Configuration public Option[] uberJar() { return options( gradleBundle("org.ehcache:dist"), jaxbConfiguration(), gradleBundle("org.ehcache:transactions"), jtaConfiguration(), baseConfiguration("TransactionalOsgiTest", "uberJar") ); }
Example #13
Source File: OsgiMarkLogicInputTestIT.java From components with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { return options(composite(ComponentsPaxExamOptions.getOptions()), // linkBundle("org.talend.components-components-common-bundle"), // linkBundle("org.talend.components-components-marklogic-definition")); }
Example #14
Source File: HwvtepSouthboundIT.java From ovsdb with Eclipse Public License 1.0 | 5 votes |
@Override @Configuration public Option[] config() { Option[] options = super.config(); Option[] propertyOptions = getPropertiesOptions(); Option[] otherOptions = getOtherOptions(); Option[] combinedOptions = new Option[options.length + propertyOptions.length + otherOptions.length]; System.arraycopy(options, 0, combinedOptions, 0, options.length); System.arraycopy(propertyOptions, 0, combinedOptions, options.length, propertyOptions.length); System.arraycopy(otherOptions, 0, combinedOptions, options.length + propertyOptions.length, otherOptions.length); return combinedOptions; }
Example #15
Source File: AgentInMemoryWithRealRecipesTest.java From roboconf-platform with Apache License 2.0 | 5 votes |
@Override @Configuration public Option[] config() throws Exception { File resourcesDirectory = TestUtils.findApplicationDirectory( "lamp" ); String roboconfVersion = ItUtils.findRoboconfVersion(); return OptionUtils.combine( super.config(), systemProperty( APP_LOCATION ).value( resourcesDirectory.getAbsolutePath()), mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-plugin-script" ) .version( roboconfVersion ) .start()); }
Example #16
Source File: SocketCollectorTest.java From karaf-decanter with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { Option[] options = new Option[]{ KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "decanter.version", System.getProperty("decanter.version")) }; return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new); }
Example #17
Source File: Jsr107OsgiTest.java From ehcache3 with Apache License 2.0 | 5 votes |
@Configuration public Option[] uberJar() { return options( gradleBundle("org.ehcache:dist"), jaxbConfiguration(), gradleBundle("javax.cache:cache-api"), baseConfiguration("Jsr107OsgiTest", "uberJar") ); }
Example #18
Source File: AgentInitializationWithScopedInstanceTest.java From roboconf-platform with Apache License 2.0 | 5 votes |
@Override @Configuration public Option[] config() throws Exception { List<Option> options = new ArrayList<> (); options.addAll( Arrays.asList( super.config())); // Store the application's location File resourcesDirectory = TestUtils.findApplicationDirectory( "lamp" ); String appLocation = resourcesDirectory.getAbsolutePath(); options.add( systemProperty( APP_LOCATION ).value( appLocation )); // Deploy the agent's bundles String roboconfVersion = ItUtils.findRoboconfVersion(); options.add( mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-plugin-api" ) .version( roboconfVersion ) .start()); options.add( mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-agent" ) .version( roboconfVersion ) .start()); return options.toArray( new Option[ options.size()]); }
Example #19
Source File: SkipServiceTrackingOSGiTest.java From carbon-kernel with Apache License 2.0 | 5 votes |
/** * This configuration registers the capability "org.wso2.carbon.sample.transport.mgt.Transport" statically using * Provider-Capability header with "org.wso2.carbon.sample.transport.http" bundle and also dynamically registers the * same capability with the implementation of @see TransportServiceCapabilityProvider in * "org.wso2.carbon.sample.transport.custom" bundle. * * @return the bundle configurations that will be used for this test case. */ @Configuration public Option[] createConfiguration() { return new Option[]{ copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.transport.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.transport.ftp").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.order.resolver").groupId("org.wso2.carbon") .versionAsInProject()) }; }
Example #20
Source File: OsgiJiraComponentsTestIT.java From components with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { return options(composite(ComponentsPaxExamOptions.getOptions()), // linkBundle("commons-logging-commons-logging"), // linkBundle("org.talend.components-components-common-bundle"), // linkBundle("org.talend.components-components-jira-bundle")); }
Example #21
Source File: CamelCollectorTest.java From karaf-decanter with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { Option[] options = new Option[]{ KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "decanter.version", System.getProperty("decanter.version")), KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "camel.version", System.getProperty("camel.version")), KarafDistributionOption.features("mvn:org.apache.camel.karaf/apache-camel/" + System.getProperty("camel.version") + "/xml/features", "camel-core") }; return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new); }
Example #22
Source File: ByteSizedOnHeapOsgiTest.java From ehcache3 with Apache License 2.0 | 5 votes |
@Configuration public Option[] uberJar() { return options( gradleBundle("org.ehcache:dist"), jaxbConfiguration(), baseConfiguration("ByteSizedOnHeapOsgiTest", "uberJar") ); }
Example #23
Source File: HttpServiceTest.java From cxf with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { return OptionUtils.combine( cxfBaseConfig(), features(cxfUrl, "cxf-jaxws", "cxf-http-jetty"), testUtils(), logLevel(LogLevel.INFO), provision(serviceBundle()) ); }
Example #24
Source File: LogCollectorTest.java From karaf-decanter with Apache License 2.0 | 5 votes |
@Configuration public Option[] config() { Option[] options = new Option[]{ KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "decanter.version", System.getProperty("decanter.version")) }; return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new); }
Example #25
Source File: XKRSSDisableTest.java From cxf with Apache License 2.0 | 5 votes |
@Configuration public Option[] getConfig() { return OptionUtils.combine( super.getConfig(), editConfigurationFilePut("etc/org.apache.cxf.xkms.cfg", "xkms.enableXKRSS", "false") ); }
Example #26
Source File: CustomRuntimeOSGiTest.java From carbon-kernel with Apache License 2.0 | 5 votes |
@Configuration public Option[] createConfiguration() { return new Option[] { copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.mgt").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.mss").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.runtime.jar").groupId("org.wso2.carbon") .versionAsInProject()), copyOSGiLibBundle(maven().artifactId("org.wso2.carbon.sample.order.resolver").groupId("org.wso2.carbon") .versionAsInProject()) }; }
Example #27
Source File: KarafTestSupport.java From mobi with GNU Affero General Public License v3.0 | 5 votes |
@Configuration public Option[] config() throws IOException, URISyntaxException { MavenArtifactUrlReference karafUrl = CoreOptions.maven() .groupId("com.mobi") .artifactId("mobi-distribution") .version(MavenUtils.getArtifactVersion("com.mobi", "mobi-distribution")) .type("tar.gz"); List<Option> options = new ArrayList<>(Arrays.asList( KarafDistributionOption.karafDistributionConfiguration() .frameworkUrl(karafUrl) .unpackDirectory(new File("target/exam")) .useDeployFolder(false), KarafDistributionOption.keepRuntimeFolder(), KarafDistributionOption.logLevel(LogLevel.INFO), KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getFileResource("/etc/org.ops4j.pax.logging.cfg")), KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT), KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port.secure", HTTPS_PORT), KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", RMI_REG_PORT), KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", SSH_PORT), KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", RMI_SERVER_PORT), CoreOptions.mavenBundle() .groupId("com.mobi") .artifactId("itests-support") .version(MavenUtils.getArtifactVersion("com.mobi", "itests-support")) )); Files.list(getFileResource("/etc").toPath()).forEach(path -> options.add(KarafDistributionOption.replaceConfigurationFile("etc/" + path.getFileName(), path.toFile()))); return options.toArray(new Option[options.size()]); }
Example #28
Source File: DelayedInstallationOfTargetHandlerTest.java From roboconf-platform with Apache License 2.0 | 5 votes |
@Override @Configuration public Option[] config() throws Exception { List<Option> options = new ArrayList<> (); options.addAll( Arrays.asList( super.config())); // Store the application's location File resourcesDirectory = TestUtils.findApplicationDirectory( "lamp" ); String appLocation = resourcesDirectory.getAbsolutePath(); options.add( systemProperty( APP_LOCATION ).value( appLocation )); // Disable the JMX server. Not sure it is really useful... options.add( configureSecurity().disableKarafMBeanServerBuilder()); // Pre-deploy the agent and the plug-in API. // "roboconf:target" would install them. But we get OSGi import errors // with the PAX probe (the bundle that is generated on the fly by PAX-Exam // and that wraps the test classes). // // To prevent it, we deploy them before running the test. String roboconfVersion = ItUtils.findRoboconfVersion(); options.add( mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-plugin-api" ) .version( roboconfVersion ) .start()); options.add( mavenBundle() .groupId( "net.roboconf" ) .artifactId( "roboconf-agent" ) .version( roboconfVersion ) .start()); return options.toArray( new Option[ options.size()]); }
Example #29
Source File: LibraryIntegrationTestBase.java From ovsdb with Eclipse Public License 1.0 | 5 votes |
@Configuration @Override public Option[] config() { Option[] parentOptions = super.config(); Option[] propertiesOptions = getPropertiesOptions(); Option[] otherOptions = getOtherOptions(); Option[] options = new Option[parentOptions.length + propertiesOptions.length + otherOptions.length]; System.arraycopy(parentOptions, 0, options, 0, parentOptions.length); System.arraycopy(propertiesOptions, 0, options, parentOptions.length, propertiesOptions.length); System.arraycopy(otherOptions, 0, options, parentOptions.length + propertiesOptions.length, otherOptions.length); return options; }
Example #30
Source File: SimpleOsgiTest.java From ehcache3 with Apache License 2.0 | 5 votes |
@Configuration public Option[] uberJarWithJdkServiceLoading() { return options( frameworkProperty(OSGI_LOADING).value("false"), gradleBundle("org.ehcache:dist"), jaxbConfiguration(), baseConfiguration("SimpleOsgiTest", "uberJarWithJdkServiceLoading") ); }