01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.test.util.ejb;
23:
24: import java.rmi.RemoteException;
25: import java.util.Properties;
26: import javax.ejb.EJBObject;
27:
28: /**
29: * The remote interface of the server side test runner. The EJBTestClient calls
30: * run with the names of the test class and test method to execute. Then run
31: * calls setUpEJB, runTestCase, and tearDownEJB in sepperate transactions. In
32: * order for the the tests to run as expected by the client the EJBTestRunner
33: * bean must be setup exactly as follows in the ejb-jar.xml file:
34: * <pre>
35: * <?xml version="1.0"?>
36: * <!DOCTYPE ejb-jar PUBLIC
37: * "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
38: * "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">
39: * <ejb-jar>
40: * <enterprise-beans>
41: * <session>
42: * <description>JUnit Session Bean Test Runner</description>
43: * <ejb-name>EJBTestRunnerEJB</ejb-name>
44: * <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
45: * <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
46: * <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
47: * <session-type>Stateless</session-type>
48: * <transaction-type>Bean</transaction-type>
49: * </session>
50: * </enterprise-beans>
51: * </ejb-jar>
52: * </pre>
53: *
54: * Additionally, the home interface must be bount to the jndi name:
55: * "ejb/EJBTestRunner"
56: *
57: * It is recomended that the test classes and the classes of JUnitEJB be
58: * packaged into a single jar.
59: *
60: * @see EJBTestCase
61: *
62: * @author <a href="mailto:dain@daingroup.com">Dain Sundstrom</a>
63: * @author Scott.Stark@jboss.org
64: * @version $Revision: 61778 $
65: */
66: public interface EJBTestRunner extends EJBObject {
67: /** Runs the specified test method on the specified class by calling
68: * run(className, methodName, props) with props built from the java:comp/env
69: * bindings.
70: *
71: * @param className the name of the test class
72: * @param methodName the name of the test method
73: * @throws RemoteTestException If any throwable is thrown during execution
74: * of the method, it is wrapped with a RemoteTestException and rethrown.
75: */
76: public void run(String className, String methodName)
77: throws RemoteTestException, RemoteException;
78:
79: /**
80: * Runs the specified test method on the specified class.
81: * @param className the name of the test class
82: * @param methodName the name of the test method
83: * @param props any properties passed in from the client for use by the
84: * server side tests
85: * @throws RemoteTestException If any throwable is thrown during execution
86: * of the method, it is wrapped with a RemoteTestException and rethrown.
87: */
88: public void run(String className, String methodName,
89: Properties props) throws RemoteTestException,
90: RemoteException;
91: }
|