I am using "ServletTestCase" to test EJBs deployed on Weblogic Server 6.1.
Here is the test scenario:
I have 2 EJBs I need to test. I want to test one method for each EJB.
The method of 2nd EJB uses the return value of the method of 1st EJB.
Here is the code
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public class CactusTest extends ServletTestCase {
...
public void testPlus() throws Exception {
sum = ejb.plus(2, 3);
assertEquals(5, sum);
}
public void testMinus() throws Exception {
int diff = ejb2.minus(sum, 3);
assertEquals(2, diff);
}
....
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
It is does not work because I think the instance variable "sum" was
initialized to 0 when the method "testMinus()" was executed. Does anyone
know why this happens? (May be 2nd instance was created?)
What are the alternatives if this does not work?
Regards,
Honghai Zhang
TPAS, Towers Perrin
--
To unsubscribe, e-mail: <mailto:cactus-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@;jakarta.apache.org>