if(artifact.getURI().toString().equals("WEB-INF/web.composite")) {
Composite composite = (Composite)artifact.getModel();
Assert.assertEquals("Number of components", 1, composite.getComponents().size());
Component component = composite.getComponents().get(0);
Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
WebImplementation webImpl = (WebImplementation) component.getImplementation();
Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
List<String> referenceNames = new ArrayList<String>();
referenceNames.add("name1");
referenceNames.add("sample.HelloworldEjbServlet_service");
for(Reference ref : webImpl.getReferences()) {
Assert.assertTrue(referenceNames.contains(ref.getName()));
}
}
}
List<Composite> deployables = contribution.getDeployables();
Assert.assertEquals("Deployable composites", 1, deployables.size());
Composite composite = deployables.get(0);
Assert.assertEquals("Number of components", 1, composite.getComponents().size());
Component component = composite.getComponents().get(0);
Assert.assertTrue("Component with implementation.web", component.getImplementation() instanceof WebImplementation);
WebImplementation webImpl = (WebImplementation) component.getImplementation();
Assert.assertEquals("Number of reference", 2, webImpl.getReferences().size());
List<String> referenceNames = new ArrayList<String>();
referenceNames.add("name1");
referenceNames.add("sample.HelloworldEjbServlet_service");
for(Reference ref : webImpl.getReferences()) {
Assert.assertTrue(referenceNames.contains(ref.getName()));
}
}