Package org.apache.felix.scr.integration.components

Examples of org.apache.felix.scr.integration.components.SimpleServiceImpl.drop()


        final SimpleComponent comp10 = SimpleComponent.INSTANCE;
        TestCase.assertNotNull( comp10 );
        TestCase.assertNull( comp10.m_singleRef );
        TestCase.assertTrue( comp10.m_multiRef.contains( srv1 ) );

        srv1.drop();
        delay(); // async reactivate

        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        final SimpleComponent comp11 = SimpleComponent.INSTANCE;
        TestCase.assertNotSame( comp10, comp11 );
View Full Code Here


        TestCase.assertFalse( comp22.m_multiRef.contains( srv2 ) );
        TestCase.assertTrue( comp22.m_multiRef.contains( srv3 ) );
        TestCase.assertTrue( comp22.m_multiRef.contains( srv4 ) );

        // drop srv4 again, expect rebind
        srv4.drop();
        delay();

        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        final SimpleComponent comp23 = SimpleComponent.INSTANCE;
        TestCase.assertNotSame( comp20, comp23 );
View Full Code Here

        final SimpleComponent comp10 = SimpleComponent.INSTANCE;
        TestCase.assertNotNull( comp10 );
        TestCase.assertNull( comp10.m_singleRef );
        TestCase.assertTrue( comp10.m_multiRef.contains( srv1 ) );

        srv1.drop();
        delay(); // async reactivate

        TestCase.assertEquals( Component.STATE_UNSATISFIED, component.getState() );
        final SimpleComponent comp11 = SimpleComponent.INSTANCE;
        TestCase.assertNull( comp11 );
View Full Code Here

        TestCase.assertFalse( comp22.m_multiRef.contains( srv2 ) );
        TestCase.assertTrue( comp22.m_multiRef.contains( srv3 ) );
        TestCase.assertTrue( comp22.m_multiRef.contains( srv4 ) );

        // drop srv4 again, expect greedy rebind
        srv4.drop();
        delay();

        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        final SimpleComponent comp23 = SimpleComponent.INSTANCE;
        TestCase.assertNotSame( comp20, comp23 );
View Full Code Here

        finally
        {
            theConfig.remove( targetProp );
            if ( service != null )
            {
                service.drop();
            }
        }
    }

    /**
 
View Full Code Here

            delay();

            //remove higher ranked service
            if (service2 != null)
            {
                service2.drop();
            }
             // same instance after reconfiguration
            TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
            TestCase.assertEquals( instance, SimpleComponent.INSTANCE );
            TestCase.assertEquals( PROP_NAME, SimpleComponent.INSTANCE.getProperty( PROP_NAME ) );
View Full Code Here

        {
//            Thread.sleep( 60000 );
            theConfig.remove( targetProp );
            if ( service != null )
            {
                service.drop();
            }
        }
    }

View Full Code Here

        srv1.update( "foo" );
        checkProperties( serviceReference, 5, null, "p1", "p2" );
        Assert.assertEquals("updated", serviceReference.getProperty("SimpleService"));

        srv1.drop();
        checkProperties( serviceReference, 5, null, "p1", "p2" );
        Assert.assertEquals("unbound", serviceReference.getProperty("SimpleService"));

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here

        final SimpleComponent comp10 = SimpleComponent.INSTANCE;
        TestCase.assertNotNull( comp10 );
        TestCase.assertEquals( srv1, comp10.m_singleRef );
        TestCase.assertTrue( comp10.m_multiRef.isEmpty() );

        srv1.drop();
        // no delay, should be immediate

        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        final SimpleComponent comp11 = SimpleComponent.INSTANCE;
        TestCase.assertSame( comp10, comp11 );
View Full Code Here

        TestCase.assertSame( comp20, comp22 );
        TestCase.assertEquals( srv3, comp22.m_singleRef );
        TestCase.assertTrue( comp22.m_multiRef.isEmpty() );

        // drop srv4 again, expect no rebind
        srv4.drop();
        delay();

        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        final SimpleComponent comp23 = SimpleComponent.INSTANCE;
        TestCase.assertSame( comp20, comp23 );
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.