KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > util > ejb > EJBTestRunner


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * 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 JavaDoc;
25 import java.util.Properties JavaDoc;
26 import javax.ejb.EJBObject JavaDoc;
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  * &lt;?xml version="1.0"?&gt;
36  * &lt;!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"&gt;
39  * &lt;ejb-jar&gt;
40  * &lt;enterprise-beans&gt;
41  * &lt;session&gt;
42  * &lt;description&gt;JUnit Session Bean Test Runner&lt;/description&gt;
43  * &lt;ejb-name&gt;EJBTestRunnerEJB&lt;/ejb-name&gt;
44  * &lt;home&gt;net.sourceforge.junitejb.EJBTestRunnerHome&lt;/home&gt;
45  * &lt;remote&gt;net.sourceforge.junitejb.EJBTestRunner&lt;/remote&gt;
46  * &lt;ejb-class&gt;net.sourceforge.junitejb.EJBTestRunnerBean&lt;/ejb-class&gt;
47  * &lt;session-type&gt;Stateless&lt;/session-type&gt;
48  * &lt;transaction-type&gt;Bean&lt;/transaction-type&gt;
49  * &lt;/session&gt;
50  * &lt;/enterprise-beans&gt;
51  * &lt;/ejb-jar&gt;
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: 37406 $
65  */

66 public interface EJBTestRunner extends EJBObject JavaDoc
67 {
68    /** Runs the specified test method on the specified class by calling
69     * run(className, methodName, props) with props built from the java:comp/env
70     * bindings.
71     *
72     * @param className the name of the test class
73     * @param methodName the name of the test method
74     * @throws RemoteTestException If any throwable is thrown during execution
75     * of the method, it is wrapped with a RemoteTestException and rethrown.
76     */

77    public void run(String JavaDoc className, String JavaDoc methodName)
78       throws RemoteTestException, RemoteException JavaDoc;
79
80    /**
81     * Runs the specified test method on the specified class.
82     * @param className the name of the test class
83     * @param methodName the name of the test method
84     * @param props any properties passed in from the client for use by the
85     * server side tests
86     * @throws RemoteTestException If any throwable is thrown during execution
87     * of the method, it is wrapped with a RemoteTestException and rethrown.
88     */

89    public void run(String JavaDoc className, String JavaDoc methodName, Properties JavaDoc props)
90       throws RemoteTestException, RemoteException JavaDoc;
91 }
92
Popular Tags