use of org.apache.felix.ipojo.ComponentInstance in project felix by apache.
the class TestCallbacks method testWithOnePairForTwoService.
@Test
public void testWithOnePairForTwoService() {
ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Callbacks-both-1");
// Controller set to true.
osgiHelper.waitForService(FooService.class.getName(), null, 5000);
osgiHelper.waitForService(CheckService.class.getName(), null, 5000);
CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);
assertNotNull(check);
Integer reg = (Integer) check.getProps().get("registered");
Integer unreg = (Integer) check.getProps().get("unregistered");
assertNotNull(reg);
assertNotNull(unreg);
assertEquals(new Integer(2), reg);
assertEquals(new Integer(0), unreg);
ci.stop();
reg = (Integer) check.getProps().get("registered");
unreg = (Integer) check.getProps().get("unregistered");
assertEquals(new Integer(2), reg);
assertEquals(new Integer(2), unreg);
}
use of org.apache.felix.ipojo.ComponentInstance in project felix by apache.
the class TestInheritedClasses method testIP12.
@Test
public void testIP12() {
ComponentInstance ci = ipojoHelper.createComponentInstance(pi12.getName(), "ci");
ServiceReference ref3 = ipojoHelper.getServiceReferenceByName(ParentInterface2.class.getName(), "ci");
assertNotNull("Check Parent2", ref3);
ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");
assertNotNull("Check PP", ref4);
ci.dispose();
}
use of org.apache.felix.ipojo.ComponentInstance in project felix by apache.
the class TestInheritedClasses method testIP3.
@Test
public void testIP3() {
ComponentInstance ci = ipojoHelper.createComponentInstance(pi3.getName(), "ci");
ServiceReference ref1 = ipojoHelper.getServiceReferenceByName(ChildInterface.class.getName(), "ci");
assertNotNull("Check Child", ref1);
ServiceReference ref2 = ipojoHelper.getServiceReferenceByName(ParentInterface1.class.getName(), "ci");
assertNotNull("Check Parent1", ref2);
ServiceReference ref3 = ipojoHelper.getServiceReferenceByName(ParentInterface2.class.getName(), "ci");
assertNotNull("Check Parent2", ref3);
ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");
assertNotNull("Check PP", ref4);
ServiceReference ref5 = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "ci");
assertNotNull("Check FS", ref5);
ci.dispose();
}
use of org.apache.felix.ipojo.ComponentInstance in project felix by apache.
the class TestInheritedClasses method testIP11.
@Test
public void testIP11() {
ComponentInstance ci = ipojoHelper.createComponentInstance(pi11.getName(), "ci");
ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");
assertNotNull("Check PP", ref4);
ci.dispose();
}
use of org.apache.felix.ipojo.ComponentInstance in project felix by apache.
the class TestInheritedClasses method testIP21.
@Test
public void testIP21() {
ComponentInstance ci = ipojoHelper.createComponentInstance(pi21.getName(), "ci");
ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");
assertNotNull("Check PP", ref4);
ci.dispose();
}
Aggregations