jbossMetaData.merge(jbossXmlMetaData, specMetaData);
// Add the standardjboss.xml wrapper for defaults
JBossMetaDataWrapper wrapper = new JBossMetaDataWrapper(jbossMetaData, stdMetaData);
// Test the unified metadata view using the wrapper
InvokerProxyBindingsMetaData bindings = wrapper.getInvokerProxyBindings();
JBossEnterpriseBeansMetaData beans = wrapper.getEnterpriseBeans();
JBossEnterpriseBeanMetaData sessionBean = beans.get("StatelessSessionBean");
assertNotNull(sessionBean);
for(JBossEnterpriseBeanMetaData jbean : beans)
{
ContainerConfigurationMetaData beanCfg = jbean.determineContainerConfiguration();
assertNotNull(beanCfg);
InvokerBindingsMetaData invokers = jbean.determineInvokerBindings();
assertTrue(jbean.getEjbName()+" has > 0 invokers", invokers.size() > 0);
for(InvokerBindingMetaData invoker : invokers)
{
InvokerProxyBindingMetaData ipbmd = bindings.get(invoker.getName());
assertNotNull(invoker.getName(), ipbmd);
}
}
JBossEnterpriseBeanMetaData jsessionBean = (JBossEnterpriseBeanMetaData) sessionBean;
InvokerBindingsMetaData invokers = jsessionBean.determineInvokerBindings();
assertTrue(sessionBean.getEjbName()+" has 1 invokers", invokers.size() > 0);
// Test the legacy wrapper view
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();