Examples of installBundle()


Examples of org.osgi.framework.BundleContext.installBundle()

        expect(installedBundle1.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();
        expect(installedBundle2.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();

        // Installs feature f1 and f2
        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(eq(bundle1), isA(InputStream.class))).andReturn(installedBundle1);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);

        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);

        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(eq(bundle2), isA(InputStream.class))).andReturn(installedBundle2);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        installedBundle2.start();
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

        expect(installedBundle1.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();
        expect(installedBundle2.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();

        // Installs feature f1 and f2
        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(eq(bundle1), isA(InputStream.class))).andReturn(installedBundle1);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        installedBundle1.uninstall();
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

        expect(installedBundle1.getBundleId()).andReturn(12345L);
        expect(installedBundle1.getBundleId()).andReturn(12345L);
        installedBundle1.uninstall();

        expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
        expect(bundleContext.installBundle(eq(bundle2), isA(InputStream.class))).andReturn(installedBundle2);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        installedBundle2.uninstall();
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

        expect(installedBundle1.getSymbolicName()).andReturn(headers.get(Constants.BUNDLE_SYMBOLICNAME)).anyTimes();
        expect(installedBundle1.getHeaders()).andReturn(headers).anyTimes();
        expect(bundleContext.getBundles()).andReturn(new Bundle[] { installedBundle1 });
        expect(bundleContext.getBundles()).andReturn(new Bundle[] { installedBundle1 });

        expect(bundleContext.installBundle(eq(bundle2), isA(InputStream.class))).andReturn(installedBundle2);
        expect(bundleContext.getBundles()).andReturn(new Bundle[] { installedBundle1, installedBundle2 });
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getBundleId()).andReturn(54321L);
        expect(installedBundle2.getSymbolicName()).andReturn("fragment").anyTimes();
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

    public static void setUpBeforeClass() throws Exception {
        host = new TestEquinoxHost();
        BundleContext context = host.start();

        InputStream is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle.jar");
        testBundle = context.installBundle("test-bundle", is);
        is.close();
        discoverer = new EquinoxServiceDiscoverer(context);
        File dep = new File("target/bundles");
        List<Bundle> bundles = new ArrayList<Bundle>();
        for (File f : dep.listFiles()) {
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

                bis.close();
                continue;
            }
            bis.close();
            bis = new BufferedInputStream(new FileInputStream(f));
            Bundle b = context.installBundle(f.getName(), bis);
            System.out.println("Installed "+b.getSymbolicName() + " [" + getState(b) + "]");
            bundles.add(b);
            bis.close();
        }
        for (Bundle b : bundles) {
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

          try {
            String fileUriBase = "file://";
            if (File.separator.equals("\\")) {
              fileUriBase = "file:///";
            }
            Bundle bundle = bundleContext.installBundle(fileUriBase + artifact.getFile().getAbsolutePath());
            installedBundles.add(bundle);
            if (artifact.getFile().getAbsolutePath().indexOf("triax") > 0) {
              bundle.start();
            }
            log.debug("Installed: " + bundle);
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

        File testBundle = new File("./target/bundle.jar");
        String location = testBundle.toURI().normalize().toString();

        BundleContext context = papoose.getSystemBundleContext();

        Bundle bundle = context.installBundle(location);

        Assert.assertEquals(1, bundle.getBundleId());

        Assert.assertEquals(location, bundle.getLocation());
View Full Code Here

Examples of org.osgi.framework.BundleContext.installBundle()

        framework.init();

        Bundle systemBundle = framework.getBundleContext().getBundle(0);
        BundleContext context = systemBundle.getBundleContext();

        Bundle testBundle = context.installBundle(location);

        long testBundleId = testBundle.getBundleId();

        assertTrue(testBundleId > 0);
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.