assertTrue(org.apache.openejb.OpenEJB.isInitialized());
//
// ContainerSystem
//
ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
assertNotNull("containerSystem is null", containerSystem);
Context initialContext = containerSystem.getJNDIContext();
assertNotNull(initialContext);
//
// TransactionManager
//
Object tm = context.getBean("tm");
TransactionManager springTM = (TransactionManager) tm;
assertNotNull("springTM is null", springTM);
assertTrue("springTM should be an instance of MockTransactionManager", springTM instanceof MockTransactionManager);
TransactionManager systemTM = SystemInstance.get().getComponent(TransactionManager.class);
assertNotNull("systemTM is null", systemTM);
assertSame(springTM, systemTM);
assertSame(springTM, initialContext.lookup("openejb/TransactionManager"));
//
// SecurityService
//
SecurityService springSecurityService = (SecurityService) context.getBean("sec");
assertNotNull("springSecurityService is null", springSecurityService);
assertTrue("springSecurityService should be an instance of MockSecurityService", springSecurityService instanceof MockSecurityService);
SecurityService systemSecurityService = SystemInstance.get().getComponent(SecurityService.class);
assertNotNull("systemSecurityService is null", systemSecurityService);
assertSame(springSecurityService, systemSecurityService);
assertSame(springSecurityService, initialContext.lookup("openejb/SecurityService"));
//
// DataSource
//
DataSource springDataSource = (DataSource) context.getBean("ds");
assertNotNull("springDataSource is null", springDataSource);
assertTrue("springDataSource should be an instance of BasicDataSource", springDataSource instanceof BasicDataSource);
DataSource jndiDataSource = (DataSource) initialContext.lookup("openejb/Resource/ds");
assertSame(springDataSource, jndiDataSource);
DataSource exportedDS = (DataSource) context.getBean("openejbDS");
assertSame(springDataSource, exportedDS);
//
// Container
//
Container singletonContainer = containerSystem.getContainer("SpringDefinedSingletonContainer");
assertTrue("singletonContainer should be an instance of SingletonContainer", singletonContainer instanceof org.apache.openejb.core.singleton.SingletonContainer);
Container statelessContainer = containerSystem.getContainer("SpringDefinedStatelessContainer");
assertTrue("statelessContainer should be an instance of StatelessContainer", statelessContainer instanceof org.apache.openejb.core.stateless.StatelessContainer);
Container statefulContainer = containerSystem.getContainer("SpringDefinedStatefulContainer");
assertTrue("statefulContainer should be an instance of StatefulContainer", statefulContainer instanceof org.apache.openejb.core.stateful.StatefulContainer);
Container mdbContainer = containerSystem.getContainer("SpringDefinedMdbContainer");
assertTrue("mdbContainer should be an instance of MdbContainer", mdbContainer instanceof org.apache.openejb.core.mdb.MdbContainer);
Container bmpContainer = containerSystem.getContainer("SpringDefinedBmpContainer");
assertTrue("bmpContainer should be an instance of BmpContainer", bmpContainer instanceof EntityContainer);
Container cmpContainer = containerSystem.getContainer("SpringDefinedCmpContainer");
assertTrue("cmpContainer should be an instance of CmpContainer", cmpContainer instanceof org.apache.openejb.core.cmp.CmpContainer);
//
// JNDI Context
//