@PersistenceContext
private EntityManager em;
public void setUp() throws OpenEJBException, NamingException, IOException {
ConfigurationFactory config = new ConfigurationFactory();
Assembler assembler = new Assembler();
assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
AppModule app = new AppModule(this.getClass().getClassLoader(), "test-app");
Persistence persistence = new Persistence(new org.apache.openejb.jee.jpa.unit.PersistenceUnit("foo-unit"));
app.getPersistenceModules().add(new PersistenceModule("root", persistence));
EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(SuperBean.class));
app.getEjbModules().add(new EjbModule(ejbJar));
ClientModule clientModule = new ClientModule(null, app.getClassLoader(), app.getJarLocation(), null, null);
clientModule.getLocalClients().add(this.getClass().getName());
app.getClientModules().add(clientModule);
assembler.createApplication(config.configureApplication(app));
}