KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > exe > state > FaultImplicitHandlerTest


1 package org.jbpm.bpel.exe.state;
2
3
4 /**
5  * @author Juan Cantu
6  * @version $Revision: 1.3 $ $Date: 2005/06/16 19:15:35 $
7  */

8 public class FaultImplicitHandlerTest extends AbstractStateTestCase {
9
10   public ScopeState getState() {
11     return FaultingState.FAULTING_IMPLICITLY;
12   }
13   
14   public void testChildrenCompensated() {
15     ((HandlingState)scope.getState()).childrenCompensated(scope);
16     
17     assertEquals(EndedState.FAULTED, scope.getState());
18   }
19   
20   public void testChildrenCompensatedAtScope() {
21     TestInstance parent = createTestScope(root);
22     ((HandlingState)scope.getState()).childrenCompensated(scope);
23     
24     assertEquals(EndedState.FAULTED, scope.getState());
25     assertTrue(parent.childFaulted);
26   }
27   
28   public void testFaulted() {
29     scope.faulted(null);
30     assertEquals(EndedState.FAULTED, scope.getState());
31   }
32   
33   public void testFaultedAtScope() {
34     TestInstance parent = createTestScope(root);
35     
36     scope.faulted(null);
37     assertEquals(EndedState.FAULTED, scope.getState());
38     assertTrue(parent.childFaulted);
39   }
40   
41   public void testTerminate() {
42     ScopeState oldState = scope.getState();
43     scope.terminate();
44     assertEquals(oldState, scope.getState());
45   }
46   
47 }
48
Popular Tags