@BeforeClass
public static void beforeClass() throws Exception
{
AbstractEJB3TestCase.beforeClass();
AbstractDeploymentUnit deploymentUnit = new AbstractDeploymentUnit(new AbstractDeploymentContext("ejbthree1558", ""));
deploymentUnit.createClassLoader(new ClassLoaderFactory() {
public ClassLoader createClassLoader(org.jboss.deployers.structure.spi.DeploymentUnit unit) throws Exception
{
return Thread.currentThread().getContextClassLoader();
}
public void removeClassLoader(org.jboss.deployers.structure.spi.DeploymentUnit unit) throws Exception
{
}
});
DeploymentUnit unit = new MockDeploymentUnit(deploymentUnit);
Ejb3Deployment deployment = new MockEjb3Deployment(unit, deploymentUnit);
deployment.setEJBReferenceResolver(new ScopedEJBReferenceResolver());
Class<?> beanImplementationClasses[] = { TXNotSupportedMDB.class };
JBossMetaData jbossMetaData = MetaDataHelper.getMetaDataFromBeanImplClasses(beanImplementationClasses);
unit.addAttachment(AttachmentNames.PROCESSED_METADATA, jbossMetaData);
String ejbName = "TXNotSupportedMDB";
JBossMessageDrivenBeanMetaData beanMetaData = (JBossMessageDrivenBeanMetaData) jbossMetaData.getEnterpriseBean(ejbName);
Domain domain = getDomain("Message Driven Bean");
ClassLoader cl = deploymentUnit.getClassLoader();
String beanClassName = beanMetaData.getEjbClass();
Properties ctxProperties = null;
container = new MyMDB(ejbName, domain, cl, beanClassName, ctxProperties, deployment, beanMetaData);
}