KickJava   Java API By Example, From Geeks To Geeks.

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


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 CompChildrenAtHandlerTest extends AbstractStateTestCase {
9
10   public ScopeState getState() {
11     return CompensatingState.TERMINATING_CHILDREN_AT_HANDLER;
12   }
13   
14   public void testChildrenTerminated() {
15     scope.getState().childrenTerminated(scope);
16     
17     assertEquals( EndedState.FAULTED, scope.getState() );
18   }
19   
20   public void testChildrenTerminatedAtScope() {
21     TestInstance parent = createTestScope(root);
22     scope.getState().childrenTerminated(scope);
23     
24     assertEquals( EndedState.FAULTED, scope.getState() );
25     assertTrue( parent.childFaulted );
26   }
27   
28   public void testChildrenCompensated() {
29     try { ((HandlingState)scope.getState()).childrenCompensated(scope); }
30     catch(IllegalStateException JavaDoc e) { return; }
31     fail("compensate can't be invoked at this state");
32   }
33 }
Popular Tags