public void testMain() throws Exception
{
Object ref = getInitialContext().lookup("StatefulSession");
StatefulSessionHome home = (StatefulSessionHome) PortableRemoteObject.narrow(ref, StatefulSessionHome.class);
StatefulSession stateful = home.create();
stateful.test();
int i = 5;
while(!stateful.isPassivated())
{
if(i == 0)
fail("Gave up waiting for passivation.");
try
{
Thread.sleep(1500);
}
catch(InterruptedException e)
{
//
}
--i;
}
stateful.remove();
}