public class EJBTestCase
extends junit.framework.TestCase
1. setUpEJB (TX 1)
2. run (TX 2)
2.1. runBare
2.1.1 setUp
2.1.2
2.1.3 tearDown
3. ejbTearDown (TX 2)
For an ejb test case to run successfully, the following must be setup:
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 and Description |
|---|
EJBTestCase(java.lang.String methodName)
Constructs a test case that will run the method with the specified name.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
countTestCases, createResult, getName, run, runTest, setName, setUp, tearDown, toStringassertEquals, 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, failSamepublic EJBTestCase(java.lang.String methodName)
methodName - the name of the method that will executed when this
test is runpublic 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.Testrun in class junit.framework.TestCasepublic void runBare()
throws java.lang.Throwable
runBare in class junit.framework.TestCasejava.lang.Throwablepublic 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 occuresDistributable under LGPL license. See terms of license at gnu.org