Methods Summary |
---|
public static junit.framework.Test | suite()
return getDeploySetup(StatefulUnitTestCase.class, "testejb3-statefulcache-service.xml, cache-test.jar, cache-test.sar");
|
public void | testBench()
StatefulRemote remote = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
System.out.println("bench: " + remote.bench(1000));
remote.done(); // remove this
|
public void | testBenchSimple()
SimpleStatefulRemote remote = (SimpleStatefulRemote) getInitialContext().lookup("SimpleStatefulBean/remote");
System.out.println("simple bench: " + remote.bench(1000));
|
public void | testSimpleLocal()
MBeanServerConnection server = getServer();
ObjectName testerName = new ObjectName("jboss.ejb3:service=Tester,test=cache");
Object[] params = {};
String[] sig = {};
server.invoke(testerName, "testSimpleLocal", params, sig);
|
public void | testSimpleStateful()
SimpleStatefulRemote remote = (SimpleStatefulRemote) getInitialContext().lookup("SimpleStatefulBean/remote");
remote.reset();
remote.setState("hello");
Thread.sleep(5000);
assertEquals("hello", remote.getState());
assertTrue(remote.getPostActivate());
assertTrue(remote.getPrePassivate());
|
public void | testSimpleStatefulLongRunning()
SimpleStatefulRemote remote = (SimpleStatefulRemote) getInitialContext().lookup("SimpleStatefulBean/remote");
remote.reset();
remote.setState("hello");
remote.longRunning();
assertEquals("hello", remote.getState());
assertTrue(remote.getPostActivate());
assertTrue(remote.getPrePassivate());
|
public void | testStateful()
StatefulRemote remote = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
remote.reset();
remote.setState("hello");
Thread.sleep(11000);
assertEquals("hello", remote.getState());
assertTrue(remote.getPostActivate());
assertTrue(remote.getPrePassivate());
remote.done(); // remove this
|
public void | testStatefulLongRunning()
StatefulRemote remote = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
remote.reset();
remote.setState("hello");
remote.longRunning();
// It is in use so not yet passivated
assertFalse(remote.getPrePassivate());
Thread.sleep(11000);
// Now it will be.
assertEquals("hello", remote.getState());
assertTrue(remote.getPostActivate());
assertTrue(remote.getPrePassivate());
remote.done(); // remove this
|