User: d_jencks
Date: 01/09/14 18:07:12
Modified: src/main/org/jboss/test/idgen/test IdGenUnitTestCase.java
Log:
Converted to JBossTestCase and logging, made work (dbtest still breaks with
Hypersonic 1.4)
Revision Changes Path
1.2 +22 -31
jbosstest/src/main/org/jboss/test/idgen/test/IdGenUnitTestCase.java
Index: IdGenUnitTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/idgen/test/IdGenUnitTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IdGenUnitTestCase.java 2001/09/12 04:55:38 1.1
+++ IdGenUnitTestCase.java 2001/09/15 01:07:11 1.2
@@ -1,4 +1,10 @@
/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+/*
* Copyright 1999 by dreamBean Software,
* All rights reserved.
*/
@@ -13,25 +19,26 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.jboss.test.util.Deploy;
import org.jboss.test.idgen.interfaces.*;
+import org.jboss.test.JBossTestCase;
+
/**
*
* @see <related>
- * @author $Author: d_jencks $
- * @version $Revision: 1.1 $
+ * @author Author: d_jencks only added JBossTestCase and logging
+ * @version $Revision: 1.2 $
*/
public class IdGenUnitTestCase
- extends junit.framework.TestCase
+ extends JBossTestCase
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
- static boolean deployed = false;
+
// Constructors --------------------------------------------------
public IdGenUnitTestCase(String name)
@@ -43,7 +50,7 @@
public void testGenerator()
throws Exception
{
- IdGeneratorHome home = (IdGeneratorHome)new
InitialContext().lookup(IdGeneratorHome.JNDI_NAME);
+ IdGeneratorHome home =
(IdGeneratorHome)getInitialContext().lookup(IdGeneratorHome.JNDI_NAME);
IdGenerator generator = home.create();
generator.getNewId("Account");
@@ -60,12 +67,9 @@
protected void setUp()
throws Exception
{
- if (deployed) return;
- // System.out.println("Deploying");
- // new org.jboss.jmx.client.Deployer().deploy("../deploy/idgen.jar");
- deployed = true;
-
- System.out.println("Remove id counters");
+ super.setUp();
+ deployJ2ee("idgen.jar");
+ getLog().debug("Remove id counters");
{
IdCounterHome home = (IdCounterHome)new
InitialContext().lookup(IdCounterHome.JNDI_NAME);
Collection counters = home.findAll();
@@ -73,28 +77,15 @@
while(enum.hasNext())
{
EJBObject obj = (EJBObject)enum.next();
- System.out.println("Removing "+obj.getPrimaryKey());
+ getLog().debug("Removing "+obj.getPrimaryKey());
obj.remove();
}
}
}
-
- /**
- * Setup the test suite.
- */
- public static Test suite() {
- TestSuite suite = new TestSuite();
-
- // add a test case to deploy our support applications
- String filename = "idgen.jar";
- suite.addTest(new Deploy.Deployer(filename));
-
- suite.addTest(new TestSuite(IdGenUnitTestCase.class));
-
- // add a test case to undeploy our support applications
- suite.addTest(new Deploy.Undeployer(filename));
-
- return suite;
- }
+ protected void tearDown() throws Exception
+ {
+ undeployJ2ee("idgen.jar");
+ super.tearDown();
+ }
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development