Package org.osgi.framework

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


    {
        // 1. Bundle registers service with pid1
        final String pid = "test_two_bundles_one_pid";
        final Bundle bundleA = installBundle( pid, ManagedServiceTestActivator.class );
        final String locationA = bundleA.getLocation();
        bundleA.start();
        delay();

        // call back with null
        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNull( tester.props );
View Full Code Here


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

        // 5. Start BundleA
        bundleA.start();
        delay();

        // ==> call back with the prop.
        final ManagedServiceTestActivator tester2 = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( tester2.props );
View Full Code Here

        // Test 2

        // 8. BundleA registers ManagedService with pid1.
        final Bundle bundleA2 = installBundle( pid, ManagedServiceTestActivator.class );
        final String locationA2 = bundleA.getLocation();
        bundleA2.start();
        delay();

        // call back with null
        final ManagedServiceTestActivator tester21 = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNull( tester21.props );
View Full Code Here

        final String locationA = "test:location/A/" + pid;
        final Configuration config = configure( pid, locationA, true );

        // 3. register ManagedService ms1 with pid from said locationA
        final Bundle bundleA = installBundle( pid, ManagedServiceTestActivator.class, locationA );
        bundleA.start();
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceTestActivator testerA1 = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( testerA1.props );
View Full Code Here

        TestCase.assertEquals( 1, testerA1.numManagedServiceUpdatedCalls );

        // 4. register ManagedService ms2 with pid from locationB
        final String locationB = "test:location/B/" + pid;
        final Bundle bundleB = installBundle( pid, ManagedServiceTestActivator2.class, locationB );
        bundleB.start();
        delay();

        // ==> invisible configuration supplied as null to service ms2
        final ManagedServiceTestActivator2 testerB1 = ManagedServiceTestActivator2.INSTANCE;
        TestCase.assertNull( testerB1.props );
View Full Code Here

        final String locationA = "test:location/A/" + pid;
        final Configuration config = configure( pid, null, true );

        // 3. register ManagedService ms1 with pid from locationA
        final Bundle bundleA = installBundle( pid, ManagedServiceTestActivator.class, locationA );
        bundleA.start();
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceTestActivator testerA1 = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( testerA1.props );
View Full Code Here

        TestCase.assertEquals( locationA, config.getBundleLocation() );

        // 4. register ManagedService ms2 with pid from locationB
        final String locationB = "test:location/B/" + pid;
        final Bundle bundleB = installBundle( pid, ManagedServiceTestActivator2.class, locationB );
        bundleB.start();
        delay();

        // ==> invisible configuration supplied as null to service ms2
        final ManagedServiceTestActivator2 testerB1 = ManagedServiceTestActivator2.INSTANCE;
        TestCase.assertNull( testerB1.props );
View Full Code Here

        final Configuration config = createFactoryConfiguration( factoryPid, locationA, true );
        final String pid = config.getPid();

        // 3. register ManagedService ms1 with pid from said locationA
        final Bundle bundleA = installBundle( factoryPid, ManagedServiceFactoryTestActivator.class, locationA );
        bundleA.start();
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceFactoryTestActivator testerA1 = ManagedServiceFactoryTestActivator.INSTANCE;
        TestCase.assertNotNull( testerA1.configs.get( pid ) );
View Full Code Here

        TestCase.assertEquals( 1, testerA1.numManagedServiceFactoryUpdatedCalls );

        // 4. register ManagedService ms2 with pid from locationB
        final String locationB = "test:location/B/" + factoryPid;
        final Bundle bundleB = installBundle( factoryPid, ManagedServiceFactoryTestActivator2.class, locationB );
        bundleB.start();
        delay();

        // ==> configuration not supplied to service ms2
        final ManagedServiceFactoryTestActivator2 testerB1 = ManagedServiceFactoryTestActivator2.INSTANCE;
        TestCase.assertNull( testerB1.configs.get( pid ));
View Full Code Here

        TestCase.assertNull( config.getBundleLocation() );

        // 3. register ManagedService ms1 with pid from said locationA
        final Bundle bundleA = installBundle( factoryPid, ManagedServiceFactoryTestActivator.class, locationA );
        bundleA.start();
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceFactoryTestActivator testerA1 = ManagedServiceFactoryTestActivator.INSTANCE;
        TestCase.assertNotNull( testerA1.configs.get( pid ) );
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.