{
VirtualFile ear = createBasicEar();
VFSDeploymentUnit topUnit = assertDeploy(ear);
try
{
WeldDiscoveryEnvironment wbDiscovery = topUnit.getAttachment(WeldDiscoveryEnvironment.class);
assertNotNull("Null WBDiscoveryEnv.", wbDiscovery);
Set<String> expected = new HashSet<String>();
addExpectedResource(expected, "ejbs.jar");
addExpectedResource(expected, "ext.jar");
addExpectedResource(expected, "simple.jar");
addExpectedResource(expected, "ui.jar");
addExpectedResource(expected, "crm.jar");
addExpectedResource(expected, "simple.war", "/WEB-INF/beans.xml");
assertNotNull(wbDiscovery);
for (URL url : wbDiscovery.getWeldXml())
{
boolean found = false;
Iterator<String> iter = expected.iterator();
while (iter.hasNext())
{
String expectedURL = iter.next();
if (url.toExternalForm().contains(expectedURL))
{
iter.remove();
found = true;
break;
}
}
assertTrue("Unexpected wb url: " + url, found);
}
assertEmpty("Should be emtpy, missing " + expected, expected);
addExpectedClass(expected, BusinessInterface.class);
addExpectedClass(expected, MySLSBean.class);
addExpectedClass(expected, ExternalWebBean.class);
addExpectedClass(expected, PlainJavaBean.class);
addExpectedClass(expected, UIWebBean.class);
addExpectedClass(expected, ServletWebBean.class);
addExpectedClass(expected, CrmWebBean.class);
for (String className : wbDiscovery.getWeldClasses())
assertTrue(expected.remove(className));
assertEmpty("Should be emtpy, missing " + expected, expected);
}
finally