Refine search
/** * Base configuration for a Karaf container running the specified Ignite features. * * @return The configuration. */ public Option[] baseConfig() { return options( // Specify which version of Karaf to use. karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz") .versionAsInProject()) .karafVersion(System.getProperty("karafVersion")) .useDeployFolder(false) .unpackDirectory(new File("target/paxexam/unpack")), // Add JUnit bundles. junitBundles(), // Add the additional JRE exports that Ignite requires. editConfigurationFileExtend("etc/jre.properties", "jre-1.7", "sun.nio.ch"), editConfigurationFileExtend("etc/jre.properties", "jre-1.8", "sun.nio.ch"), // Make log level INFO. logLevel(LogLevelOption.LogLevel.INFO), // Add our features repository. features(mavenBundle() .groupId("org.apache.ignite").artifactId("ignite-osgi-karaf") .version(System.getProperty("projectVersion")).type("xml/features"), featuresToInstall().toArray(new String[0])), // Propagate the projectVersion system property. systemProperty("projectVersion").value(System.getProperty("projectVersion")) ); }
public static Option baseConfiguration(String ... path) { return composite( gradleBundle("org.slf4j:slf4j-api"), gradleBundle("org.slf4j:slf4j-simple").noStart(), gradleBundle("org.apache.felix:org.apache.felix.scr"), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), cleanCaches(true), workingDirectory(join(File.separator, "build", "osgi-container", join(File.separator, path))), junitBundles() ); }
@Configuration public Option[] config() { return options( junitBundles(), bundle("file:" + System.getProperty("caffeine.osgi.jar")), bundle("file:" + System.getProperty("caffeine-guava.osgi.jar")), mavenBundle("com.google.guava", "guava", System.getProperty("guava.osgi.version"))); }
@Configuration public Option[] config() { return options( junitBundles(), bundle("file:" + System.getProperty("caffeine.osgi.jar"))); }
/** * Creates default pax exam configuration for Karaf. * @return the default configuration */ public Option[] createConfig() { final Option[] base = options( cleanCaches(), karafDistributionConfiguration() .frameworkUrl( maven().groupId("org.apache.karaf").artifactId("apache-karaf") .type("zip").versionAsInProject()) .name("Apache Karaf") .karafVersion( MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf")) .unpackDirectory(new File("target/exam/unpack/")), keepRuntimeFolder(), cleanCaches(), junitBundles(), addCodeCoverageOption(), addMavenSettingsOptions(), mavenReposURLOptions(), loggingLevel(), addExtraOptions(), featureToTest()); final Option[] baseAndJVM = OptionUtils.combine(base, addJVMOptions()); final Option vmOption = (paxRunnerVmOption != null) ? CoreOptions .vmOption(paxRunnerVmOption) : null; return OptionUtils.combine(baseAndJVM, vmOption); } /**
/** * Use the vanilla Apache Karaf container. Override this method to use * a different Karaf-compatible framework artifact. */ protected MavenUrlReference getFrameworkUrl() { return maven() .groupId("org.apache.karaf") .artifactId("apache-karaf") .type("tar.gz") .version(getKarafVersion()); }
/** * Create an option to install all the requested Provisionr features inside the PAX Exam container */ public static FeaturesScannerProvisionOption installProvisionrFeatures(String... features) { return scanFeatures( maven().groupId("org.apache.provisionr").artifactId("provisionr-features") .type("xml").classifier("features").versionAsInProject(), features ); } }
@Configuration public Option[] config() { return new Option[] { CoreOptions.systemProperty("ogema.resources.useByteCodeGeneration").value("true"), CoreOptions.frameworkProperty("osgi.console").value("true"), CoreOptions.frameworkProperty("osgi.console.enable.builtin").value("true"), CoreOptions.frameworkProperty("org.osgi.service.http.port").value(Integer.toString(HTTP_PORT)), CoreOptions.frameworkProperty("org.osgi.framework.bsnversion").value("multiple"), // CoreOptions.systemProperty("org.ogema.security").value("on"), CoreOptions.junitBundles(), // load the bundle of the extending class directly from maven build dir: CoreOptions.when(includeTestBundle) .useOptions(CoreOptions.bundle("reference:file:target/classes/").start()), CoreOptions.composite(frameworkBundles()), // ogemaWebFrontentOption(), // wicketGuiOption(), // webConsoleOption(), // felixGogoShellOption(), }; }
public String getKarafDistro() { String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP, KARAF_DISTRO_GROUPID); String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP, KARAF_DISTRO_ARTIFACTID); String type = System.getProperty(KARAF_DISTRO_TYPE_PROP, KARAF_DISTRO_TYPE); return maven().groupId(groupId).artifactId(artifactId).versionAsInProject().type(type).getURL(); }
/** * Configures the required system property to set the log-level in Karaf. * * @param logLevel the log level which should be used for pax-logging. Possible values are TRACE, DEBUG, INFO, WARN, * ERROR and FATAL * @return a pax-exam option */ public static SystemPropertyOption setLogLevel(String logLevel) { return systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(logLevel); }
public static Option logbackBundles() { LOG.info("Console Enabled {}", consoleEnabled); return composite( when(consoleEnabled).useOptions(systemProperty("osgi.console").value("6666"), systemProperty("osgi.console.enable.builtin").value("true")), when(consoleEnabled && isFelix()).useOptions( mavenBundle("org.apache.felix", "org.apache.felix.gogo.command", "0.14.0"), mavenBundle("org.apache.felix", "org.apache.felix.gogo.runtime", "0.12.1"), mavenBundle("org.apache.felix", "org.apache.felix.gogo.shell", "0.10.0")), systemProperty("logback.configurationFile").value( "file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml"), linkBundle("slf4j.api"), linkBundle("jcl.over.slf4j"), linkBundle("ch.qos.logback.core"), linkBundle("ch.qos.logback.classic")); }
/** * @return Pax-Exam option to change the Nexus edition based on groupId and artifactId */ public static Option nexusEdition(final String groupId, final String artifactId) { return nexusEdition(maven(groupId, artifactId).versionAsInProject().classifier("features").type("xml"), artifactId); }
@Configuration public Option[] configuration() throws IOException, URISyntaxException { return CoreOptions.options( junitBundles(), mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.0.12"), mavenBundle("org.osgi", "org.osgi.dto", "1.0.0"), mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", "1.8.16" ), mavenBundle( "org.apache.felix", "org.apache.felix.fileinstall", "3.2.6" ), mavenBundle( "org.ops4j.pax.logging", "pax-logging-api", "1.7.2" ), frameworkProperty("repository.home").value("target"), systemProperties(new SystemPropertyOption("felix.fileinstall.dir").value(getConfigDir())), jarBundles(), jpmsOptions()); }
public Option felixGogoShellOption() { return CoreOptions.composite( CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.gogo.runtime", "0.16.2"), // the shell causes ugly VM crashes in tests -> "the forked JVM terminated without properly saying goodbye" // CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.gogo.shell", "1.0.0"), CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.gogo.command", "0.16.0")); }
public static Option calabashConfigFile() { File configFile = new File(PathUtils.getBaseDir() + "/src/test/resources/config-calabash.xml"); return composite( configFile.exists() ? systemProperty("org.daisy.pipeline.xproc.configuration").value(configFile.toString()) : null, systemProperty("com.xmlcalabash.config.user").value("") ); }
public static Option paxCdiWithOwbBundles() { Properties props = new Properties(); try { props.load(TestConfiguration.class.getResourceAsStream("/systemPackages.properties")); } catch (IOException exc) { throw new Ops4jException(exc); } return composite( // do not treat javax.annotation as system package when(isEquinox()).useOptions( frameworkProperty("org.osgi.framework.system.packages").value( props.get("org.osgi.framework.system.packages"))), linkBundle("org.ops4j.pax.cdi.openwebbeans"), // there is a classloader conflict when adding this dep to the POM mavenBundle("org.ops4j.pax.cdi", "pax-cdi-undertow-openwebbeans", PAX_CDI_VERSION), mavenBundle("org.apache.openwebbeans", "openwebbeans-impl", "1.5.0"), mavenBundle("org.apache.openwebbeans", "openwebbeans-spi", "1.5.0"), mavenBundle("org.apache.openwebbeans", "openwebbeans-web", "1.5.0"), mavenBundle("org.apache.openwebbeans", "openwebbeans-el22", "1.5.0"), // needed by pax-cdi-web-openwebbeans mavenBundle("org.apache.geronimo.specs", "geronimo-jsp_2.2_spec", "1.2"), mavenBundle("org.apache.xbean", "xbean-asm6-shaded", "4.6"), // mavenBundle("org.apache.xbean", "xbean-finder-shaded", "4.6"), // //mavenBundle("org.slf4j", "jul-to-slf4j").versionAsInProject(), mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec", "1.1.1"), mavenBundle("javax.validation", "validation-api", "1.1.0.Final"), mavenBundle("javax.interceptor", "javax.interceptor-api", "1.2"), mavenBundle("javax.el", "javax.el-api", "3.0.0")); }
/** * Creates a {@link JUnitBundlesOption}. * * @return junit bundles option */ public static CompositeOption junitBundles() { return new DefaultCompositeOption(new JUnitBundlesOption(), systemProperty( "pax.exam.invoker").value("junit"), bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.hamcrest.core.link"), bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")); }
/** * Set default launchpad options * @param launchpadVersion null means use the latest * @return Composite option */ public static CompositeOption defaultLaunchpadOptions(String launchpadVersion) { final String paxLogLevel = System.getProperty("pax.exam.log.level", "INFO"); final int slingStartLevel = DEFAULT_SLING_START_LEVEL; final String telnetPort = System.getProperty(PROP_TELNET_PORT, String.valueOf(getAvailablePort())); final String httpPort = System.getProperty(PROP_HTTP_PORT, String.valueOf(getAvailablePort())); log.info("{}={}", PROP_TELNET_PORT, telnetPort); log.info("{}={}", PROP_HTTP_PORT, httpPort); return new DefaultCompositeOption( junitBundles(), systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value(paxLogLevel), SlingPaxOptions.felixRemoteShellBundles(), SlingPaxOptions.slingBootstrapBundles(), SlingPaxOptions.slingLaunchpadBundles(launchpadVersion), CoreOptions.frameworkStartLevel(slingStartLevel), CoreOptions.frameworkProperty(PROP_TELNET_PORT).value(telnetPort), CoreOptions.frameworkProperty(PROP_HTTP_PORT).value(httpPort) ); }
/** * 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])); }
/** * Convenience method (shorter) for referencing an maven artifact based on groupId/artifactId. * * @param groupId * artifact group id * @param artifactId * artifact id * * @return maven artifact url */ public static MavenArtifactUrlReference maven(final String groupId, final String artifactId) { return maven().groupId(groupId).artifactId(artifactId); }