use of org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.ServiceInterface2 in project sling by apache.
the class MockBundleContextDynamicReferencesTest method testAddRemoveMandatoryMultipleService.
@Test
public void testAddRemoveMandatoryMultipleService() {
ServiceRegistration reg2b = bundleContext.registerService(ServiceInterface2.class.getName(), dependency2b, null);
assertDependencies2(dependency2a, dependency2b);
reg2b.unregister();
assertDependencies2(dependency2a);
// in real OSGi this should fail - but this is not covered by the current implementation. so test the real implementation here.
reg2a.unregister();
assertDependencies2();
}
use of org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.ServiceInterface2 in project sling by apache.
the class MockBundleContextStaticGreedyReferencesTest method testAddRemoveMandatoryMultipleService_FailReg2aUnregister.
@Test(expected = ReferenceViolationException.class)
public void testAddRemoveMandatoryMultipleService_FailReg2aUnregister() {
ServiceRegistration reg2b = bundleContext.registerService(ServiceInterface2.class.getName(), dependency2b, null);
assertDependencies2(dependency2a, dependency2b);
reg2b.unregister();
assertDependencies2(dependency2a);
// this should fail
reg2a.unregister();
}
use of org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.ServiceInterface2 in project sling by apache.
the class MockBundleContextStaticGreedyReferencesTest method testAddRemoveMandatoryMultipleService.
@Test
public void testAddRemoveMandatoryMultipleService() {
ServiceRegistration reg2b = bundleContext.registerService(ServiceInterface2.class.getName(), dependency2b, null);
assertDependencies2(dependency2a, dependency2b);
reg2b.unregister();
assertDependencies2(dependency2a);
}
use of org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.ServiceInterface2 in project sling by apache.
the class MockBundleContextDynamicReferencesOsgiR6Test method testAddRemoveMandatoryMultipleService.
@Test
public void testAddRemoveMandatoryMultipleService() {
ServiceRegistration reg2b = bundleContext.registerService(ServiceInterface2.class.getName(), dependency2b, null);
assertDependencies2(dependency2a, dependency2b);
reg2b.unregister();
assertDependencies2(dependency2a);
// in real OSGi this should fail - but this is not covered by the current implementation. so test the real implementation here.
reg2a.unregister();
assertDependencies2();
}
Aggregations