1 package org.jbpm.bpel.exe.state; 2 3 4 8 public class FaultExplicitHandlerTest extends AbstractStateTestCase { 9 10 public ScopeState getState() { 11 return FaultingState.FAULTING_EXPLICITLY; 12 } 13 14 public void testFaulted() { 15 scope.faulted(null); 16 assertEquals(FaultingState.TERMINATING_CHILDREN_AT_HANDLER, scope.getState()); 17 assertChildrenTerminated(); 18 } 19 20 public void testFaultedAtScope() { 21 TestInstance parent = createTestScope(root); 22 23 scope.faulted(null); 24 assertEquals(FaultingState.TERMINATING_CHILDREN_AT_HANDLER, scope.getState()); 25 assertChildrenTerminated(); 26 assertFalse(parent.childFaulted); 27 } 28 29 public void testCompleted() { 30 scope.completed(); 31 32 assertEquals( EndedState.COMPLETED_ABNORMALLY, scope.getState() ); 33 } 34 35 public void testCompletedAtScope() { 36 TestInstance parent = createTestScope(root); 37 scope.completed(); 38 39 assertEquals( EndedState.COMPLETED_ABNORMALLY, scope.getState() ); 40 assertFalse( parent.childFaulted ); 41 assertTrue(scopeCompletionLog.executed); 42 } 43 44 public void testChildrenCompensated() { 45 try { ((HandlingState)scope.getState()).childrenCompensated(scope); } 46 catch(IllegalStateException e) { return; } 47 fail("compensate can't be invoked at this state"); 48 } 49 50 public void testTerminate() { 51 ScopeState oldState = scope.getState(); 52 scope.terminate(); 53 assertEquals(oldState, scope.getState()); 54 } 55 56 } 57 | Popular Tags |