use of org.apache.felix.scr.integration.components.SimpleService2Impl in project felix by apache.
the class ServiceBindTest method test_multi_service_bind_unbind_order.
@Test
public void test_multi_service_bind_unbind_order() throws Exception {
final SimpleServiceImpl srv1 = SimpleServiceImpl.create(bundleContext, "srv1");
final SimpleService2Impl srv2 = SimpleService2Impl.create(bundleContext, "srv2");
String name = "test_multi_service_bind_unbind_order";
ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(name, ComponentConfigurationDTO.ACTIVE);
final SimpleComponent2 comp10 = SimpleComponent2.INSTANCE;
TestCase.assertNotNull(comp10);
TestCase.assertEquals(2, comp10.getBindings().size());
TestCase.assertEquals("bindSimpleService", comp10.getBindings().get(0));
TestCase.assertEquals("bindSimpleService2", comp10.getBindings().get(1));
disableAndCheck(cc);
delay();
TestCase.assertEquals(4, comp10.getBindings().size());
TestCase.assertEquals("bindSimpleService", comp10.getBindings().get(0));
TestCase.assertEquals("bindSimpleService2", comp10.getBindings().get(1));
TestCase.assertEquals("unbindSimpleService2", comp10.getBindings().get(2));
TestCase.assertEquals("unbindSimpleService", comp10.getBindings().get(3));
srv1.drop();
srv2.drop();
}
use of org.apache.felix.scr.integration.components.SimpleService2Impl in project felix by apache.
the class ServiceBindGreedyTest method test_multi_service_bind_unbind_order.
@Test
public void test_multi_service_bind_unbind_order() throws Exception {
final SimpleServiceImpl srv1 = SimpleServiceImpl.create(bundleContext, "srv1");
final SimpleService2Impl srv2 = SimpleService2Impl.create(bundleContext, "srv2");
String name = "test_multi_service_bind_unbind_order";
ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(name, ComponentConfigurationDTO.ACTIVE);
final SimpleComponent2 comp10 = SimpleComponent2.INSTANCE;
TestCase.assertNotNull(comp10);
TestCase.assertEquals(2, comp10.getBindings().size());
TestCase.assertEquals("bindSimpleService", comp10.getBindings().get(0));
TestCase.assertEquals("bindSimpleService2", comp10.getBindings().get(1));
disableAndCheck(cc);
delay();
TestCase.assertEquals(4, comp10.getBindings().size());
TestCase.assertEquals("bindSimpleService", comp10.getBindings().get(0));
TestCase.assertEquals("bindSimpleService2", comp10.getBindings().get(1));
TestCase.assertEquals("unbindSimpleService2", comp10.getBindings().get(2));
TestCase.assertEquals("unbindSimpleService", comp10.getBindings().get(3));
srv1.drop();
srv2.drop();
}
Aggregations