KickJava   Java API By Example, From Geeks To Geeks.

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


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

9 public class NormalProcessingTest extends AbstractStateTestCase {
10
11   public ScopeState getState() {
12     return ActiveState.NORMAL_PROCESSING;
13   }
14
15   public void testCompleted() {
16     scope.getToken().end();
17     scope.completed();
18     
19     assertEquals( EndedState.COMPLETED, scope.getState() );
20   }
21   
22   public void testCompletedAtScope() {
23     createTestScope(root);
24     scope.getToken().end();
25     scope.completed();
26     
27     assertEquals( EndedState.COMPLETED, scope.getState() );
28     assertTrue(scopeCompletionLog.executed);
29   }
30   
31   public void testFaulted() {
32     Fault fault = new Fault();
33     scope.faulted(fault);
34     
35     assertEquals( FaultingState.TERMINATING_CHILDREN, scope.getState() );
36     assertEquals( fault, scope.getFault() );
37     assertChildrenTerminated();
38   }
39   
40   public void testTerminate() {
41     scope.terminate();
42     
43     assertEquals( TerminatingState.TERMINATING_CHILDREN, scope.getState() );
44     assertChildrenTerminated();
45   }
46 }
Popular Tags