* @throws Exception
*/
public void testEntity()
throws Exception
{
EjbJar2xMetaData specMetaData = unmarshal();
JBossMetaData jbossMetaData = unmarshal("JBoss30_entityConfig.xml", JBossMetaData.class, null);
JBossMetaData stdMetaData = unmarshal("JBoss5xEverything_testStandard.xml", JBossMetaData.class, null);
JBossMetaData mergedMetaData = new JBossMetaData();
mergedMetaData.merge(jbossMetaData, specMetaData);
JBossMetaDataWrapper wrapper = new JBossMetaDataWrapper(mergedMetaData, stdMetaData);
ContainerConfigurationMetaData conf = wrapper.getContainerConfiguration("TestEntity Container Configuration");
assertNotNull(conf);
assertEquals("TestEntity Container Configuration", conf.getContainerName());
assertEquals("Standard CMP 2.x EntityBean", conf.getExtendsName());
assertEquals("org.jboss.ejb.plugins.PerTxEntityInstanceCache", conf.getInstanceCache());
assertEquals("org.jboss.ejb.plugins.EntityInstancePool", conf.getInstancePool());
assertEquals("org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager", conf.getPersistenceManager());
assertEquals("org.jboss.ejb.plugins.lock.NoLock", conf.getLockingPolicy());
assertEquals("org.jboss.web.WebClassLoader", conf.getWebClassLoader());
assertEquals("entity-unified-invoker", conf.getDefaultInvokerName());
assertEquals(CommitOption.B, conf.getCommitOption());
assertEquals(30000, conf.getOptiondRefreshRateMillis());
ContainerConfigurationMetaData conf2 = wrapper.getContainerConfiguration("Clustered CMP EntityBean");
assertEquals("org.jboss.ejb.plugins.EntityInstanceCache", conf2.getInstanceCache());
assertEquals("org.jboss.ejb.plugins.EntityInstancePool", conf2.getInstancePool());
assertEquals("org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager", conf2.getPersistenceManager());
assertEquals("org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock", conf2.getLockingPolicy());
assertEquals("org.jboss.web.WebClassLoader", conf2.getWebClassLoader());
assertEquals("clustered-entity-unified-invoker", conf2.getDefaultInvokerName());
HashSet<String> conf2Names = new HashSet<String>();
conf2Names.add("clustered-entity-unified-invoker");
assertEquals(conf2Names, conf2.getInvokerProxyBindingNames());
assertEquals(CommitOption.A, conf2.getCommitOption());
assertEquals(null, conf2.getSecurityDomain());
assertNotNull(conf2.getClusterConfig());
assertEquals("DefaultPartition", conf2.getClusterConfig().getPartitionName());
assertTrue(specMetaData.isEJB2x());
EntityBeanMetaData entity = (EntityBeanMetaData) specMetaData.getEnterpriseBean("TestEntity");
assertNotNull(entity);
assertFalse(entity.isCMP1x());
entity = (EntityBeanMetaData) specMetaData.getEnterpriseBean("TestEntityCmp1");
assertNotNull(entity);
assertTrue(entity.isCMP1x());
JBossEntityBeanMetaData jbe = (JBossEntityBeanMetaData) mergedMetaData.getEnterpriseBean("TestEntity");
assertNotNull(jbe);