Examples of ManagedServiceTestActivator


Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        // register ManagedService ms1 with pid from said locationA
        bundle = installBundle( pid0, ManagedServiceTestActivator.class );
        bundle.start();
        delay();

        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( tester.props );
        TestCase.assertEquals( pid0, tester.props.get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
        TestCase.assertEquals( PROP_NAME, tester.props.get( PROP_NAME ) );
        TestCase.assertEquals( 1, tester.numManagedServiceUpdatedCalls );

        // change ManagedService PID
        tester.changePid( pid1 );
        delay();

        TestCase.assertNotNull( tester.props );
        TestCase.assertEquals( pid1, tester.props.get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        // register ManagedService ms1 with pid from said locationA
        bundle = installBundle( pid0 + "," + pid1, ManagedServiceTestActivator.class );
        bundle.start();
        delay();

        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( tester.props );

        TestCase.assertEquals( pid0, tester.configs.get( pid0 ).get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.configs.get( pid0 ).get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
        TestCase.assertNull( tester.configs.get( pid0 ).get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
        TestCase.assertEquals( PROP_NAME, tester.configs.get( pid0 ).get( PROP_NAME ) );

        TestCase.assertEquals( pid1, tester.configs.get( pid1 ).get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.configs.get( pid1 ).get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
        TestCase.assertNull( tester.configs.get( pid1 ).get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
        TestCase.assertEquals( PROP_NAME, tester.configs.get( pid1 ).get( PROP_NAME ) );

        // two pids, two calls
        TestCase.assertEquals( 2, tester.numManagedServiceUpdatedCalls );

        // change ManagedService PID
        tester.changePid( pid1 + "," + pid2 );
        delay();

        TestCase.assertNotNull( tester.props );

        // config pid0 is not "removed"
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

            bundle2.start();

            // give cm time for distribution
            delay();

            final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
            TestCase.assertNotNull( "Activator not started !!", tester );

            final ManagedServiceTestActivator2 tester2 = ManagedServiceTestActivator2.INSTANCE;
            TestCase.assertNotNull( "Activator 2 not started !!", tester2 );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

            bundle.start();

            bundle2 = installBundle( pid, ManagedServiceTestActivator2.class );
            bundle2.start();

            final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
            TestCase.assertNotNull( "Activator not started !!", tester );

            final ManagedServiceTestActivator2 tester2 = ManagedServiceTestActivator2.INSTANCE;
            TestCase.assertNotNull( "Activator not started !!", tester2 );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        bundle.start();

        // give cm time for distribution
        delay();

        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( "Activator not started !!", tester );

        // assert activater has configuration (two calls, one per pid)
        TestCase.assertNotNull( "Expect Properties after Service Registration", tester.props );
        TestCase.assertEquals( "Expect a single update call", 2, tester.numManagedServiceUpdatedCalls );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        bundle.start();

        // give cm time for distribution
        delay();

        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( "Activator not started !!", tester );

        // assert activater has configuration (two calls, one per pid)
        TestCase.assertNotNull( "Expect Properties after Service Registration", tester.props );
        TestCase.assertEquals( "Expect a single update call", 2, tester.numManagedServiceUpdatedCalls );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        bundle = installBundle( pid, ManagedServiceTestActivator.class );
        bundle.start();
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( tester.props );
        TestCase.assertEquals( pid, tester.props.get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
        TestCase.assertEquals( PROP_NAME, tester.props.get( PROP_NAME ) );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        bundle = installBundle( pid, ManagedServiceTestActivator.class );
        bundle.start();
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( tester.props );
        TestCase.assertEquals( pid, tester.props.get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
        TestCase.assertEquals( PROP_NAME, tester.props.get( PROP_NAME ) );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        // 2. update config with properties
        final Configuration config = configure( pid, null, true );
        delay();

        // ==> configuration supplied to the service ms1
        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( tester.props );
        TestCase.assertEquals( pid, tester.props.get( Constants.SERVICE_PID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
        TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
        TestCase.assertEquals( PROP_NAME, tester.props.get( PROP_NAME ) );
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.ManagedServiceTestActivator

        String pid = "test_start_bundle_configure_stop_start_bundle";

        // start the bundle and assert this
        bundle = installBundle( pid );
        bundle.start();
        final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( "Activator not started !!", tester );

        // give cm time for distribution
        delay();

        // assert activater has no configuration
        TestCase.assertNull( "Expect no Properties after Service Registration", tester.props );
        TestCase.assertEquals( "Expect update call", 1, tester.numManagedServiceUpdatedCalls );

        // configure after ManagedServiceRegistration --> configure via update
        configure( pid );
        delay();

        // assert activater has configuration
        TestCase.assertNotNull( "Expect Properties after Service Registration", tester.props );
        TestCase.assertEquals( "Expect a second update call", 2, tester.numManagedServiceUpdatedCalls );

        // stop the bundle now
        bundle.stop();

        // assert INSTANCE is null
        TestCase.assertNull( ManagedServiceTestActivator.INSTANCE );

        delay();

        // start the bundle again (and check)
        bundle.start();
        final ManagedServiceTestActivator tester2 = ManagedServiceTestActivator.INSTANCE;
        TestCase.assertNotNull( "Activator not started the second time!!", tester2 );
        TestCase.assertNotSame( "Instances must not be the same", tester, tester2 );

        // give cm time for distribution
        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.