01: /*
02: * JBoss, Home of Professional Open Source
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jboss.ejb3.test.stateful.unit;
09:
10: import junit.framework.Test;
11:
12: import org.jboss.logging.Logger;
13: import org.jboss.test.JBossTestCase;
14:
15: /**
16: * Test nested SFSB for repeated passivation
17: *
18: * @author Ben.Wang@jboss.org
19: * @version $Revision: 60658 $
20: */
21: public class NestedBeanUnitTestCase extends JBossTestCase {
22: private static final Logger log = Logger
23: .getLogger(NestedBeanUnitTestCase.class);
24: private NestedBeanTestRunner runner;
25:
26: public NestedBeanUnitTestCase(String name) {
27: super (name);
28: }
29:
30: public static Test suite() throws Exception {
31: return getDeploySetup(NestedBeanUnitTestCase.class,
32: "stateful-test.jar");
33: }
34:
35: @Override
36: protected void setUp() throws Exception {
37: super .setUp();
38:
39: runner = new NestedBeanTestRunner(getInitialContext(), log);
40: runner.setUp();
41: // Use a sleep time just a bit longer than twice the bean timeout
42: runner.setSleepTime(2100L);
43: }
44:
45: @Override
46: protected void tearDown() throws Exception {
47: super .tearDown();
48:
49: if (runner != null)
50: runner.tearDown();
51: }
52:
53: public void testBasic() throws Exception {
54: runner.testBasic();
55: }
56:
57: public void testDependentLifecycle() throws Exception {
58: runner.testDependentLifecycle();
59: }
60:
61: public void testStatefulPassivation() throws Exception {
62: runner.testStatefulPassivation();
63: }
64: }
|