当前位置: 首页>>代码示例>>Java>>正文


Java Configuration类代码示例

本文整理汇总了Java中org.ops4j.pax.exam.Configuration的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Configuration类属于org.ops4j.pax.exam包,在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
    public Option[] configuration() {
        InputStream testBundle = TinyBundles.bundle()
            .set(Constants.BUNDLE_SYMBOLICNAME, "incompleteTestUnit") //
            .set("Meta-Persistence", " ") //
            .add("META-INF/persistence.xml", this.getClass().getResourceAsStream("/persistence.xml")) //
            .build(TinyBundles.withBnd());
        return new Option[] {//
            baseOptions(),//
            ariesJpa21(),//
            jta12Bundles(), //
            eclipseLink(),//
            derbyDSF(), //
            testBundleEclipseLink().noStart(),//
            streamBundle(testBundle)
//         ,debug()
        };
    }
 
开发者ID:apache,项目名称:aries-jpa,代码行数:19,代码来源:EclipseAdditionalTest.java

示例2: config

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public Option[] config() {
    return options(
            // vmOptions("-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"),
            systemProperty("org.osc.core.server.installer.debug").value("true"),
            mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(),
            mavenBundle("org.apache.felix", "org.apache.felix.scr").versionAsInProject(),
            mavenBundle("org.apache.felix", "org.apache.felix.log").versionAsInProject(),
            mavenBundle("org.apache.felix", "org.apache.felix.resolver").versionAsInProject(),
            // NB FileInstall included for its API, but NOT started so the directory polling doesn't happen
            mavenBundle("org.apache.felix", "org.apache.felix.fileinstall").versionAsInProject().start(false),
            mavenBundle("org.osgi", "org.osgi.service.repository").versionAsInProject(),
            mavenBundle("biz.aQute.bnd", "biz.aQute.bndlib").versionAsInProject(),
            mavenBundle("biz.aQute.bnd", "biz.aQute.repository").versionAsInProject(),
            mavenBundle(GROUPID, "osc-resolver").versionAsInProject(),
            mavenBundle(GROUPID, "osc-installer").versionAsInProject(),
            junitBundles(),
            // javax.xml exports required as version=1.0 for bnd repository
            systemPackage("javax.xml.namespace;version=1.0.0"),
            systemPackage("javax.xml.stream;version=1.0.0")
            );
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:23,代码来源:InstallerIntegrationTest.java

示例3: config

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public Option[] config() throws Exception {
    return options(
            regressionDefaults(),
            mvnBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
            mvnBundle("org.apache.geronimo.specs", "geronimo-j2ee-connector_1.6_spec"),
            mvnBundle("org.apache.geronimo.specs", "geronimo-jms_2.0_spec"),
            mvnBundle("org.ops4j.pax.transx", "pax-transx-tm-api"),
            mvnBundle("org.ops4j.pax.transx", "pax-transx-tm-narayana"),
            mvnBundle("org.ops4j.pax.transx", "pax-transx-connector"),
            mvnBundle("org.ops4j.pax.transx", "pax-transx-jms"),
            mvnBundle("org.ops4j.pax.transx", "pax-transx-jdbc"),
            mvnBundle("com.h2database", "h2"),
            systemProperty("com.arjuna.ats.arjuna.recovery.periodicRecoveryInitilizationOffset").value("1")
    );
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:17,代码来源:NarayanaTest.java

示例4: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public static Option[] configuration() throws Exception {
    return new Option[]
            {
                    karafDistributionConfiguration()
                            .frameworkUrl(KARAF_URL)
                            .unpackDirectory(new File("target/paxexam/unpack")),
                    replaceConfigurationFile(BUNDLE_INSTALL_ACL_CFG,
                            new File("src/test/resources/etc/bundleinstall.cfg")),
                    replaceConfigurationFile(CONFIG_PROPERTIES,
                            new File("src/test/resources/etc/config.properties")),
                    mavenBundle()
                            .groupId(OSGIFX_GROUP_ID)
                            .artifactId(OSGIFX_BOOT_ARTIFACT_ID)
                            .versionAsInProject(),
                    mavenBundle()
                            .groupId(OSGIFX_GROUP_ID)
                            .artifactId(IT_DUMMY_BUNDLE_ARTIFACT_ID)
                            .versionAsInProject(),
                    mavenBundle(TESTFX_GROUP_ID, TESTFX_CORE_ARTIFACT_ID, TESTFX_VERSION),
                    mavenBundle(TESTFX_GROUP_ID, TESTFX_INTERNAL_ARTIFACT_ID, TESTFX_VERSION),
                    logLevel(LogLevelOption.LogLevel.INFO)
            };
}
 
开发者ID:jtkb,项目名称:flexfx,代码行数:25,代码来源:TFxTest.java

示例5: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public static Option[] configuration() throws Exception {
    return new Option[]
            {
                    karafDistributionConfiguration()
                            .frameworkUrl(KARAF_URL)
                            .unpackDirectory(new File("target/paxexam/unpack")),
                    replaceConfigurationFile(BUNDLE_INSTALL_ACL_CFG,
                            new File("src/test/resources/etc/bundleinstall.cfg")),
                    mavenBundle()
                            .groupId(OSGIFX_GROUP_ID)
                            .artifactId(OSGIFX_BOOT_ARTIFACT_ID)
                            .versionAsInProject(),
                    logLevel(LogLevelOption.LogLevel.INFO)
            };
}
 
开发者ID:jtkb,项目名称:flexfx,代码行数:17,代码来源:DeployOsgiFxTest.java

示例6: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public static Option[] configuration() throws Exception
{
    return new Option[]
            {
                    karafDistributionConfiguration()
                            .frameworkUrl(KARAF_URL)
                            .unpackDirectory(new File("target/paxexam/unpack")),
                    replaceConfigurationFile(BUNDLE_INSTALL_ACL_CFG,
                            new File("src/test/resources/etc/bundleinstall.cfg")),
                    replaceConfigurationFile(CONFIG_PROPERTIES,
                            new File("src/test/resources/etc/config.properties")),
                    mavenBundle(TESTFX_GROUP_ID, TESTFX_CORE_ARTIFACT_ID, TESTFX_VERSION),
                    mavenBundle(TESTFX_GROUP_ID, TESTFX_INTERNAL_ARTIFACT_ID, TESTFX_VERSION),
                    logLevel(LogLevelOption.LogLevel.INFO)
            };
}
 
开发者ID:jtkb,项目名称:flexfx,代码行数:18,代码来源:OsgiFxFailureTest.java

示例7: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public static Option[] configuration() throws Exception {
    MavenArtifactUrlReference karaf = maven().groupId("org.apache.karaf").artifactId("apache-karaf")
        .type("zip").version("4.0.7");
    MavenUrlReference brave = maven().groupId("io.zipkin.brave.karaf").artifactId("brave-features").type("xml")
       .classifier("features").version("1.0.0-SNAPSHOT");
    return new Option[] //
    {
     karafDistributionConfiguration().frameworkUrl(karaf).useDeployFolder(false),
     configureConsole().ignoreLocalConsole(), //
     logLevel(LogLevel.INFO), //
     keepRuntimeFolder(), //
     features(brave, "brave-core", "brave-kafka08"),
     // Create an empty config to trigger creation of component 
     newConfiguration("io.zipkin.reporter.urlconnect").asOption(),
     newConfiguration("io.zipkin.reporter.kafka08").asOption()
    };
}
 
开发者ID:openzipkin,项目名称:brave-karaf,代码行数:19,代码来源:BraveTest.java

示例8: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
// @formatter:off
public static Option[] configuration() throws Exception {
    return new Option[] {
            karafDistributionConfiguration()
                    .frameworkUrl(
                            maven()
                                .groupId("de.nierbeck.example.vertx")
                                .artifactId("Vertx-Karaf")
                                .type("tar.gz").versionAsInProject()
                            )
                    .unpackDirectory(new File("target/paxexam/unpack/"))
                    .useDeployFolder(false)
                    .runEmbedded(false), // only for debugging
            configureConsole().ignoreLocalConsole(), 
            logLevel(LogLevel.DEBUG), 
            keepRuntimeFolder()
   };
}
 
开发者ID:ANierbeck,项目名称:Karaf-Vertx,代码行数:20,代码来源:VertxExtenderKarafTest.java

示例9: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public static Option[] configuration() throws Exception {
    return new Option[] { karafDistributionConfiguration()
            .frameworkUrl(
                        maven()
                            .groupId("de.nierbeck.example.vertx")
                            .artifactId("Vertx-Karaf")
                            .type("tar.gz")
                            .versionAsInProject())
            .unpackDirectory(new File("target/paxexam/unpack/"))
            .useDeployFolder(false)
            .runEmbedded(false), //only for debugging 
            configureConsole().ignoreLocalConsole(), 
            logLevel(LogLevel.INFO), keepRuntimeFolder()
        };
}
 
开发者ID:ANierbeck,项目名称:Karaf-Vertx,代码行数:17,代码来源:CustomVertxKarafTest.java

示例10: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public Option[] configuration() throws Exception {
    return new Option[] { karafDistributionConfiguration()
            .frameworkUrl(
                        maven()
                            .groupId("de.nierbeck.example.vertx.mircoservices")
                            .artifactId("Vertx-Microservices-Karaf")
                            .type("tar.gz")
                            .versionAsInProject())
            .unpackDirectory(new File("target/paxexam/unpack/"))
            .useDeployFolder(false)
            .runEmbedded(false) //only for debugging
            , features(
                    maven().groupId("de.nierbeck.example.vertx.mircoservices")
                        .artifactId("Vertx-Microservices-Features")
                        .type("xml")
                        .classifier("features").versionAsInProject(),
                    "Vertx-AliveCheck")
            , configureConsole().ignoreLocalConsole(), logLevel(LogLevel.INFO), keepRuntimeFolder()
            ,  mavenBundle().groupId("io.vertx").artifactId("vertx-unit").versionAsInProject()
        };
}
 
开发者ID:ANierbeck,项目名称:Karaf-Vertx,代码行数:23,代码来源:AliveCheckInternalTest.java

示例11: withDefaultConfig

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public static Option[] withDefaultConfig(final Option ...options) {
    Option[] defaultOptions = {
            keepCaches(),
            karafDistributionConfiguration()
                    .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf-minimal").type("zip")
                                         .version("4.0.6"))
                    .karafVersion("4.0.6")
                    .unpackDirectory(new File("target/exam")),
            logLevel(WARN),
            features(karafStandardRepo),
            features(etceteraRepo, "etcetera"),
            junitBundles(),
            systemPackages("javax.mail","javax.mail.internet"),
            keepRuntimeFolder(),
            configureConsole().ignoreLocalConsole().ignoreRemoteShell()
    };
    return Stream.concat(Arrays.stream(defaultOptions), Arrays.stream(options)).collect(Collectors.toList())
                 .toArray(defaultOptions);
}
 
开发者ID:yrashk,项目名称:etcetera,代码行数:21,代码来源:ContainerConfiguration.java

示例12: config

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
public Option[] config() throws IOException {
    return ContainerConfiguration.withDefaultConfig(
            editConfigurationFilePut("etc/etcetera.properties", "backends",
                                     "base, main, overlay"),
            editConfigurationFilePut("etc/etcetera.properties", "base.service", "file"),
            editConfigurationFilePut("etc/etcetera.properties", "base.path", "lib"),
            editConfigurationFilePut("etc/etcetera.properties", "base.save", "ALL"),
            editConfigurationFilePut("etc/etcetera.properties", "main.service", "file"),
            editConfigurationFilePut("etc/etcetera.properties", "main.path", "bin"),
            editConfigurationFilePut("etc/etcetera.properties", "main.save", "FILES"),
            editConfigurationFilePut("etc/etcetera.properties", "overlay.service", "file"),
            editConfigurationFilePut("etc/etcetera.properties", "overlay.path", "${karaf.data}"),
            editConfigurationFilePut("etc/etcetera.properties", "overlay.save", "PROPERTIES"),
            editConfigurationFilePut("bin/test.cfg", "test1", "value1"),
            editConfigurationFilePut("bin/test.cfg", "test2", "value1"),
            editConfigurationFilePut("data/test.cfg", "test2", "value2"),
            editConfigurationFilePut("data/test-f.cfg", "test3", "value3")
    );
}
 
开发者ID:yrashk,项目名称:etcetera,代码行数:21,代码来源:BackendConfigurationTest.java

示例13: factory

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Test
public void factory() throws IOException, InvalidSyntaxException {
    ServiceReference<ConfigurationAdmin> reference = bundleContext
            .getServiceReference(ConfigurationAdmin.class);
    ConfigurationAdmin configurationAdmin = bundleContext.getService(reference);

    org.osgi.service.cm.Configuration[] configurations = configurationAdmin
            .listConfigurations("(service.factoryPid=test)");
    assertNotNull(configurations);

    Dictionary<String, Object> properties = configurations[0].getProperties();

    assertNotNull(properties);

    assertEquals("value3", properties.get("test3"));

    bundleContext.ungetService(reference);
}
 
开发者ID:yrashk,项目名称:etcetera,代码行数:19,代码来源:BackendConfigurationTest.java

示例14: creating

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Test(timeout = 5000)
public void creating() throws IOException {
    ServiceReference<ConfigurationAdmin> reference = bundleContext
            .getServiceReference(ConfigurationAdmin.class);
    ConfigurationAdmin configurationAdmin = bundleContext.getService(reference);

    org.osgi.service.cm.Configuration configuration = configurationAdmin.getConfiguration("new");

    Hashtable<String, Object> update = new Hashtable<>();
    update.put("test", "passed");
    configuration.update(update);

    Map<String, String> config = new HashMap<>();

    do {
        try {
            config = ConfigFileReader.read("lib/new.cfg", new FileInputStream("lib/new.cfg"));
        } catch (IOException e) {}
    } while (config.get("test") == null || !config.get("test").contentEquals("passed"));

}
 
开发者ID:yrashk,项目名称:etcetera,代码行数:22,代码来源:BackendConfigurationTest.java

示例15: configuration

import org.ops4j.pax.exam.Configuration; //导入依赖的package包/类
@Configuration
    public Option[] configuration() {
        MavenUrlReference karafStandardFeature = maven()
                .groupId("org.apache.karaf.features").artifactId("standard")
                .type("xml").classifier("features").versionAsInProject();

        return combine(
                configurationMinimal(),
//                KarafDistributionOption.debugConfiguration("9999", true),
                KarafDistributionOption.replaceConfigurationFile("credential.store", new File("target/test-classes/credential.store")),
                environment("CREDENTIAL_STORE_PROTECTION_ALGORITHM=masked-MD5-DES"),
                environment("CREDENTIAL_STORE_PROTECTION_PARAMS=MDkEKXNvbWVhcmJpdHJhcnljcmF6eXN0cmluZ3RoYXRkb2Vzbm90bWF0dGVyAgID6AQIQt//5Ifg0x8="),
                environment("CREDENTIAL_STORE_PROTECTION=9KjAtKnaEnb3hgj+67wrS85IHABrZXBgG2gShcQ9kEGl4zjV9TLfyEwxBJ6836dI"),
                environment("CREDENTIAL_STORE_ATTR_location=credential.store"),
                vmOption("-Dprop=CS:key"),
                KarafDistributionOption.features(karafStandardFeature, "management")
        );
    }
 
开发者ID:jboss-fuse,项目名称:fuse-karaf,代码行数:19,代码来源:CredentialStoreJMXIntegrationTest.java


注:本文中的org.ops4j.pax.exam.Configuration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。