org.jboss.test.util.ejb
Interface EJBTestRunner

All Superinterfaces:
EJBObject (src) , java.rmi.Remote

public interface EJBTestRunner
extends EJBObject (src)

The remote interface of the server side test runner. The EJBTestClient calls run with the names of the test class and test method to execute. Then run calls setUpEJB, runTestCase, and tearDownEJB in sepperate transactions. In order for the the tests to run as expected by the client the EJBTestRunner bean must be setup exactly as follows in the ejb-jar.xml file:

 <?xml version="1.0"?>
 <!DOCTYPE ejb-jar PUBLIC 
       "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
       "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">
 <ejb-jar>
    <enterprise-beans>
       <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>
          <session-type>Stateless</session-type>
          <transaction-type>Bean</transaction-type>
       </session>
    </enterprise-beans>
 </ejb-jar>
 
Additionally, the home interface must be bount to the jndi name: "ejb/EJBTestRunner" It is recomended that the test classes and the classes of JUnitEJB be packaged into a single jar.

See Also:
EJBTestCase (src)

Method Summary
 void run(java.lang.String className, java.lang.String methodName)
          Runs the specified test method on the specified class by calling run(className, methodName, props) with props built from the java:comp/env bindings.
 void run(java.lang.String className, java.lang.String methodName, java.util.Properties props)
          Runs the specified test method on the specified class.
 
Methods inherited from interface javax.ejb.EJBObject (src)
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

run

public void run(java.lang.String className,
                java.lang.String methodName)
         throws RemoteTestException (src) ,
                java.rmi.RemoteException
Runs the specified test method on the specified class by calling run(className, methodName, props) with props built from the java:comp/env bindings.

Parameters:
className - the name of the test class
methodName - the name of the test method
Throws:
RemoteTestException (src) - If any throwable is thrown during execution of the method, it is wrapped with a RemoteTestException and rethrown.
java.rmi.RemoteException

run

public void run(java.lang.String className,
                java.lang.String methodName,
                java.util.Properties props)
         throws RemoteTestException (src) ,
                java.rmi.RemoteException
Runs the specified test method on the specified class.

Parameters:
className - the name of the test class
methodName - the name of the test method
props - any properties passed in from the client for use by the server side tests
Throws:
RemoteTestException (src) - If any throwable is thrown during execution of the method, it is wrapped with a RemoteTestException and rethrown.
java.rmi.RemoteException