Class MockAsynchronousFlow
java.lang.Object
net.officefloor.compile.test.managedfunction.MockAsynchronousFlow
- All Implemented Interfaces:
AsynchronousFlow
Mock
AsynchronousFlow.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete(AsynchronousFlowCompletion completion) Invoked by application code once theAsynchronousFlowis complete.Obtains the providedAsynchronousFlowCompletion.booleanIndicates ifAsynchronousFlowis complete.Waits a default period of time for completion.waitOnCompletion(int timeToWait) Waits for completion.
-
Constructor Details
-
MockAsynchronousFlow
public MockAsynchronousFlow()
-
-
Method Details
-
isComplete
public boolean isComplete()Indicates ifAsynchronousFlowis complete.- Returns:
trueifAsynchronousFlowis complete.
-
getCompletion
Obtains the provided
AsynchronousFlowCompletion.Note: will fail if this
AsynchronousFlowis not complete.- Returns:
AsynchronousFlowCompletionornullif not provided.
-
waitOnCompletion
Waits for completion.- Parameters:
timeToWait- Time in milliseconds to wait.- Returns:
- Provided
AsynchronousFlowCompletion.
-
waitOnCompletion
Waits a default period of time for completion.- Returns:
- Provided
AsynchronousFlowCompletion.
-
complete
Description copied from interface:AsynchronousFlowInvoked by application code once the
AsynchronousFlowis complete.Note that only the first invocation of this method is considered. All further invocations are ignored.
Furthermore, if the
AsynchronousFlowtakes too long to complete then all invocations are ignored. TheManagedFunctionwill be throwing anAsynchronousFlowTimedOutEscalation.- Specified by:
completein interfaceAsynchronousFlow- Parameters:
completion-AsynchronousFlowCompletionto updateManagedObjectstate and possibly throw failures.
-