Package org.osgi.framework

Examples of org.osgi.framework.Bundle.stop()


                catch (Exception ex)
                {
                }
                bundle2.start();
                new URL("test" + System.identityHashCode(bundle2) + ":").openConnection();
                bundle2.stop();
                try
                {
                    new URL("test" + System.identityHashCode(bundle2) + ":").openConnection();
                    throw new Exception("Unexpected url2 resolve");
                }
View Full Code Here


                    }
                }
            }.start();
            Thread.sleep(DELAY / 4);
            long t0 = System.currentTimeMillis();
            bundle.stop();
            long t1 = System.currentTimeMillis();

            assertEquals(Bundle.RESOLVED, bundle.getState());
            assertTrue((t1 - t0) > DELAY / 2);
View Full Code Here

            {
                public void run()
                {
                    try
                    {
                        bundle.stop();
                    }
                    catch (BundleException e)
                    {
                        e.printStackTrace();
                    }
View Full Code Here

        Class clazz1 = cl1.loadClass(URLHandlersTest.class.getName());

        clazz1.getMethod("testURLHandlers").invoke(clazz1.newInstance());

        bundle.stop();
        bundle.start();
        Class clazz2 = cl2.loadClass(URLHandlersTest.class.getName());

        clazz2.getMethod("testURLHandlers").invoke(clazz2.newInstance());
        bundle.stop();
View Full Code Here

        // ensure a freshly retrieved object also has the location
        final Configuration beforeUninstall = getConfiguration( pid );
        TestCase.assertEquals( beforeUninstall.getBundleLocation(), bundle.getLocation() );

        // stop cm bundle now before uninstalling configured bundle
        cmBundle.stop();
        delay();

        // assert configuration admin service is gone
        TestCase.assertNull( configAdminTracker.getService() );
View Full Code Here

        delay();
        configListener.assertEvents( ConfigurationEvent.CM_LOCATION_CHANGED, 1 );

        // restart CM bundle
        final Bundle cmBundle = getCmBundle();
        cmBundle.stop();
        delay();
        cmBundle.start();

        // assert configuration still bound
        final Configuration configAfterRestart = getConfiguration( pid );
View Full Code Here

        TestCase.assertNull( configAfterRestart.getBundleLocation() );
        delay();
        configListener.assertEvents( ConfigurationEvent.CM_LOCATION_CHANGED, 1 );

        // restart CM bundle
        cmBundle.stop();
        delay();
        cmBundle.start();

        // assert configuration unbound
        final Configuration configUnboundAfterRestart = getConfiguration( pid );
View Full Code Here

        delay();
        TestCase.assertEquals( location, config.getBundleLocation() );

        // restart CM bundle
        final Bundle cmBundle = getCmBundle();
        cmBundle.stop();
        delay();
        cmBundle.start();

        // assert configuration still bound
        final Configuration configAfterRestart = getConfiguration( pid );
View Full Code Here

        bundle.stop();
        delay();
        TestCase.assertEquals( location, configAfterRestart.getBundleLocation() );

        // restart CM bundle
        cmBundle.stop();
        delay();
        cmBundle.start();

        // assert configuration still bound
        final Configuration configBoundAfterRestart = getConfiguration( pid );
View Full Code Here

        // ==> call back with the prop.
        TestCase.assertNotNull( tester.props );
        TestCase.assertEquals( 2, tester.numManagedServiceUpdatedCalls );

        // 4. Stop BundleA
        bundleA.stop();
        delay();

        // 5. Start BundleA
        bundleA.start();
        delay();
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.