[jboss-cvs] JBossAS SVN: r61787 - trunk/testsuite/src/main/org/jboss/test/util/ejb.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 28 10:44:22 EDT 2007
Author: dimitris at jboss.org
Date: 2007-03-28 10:44:22 -0400 (Wed, 28 Mar 2007)
New Revision: 61787
Modified:
trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestCase.java
trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestRunner.java
Log:
JBAS-4144, remove remaining uses of the legacy ejbunit class (i.e. cmp2 tests)
Modified: trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestCase.java 2007-03-28 14:43:38 UTC (rev 61786)
+++ trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestCase.java 2007-03-28 14:44:22 UTC (rev 61787)
@@ -21,14 +21,11 @@
*/
package org.jboss.test.util.ejb;
+import java.util.Properties;
-import java.util.Properties;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
-import org.jboss.test.AbstractTestDelegate;
-import org.jboss.test.JBossTestServices;
-
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import junit.framework.TestResult;
@@ -41,31 +38,32 @@
* work just like setUp and tearDown except they run in a sepperate transaction.
* The execution order is as follows:
* <pre>
- * 1. setUpEJB (TX 1)
- * 2. run (TX 2)
- * 2.1. runBare
- * 2.1.1 setUp
- * 2.1.2 <your test method>
- * 2.1.3 tearDown
- * 3. ejbTearDown (TX 2)
+ * 1. setUpEJB (TX 1)
+ * 2. run (TX 2)
+ * 2.1. runBare
+ * 2.1.1 setUp
+ * 2.1.2 <your test method>
+ * 2.1.3 tearDown
+ * 3. ejbTearDown (TX 2)
* </pre>
*
* For an ejb test case to run successfully, the following must be setup:
* <pre>
- * 1. The ejb test case class must be availabe to the client vm.
- * 2. The ejb test case class must be availabe to the EJBTestRunner bean
- * on the server.
- * 3. The EJBTestRunnerHome must be bound to "ejb/EJBTestRunner" in the
- * jndi context obtained from new InitialContext();
- * 4. The EJBTestRunner bean must be configured as specified in the
- * EJBTestRunner javadoc.
+ * 1. The ejb test case class must be availabe to the client vm.
+ * 2. The ejb test case class must be availabe to the EJBTestRunner bean
+ * on the server.
+ * 3. The EJBTestRunnerHome must be bound to "ejb/EJBTestRunner" in the
+ * jndi context obtained from new InitialContext();
+ * 4. The EJBTestRunner bean must be configured as specified in the
+ * EJBTestRunner javadoc.
* </pre>
*
* @see EJBTestRunner
* @see junit.framework.TestCase
*
* @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>
- * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:scott at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
* @version $Revision$
*/
public class EJBTestCase extends TestCase
@@ -73,16 +71,10 @@
private boolean serverSide = false;
protected Properties props;
- public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
- {
- AbstractTestDelegate delegate = new JBossTestServices(clazz);
- return delegate;
- }
-
/**
* Constructs a test case that will run the method with the specified name.
* @param methodName the name of the method that will executed when this
- * test is run
+ * test is run
*/
public EJBTestCase(String methodName)
{
@@ -93,7 +85,7 @@
* Sets the flag that is used to determine if the class
* is running on the server side.
* @param serverSide boolean flag that this class uses to determine
- * if it's running on the server side.
+ * if it's running on the server side.
*/
public void setServerSide(boolean serverSide)
{
@@ -102,7 +94,7 @@
/**
* Is this class running on the server side?
- * @return true if this class is running on the server side
+ * @return true if this class is running on the server side
*/
public boolean isServerSide()
{
@@ -218,8 +210,17 @@
public void setUpEJB(Properties props) throws Exception
{
this.props = props;
+
+ // JBAS-4144, hack to allow subclasses that originally
+ // used net.sourceforge.junitejb.EJBTestCase to still work.
+ setUpEJB();
}
+ public void setUpEJB() throws Exception
+ {
+ // empty
+ }
+
/** Tears down the ejb test case. This method is called after
* each test is executed and is run in a private transaction.
* @param props the properties passed in from the client
@@ -227,8 +228,16 @@
*/
public void tearDownEJB(Properties props) throws Exception
{
+ // JBAS-4144, hack to allow subclasses that originally
+ // used net.sourceforge.junitejb.EJBTestCase to still work.
+ tearDownEJB();
}
+ public void tearDownEJB() throws Exception
+ {
+ // empty
+ }
+
/**
* Looks up the ejb test runner home in JNDI (at "ejb/EJBTestRunner")
* and creates a new runner.
Modified: trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestRunner.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestRunner.java 2007-03-28 14:43:38 UTC (rev 61786)
+++ trunk/testsuite/src/main/org/jboss/test/util/ejb/EJBTestRunner.java 2007-03-28 14:44:22 UTC (rev 61787)
@@ -1,24 +1,24 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.test.util.ejb;
import java.rmi.RemoteException;
@@ -41,9 +41,9 @@
* <session>
* <description>JUnit Session Bean Test Runner</description>
* <ejb-name>EJBTestRunnerEJB</ejb-name>
- * <home>net.sourceforge.junitejb.EJBTestRunnerHome</home>
- * <remote>net.sourceforge.junitejb.EJBTestRunner</remote>
- * <ejb-class>net.sourceforge.junitejb.EJBTestRunnerBean</ejb-class>
+ * <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
+ * <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
+ * <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
* <session-type>Stateless</session-type>
* <transaction-type>Bean</transaction-type>
* </session>
More information about the jboss-cvs-commits
mailing list