assertEquals(ResourceIF.class, resourceMethodBean.getBeanInterface());
assertEquals("ResourceOnMethodBean", resourceMethodBean.getLink());
Set<ResourceInjectionTargetMetaData> resourceMethodBeanTargets = resourceMethodBean.getInjectionTargets();
assertNotNull(resourceMethodBeanTargets);
assertEquals(1, resourceMethodBeanTargets.size());
ResourceInjectionTargetMetaData method = resourceMethodBeanTargets.iterator().next();
assertEquals(Client.class.getName(), method.getInjectionTargetClass());
assertEquals("setResourceMethodBean", method.getInjectionTargetName());
AnnotatedEJBReferenceMetaData resourceFieldBean = clientMD.getAnnotatedEjbReferences().get(classMainName + "/resourceFieldBean");
assertNotNull(resourceFieldBean);
assertEquals("ResourceOnFieldBean", resourceFieldBean.getLink());
Set<ResourceInjectionTargetMetaData> resourceFieldBeanTargets = resourceFieldBean.getInjectionTargets();
assertNotNull(resourceFieldBeanTargets);
assertEquals(1, resourceFieldBeanTargets.size());
ResourceInjectionTargetMetaData field = resourceFieldBeanTargets.iterator().next();
assertEquals(Client.class.getName(), field.getInjectionTargetClass());
assertEquals("resourceFieldBean", field.getInjectionTargetName());
AnnotatedEJBReferenceMetaData resourceClassBean = clientMD.getAnnotatedEjbReferences().get("ejb/resourceClassBean");
assertNotNull(resourceClassBean);
assertEquals("ResourcesOnClassBean", resourceClassBean.getLink());
assertEquals("refs/resources/ResourcesOnClassBean", resourceClassBean.getMappedName());
assertEquals("refs/resources/ResourcesOnClassBean", resourceClassBean.getJndiName());
// jms Queue maps to message-destination-refs
MessageDestinationReferencesMetaData msgRefs = clientMD.getMessageDestinationReferences();
assertNotNull(msgRefs);
MessageDestinationReferenceMetaData sendQueue = clientMD.getMessageDestinationReferenceByName("sendQueue");
assertNotNull(sendQueue);
Set<ResourceInjectionTargetMetaData> sendQueueTargets = sendQueue.getInjectionTargets();
assertNotNull(sendQueueTargets);
assertEquals(1, sendQueueTargets.size());
ResourceInjectionTargetMetaData sendQueueField = sendQueueTargets.iterator().next();
assertEquals(Client.class.getName(), sendQueueField.getInjectionTargetClass());
assertEquals("sendQueue", sendQueueField.getInjectionTargetName());
// ORB maps to a resource-env-ref
ResourceEnvironmentReferenceMetaData orbRes = clientMD.getResourceEnvironmentReferenceByName(Client.class.getName() + "/orb");
assertNotNull(orbRes);
Set<ResourceInjectionTargetMetaData> orbResTargets = orbRes.getInjectionTargets();
assertNotNull(orbResTargets);
assertEquals(1, orbResTargets.size());
ResourceInjectionTargetMetaData orbField = orbResTargets.iterator().next();
assertEquals(Client.class.getName(), orbField.getInjectionTargetClass());
assertEquals("orb", orbField.getInjectionTargetName());
// URL maps to resource-ref
ResourceReferenceMetaData urlRes = clientMD.getResourceReferenceByName("jboss-home-page");
assertNotNull(urlRes);
assertEquals("http://www.jboss.org", urlRes.getMappedName());
Set<ResourceInjectionTargetMetaData> urlResTargets = urlRes.getInjectionTargets();
assertNotNull(urlResTargets);
assertEquals(1, urlResTargets.size());
ResourceInjectionTargetMetaData urlResField = urlResTargets.iterator().next();
assertEquals(Client.class.getName(), urlResField.getInjectionTargetClass());
assertEquals("jbossHome", urlResField.getInjectionTargetName());
// UserTransaction
// String maps to env-entry
EnvironmentEntryMetaData queueNameEntry = clientMD.getEnvironmentEntryByName("queueName");
assertNotNull(queueNameEntry);
assertEquals("queue/testQueue", queueNameEntry.getValue());
Set<ResourceInjectionTargetMetaData> queueNameEntryTargets = queueNameEntry.getInjectionTargets();
assertNotNull(queueNameEntryTargets);
assertEquals(1, queueNameEntryTargets.size());
ResourceInjectionTargetMetaData queueNameEntryField = queueNameEntryTargets.iterator().next();
assertEquals(Client.class.getName(), queueNameEntryField.getInjectionTargetClass());
assertEquals("queueName", queueNameEntryField.getInjectionTargetName());
// Float
// int
LifecycleCallbacksMetaData postConstructs = clientMD.getPostConstructs();
assertNotNull(postConstructs);
assertEquals(1, postConstructs.size());
LifecycleCallbackMetaData pc = postConstructs.get(0);
assertEquals(Client.class.getName(), pc.getClassName());
assertEquals("postConstruct", pc.getMethodName());
LifecycleCallbacksMetaData preDestroys = clientMD.getPreDestroys();
assertNotNull(preDestroys);
assertEquals(1, preDestroys.size());
LifecycleCallbackMetaData pd = preDestroys.get(0);
assertEquals(Client.class.getName(), pd.getClassName());
assertEquals("destroy", pd.getMethodName());
// @WebServiceRef
ServiceReferenceMetaData wsRef = clientMD.getServiceReferenceByName("service/somewebservice");
assertNotNull(wsRef);
Field wsRefField = Client.class.getDeclaredField("service");
assertEquals(wsRefField, wsRef.getAnnotatedElement());
assertEquals(DefaultWebServiceService.class.getName(), wsRef.getServiceRefType());
Set<ResourceInjectionTargetMetaData> wsRefTargets = wsRef.getInjectionTargets();
ResourceInjectionTargetMetaData wsRefFieldTarget = wsRefTargets.iterator().next();
assertEquals(Client.class.getName(), wsRefFieldTarget.getInjectionTargetClass());
assertEquals("service", wsRefFieldTarget.getInjectionTargetName());
assertNull(wsRef.getServiceInterface());
assertAnnotationContext(creator.getAnnotationContext());
}