Search in sources :

Example 11 with Configuration

use of org.ops4j.pax.exam.Configuration in project hibernate-orm by hibernate.

the class OsgiIntegrationTest method config.

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Prepare the Karaf container
@Configuration
public Option[] config() throws Exception {
    final Properties paxExamEnvironment = loadPaxExamEnvironmentProperties();
    final boolean debug = ConfigurationHelper.getBoolean("org.hibernate.testing.osgi.paxExam.debug", Environment.getProperties(), DEBUG);
    return options(when(debug).useOptions(debugConfiguration("5005", true)), karafDistributionConfiguration().frameworkUrl(paxExamEnvironment.getProperty("org.ops4j.pax.exam.container.karaf.distroUrl")).karafVersion(paxExamEnvironment.getProperty("org.ops4j.pax.exam.container.karaf.version")).name("Apache Karaf").unpackDirectory(new File(paxExamEnvironment.getProperty("org.ops4j.pax.exam.container.karaf.unpackDir"))).useDeployFolder(false), editConfigurationFileExtend("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "https://repository.jboss.org/nexus/content/groups/public/"), configureConsole().ignoreLocalConsole().ignoreRemoteShell(), when(debug).useOptions(keepRuntimeFolder()), logLevel(LogLevelOption.LogLevel.INFO), features(featureXmlUrl(paxExamEnvironment), "hibernate-orm"), features(featureXmlUrl(paxExamEnvironment), "hibernate-envers"), features(testingFeatureXmlUrl(), "hibernate-osgi-testing"));
}
Also used : Properties(java.util.Properties) File(java.io.File) Configuration(org.ops4j.pax.exam.Configuration) KarafDistributionOption.debugConfiguration(org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration) KarafDistributionOption.karafDistributionConfiguration(org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration)

Example 12 with Configuration

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

the class ImportServiceTest method config.

@SuppressWarnings("deprecation")
@Configuration
public Option[] config() {
    List<Option> options = new ArrayList<>(Arrays.asList(super.config()));
    InputStream testBundleImportService = bundle().set(Constants.IMPORT_SERVICE, "FooService").set(Constants.BUNDLE_SYMBOLICNAME, BUNDLE1_NAME).set(Constants.BUNDLE_VERSION, "1.0.0").set(Constants.BUNDLE_MANIFESTVERSION, "2").build();
    options.add(CoreOptions.streamBundle(testBundleImportService));
    InputStream testBundleRequireService = bundle().set(Constants.REQUIRE_CAPABILITY, "osgi.service;effective:=active;filter:=\"(objectClass=FooService)\"").set(Constants.BUNDLE_SYMBOLICNAME, BUNDLE2_NAME).set(Constants.BUNDLE_VERSION, "1.0.0").set(Constants.BUNDLE_MANIFESTVERSION, "2").build();
    options.add(CoreOptions.streamBundle(testBundleRequireService));
    return options.toArray(new Option[] {});
}
Also used : InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) Option(org.ops4j.pax.exam.Option) Configuration(org.ops4j.pax.exam.Configuration)

Example 13 with Configuration

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

the class AbstractTransactionTest method localServerH2XATxConfiguration.

@Configuration
public Option[] localServerH2XATxConfiguration() {
    String localRepo = System.getProperty("maven.repo.local");
    if (localRepo == null) {
        localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
    }
    Option testSpecificOptions = testSpecificOptions();
    return options(junitBundles(), systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), when(localRepo != null).useOptions(CoreOptions.vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo)), xaTxControlService(), localJdbcResourceProviderWithH2(), systemProperty(REMOTE_DB_PROPERTY).value(getRemoteDBPath()), when(testSpecificOptions != null).useOptions(testSpecificOptions), mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(), mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject());
}
Also used : Option(org.ops4j.pax.exam.Option) Configuration(org.ops4j.pax.exam.Configuration)

Example 14 with Configuration

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

the class AbstractTransactionTest method localEmbeddedH2XATxConfiguration.

@Configuration
public Option[] localEmbeddedH2XATxConfiguration() {
    String localRepo = System.getProperty("maven.repo.local");
    if (localRepo == null) {
        localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
    }
    Option testSpecificOptions = testSpecificOptions();
    return options(junitBundles(), systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), when(localRepo != null).useOptions(CoreOptions.vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo)), xaTxControlService(), localJdbcResourceProviderWithH2(), when(testSpecificOptions != null).useOptions(testSpecificOptions), mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(), mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject());
}
Also used : Option(org.ops4j.pax.exam.Option) Configuration(org.ops4j.pax.exam.Configuration)

Example 15 with Configuration

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

the class AbstractTransactionTest method xaConfigAdminDrivenH2XATxConfiguration.

@Configuration
public Option[] xaConfigAdminDrivenH2XATxConfiguration() {
    String localRepo = System.getProperty("maven.repo.local");
    if (localRepo == null) {
        localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
    }
    Option testSpecificOptions = testSpecificOptions();
    return options(junitBundles(), systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), when(localRepo != null).useOptions(CoreOptions.vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo)), xaTxControlService(), xaJdbcResourceProviderWithH2(), systemProperty(REMOTE_DB_PROPERTY).value(getRemoteDBPath()), mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(), systemProperty(CONFIGURED_PROVIDER_PROPERTY).value("xa"), when(testSpecificOptions != null).useOptions(testSpecificOptions), mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(), mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject());
}
Also used : Option(org.ops4j.pax.exam.Option) 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