assertNotNull(jarMD);
EnterpriseBeanMetaData beanMD = jarMD.getEnterpriseBean("MyStatelessBean");
assertNotNull(beanMD);
assertEquals(true, beanMD.isSession());
assertTrue(beanMD instanceof SessionBeanMetaData);
SessionBeanMetaData sbeanMD = (SessionBeanMetaData) beanMD;
assertEquals(SessionType.Stateless, sbeanMD.getSessionType());
AnnotatedEJBReferencesMetaData aejbRefs = sbeanMD.getAnnotatedEjbReferences();
assertNotNull(aejbRefs);
assertEquals(2, aejbRefs.size());
getLog().debug(aejbRefs);
AnnotatedEJBReferenceMetaData injectedField = aejbRefs.get("injectedField");
assertNotNull(injectedField);
assertEquals(MyStatelessLocal.class, injectedField.getBeanInterface());
ResourceReferencesMetaData resRefs = sbeanMD.getResourceReferences();
//
assertEquals(3, resRefs.size());
ResourceReferenceMetaData homePageRef = resRefs.get(MyStatelessBean.class.getName() + "/homePage");
assertNotNull(homePageRef);
assertEquals("java.net.URL", homePageRef.getType());
Set<ResourceInjectionTargetMetaData> homePageRefTargets = homePageRef.getInjectionTargets();
assertEquals(1, homePageRefTargets.size());
ResourceInjectionTargetMetaData homePageRefTarget = homePageRefTargets.iterator().next();
assertEquals("org.jboss.test.metadata.annotation.ejb3.MyStatelessBean", homePageRefTarget.getInjectionTargetClass());
assertEquals("setHomePage", homePageRefTarget.getInjectionTargetName());
ResourceReferenceMetaData googleHome = resRefs.get("googleHome");
assertNotNull(googleHome);
assertEquals("java.net.URL", googleHome.getType());
assertEquals("http://www.google.com", googleHome.getMappedName());
ResourceReferenceMetaData defaultDS = resRefs.get("jdbc/ds");
assertNotNull(defaultDS);
assertEquals("javax.sql.DataSource", defaultDS.getType());
assertEquals("java:/DefaultDS", defaultDS.getMappedName());
ResourceEnvironmentReferencesMetaData resEnvRefs = sbeanMD.getResourceEnvironmentReferences();
assertEquals(1, resEnvRefs.size());
ResourceEnvironmentReferenceMetaData contextRef = resEnvRefs.get(sbeanMD.getEjbClass() + "/context");
assertNotNull(contextRef);
assertEquals("javax.ejb.SessionContext", contextRef.getType());
Set<ResourceInjectionTargetMetaData> contextRefTargets = contextRef.getInjectionTargets();
assertEquals(1, contextRefTargets.size());
ResourceInjectionTargetMetaData contextRefTarget = contextRefTargets.iterator().next();
assertEquals("org.jboss.test.metadata.annotation.ejb3.MyStatelessBean", contextRefTarget.getInjectionTargetClass());
assertEquals("context", contextRefTarget.getInjectionTargetName());
EnvironmentEntriesMetaData envEntries = sbeanMD.getEnvironmentEntries();
assertEquals(2, envEntries.size());
EnvironmentEntryMetaData pi = envEntries.get(sbeanMD.getEjbClass() + "/pi");
assertEquals("3.14159", pi.getValue());
// TODO: should this be java.lang.Double?
assertEquals("double", pi.getType());
MessageDestinationReferencesMetaData msgRefs = sbeanMD.getMessageDestinationReferences();
assertEquals(1, msgRefs.size());
MessageDestinationReferenceMetaData mailQueue = msgRefs.get(sbeanMD.getEjbClass() + "/mailQueue");
assertNotNull(mailQueue);
assertEquals("javax.jms.Queue", mailQueue.getType());
}