org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel Java Examples

The following examples show how to use org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel. 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: OSGiTest.java    From trellis with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    final ConfigurationManager cm = new ConfigurationManager();
    final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
    final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
    final String sshPort = cm.getProperty("karaf.ssh.port");
    final String jenaVersion = cm.getProperty("jena.version");
    final String activemqVersion = cm.getProperty("activemq.version");

    return new Option[] {
        karafDistributionConfiguration()
            .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
                    .version(cm.getProperty("karaf.version")).type("zip"))
            .unpackDirectory(new File("build", "exam"))
            .useDeployFolder(false),
        logLevel(LogLevel.INFO),
        keepRuntimeFolder(),
        configureConsole().ignoreLocalConsole(),

        features(maven().groupId("org.apache.karaf.features").artifactId("standard")
                    .versionAsInProject().classifier("features").type("xml"), "scr"),
        features(maven().groupId("org.apache.karaf.features").artifactId("spring-legacy")
                    .versionAsInProject().classifier("features").type("xml"), "spring"),
        features(maven().groupId("org.apache.activemq").artifactId("activemq-karaf")
                    .version(activemqVersion).classifier("features").type("xml")),
        features(maven().groupId("org.apache.jena").artifactId("jena-osgi-features")
                    .version(jenaVersion).classifier("features").type("xml")),
        features(maven().groupId("org.trellisldp").artifactId("trellis-karaf")
                    .type("xml").classifier("features").versionAsInProject(),
                    "trellis-jena"),

        editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories",
                "https://repo1.maven.org/maven2@id=central"),
        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)
   };
}
 
Example #3
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 #4
Source File: BundlesTest.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    return new Option[]{
        olingoBaseConfig(),
        features(olingoUrl, "olingo-server", "olingo-client"),
        logLevel(LogLevel.INFO)};
}
 
Example #5
Source File: CarServiceTest.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    return new Option[] {
        olingoBaseConfig(),
        features(olingoUrl, "olingo-server", "olingo-client"),
        mavenBundle("org.apache.olingo", "odata-server-osgi-sample", "4.8.0-SNAPSHOT"),
        logLevel(LogLevel.INFO)
    };
}
 
Example #6
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 #7
Source File: HwvtepSouthboundIT.java    From ovsdb with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Option getLoggingOption() {
    Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
            "log4j2.logger.hwvtepsouthbound-it.name",
            HwvtepSouthboundIT.class.getPackage().getName());
    option = composite(option, editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
            "log4j2.logger.hwvtepsouthbound-it.level",
            LogLevel.INFO.name()));
    option = composite(option, super.getLoggingOption());
    return option;
}
 
Example #8
Source File: LibraryIntegrationTestBase.java    From ovsdb with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Option getLoggingOption() {
    Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
            "log4j2.logger.library-it.name",
            getClass().getPackage().getName());
    option = composite(option, editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
            "log4j2.logger.library-it.level",
            LogLevel.INFO.name()));
    option = composite(option, super.getLoggingOption());
    return option;
}
 
Example #9
Source File: BundlesAndNamespacesTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    return OptionUtils.combine(
        cxfBaseConfig(),
        features(cxfUrl, "aries-blueprint", "cxf-core", "cxf-jaxws"),
        logLevel(LogLevel.INFO)
    );
}
 
Example #10
Source File: HttpServiceTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    return OptionUtils.combine(
        cxfBaseConfig(),
        features(cxfUrl, "cxf-jaxws", "cxf-http-jetty"),
        testUtils(),
        logLevel(LogLevel.INFO),
        provision(serviceBundle())
    );
}
 
Example #11
Source File: JaxRsServiceTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() {
    return OptionUtils.combine(
        cxfBaseConfig(),
        features(cxfUrl, "cxf-core", "cxf-wsdl", "cxf-jaxrs", "cxf-bean-validation-core", "cxf-bean-validation"),
        logLevel(LogLevel.INFO),
        provision(serviceBundle())
    );
}
 
