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
FlowCallback
that checks on completion and propagates failures.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isComplete
Indicates ifFlow
is 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 void
assertComplete()
Asserts theFlow
is complete.void
assertComplete(ThreadedTestSupport threading)
Asserts theFlow
is complete.void
assertNotComplete()
Asserts theFlow
is not complete.void
assertNotComplete(ThreadedTestSupport threading)
Asserts theFlow
is not complete.void
run(java.lang.Throwable escalation)
Invoked on completion of theFlow
.
-
-
-
Field Detail
-
isComplete
protected volatile boolean isComplete
Indicates ifFlow
is complete.
-
-
Method Detail
-
assertComplete
public void assertComplete() throws java.lang.Exception
Asserts theFlow
is complete.- Throws:
java.lang.Exception
- If failure in execution.
-
assertComplete
public void assertComplete(ThreadedTestSupport threading) throws java.lang.Exception
Asserts theFlow
is complete.- Parameters:
threading
-ThreadedTestSupport
to wait for completion. Necessary if spawningThreadState
.- Throws:
java.lang.Exception
- If failure in execution.
-
assertNotComplete
public void assertNotComplete() throws java.lang.Exception
Asserts theFlow
is not complete.- Throws:
java.lang.Exception
- If failure in execution.
-
assertNotComplete
public void assertNotComplete(ThreadedTestSupport threading) throws java.lang.Exception
Asserts theFlow
is not complete.- Parameters:
threading
-ThreadedTestSupport
to 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.Throwable
Description copied from interface:FlowCallback
Invoked on completion of theFlow
.- Specified by:
run
in interfaceFlowCallback
- Parameters:
escalation
- PossibleThrowable
from theFlow
.null
indicates allEscalation
instances handled withinFlow
.- Throws:
java.lang.Throwable
-Escalation
within the callback logic.
-
-