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")) ); }
/** * Creates a {@link SystemPropertyOption}. * * @param key * system property key * * @return framework property option */ public static SystemPropertyOption systemProperty(final String key) { return new SystemPropertyOption(key); }
String name = m_system.createID( RUNNER_TEST_CONTAINER ); ExamSystem m_subsystem = m_system.fork( options( systemProperty( Constants.RMI_HOST_PROPERTY ).value( m_reg.getHost() ), systemProperty( Constants.RMI_PORT_PROPERTY ).value( "" + m_reg.getPort() ), systemProperty( Constants.RMI_NAME_PROPERTY ).value( name ) m_target = new RBCRemoteTarget( name, m_reg.getPort(), m_subsystem.getTimeout() );
throw new RuntimeException("maven.repo.local system properties must be absolute."); return options(mavenBundle("org.apache.felix", "org.apache.felix.scr"), // linkBundle("org.slf4j-slf4j-api"), // linkBundle("org.slf4j-slf4j-simple").noStart(), // linkBundle("com.fasterxml.jackson.core-jackson-annotations"), // new DefaultCompositeOption(new JUnitBundlesOption(), systemProperty("pax.exam.invoker").value("junit"), bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")), cleanCaches() // , frameworkProperty("org.osgi.framework.system.packages.extra").value("sun.misc"), // when(localRepo.length() > 0).useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo))
@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(), }; }
protected static Option[] baseConfigure() { return options( bootDelegationPackage("sun.*"), bootDelegationPackage("com.sun.*"), frameworkStartLevel(START_LEVEL_TEST_BUNDLE), workingDirectory("target/paxexam"), systemProperty("org.ops4j.pax.logging.property.file").value("src/test/resources/pax-logging.properties"), frameworkProperty("felix.bootdelegation.implicit").value("false"), systemProperty("java.protocol.handler.pkgs").value("org.ops4j.pax.url"), systemProperty("org.osgi.service.http.hostname").value("127.0.0.1"), systemProperty("org.osgi.service.http.port").value("8181"), systemProperty("org.ops4j.pax.web.log.ncsa.enabled").value("true"), systemProperty("org.ops4j.pax.web.log.ncsa.directory").value("target/logs"), systemProperty("ProjectVersion").value(TestConfiguration.PAX_WEB_VERSION),
protected static Option[] baseConfigure() { return options( workingDirectory("target/paxexam/"), cleanCaches(true), junitBundles(), frameworkProperty("felix.bootdelegation.implicit").value( systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level") .value("WARN"), systemProperty("org.osgi.service.http.hostname").value( "127.0.0.1"), systemProperty("org.osgi.service.http.port").value("8181"), systemProperty("java.protocol.handler.pkgs").value( "org.ops4j.pax.url"), systemProperty("org.ops4j.pax.url.war.importPaxLoggingPackages") .value("true"), systemProperty("org.ops4j.pax.web.log.ncsa.enabled").value( "true"), systemProperty("org.ops4j.pax.web.log.ncsa.directory").value( "target/logs"), systemProperty("org.ops4j.pax.web.jsp.scratch.dir").value("target/paxexam/scratch-dir"), systemProperty("ProjectVersion").value(TestConfiguration.PAX_WEB_VERSION), systemProperty("org.ops4j.pax.url.mvn.certificateCheck").value("false"), addCodeCoverageOption(),
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() ); }
return options( provision(bundles), when(useFragmentBundle).useOptions(url(String.format("file:%s/%s-%s-fragment-bundle.jar", projectBuildDirectory, projectBaseBundleJarName, projectVersion)).noStart()), systemPackages( junitBundles(), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(paxLoggingLevel) );
/** * 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); }
protected String getSystemProperty(String key) { SystemPropertyOption[] systemProperties = examSystem.getOptions(SystemPropertyOption.class); if (systemProperties != null) { for (SystemPropertyOption systemPropertyOption : systemProperties) { if (key.equals(systemPropertyOption.getKey())) { return systemPropertyOption.getValue(); } } } return null; } }
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")); }
vmOption("-Xms600M"), vmOption("-Xmx600M"), vmOption("-XX:MaxDirectMemorySize=2G"), vmOption("-XX:+UnlockDiagnosticVMOptions"), vmOption("-XX:+UnsyncloadClass"), propagateSystemProperty(TestCleaner.CLEAN_ON_SUCCESS_KEY), systemProperty("basedir").value(TestBaseDir.get()), replaceConfigurationFile("etc/logback/logback.xml", logbackXml)), systemProperty("root.level").value(logLevel), systemProperty(PORT_REGISTRY_MIN_KEY).value(Integer.toString(PORT_REGISTRY_MIN_FORK)), systemProperty(PORT_REGISTRY_MAX_KEY).value(Integer.toString(PORT_REGISTRY_MAX_FORK)),
@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 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("") ); }
private Option getInvokerConfiguration() { KarafExamSystemConfigurationOption[] internalConfigurationOptions = system .getOptions(KarafExamSystemConfigurationOption.class); Option invokerConfiguration = systemProperty("pax.exam.invoker").value("junit"); if (internalConfigurationOptions != null && internalConfigurationOptions.length != 0) { invokerConfiguration = systemProperty("pax.exam.invoker").value( internalConfigurationOptions[0].getInvoker()); } return invokerConfiguration; }
@Override public void start() throws IOException { try { String examVersion = skipSnapshotFlag(Info.getPaxExamVersion()); system = system.fork(new Option[] { systemPackage("org.ops4j.pax.exam;version=" + examVersion), systemPackage("org.ops4j.pax.exam.options;version=" + examVersion), systemPackage("org.ops4j.pax.exam.util;version=" + examVersion), systemProperty("java.protocol.handler.pkgs").value("org.ops4j.pax.url") }); setSystemProperties(); createFramework(createFrameworkProperties()); installAndStartBundles(); startFramework(); } catch (BundleException exc) { throw new TestContainerException("Problem starting test container.", exc); } catch (ExamConfigurationException e) { throw new TestContainerException("Problem in test container configuration", e); } }
/** * 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")); }
@Override public void start() { ExamSystem fork = system.fork(new Option[] { systemPackage("org.ops4j.pax.exam.container.eclipse;version=" + skipSnapshotFlag(Info.getPaxExamVersion())), systemPackage( "org.ops4j.pax.exam;version=" + skipSnapshotFlag(Info.getPaxExamVersion())), systemPackage( "org.ops4j.pax.exam.options;version=" + skipSnapshotFlag(Info.getPaxExamVersion())), systemPackage( "org.ops4j.pax.exam.util;version=" + skipSnapshotFlag(Info.getPaxExamVersion())), systemProperty("java.protocol.handler.pkgs").value("org.ops4j.pax.url"), application.getProduct().getLauncher().getProvision().asOption() fork.getTempFolder()); Map<String, String> initialProperties = createFrameworkProperties(fork, setLocationProperties(createEclipseDefaults(), layout)); try { layout.create(); for (CopyFilesOption option : fork.getOptions(CopyFilesOption.class)) { option.copyTo(layout);
/** * 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) ); }