Example #12
Source File: KarafIT.java    From fcrepo-camel-toolbox with Apache License 2.0 4 votes vote down vote up
@Configuration
public Option[] config() {
    final ConfigurationManager cm = new ConfigurationManager();
    final String fcrepoPort = cm.getProperty("fcrepo.dynamic.test.port");
    final String jmsPort = cm.getProperty("fcrepo.dynamic.jms.port");
    final String reindexingPort = cm.getProperty("fcrepo.dynamic.reindexing.port");
    final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
    final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
    final String sshPort = cm.getProperty("karaf.ssh.port");
    final String fcrepoBaseUrl = "localhost:" + fcrepoPort + "/fcrepo/rest";

    final String version = cm.getProperty("project.version");
    final String fcrepoAudit = getBundleUri("fcrepo-audit-triplestore", version);
    final String fcrepoFixity = getBundleUri("fcrepo-fixity", version);
    final String fcrepoReindexing = getBundleUri("fcrepo-reindexing", version);
    final String fcrepoSerialization = getBundleUri("fcrepo-serialization", version);
    final String fcrepoIndexingSolr = getBundleUri("fcrepo-indexing-solr", version);
    final String fcrepoIndexingTriplestore = getBundleUri("fcrepo-indexing-triplestore", version);
    final String fcrepoServiceAmq = getBundleUri("fcrepo-service-activemq", version);
    final String fcrepoService = getBundleUri("fcrepo-service-camel", version);

    final String fcrepoReindexingBlueprint = getBlueprintUri("fcrepo-reindexing-blueprint", version);

    return new Option[] {
        karafDistributionConfiguration()
            .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
                    .versionAsInProject().type("zip"))
            .unpackDirectory(new File("target", "exam"))
            .useDeployFolder(false),
        logLevel(LogLevel.WARN),
        keepRuntimeFolder(),
        configureConsole().ignoreLocalConsole(),
        features(maven().groupId("org.apache.karaf.features").artifactId("standard")
                    .versionAsInProject().classifier("features").type("xml"), "scr"),
        features(maven().groupId("org.apache.camel.karaf").artifactId("apache-camel")
                    .type("xml").classifier("features").versionAsInProject(), "camel-mustache",
                    "camel-blueprint", "camel-http4", "camel-spring", "camel-exec", "camel-jetty9",
                    "camel-jacksonxml"),
        features(maven().groupId("org.apache.activemq").artifactId("activemq-karaf")
                    .type("xml").classifier("features").versionAsInProject(), "activemq-camel"),
        features(maven().groupId("org.fcrepo.camel").artifactId("fcrepo-camel")
                    .type("xml").classifier("features").versionAsInProject(), "fcrepo-camel"),
        mavenBundle().groupId("org.codehaus.woodstox").artifactId("woodstox-core-asl").versionAsInProject(),

        CoreOptions.systemProperty("o.f.c.serialization-bundle").value(fcrepoSerialization),
        CoreOptions.systemProperty("o.f.c.fixity-bundle").value(fcrepoFixity),
        CoreOptions.systemProperty("o.f.c.reindexing-bundle").value(fcrepoReindexing),
        CoreOptions.systemProperty("o.f.c.a.triplestore-bundle").value(fcrepoAudit),
        CoreOptions.systemProperty("o.f.c.i.triplestore-bundle").value(fcrepoIndexingTriplestore),
        CoreOptions.systemProperty("o.f.c.i.solr-bundle").value(fcrepoIndexingSolr),
        CoreOptions.systemProperty("o.f.c.s.activemq-bundle").value(fcrepoServiceAmq),
        CoreOptions.systemProperty("o.f.c.s.camel-bundle").value(fcrepoService),

        bundle(fcrepoAudit).start(),
        bundle(fcrepoIndexingSolr).start(),
        bundle(fcrepoIndexingTriplestore).start(),
        bundle(fcrepoFixity).start(),
        bundle(fcrepoSerialization).start(),
        bundle(fcrepoReindexing).start(),
        bundle(fcrepoServiceAmq).start(),
        bundle(fcrepoService).start(),
        bundle(fcrepoReindexingBlueprint).start(),

        CoreOptions.systemProperty("fcrepo.port").value(fcrepoPort),
        CoreOptions.systemProperty("karaf.reindexing.port").value(reindexingPort),
        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/org.fcrepo.camel.serialization.cfg", "serialization.descriptions",
                "data/tmp/descriptions"),
        editConfigurationFilePut("etc/org.fcrepo.camel.reindexing.cfg", "rest.port", reindexingPort),
        editConfigurationFilePut("etc/org.fcrepo.camel.service.cfg", "fcrepo.baseUrl", fcrepoBaseUrl),
        editConfigurationFilePut("etc/org.fcrepo.camel.service.activemq.cfg", "jms.brokerUrl",
                "tcp://localhost:" + jmsPort),
        editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg",
                "log4j.logger.org.apache.camel.impl.converter", "ERROR, stdout")
   };
}
 
