Examples of TinyBundle


Examples of org.ops4j.pax.tinybundles.core.TinyBundle

            mavenBundle("org.ops4j.pax.exam.samples", "pax-exam-sample9-pde", Info.getPaxExamVersion()),
            url(createFragmentBundle().toExternalForm()).noStart(), junitBundles(), cleanCaches());
    }

    private URL createFragmentBundle() {
        TinyBundle bundle = TinyBundles.bundle()
            .set(Constants.FRAGMENT_HOST, "org.ops4j.pax.exam.sample9.pde")
            .set(Constants.BUNDLE_MANIFESTVERSION, "2")
            .set(Constants.BUNDLE_SYMBOLICNAME, "org.ops4j.pax.exam.sample9.fragment")
            .add("messages.properties", getClass().getResource("/messages.properties"));

        try {
            Store<InputStream> store = StoreFactory.anonymousStore();
            Handle handle = store.store(bundle.build());
            return store.getLocation(handle).toURL();
        }
        catch (IOException e) {
            throw new TestContainerException(e);
        }
View Full Code Here

Examples of org.ops4j.pax.tinybundles.core.TinyBundle

        }
        catch (IOException e) {
            throw new TestContainerException("Writing object data failed", e);
        }
        ByteArrayInputStream stream = new ByteArrayInputStream(outputStream.toByteArray());
        TinyBundle bundle = TinyBundles.bundle();
        bundle.add(ConfigurationOptionConfigurationListener.class);
        bundle.add(ConfigurationOptionActivator.class).add("override.obj", stream);
        bundle
            .set(Constants.BUNDLE_SYMBOLICNAME, "PAXExamConfigurationOption-" + UUID.randomUUID());
        bundle.set(Constants.IMPORT_PACKAGE,
            "org.osgi.framework,org.osgi.service.cm,org.osgi.util.tracker,org.slf4j");
        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);
    }
View Full Code Here

Examples of org.ops4j.pax.tinybundles.core.TinyBundle

            throw new TestContainerException("No tests added to setup!");
        }

        constructProbeTag(extraProperties);
        try {
            TinyBundle bundle = prepareProbeBundle(createExtraIgnores());
            return new DefaultTestProbeProvider(getTests(), store, store.store(bundle
                .build(withClassicBuilder())));

        }
        catch (IOException e) {
            throw new TestContainerException(e);
View Full Code Here

Examples of org.ops4j.pax.tinybundles.core.TinyBundle

            throw new TestContainerException(e);
        }
    }

    private TinyBundle prepareProbeBundle(Properties p) throws IOException {
        TinyBundle bundle = bundle(store).set(Constants.DYNAMICIMPORT_PACKAGE, "*");

        bundle.set(Constants.BUNDLE_SYMBOLICNAME, "");
        bundle.set(Constants.BUNDLE_MANIFESTVERSION, "2");
        for (Object key : extraProperties.keySet()) {
            bundle.set((String) key, (String) extraProperties.get(key));
        }
        for (Object key : p.keySet()) {
            bundle.set((String) key, (String) p.get(key));
        }

        Map<String, URL> map = collectResources();
        for (String item : map.keySet()) {
            bundle.add(item, map.get(item));
        }
        return bundle;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.