本文整理汇总了Java中org.ops4j.pax.exam.karaf.options.KarafDistributionOption类的典型用法代码示例。如果您正苦于以下问题:Java KarafDistributionOption类的具体用法?Java KarafDistributionOption怎么用?Java KarafDistributionOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KarafDistributionOption类属于org.ops4j.pax.exam.karaf.options包,在下文中一共展示了KarafDistributionOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configuration
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的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")
);
}
示例2: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven.
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/exam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// add mqnaas-bundletree feature
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas").artifactId("mqnaas").classifier("features")
.type("xml").version("0.0.1-SNAPSHOT"), "mqnaas-bundletree"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例3: baseConfig
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
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))
);
}
示例4: getKarafDistributionOption
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
public static Option getKarafDistributionOption() {
String karafVersion = getKarafVersion();
LOG.info("*** The karaf version is " + karafVersion + " ***");
String localRepo = System.getProperty("maven.repo.local", "");
if (localRepo.length() > 0) {
LOG.info("Using alternative local Maven repository in {}.", new File(localRepo).getAbsolutePath());
localRepo = new File(localRepo).getAbsolutePath().toString()+"@id=local,";
}
return new DefaultCompositeOption(KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject())
.karafVersion(karafVersion)
.name("Apache Karaf")
.useDeployFolder(false).unpackDirectory(new File("target/paxexam/unpack/"))
,
KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories",
localRepo+
"http://repo1.maven.org/[email protected]=central," +
" http://svn.apache.org/repos/asf/servicemix/[email protected]=servicemix," +
" http://repository.springsource.com/maven/bundles/[email protected]=springsource.release," +
" http://repository.springsource.com/maven/bundles/[email protected]=springsource.external," +
" https://oss.sonatype.org/content/repositories/releases/@id=sonatype, " +
" https://repository.jboss.org/nexus/content/groups/[email protected]=ea"
));
}
示例5: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
Option[] options = new Option[] {
when(Boolean.getBoolean(KARAF_DEBUG_PROP))
.useOptions(KarafDistributionOption.debugConfiguration(KARAF_DEBUG_PORT, true)),
karafDistributionConfiguration().frameworkUrl(getKarafDistro())
.unpackDirectory(new File(PAX_EXAM_UNPACK_DIRECTORY)).useDeployFolder(false),
when(Boolean.getBoolean(KEEP_UNPACK_DIRECTORY_PROP)).useOptions(keepRuntimeFolder()),
features(getFeatureRepo(), getFeatureName()),
mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api", "1.0.0"), getLoggingOption(),
mvnLocalRepoOption(),
editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*") };
return OptionUtils.combine(options, getAdditionalOptions());
}
示例6: getOtherOptions
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
private Option[] getOtherOptions() {
return new Option[] {
vmOption("-javaagent:../../pax/jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"),
keepRuntimeFolder(), configureConsole().ignoreLocalConsole(),
logLevel(LogLevel.INFO),
when(Boolean.getBoolean(KARAF_DEBUG_PROP)).useOptions(
KarafDistributionOption.debugConfiguration(KARAF_DEBUG_PORT, true)),};
}
示例7: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
/**
* Container configuration.
*
* @return The configuration.
*/
@Configuration
public Option[] config() {
List<Option> options = new ArrayList<>(Arrays.asList(baseConfig()));
options.add(KarafDistributionOption.features(CAMEL_REPO_URI));
return CoreOptions.options(options.toArray(new Option[0]));
}
示例8: configure
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
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"),
// uncomment this to debug it.
// debugConfiguration("5005", true),
features(getArtemisMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};
return options;
}
示例9: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven. Same applies for bundletree-itests-testbundleX version
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/exam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// add core feature (including bundletree)
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas").artifactId("mqnaas").classifier("features")
.type("xml").version("0.0.1-SNAPSHOT"), "mqnaas"),
// install both test bundles
CoreOptions.mavenBundle().groupId("org.mqnaas").artifactId("bundletree-itests-testbundleA").version("0.0.1-SNAPSHOT"),
CoreOptions.mavenBundle().groupId("org.mqnaas").artifactId("bundletree-itests-testbundleB").version("0.0.1-SNAPSHOT"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例10: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven.
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/paxexam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// maintain our log configuration
KarafDistributionOption.doNotModifyLogConfiguration(),
// add network feature
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas.extensions").artifactId("network").classifier("features")
.type("xml").version("0.0.1-SNAPSHOT"), "network"),
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas.extensions").artifactId("odl").classifier("features")
.type("xml").version("0.0.1-SNAPSHOT"), "odl"),
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas.extensions").artifactId("modelreader")
.classifier("features").type("xml").version("0.0.1-SNAPSHOT"), "mqnaas-modelreader"),
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas").artifactId("mqnaas")
.classifier("features").type("xml").version("0.0.1-SNAPSHOT"), "mqnaas-wiremock"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例11: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven.
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/paxexam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// maintain our log configuration
KarafDistributionOption.doNotModifyLogConfiguration(),
// add network feature
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas.extensions").artifactId("network").classifier("features")
.type("xml").version("0.0.1-SNAPSHOT"), "network"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例12: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven.
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/paxexam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// maintain our log configuration
KarafDistributionOption.doNotModifyLogConfiguration(),
// add network feature
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas.extensions").artifactId("network").classifier("features")
.type("xml").version("0.0.1-SNAPSHOT"), "network"),
CoreOptions.mavenBundle("org.mqnaas.extensions", "network-test-helpers", "0.0.1-SNAPSHOT"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例13: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven.
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/paxexam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// maintain our log configuration
KarafDistributionOption.doNotModifyLogConfiguration(),
// add MQNaaS feature
KarafDistributionOption.features(
CoreOptions.maven().groupId("org.mqnaas").artifactId("mqnaas").classifier("features").type("xml").version("0.0.1-SNAPSHOT"),
"mqnaas"),
// add MQNaaS OpenStack feature
KarafDistributionOption.features(
CoreOptions.maven().groupId("org.mqnaas.extensions").artifactId("openstack").classifier("features").type("xml")
.version("0.0.1-SNAPSHOT"), "mqnaas-openstack"),
// install mqnaas-test-helpers bundle
CoreOptions.mavenBundle().groupId("org.mqnaas").artifactId("mqnaas-test-helpers").version("0.0.1-SNAPSHOT"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例14: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@Configuration
public Option[] config() {
// FIXME Read mqnass features version from maven.
// now mqnaas features version in this file must be changed manually in each release!
return new Option[] {
// distribution to test: Karaf 3.0.3
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("3.0.3"))
.karafVersion("3.0.3").name("Apache Karaf").useDeployFolder(false)
// keep deployed Karaf
.unpackDirectory(new File("target/paxexam")),
// no local and remote consoles
KarafDistributionOption.configureConsole().ignoreLocalConsole(),
KarafDistributionOption.configureConsole().ignoreRemoteShell(),
// keep runtime folder allowing analysing results
KarafDistributionOption.keepRuntimeFolder(),
// use custom logging configuration file with a custom appender
KarafDistributionOption.replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(
"src/test/resources/org.ops4j.pax.logging.cfg")),
// maintain our log configuration
KarafDistributionOption.doNotModifyLogConfiguration(),
// add network feature
KarafDistributionOption.features(CoreOptions.maven().groupId("org.mqnaas").artifactId("mqnaas").classifier("features").type("xml")
.version("0.0.1-SNAPSHOT"), "mqnaas"),
// install mqnaas-test-helpers bundle
CoreOptions.mavenBundle().groupId("org.mqnaas").artifactId("mqnaas-test-helpers").version("0.0.1-SNAPSHOT"),
// debug option
// KarafDistributionOption.debugConfiguration()
};
}
示例15: config
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; //导入依赖的package包/类
@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());
}