KickJava   Java API By Example, From Geeks To Geeks.

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


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 CompImplicitHandlerTest extends AbstractStateTestCase {
9   
10   public ScopeState getState() {
11     return CompensatingState.COMPENSATING_IMPLICITLY;
12   }
13   
14   public void testChildrenCompensated() {
15     ((HandlingState)scope.getState()).childrenCompensated(scope);
16     
17     assertEquals( EndedState.COMPENSATED, scope.getState() );
18   }
19   
20   public void testChildrenCompensatedAtScope() {
21     TestInstance parent = createTestScope(root);
22     ((HandlingState)scope.getState()).childrenCompensated(scope);
23     
24     assertEquals( EndedState.COMPENSATED, scope.getState() );
25     assertTrue( parent.childCompensated );
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     assertFalse(parent.childCompensated);
39     assertTrue(parent.childFaulted);
40   }
41 }
42
Popular Tags