@Test
public void testRemoveByHandle() throws Exception
{
MyStateful21Home home = (MyStateful21Home) getInitialContext().lookup("MyStateful21Bean/home");
MyStateful21 session = home.create();
session.setName("Test");
String actual = session.sayHello();
assertEquals("Hi Test", actual);
try
{
home.remove(session.getHandle());
}
catch(RuntimeException e)
{
if(e.getCause().getMessage().equals("pre destroy called multiple times"))
fail("pre destroy called multiple times");