@Test
public void testStatefulLocalHome() throws Exception {
final String message = "Bean Message";
final SimpleStatefulHome home = (SimpleStatefulHome) iniCtx.lookup("java:module/SimpleStatefulBean!" + SimpleStatefulHome.class.getName());
SimpleInterface ejbInstance = home.createSimple(message);
Assert.assertEquals(message, ejbInstance.sayHello());
ejbInstance = home.createComplex("hello", "world");
Assert.assertEquals("hello world", ejbInstance.sayHello());
ejbInstance.remove();
try {
ejbInstance.sayHello();
fail("Expected bean to be removed");
} catch (NoSuchObjectException expected) {
}
}