@Override protected void cleanupTest() throws Exception { Context ctx = new InitialContext(props); unbind(JNDI_NAME, ctx); namingServer.destroy(); namingMain.stop(); manager.stop(); // Need to stop cos JNDI region factory does not stop it. }
@After public void tearDown() throws Exception { try { unbind("UserTransaction", ctx); unbind("java:/TransactionManager", ctx); ctx.close(); jndiServer.stop(); } finally { if (serviceRegistry != null) { ServiceRegistryBuilder.destroy(serviceRegistry); } } }