{MyServlet.class};
List<Class<?>> classes = Arrays.asList(webClasses);
System.out.println("Processing classes: " + classes);
//enableTrace("org.jboss.metadata.annotation.creator");
Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
Web25MetaData annotation = creator.create(classes);
assertTrue(annotation.is25());
//Now create the web meta data
WebMetaData xml = unmarshal("AnnotationWeb_testAnnotationXML.xml", WebMetaData.class);
//Create the JBossWebMetaData
JBossWebMetaData jbossWMD = unmarshal("JBossWeb_testAnnotationXML.xml", JBossWebMetaData.class);
//Let us merge the merged spec metadata with the jbossweb metadata
JBossWebMetaData mergedJBossWebMD = new JBossWebMetaData();
mergedJBossWebMD.merge(jbossWMD, xml);
//Assert the run as role
assertTrue(mergedJBossWebMD.getRunAsIdentity("MyServlet").getRoleName().startsWith("PLACEHOLDER"));
WebMetaData merged = new WebMetaData();
//Merge the annotation and xml
AnnotationMergedView.merge(merged, xml, annotation);
JBossWebMetaData newMerged = new JBossWebMetaData();
newMerged.merge(mergedJBossWebMD, merged);
//Assert the run as role
JBossServletMetaData jbossServletMetaData = newMerged.getServlets().get("MyServlet");
assertEquals("InternalUser", jbossServletMetaData.getRunAs().getRoleName());
assertEquals("javajoe", jbossServletMetaData.getRunAsPrincipal());
// @PostConstruct
assertEquals("setUp", merged.getPostConstructs().get(0).getMethodName());
// @PreDestroy
assertEquals("tearDown", merged.getPreDestroys().get(0).getMethodName());
assertAnnotationContext(creator.getAnnotationContext());
}