@Configuration public Option[] uberJarWithJdkServiceLoading() { return options( frameworkProperty(OSGI_LOADING).value("false"), gradleBundle("org.ehcache:dist"), baseConfiguration("OffHeapOsgiTest", "uberJarWithJdkServiceLoading") ); }
/** * Creates a {@link FrameworkPropertyOption}. * * @param key * framework property key * * @return framework property option */ public static FrameworkPropertyOption frameworkProperty(final String key) { return new FrameworkPropertyOption(key); }
private Map<String, Object> createFrameworkProperties() throws IOException { final Map<String, Object> p = new HashMap<String, Object>(); p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); SystemPackageOption[] systemPackageOptions = system.getOptions(SystemPackageOption.class); if (systemPackageOptions.length > 0) { p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, join(systemPackageOptions)); } p.put(FRAMEWORK_BOOTDELEGATION, join(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), option.getValue()); } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } return p; }
@Configuration public Option[] uberJarWithJdkServiceLoading() { return options( frameworkProperty(OSGI_LOADING).value("false"), gradleBundle("org.ehcache:dist"), baseConfiguration("SimpleOsgiTest", "uberJarWithJdkServiceLoading") ); }
private Map<String, String> createFrameworkProperties() throws ExamConfigurationException { final Map<String, String> p = new HashMap<>(); CleanCachesOption cleanCaches = system.getOption(CleanCachesOption.class); if (cleanCaches != null && cleanCaches.getValue() != null && cleanCaches.getValue()) { p.put(FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); } p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, join(system.getOptions(SystemPackageOption.class))); p.put(FRAMEWORK_BOOTDELEGATION, join(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), (String) option.getValue()); } if (LOG.isDebugEnabled()) { logFrameworkProperties(p); } return p; }
/** * Creates a {@link FrameworkPropertyOption}. * * @param key * framework property key * * @return framework property option */ public static FrameworkPropertyOption frameworkProperty(final String key) { return new FrameworkPropertyOption(key); }
private static void parseConfigIni(InputStream stream, List<Option> options, EclipseBundleSource bundleSource, URL baseUrl) throws IOException { Properties properties = new Properties(); properties.load(stream); Set<String> names = properties.stringPropertyNames(); for (String key : names) { if ("osgi.framework".equals(key)) { // ignore framework setting since we start the framework ourself, and Eclipse can // throw exceptions when using relative path here see // https://bugs.eclipse.org/bugs/show_bug.cgi?id=527175 continue; } String value = properties.getProperty(key); if ("org.eclipse.equinox.simpleconfigurator.configUrl".equals(key)) { URL url = new URL(baseUrl, value); parseSimpleConfigurator(url.openStream(), options, bundleSource); value = value + ".disabled"; } options.add(CoreOptions.frameworkProperty(key).value(value)); } }
private Map<String, String> createFrameworkProperties() throws IOException { final Map<String, String> p = new HashMap<String, String>(); CleanCachesOption cleanCaches = system.getSingleOption(CleanCachesOption.class); if (cleanCaches != null && cleanCaches.getValue() != null && cleanCaches.getValue()) { p.put(FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); } p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, buildString(system.getOptions(SystemPackageOption.class))); p.put(FRAMEWORK_BOOTDELEGATION, buildString(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), (String) option.getValue()); } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } String repositories = buildString(system.getOptions(RepositoryOption.class)); if (!repositories.isEmpty()) { System.setProperty("org.ops4j.pax.url.mvn.repositories", repositories); } return p; }
@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.frameworkProperty(Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA).value("osgi.contract;osgi.contract=\"JavaServlet\";version:Version=\"3.1\""), // 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(), }; }
/** * 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) ); }
@Override public EclipseApplicationOption ignoreApp() { provision.option(CoreOptions.frameworkProperty("eclipse.ignoreApp").value(true)); return product(null).application(null); }
@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 static Option paxCdiWithWeldBundles() { 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.weld"), // there is a classloader conflict when adding this dep to the POM mavenBundle("org.ops4j.pax.cdi", "pax-cdi-undertow-weld", PAX_CDI_VERSION), mavenBundle("com.google.guava", "guava", "13.0.1"), mavenBundle("org.jboss.weld", "weld-osgi-bundle", "2.2.8.Final")); }
frameworkProperty("felix.bootdelegation.implicit").value("false"));
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")); }
bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")), , frameworkProperty("org.osgi.framework.system.packages.extra").value("sun.misc"), // when(localRepo.length() > 0).useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo))
bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")), , frameworkProperty("org.osgi.framework.system.packages.extra").value("sun.misc"), // when(localRepo.length() > 0).useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo))