ApplicationMetaData appMetaData = new ApplicationMetaData(wrapper);
Iterator<BeanMetaData> beans2 = appMetaData.getEnterpriseBeans();
while (beans2.hasNext())
{
BeanMetaData bean = (BeanMetaData) beans2.next();
ConfigurationMetaData beanCfg = bean.getContainerConfiguration();
assertNotNull(beanCfg);
}
assertTrue(bindings.size() > 10);
// Validate some know invoker bindings
InvokerProxyBindingMetaData ssui = bindings.get("stateless-unified-invoker");
assertNotNull(ssui);
InvokerProxyBindingMetaData sfui = bindings.get("stateful-unified-invoker");
assertNotNull(sfui);
BeanMetaData beanCfg = appMetaData.getBeanByEjbName("StatelessSessionBean");
assertNotNull(beanCfg);
Iterator<String> it = beanCfg.getInvokerBindings();
org.jboss.metadata.InvokerProxyBindingMetaData imd = null;
while (it.hasNext() && imd == null)
{
String invoker = it.next();
imd = beanCfg.getApplicationMetaData().getInvokerProxyBindingMetaDataByName(invoker);
assertNotNull(imd);
}
assertNotNull(imd);
// Validate the merged StrictlyPooledMDB
JBossEnterpriseBeanMetaData strictlyPooledMDB = beans.get("StrictlyPooledMDB");
JBossMessageDrivenBeanMetaData strictlyPooledMDBMD = (JBossMessageDrivenBeanMetaData) strictlyPooledMDB;
assertNotNull("strictlyPooledMDB", strictlyPooledMDB);
assertEquals("Message driven pooling test", strictlyPooledMDBMD.getDescriptionGroup().getDescription());
assertEquals("org.jboss.test.cts.ejb.StrictlyPooledMDB", strictlyPooledMDBMD.getEjbClass());
assertTrue(strictlyPooledMDB.isMessageDriven());
assertTrue(strictlyPooledMDB instanceof JBossMessageDrivenBeanMetaData);
assertEquals("AUTO_ACKNOWLEDGE", strictlyPooledMDBMD.getAcknowledgeMode());
assertEquals("javax.jms.Queue", strictlyPooledMDBMD.getMessageDestinationType());
assertEquals(SubscriptionDurability.NonDurable, strictlyPooledMDBMD.getSubscriptionDurability());
EnvironmentEntryMetaData maxActiveCount = strictlyPooledMDBMD.getEnvironmentEntryByName("maxActiveCount");
assertEquals("maxActiveCountID", maxActiveCount.getId());
assertEquals("java.lang.Integer", maxActiveCount.getType());
assertEquals("5", maxActiveCount.getValue());
assertEquals("queue/A", strictlyPooledMDBMD.getDestinationJndiName());
assertEquals("Strictly Pooled Message Driven Bean", strictlyPooledMDBMD.getConfigurationName());
// Test security-identity information
org.jboss.metadata.SecurityIdentityMetaData secMetaData = beanCfg.getSecurityIdentityMetaData();
assertNull(secMetaData);
BeanMetaData RunAsStatelessSessionBean = appMetaData.getBeanByEjbName("RunAsStatelessSessionBean");
assertNotNull(RunAsStatelessSessionBean);
secMetaData = RunAsStatelessSessionBean.getSecurityIdentityMetaData();