Package net.officefloor.frame.test
Class CompleteFlowCallback
- java.lang.Object
-
- net.officefloor.frame.test.CompleteFlowCallback
-
- All Implemented Interfaces:
FlowCallback
- Direct Known Subclasses:
SafeCompleteFlowCallback
public class CompleteFlowCallback extends java.lang.Object implements FlowCallback
FlowCallbackthat checks on completion and propagates failures.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisCompleteIndicates ifFlowis complete.-
Fields inherited from interface net.officefloor.frame.api.function.FlowCallback
ESCALATE
-
-
Constructor Summary
Constructors Constructor Description CompleteFlowCallback()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertComplete()Asserts theFlowis complete.voidassertComplete(ThreadedTestSupport threading)Asserts theFlowis complete.voidassertNotComplete()Asserts theFlowis not complete.voidassertNotComplete(ThreadedTestSupport threading)Asserts theFlowis not complete.voidrun(java.lang.Throwable escalation)Invoked on completion of theFlow.
-
-
-
Field Detail
-
isComplete
protected volatile boolean isComplete
Indicates ifFlowis complete.
-
-
Method Detail
-
assertComplete
public void assertComplete() throws java.lang.ExceptionAsserts theFlowis complete.- Throws:
java.lang.Exception- If failure in execution.
-
assertComplete
public void assertComplete(ThreadedTestSupport threading) throws java.lang.Exception
Asserts theFlowis complete.- Parameters:
threading-ThreadedTestSupportto wait for completion. Necessary if spawningThreadState.- Throws:
java.lang.Exception- If failure in execution.
-
assertNotComplete
public void assertNotComplete() throws java.lang.ExceptionAsserts theFlowis not complete.- Throws:
java.lang.Exception- If failure in execution.
-
assertNotComplete
public void assertNotComplete(ThreadedTestSupport threading) throws java.lang.Exception
Asserts theFlowis not complete.- Parameters:
threading-ThreadedTestSupportto wait for completion. Necessary if spawningThreadState.- Throws:
java.lang.Exception- If failure in execution.
-
run
public void run(java.lang.Throwable escalation) throws java.lang.ThrowableDescription copied from interface:FlowCallbackInvoked on completion of theFlow.- Specified by:
runin interfaceFlowCallback- Parameters:
escalation- PossibleThrowablefrom theFlow.nullindicates allEscalationinstances handled withinFlow.- Throws:
java.lang.Throwable-Escalationwithin the callback logic.
-
-