From: Bill D. <bde...@jb...> - 2006-04-13 23:23:32
|
User: bdecoste Date: 06/04/13 19:23:23 Modified: src/test/org/jboss/ejb3/test/cache/unit CacheUnitTestCase.java StatefulUnitTestCase.java Log: updated for new JBossCache API Revision Changes Path 1.4 +4 -3 jboss-ejb3/src/test/org/jboss/ejb3/test/cache/unit/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/CacheUnitTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- CacheUnitTestCase.java 30 Oct 2005 00:06:47 -0000 1.3 +++ CacheUnitTestCase.java 13 Apr 2006 23:23:23 -0000 1.4 @@ -22,7 +22,8 @@ package org.jboss.ejb3.test.cache.unit; import junit.framework.Test; -import org.jboss.jmx.adaptor.rmi.RMIAdaptor; + +import org.jboss.logging.Logger; import org.jboss.test.JBossTestCase; import javax.management.MBeanServerConnection; @@ -32,13 +33,13 @@ * Sample client for the jboss container. * * @author <a href="mailto:bi...@bu...">Bill Burke</a> - * @version $Id: CacheUnitTestCase.java,v 1.3 2005/10/30 00:06:47 starksm Exp $ + * @version $Id: CacheUnitTestCase.java,v 1.4 2006/04/13 23:23:23 bdecoste Exp $ */ public class CacheUnitTestCase extends JBossTestCase { - org.apache.log4j.Category log = getLog(); + private static final Logger log = Logger.getLogger(CacheUnitTestCase.class); static boolean deployed = false; static int test = 0; 1.7 +24 -13 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.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- StatefulUnitTestCase.java 5 Jan 2006 19:54:45 -0000 1.6 +++ StatefulUnitTestCase.java 13 Apr 2006 23:23:23 -0000 1.7 @@ -23,8 +23,10 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; + import org.jboss.ejb3.test.cache.SimpleStatefulRemote; import org.jboss.ejb3.test.cache.StatefulRemote; +import org.jboss.logging.Logger; import org.jboss.test.JBossTestCase; import junit.framework.Test; @@ -32,22 +34,20 @@ * Sample client for the jboss container. * * @author <a href="mailto:bi...@bu...">Bill Burke</a> - * @version $Id: StatefulUnitTestCase.java,v 1.6 2006/01/05 19:54:45 bdecoste Exp $ + * @version $Id: StatefulUnitTestCase.java,v 1.7 2006/04/13 23:23:23 bdecoste Exp $ */ public class StatefulUnitTestCase extends JBossTestCase { - org.apache.log4j.Category log = getLog(); + private static final Logger log = Logger.getLogger(StatefulUnitTestCase.class); static boolean deployed = false; static int test = 0; public StatefulUnitTestCase(String name) { - super(name); - } public void testStateful() throws Exception @@ -57,8 +57,10 @@ remote.setState("hello"); Thread.sleep(5000); assertEquals("hello", remote.getState()); - assertTrue(remote.getPostActivate()); - assertTrue(remote.getPrePassivate()); + assertEquals(1, remote.getPostActivate()); + assertEquals(1, remote.getPrePassivate()); + + remote.remove(); } public void testStatefulLongRunning() throws Exception @@ -68,8 +70,10 @@ remote.setState("hello"); remote.longRunning(); assertEquals("hello", remote.getState()); - assertTrue(remote.getPostActivate()); - assertTrue(remote.getPrePassivate()); + assertEquals(1, remote.getPostActivate()); + assertEquals(1, remote.getPrePassivate()); + + remote.remove(); } public void testSimpleStatefulLongRunning() throws Exception @@ -79,8 +83,10 @@ remote.setState("hello"); remote.longRunning(); assertEquals("hello", remote.getState()); - assertTrue(remote.getPostActivate()); - assertTrue(remote.getPrePassivate()); + assertEquals(1, remote.getPostActivate()); + assertEquals(1, remote.getPrePassivate()); + + remote.remove(); } public void testSimpleStateful() throws Exception @@ -90,8 +96,10 @@ remote.setState("hello"); Thread.sleep(5000); assertEquals("hello", remote.getState()); - assertTrue(remote.getPostActivate()); - assertTrue(remote.getPrePassivate()); + assertEquals(1, remote.getPostActivate()); + assertEquals(1, remote.getPrePassivate()); + + remote.remove(); } public void testSimpleLocal() throws Exception @@ -107,6 +115,7 @@ { StatefulRemote remote = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote"); System.out.println("bench: " + remote.bench(1000)); + remote.remove(); } @@ -115,6 +124,8 @@ SimpleStatefulRemote remote = (SimpleStatefulRemote) getInitialContext().lookup("SimpleStatefulBean/remote"); System.out.println("simple bench: " + remote.bench(1000)); + remote.remove(); + } public static Test suite() throws Exception |