Example #13
Source File: KarafIT.java    From fcrepo-camel-toolbox with Apache License 2.0 4 votes vote down vote up
@Configuration
public Option[] config() throws Exception {
    final ConfigurationManager cm = new ConfigurationManager();
    final String artifactName = cm.getProperty("project.artifactId") + "-" + cm.getProperty("project.version");
    final String fcrepoServiceBundle = "file:" + getBaseDir() + "/target/" + artifactName + ".jar";
    final String fcrepoPort = cm.getProperty("fcrepo.dynamic.test.port");
    final String jmsPort = cm.getProperty("fcrepo.dynamic.jms.port");
    final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
    final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
    final String sshPort = cm.getProperty("karaf.ssh.port");
    return new Option[] {
        karafDistributionConfiguration()
            .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
                    .versionAsInProject().type("zip"))
            .unpackDirectory(new File("target", "exam"))
            .useDeployFolder(false),
        logLevel(LogLevel.WARN),
        keepRuntimeFolder(),
        configureConsole().ignoreLocalConsole(),
        features(maven().groupId("org.apache.karaf.features").artifactId("standard")
                    .type("xml").classifier("features").versionAsInProject(), "scr"),
        features(maven().groupId("org.apache.camel.karaf").artifactId("apache-camel")
                    .type("xml").classifier("features").versionAsInProject(), "camel",
                    "camel-blueprint", "camel-jackson"),
        features(maven().groupId("org.fcrepo.camel").artifactId("fcrepo-camel")
                    .type("xml").classifier("features").versionAsInProject(), "fcrepo-camel"),

        CoreOptions.systemProperty("fcrepo.port").value(fcrepoPort),
        CoreOptions.systemProperty("jms.port").value(jmsPort),
        CoreOptions.systemProperty("fcrepo.service.bundle").value(fcrepoServiceBundle),

        editConfigurationFilePut("etc/org.fcrepo.camel.service.cfg", "fcrepo.baseUrl",
                "http://localhost:" + fcrepoPort + "/fcrepo/rest"),
        editConfigurationFilePut("etc/org.fcrepo.camel.service.cfg", "fcrepo.authUsername",
                FEDORA_USERNAME),
        editConfigurationFilePut("etc/org.fcrepo.camel.service.cfg", "fcrepo.authPassword",
                FEDORA_PASSWORD),

        bundle(fcrepoServiceBundle).start(),

        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)
   };
}
 
Example #14
Source File: KarafIT.java    From fcrepo-camel-toolbox with Apache License 2.0 4 votes vote down vote up
@Configuration
public Option[] config() throws Exception {
    final ConfigurationManager cm = new ConfigurationManager();
    final String artifactName = cm.getProperty("project.artifactId") + "-" + cm.getProperty("project.version");
    final String fcrepoServiceBundle = "file:" + getBaseDir() + "/target/" + artifactName + ".jar";
    final String fcrepoPort = cm.getProperty("fcrepo.dynamic.test.port");
    final String jmsPort = cm.getProperty("fcrepo.dynamic.jms.port");
    final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
    final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
    final String sshPort = cm.getProperty("karaf.ssh.port");
    return new Option[] {
        karafDistributionConfiguration()
            .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
                    .versionAsInProject().type("zip"))
                .karafVersion("4.0.6")
            .unpackDirectory(new File("target", "exam"))
            .useDeployFolder(false),
        logLevel(LogLevel.WARN),
        keepRuntimeFolder(),
        configureConsole().ignoreLocalConsole(),
        features(maven().groupId("org.apache.karaf.features").artifactId("standard")
                    .type("xml").classifier("features").versionAsInProject(), "scr"),
        features(maven().groupId("org.apache.camel.karaf").artifactId("apache-camel")
                    .type("xml").classifier("features").versionAsInProject(), "camel",
                    "camel-blueprint", "camel-http4", "camel-jms"),
        features(maven().groupId("org.apache.activemq").artifactId("activemq-karaf")
                    .type("xml").classifier("features").versionAsInProject(), "activemq-camel"),
        features(maven().groupId("org.fcrepo.camel").artifactId("fcrepo-camel")
                    .type("xml").classifier("features").versionAsInProject(), "fcrepo-camel"),

        CoreOptions.systemProperty("fcrepo.port").value(fcrepoPort),
        CoreOptions.systemProperty("jms.port").value(jmsPort),
        CoreOptions.systemProperty("fcrepo.service.activemq.bundle").value(fcrepoServiceBundle),

        editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg",
                "log4j.logger.org.apache.camel.impl.converter", "ERROR, stdout"),

        bundle(fcrepoServiceBundle).start(),
        streamBundle(
                TinyBundles.bundle().add("OSGI-INF/blueprint/blueprint-test.xml",
                        new File("src/test/resources/OSGI-INF/blueprint/blueprint-test.xml").toURI().toURL())
                .set(Constants.BUNDLE_SYMBOLICNAME, "org.fcrepo.camel.service.activemq.test")
                .set(Constants.BUNDLE_MANIFESTVERSION, "2")
                .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
                .build()
            ).start(),

        editConfigurationFilePut("etc/org.fcrepo.camel.service.activemq.cfg", "jms.consumers", "1"),
        editConfigurationFilePut("etc/org.fcrepo.camel.service.activemq.cfg", "jms.connections", "1"),
        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/org.fcrepo.camel.service.activemq.cfg", "jms.brokerUrl",
                "tcp://localhost:" + jmsPort)
   };
}
 
Example #15
Source File: ItConfigurationBean.java    From roboconf-platform with Apache License 2.0 4 votes vote down vote up
/**
 * @return the roboconfLogsLevel
 */
public LogLevel getRoboconfLogsLevel() {
	return this.roboconfLogsLevel;
}