fail("Cannot instantiate under : " + e.getMessage());
}
ServiceReference ref = ipojoHelper.getServiceReferenceByName( Architecture.class.getName(), "under");
assertNotNull("Check architecture availability", ref);
Architecture arch = (Architecture) getContext().getService(ref);
assertNotNull("Check architecture", arch);
CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();
assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
InstanceDescription[] contained = id.getContainedInstances();
assertNotNull("Check contained not null", contained);
assertEquals("Check contained instances count ("+contained.length+") - 1", contained.length, 1);
assertEquals("Check instance name" , id.getName(), "under");