@Test
public void testReconnectionWithClientAPI() throws Throwable {
final EJBClientTransactionContext localUserTxContext = EJBClientTransactionContext.createLocal();
EJBClientTransactionContext.setGlobalContext(localUserTxContext);
final StatelessEJBLocator<SimpleCrashBeanRemote> locator = new StatelessEJBLocator(SimpleCrashBeanRemote.class, "", DEPLOYMENT, SimpleCrashBean.class.getSimpleName(), "");
final SimpleCrashBeanRemote proxy = EJBClient.createProxy(locator);
assertNotNull(proxy);
String echo = proxy.echo("Hello!");
assertEquals("Hello!", echo);
controller.stop(CONTAINER);
log.info("===appserver stopped===");
controller.start(CONTAINER);
log.info("===appserver started again===");
final StatelessEJBLocator<SimpleCrashBeanRemote> locator2 = new StatelessEJBLocator(SimpleCrashBeanRemote.class, "", DEPLOYMENT, SimpleCrashBean.class.getSimpleName(), "");
final SimpleCrashBeanRemote proxy2 = EJBClient.createProxy(locator2);
assertNotNull(proxy2);
echo = proxy2.echo("Bye!");
assertEquals("Bye!", echo);