initProps.setProperty("openejb.deployments.classpath.filter.descriptors", "true");
OpenEJB.init(initProps, new ServerFederation());
ejbServer.init(new Properties());
final ServicePool pool = new ServicePool(keepAliveServer, 10, 5000, true);
final ServiceDaemon serviceDaemon = new ServiceDaemon(pool, 0, "localhost");
serviceDaemon.start();
try {
final int port = serviceDaemon.getPort();
final Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
final ConfigurationFactory config = new ConfigurationFactory();
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(EchoBean.class));
assembler.createApplication(config.configureApplication(ejbJar));
// good creds
final int threads = 1;
final CountDownLatch latch = new CountDownLatch(threads);
for (int i = 0; i < threads; i++) {
final Client client = new Client(latch, i, port);
thread(client, false);
}
final boolean await = latch.await(60, TimeUnit.SECONDS);
assertTrue(await);
} finally {
serviceDaemon.stop();
OpenEJB.destroy();
}
}