|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
net.sourceforge.junitejb.EJBTestCase
public class 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
,
TestCase
Constructor Summary | |
---|---|
EJBTestCase(java.lang.String methodName)
Constructs a test case that will run the method with the specified name. |
Method Summary | |
---|---|
boolean |
isServerSide()
Is this class running on the server side? |
void |
run(junit.framework.TestResult result)
|
void |
runBare()
|
void |
setServerSide(boolean serverSide)
Sets the flag that is used to determine if the class is running on the server side. |
void |
setUpEJB()
Sets up the ejb test case. |
void |
tearDownEJB()
Tears down the ejb test case. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 void run(junit.framework.TestResult result)
run
in interface junit.framework.Test
run
in class junit.framework.TestCase
public void runBare() throws java.lang.Throwable
runBare
in class junit.framework.TestCase
java.lang.Throwable
public void setUpEJB() throws java.lang.Exception
java.lang.Exception
- if a problem occurespublic void tearDownEJB() throws java.lang.Exception
java.lang.Exception
- if a problem occures
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |