org.ops4j.pax.exam.karaf.options.KarafDistributionOption Java Examples

The following examples show how to use org.ops4j.pax.exam.karaf.options.KarafDistributionOption. 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: ServiceMixDistroTest.java    From servicemix with Apache License 2.0 6 votes vote down vote up
public Option baseConfig() {
    examples = maven().groupId("org.apache.servicemix.features").artifactId("servicemix-examples").type("xml").classifier("features").versionAsInProject();
    karafUrl = maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip").versionAsInProject();
    String LOCAL_REPOSITORY = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
    return CoreOptions.composite(
        // KarafDistributionOption.debugConfiguration("8889", true),
        karafDistributionConfiguration().frameworkUrl(karafUrl)
            .name("Apache Servicemix")
            .unpackDirectory(new File("target/exam"))
            .useDeployFolder(false),
        systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
        configureSecurity().disableKarafMBeanServerBuilder(),
        keepRuntimeFolder(),
        logLevel(LogLevel.INFO),
        editConfigurationFilePut("etc/custom.properties", "karaf.delay.console", "false"),
        editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j.logger.org.apache.karaf.features", "WARN"),
        editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j.logger.org.apache.aries.spifly", "WARN"),
        KarafDistributionOption.features(examples, "transaction"),
        when(null != LOCAL_REPOSITORY && LOCAL_REPOSITORY.length() > 0)
        .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", LOCAL_REPOSITORY))
        
    );
}
 
Example #2
Source File: JmsAppenderTest.java    From karaf-decanter with Apache License 2.0 6 votes vote down vote up
@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 #3
Source File: MqttCollectorTest.java    From karaf-decanter with Apache License 2.0 6 votes vote down vote up
@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")),
            mavenBundle().groupId("org.eclipse.paho").artifactId("org.eclipse.paho.client.mqttv3").version(System.getProperty("paho.version"))
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #4
Source File: JmsCollectorTest.java    From karaf-decanter with Apache License 2.0 6 votes vote down vote up
@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")
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #5
Source File: ArtemisFeatureTest.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
public static Option[] configure(String... features) {

      ArrayList<String> f = new ArrayList<>();
      f.addAll(Arrays.asList(features));

      Option[] options = new Option[]{karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject()).unpackDirectory(new File("target/paxexam/unpack/")),

         KarafDistributionOption.keepRuntimeFolder(), logLevel(LogLevelOption.LogLevel.INFO), editConfigurationFilePut("etc/config.properties", "karaf.startlevel.bundle", "50"),
         // [KARAF-6600] Use https URL for Maven Central
         editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "https://repo1.maven.org/maven2@id=central, https://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases"),
         // uncomment this to debug it.
         // debugConfiguration("5005", true),
         features(getArtemisMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};

      return options;
   }
 
Example #6
Source File: SocketAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #7
Source File: FileAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #8
Source File: ElasticsearchAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #9
Source File: TestBase.java    From Karaf-Cassandra with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    return options(
            karafDistributionConfiguration().frameworkUrl(mvnKarafDist())
                    .unpackDirectory(new File("target/paxexam/unpack/")).useDeployFolder(false).runEmbedded(false),
            logLevel(LogLevel.INFO), keepRuntimeFolder(),
            KarafDistributionOption.replaceConfigurationFile("etc/cassandra.yaml", new File("src/test/resources/test-cassandra.yaml")),
            features(
                    maven().groupId("de.nierbeck.cassandra").artifactId("Karaf-Cassandra-Feature").type("xml")
                            .classifier("features").versionAsInProject(),
                    "Karaf-Cassandra-Embedded", "Karaf-Cassandra-Shell"),
            configureConsole().ignoreLocalConsole(), junitBundles());
}
 
Example #10
Source File: RestAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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.features("mvn:org.apache.karaf.features/standard/" + karafVersion + "/xml/features", "http")
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #11
Source File: MongodbAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #12
Source File: JdbcAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    Option[] options = new Option[]{
            KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "decanter.version", System.getProperty("decanter.version")),
            KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.datasource-decanter.cfg", "osgi.jdbc.driver.name", "derby"),
            KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.datasource-decanter.cfg", "osgi.jndi.service.name", "jdbc/decanter"),
            KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.datasource-decanter.cfg", "osgi.jdbc.driver.class", "org.apache.derby.jdbc.EmbeddedDriver"),
            KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.datasource-decanter.cfg", "url", "jdbc:derby:data/decanter/test;create=true"),
            KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.datasource-decanter.cfg", "user", "sa"),
            KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.datasource-decanter.cfg", "password", "")
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #13
Source File: CassandraAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #14
Source File: CamelAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #15
Source File: InfluxdbAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #16
Source File: LogAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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: WebsocketAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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.features("mvn:org.apache.karaf.features/standard/" + karafVersion + "/xml/features", "http", "jetty")
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #18
Source File: Log4jSocketCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #19
Source File: KafkaAppenderTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #20
Source File: SocketCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #21
Source File: KarafTestSupport.java    From mobi with GNU Affero General Public License v3.0 5 votes vote down vote up
@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 #22
Source File: CamelCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #23
Source File: FileCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    Option[] options = new Option[]{
            KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.decanter.collector.file-test.cfg", "type", "file-test"),
            KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.decanter.collector.file-test.cfg", "path", "test.log"),
            KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "decanter.version", System.getProperty("decanter.version"))
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #24
Source File: LogCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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: JmxCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #26
Source File: SoapCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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.features("mvn:org.apache.karaf.features/standard/" + karafVersion + "/xml/features", "http")
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #27
Source File: EventAdminCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #28
Source File: RestServletCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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 #29
Source File: RestCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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.features("mvn:org.apache.karaf.features/standard/" + karafVersion + "/xml/features", "http")
    };
    return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
}
 
Example #30
Source File: KafkaCollectorTest.java    From karaf-decanter with Apache License 2.0 5 votes vote down vote up
@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);
}