本文整理匯總了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()
};
}
示例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")
);
}
示例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")
);
}
示例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)
};
}
示例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)
};
}
示例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)
};
}
示例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()
};
}
示例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()
};
}
示例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()
};
}
示例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()
};
}
示例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);
}
示例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")
);
}
示例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);
}
示例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"));
}
示例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")
);
}