// add the test as a managed bean to be able to inject into it easily
if (javaClass != null) {
final EjbJar ejbJar = new EjbJar();
final OpenejbJar openejbJar = new OpenejbJar();
final ManagedBean bean = ejbJar.addEnterpriseBean(new ManagedBean(javaClass.getSimpleName(), javaClass.getName(), true));
bean.localBean();
bean.setTransactionType(TransactionType.BEAN);
final EjbDeployment ejbDeployment = openejbJar.addEjbDeployment(bean);
ejbDeployment.setDeploymentId(javaClass.getName());
final EjbModule e = new EjbModule(ejbJar, openejbJar);
e.setClassLoader(tempClassLoader);