[jboss-cvs] jboss-ejb3/src/test/org/jboss/ejb3/test/cache/unit ...
Ben Wang
bwang at jboss.com
Fri Jul 21 04:09:44 EDT 2006
User: bwang
Date: 06/07/21 04:09:43
Modified: src/test/org/jboss/ejb3/test/cache/unit Tag: Branch_4_0
CacheUnitTestCase.java StatefulUnitTestCase.java
Log:
Backport tests from head.
Revision Changes Path
No revision
No revision
1.2.2.10 +4 -2 jboss-ejb3/src/test/org/jboss/ejb3/test/cache/unit/Attic/CacheUnitTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheUnitTestCase.java
===================================================================
RCS file: /cvsroot/jboss/jboss-ejb3/src/test/org/jboss/ejb3/test/cache/unit/Attic/CacheUnitTestCase.java,v
retrieving revision 1.2.2.9
retrieving revision 1.2.2.10
diff -u -b -r1.2.2.9 -r1.2.2.10
--- CacheUnitTestCase.java 20 Mar 2006 20:07:11 -0000 1.2.2.9
+++ CacheUnitTestCase.java 21 Jul 2006 08:09:43 -0000 1.2.2.10
@@ -32,7 +32,7 @@
* Sample client for the jboss container.
*
* @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: CacheUnitTestCase.java,v 1.2.2.9 2006/03/20 20:07:11 bill Exp $
+ * @version $Id: CacheUnitTestCase.java,v 1.2.2.10 2006/07/21 08:09:43 bwang Exp $
*/
public class CacheUnitTestCase
@@ -52,11 +52,13 @@
public void testSimple() throws Exception
{
+ /* Tests are in StatefulUnit now.
MBeanServerConnection server = getServer();
ObjectName testerName = new ObjectName("jboss.ejb3:service=Tester,test=cache");
Object[] params = {};
String[] sig = {};
server.invoke(testerName, "test", params, sig);
+ */
}
public static Test suite() throws Exception
1.2.6.10 +9 -3 jboss-ejb3/src/test/org/jboss/ejb3/test/cache/unit/StatefulUnitTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StatefulUnitTestCase.java
===================================================================
RCS file: /cvsroot/jboss/jboss-ejb3/src/test/org/jboss/ejb3/test/cache/unit/StatefulUnitTestCase.java,v
retrieving revision 1.2.6.9
retrieving revision 1.2.6.10
diff -u -b -r1.2.6.9 -r1.2.6.10
--- StatefulUnitTestCase.java 20 Mar 2006 20:07:11 -0000 1.2.6.9
+++ StatefulUnitTestCase.java 21 Jul 2006 08:09:43 -0000 1.2.6.10
@@ -32,7 +32,7 @@
* Sample client for the jboss container.
*
* @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
- * @version $Id: StatefulUnitTestCase.java,v 1.2.6.9 2006/03/20 20:07:11 bill Exp $
+ * @version $Id: StatefulUnitTestCase.java,v 1.2.6.10 2006/07/21 08:09:43 bwang Exp $
*/
public class StatefulUnitTestCase
@@ -55,10 +55,11 @@
StatefulRemote remote = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
remote.reset();
remote.setState("hello");
- Thread.sleep(5000);
+ Thread.sleep(11000);
assertEquals("hello", remote.getState());
assertTrue(remote.getPostActivate());
assertTrue(remote.getPrePassivate());
+ remote.done(); // remove this
}
public void testStatefulLongRunning() throws Exception
@@ -67,9 +68,14 @@
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
}
public void testSimpleStatefulLongRunning() throws Exception
@@ -107,7 +113,7 @@
{
StatefulRemote remote = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
System.out.println("bench: " + remote.bench(1000));
-
+ remote.done(); // remove this
}
public void testBenchSimple() throws Exception
More information about the jboss-cvs-commits
mailing list