|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTestCase
org.jboss.test.util.ejb.EJBTestCase
An ejb test case is an extension to test case where the test is executed in the ejb server's virtual machine. Two new methods setUpEJB and tearDownEJB have been added. These methods work just like setUp and tearDown except they run in a sepperate transaction. The execution order is as follows:
1. setUpEJB (TX 1) 2. run (TX 2) 2.1. runBare 2.1.1 setUp 2.1.2For an ejb test case to run successfully, the following must be setup:2.1.3 tearDown 3. ejbTearDown (TX 2)
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.
EJBTestRunner
(src) ,
junit.framework.TestCase
,
Serialized FormField Summary | |
protected java.util.Properties |
props
|
Constructor Summary | |
EJBTestCase(java.lang.String methodName)
Constructs a test case that will run the method with the specified name. |
Method Summary | |
java.lang.String |
getEJBRunnerJndiName()
Allow EJBTestCase subclasses to override the EJBRunnerHome JNDI name |
java.util.Properties |
getProps()
|
boolean |
isServerSide()
Is this class running on the server side? |
void |
run(TestResult result)
|
void |
runBare()
|
void |
setProps(java.util.Properties props)
|
void |
setServerSide(boolean serverSide)
Sets the flag that is used to determine if the class is running on the server side. |
void |
setUpEJB(java.util.Properties props)
Sets up the ejb test case. |
void |
tearDownEJB(java.util.Properties props)
Tears down the ejb test case. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Properties props
Constructor Detail |
public EJBTestCase(java.lang.String methodName)
methodName
- the name of the method that will executed when this
test is runMethod Detail |
public void setServerSide(boolean serverSide)
serverSide
- boolean flag that this class uses to determine
if it's running on the server side.public boolean isServerSide()
public java.lang.String getEJBRunnerJndiName()
public java.util.Properties getProps()
public void setProps(java.util.Properties props)
props
- the properties associated with the test casepublic void run(TestResult result)
public void runBare() throws java.lang.Throwable
java.lang.Throwable
public void setUpEJB(java.util.Properties props) throws java.lang.Exception
props
- the properties passed in from the client
java.lang.Exception
- if a problem occurespublic void tearDownEJB(java.util.Properties props) throws java.lang.Exception
props
- the properties passed in from the client
java.lang.Exception
- if a problem occures
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |