private Option getComponentUnderTestOptions() { String componentArtifactId = System.getProperty("component.artifactId"); String componentVersion = System.getProperty("component.version"); String bundleJarName = String.format("%s-%s.jar", componentArtifactId, componentVersion); String bundleJarUrl = Paths.get(PathUtils.getBaseDir(), "target", bundleJarName).toUri().toString(); LOGGER.info("Component under test artifact name: {}", bundleJarUrl); return bundle(bundleJarUrl).start(); } }
public static Option projectToOption(ProjectParser context, ProvisionControl<?> control) throws IOException { byte[] byteArray = projectToByteArray(context); UrlProvisionOption bundle = CoreOptions.streamBundle(new ByteArrayInputStream(byteArray)); if (control != null) { bundle.startLevel(control.getStartLevel()); bundle.start(control.shouldStart()); bundle.update(control.shouldUpdate()); } return bundle; }
@Override protected Option toOption() { UrlProvisionOption bundle = CoreOptions .bundle(getBundleInfo().getContext().getAbsolutePath()); bundle.startLevel(getStartLevel()); bundle.start(shouldStart()); bundle.update(shouldUpdate()); return bundle; }
@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(), }; }
@Override protected Option toOption() { URL url = getBundleInfo().getContext().getUrl(); File cacheFile = P2Cache.getCacheFile(url); UrlProvisionOption bundle; if (cacheFile.exists()) { bundle = CoreOptions.bundle(cacheFile.toURI().toASCIIString()); } else { bundle = CoreOptions.bundle(url.toExternalForm()); } bundle.startLevel(getStartLevel()); bundle.start(shouldStart()); bundle.update(shouldUpdate()); return bundle; }
@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(), }; }
bundle.set(Constants.BUNDLE_ACTIVATOR, ConfigurationOptionActivator.class.getName()); bundle.set(Constants.BUNDLE_MANIFESTVERSION, "2"); return CoreOptions.streamBundle(bundle.build()).startLevel(1).start(true).update(false);
linkBundle("org.talend.daikon-daikon-bundle"), // linkBundle("org.talend.daikon-daikon-tests").noStart(), // linkBundle("org.talend.components-components-api-service-osgi").start(), // linkBundle("org.talend.components-components-api-service-osgi-tests").noStart(), // linkBundle("org.talend.components-components-api-bundle"), //
bundle.set(Constants.BUNDLE_ACTIVATOR, ConfigurationOptionActivator.class.getName()); bundle.set(Constants.BUNDLE_MANIFESTVERSION, "2"); return CoreOptions.streamBundle(bundle.build()).startLevel(1).start(true).update(false);
linkBundle("org.talend.daikon-daikon-bundle"), // linkBundle("org.talend.daikon-daikon-tests").noStart(), // linkBundle("org.talend.components-components-api-service-osgi").start(), // linkBundle("org.talend.components-components-api-service-osgi-tests").noStart(), // linkBundle("org.talend.components-components-api-bundle"), //