{
AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
Collection<Class<?>> classes = PackageScanner.loadClasses();
WebMetaData metaData = creator.create(classes);
assertNotNull(metaData);
// @Ejb
AnnotatedEJBReferencesMetaData annotatedRefs = metaData.getAnnotatedEjbReferences();
assertNotNull(annotatedRefs);
assertEquals(2, annotatedRefs.size());
assertResourceInjectionMetaData(annotatedRefs);
// @Resource, @WebServiceRef
ServiceReferencesMetaData serviceRefs = metaData.getServiceReferences();
assertNotNull(serviceRefs);
// 3x WebServiceRef (using a different naming convetion)
assertEquals(4, serviceRefs.size());
// Only test the webService
assertInjectionTargets(serviceRefs.get("webService"), "webService");
// @Resource
EnvironmentEntriesMetaData envEntries = metaData.getEnvironmentEntries();
assertNotNull(envEntries);
assertResourceInjectionMetaData(envEntries);
assertEquals(1, envEntries.size());
// @Resource
ResourceReferencesMetaData resourceRefs = metaData.getResourceReferences();
assertNotNull(resourceRefs);
assertEquals(1, resourceRefs.size());
assertResourceInjectionMetaData(resourceRefs);
// @Resource
MessageDestinationReferencesMetaData messageRefs = metaData.getMessageDestinationReferences();
assertNotNull(messageRefs);
assertEquals(1, messageRefs.size());
assertResourceInjectionMetaData(messageRefs);
// @Resource
ResourceEnvironmentReferencesMetaData resourceEnvRefs = metaData.getResourceEnvironmentReferences();
assertNotNull(resourceEnvRefs);
assertEquals(1, resourceEnvRefs.size());
assertResourceInjectionMetaData(resourceEnvRefs);
// @PersistenceContext
PersistenceContextReferencesMetaData persistenceRefs = metaData.getPersistenceContextRefs();
assertNotNull(persistenceRefs);
assertEquals(1, persistenceRefs.size());
assertResourceInjectionMetaData(persistenceRefs);