unit = assertDeploy(ear2);
Class<?> mySLSBeanClass = getClass(MySLSBean.class, unit);
Class<?> businessInterface = getClass(BusinessInterface.class, unit);
Deployment deployment2 = initializeDeploymentBean(unit);
BeanDeploymentArchive bda2 = deployment2.getBeanDeploymentArchives().iterator().next();
// contents of BDA2
assertBDAId(bda2, "simple2.ear");
assertExpectedClasses(bda2, MySLSBean.class, BusinessInterface.class);
// call loadBDA
assertSame(bda2, deployment2.loadBeanDeploymentArchive(mySLSBeanClass));
assertSame(bda2, deployment2.loadBeanDeploymentArchive(businessInterface));
// make sure that loadBDA did not change the contents of BDA2
assertBDAId(bda2, "simple2.ear");
assertExpectedClasses(bda2, MySLSBean.class, BusinessInterface.class);
// creation of bda1 on demand
BeanDeploymentArchive bda1 = deployment2.loadBeanDeploymentArchive(plainJavaBeanClass);
assertBDAId(bda1, "simple1.ear");
assertExpectedClasses(bda1, PlainJavaBean.class);
assertNoBeansXml(bda1);
// double invocation
assertSame(bda1, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));