Package de.xima.fc.ms.test.workflow
Class AEventRunnerTest
- java.lang.Object
-
- de.xima.fc.ms.test.workflow.AWorkflowEngineTest
-
- de.xima.fc.ms.test.workflow.AEventRunnerTest
-
- All Implemented Interfaces:
DaoCrudMixin
public class AEventRunnerTest extends AWorkflowEngineTest
Base class for tests that want to test the workflow event runner, such as tests for specific triggers.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from class de.xima.fc.ms.test.workflow.AWorkflowEngineTest
client, dbConn, dbConnInvalid, ec, formData, formRecord, formVersion, group, groupOther, i18n, inbox, LOG, process, project, role, state, stateArchived, testSystemInfo, user, version
-
-
Constructor Summary
Constructors Constructor Description AEventRunnerTest()
-
Method Summary
-
Methods inherited from class de.xima.fc.ms.test.workflow.AWorkflowEngineTest
assertAttachmentContentString, assertAttachmentContentString, assertAttachmentContentZippedString, assertAttachmentsContentString, assertAttachmentsContentString, assertAttachmentsContentString, assertEntriesAreEqual, assertHasLogEntriesOfType, assertHasNoAttachments, assertHasSingleLogEntryOfType, binaryResource, createClientResource, createClientResource, createClientResource, createFormData, createFormRecordResource, createFormRecordResource, createProjectResource, createProjectResource, createProjectResource, createSleepNode, ec, formElement, getAttachmentContentData, getAttachmentContentString, getFormRecordAttachment, getFormRecordAttachment, getFormRecordAttachments, getFormRecordAttachments, getProcessingProtcolEntriesByType, getSuccessValueAs, plainTextResource, plainTextResource, readBinaryFile, readBinaryFile, readFile, readFormRecord, reloadFormRecord, reloadProcess, reloadProject, saveAndReloadFormRecord, saveAndReloadProcess, saveAndReloadProject, setupEntities, toJsonObject, updateClientLicense, updateParams, updateParams, updateParams, uploadElement, waitUntilFormRecordLocked, waitUntilFormRecordLocked, waitUntilFormRecordLocked, waitUntilFormRecordLocked, waitUntilFormRecordUnlocked, waitUntilFormRecordUnlocked, waitUntilFormRecordUnlocked, waitUntilFormRecordUnlocked
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.ms.test.dao.DaoCrudMixin
create, createOrUpdate, dao, dao, delete, read, read, readAll, update
-
-
-
-
Method Detail
-
addTo
protected void addTo(WorkflowTask task, WorkflowNode parent, int index, WorkflowNode childToAdd)
Adds the child to the given parent.- Parameters:
task
- Task to which to add the node.parent
- Parent to which to add a child.index
- Position where to add the child.childToAdd
- Child to add to the parent.
-
addTo
protected void addTo(WorkflowTask task, WorkflowNode parent, WorkflowNode childToAdd)
Adds the child to the given parent.- Parameters:
task
- Task to which to add the node.parent
- Parent to which to add a child.childToAdd
- Child to add to the parent.
-
addToRootSequence
protected void addToRootSequence(WorkflowTask task, WorkflowNode node)
Adds the given node the the root node, i.e. the main sequence of actions.- Parameters:
task
- Task to which to add the node.node
- Node to add.
-
addTriggers
protected void addTriggers(WorkflowTrigger... triggers)
-
assertContainsTriggers
protected void assertContainsTriggers(WorkflowTrigger... triggers)
-
assertFormRecordIsInState
protected void assertFormRecordIsInState(Vorgang formRecord, WorkflowState state)
-
assertFormRecordIsInState
protected void assertFormRecordIsInState(WorkflowState state)
-
assertInvokesTriggers
protected IEventExecutionResult assertInvokesTriggers(IFormRecordProvidingEvent event, WorkflowTrigger... triggers)
Asserts the given event invokes the given triggers, and only the given triggers; in the given order.- Parameters:
event
- Event to fire.triggers
- Triggers to check whether they are invoked.- Returns:
- The result of the workflow execution.
-
createAwaitTriggerInvokation
protected Runnable createAwaitTriggerInvokation(Duration waitTime, WorkflowTrigger trigger, int count)
-
createCountExecutionNode
protected WorkflowNode createCountExecutionNode(AtomicInteger counter)
-
createRecordNameNode
protected WorkflowNode createRecordNameNode(String name, Collection<String> names) throws FastJsonException
Creates a node that, upon execution, adds the name of the executed node to the given collection.- Parameters:
name
- Initial name for the node.names
- Collection to which to add the node's name.- Returns:
- A node that adds its name to the given collection when executed.
- Throws:
FastJsonException
- When the data could not be serialized.
-
formSubmissionEvent
protected IFormRecordProvidingEvent formSubmissionEvent()
-
formSubmissionEventBuilder
protected FormSubmissionEventDataBuilder formSubmissionEventBuilder()
-
runner
protected IWorkflowEventRunner runner()
-
setTasks
protected List<WorkflowTask> setTasks(int taskCount)
-
setTriggers
protected void setTriggers(WorkflowTrigger... triggers)
-
setupProcess
protected void setupProcess()
- Specified by:
setupProcess
in classAWorkflowEngineTest
-
setXfAction
protected void setXfAction(String xfAction)
-
setXfQualifier
protected void setXfQualifier(String xfQualifier)
-
triggerEvent
protected IEventExecutionResult triggerEvent(IFormRecordProvidingEvent event)
-
assertCounterDoesNotChange
protected static void assertCounterDoesNotChange(AtomicInteger counter, int expectedInitial, int seconds)
-
assertCounterReaches
protected static void assertCounterReaches(AtomicInteger counter, int target, int seconds)
-
assertCounterReachesOrHasReached
protected static void assertCounterReachesOrHasReached(AtomicInteger counter, int target, int seconds)
-
assertCounterReachesOrHasReachedAtLeast
protected static void assertCounterReachesOrHasReachedAtLeast(AtomicInteger counter, int target, int seconds)
-
assertErrorType
protected static void assertErrorType(IEventExecutionResult result, WorkflowNode node, String expectedType)
-
assertExecutionFinishedOrder
protected static void assertExecutionFinishedOrder(IEventExecutionResult result, WorkflowNode... nodes)
Asserts that node executions finished in the given order.- Parameters:
result
- Result obtained from executing the workflow.nodes
- Expected order in which the nodes should have started.
-
assertExecutionStartedOrder
protected static void assertExecutionStartedOrder(IEventExecutionResult result, WorkflowNode... nodes)
Asserts that node executions started in the given order.- Parameters:
result
- Result obtained from executing the workflow.nodes
- Expected order in which the nodes should have started.
-
assertFailure
protected static ITaskExecutionErrorResult assertFailure(IEventExecutionResult result)
-
assertFailure
protected static NodeThrewException assertFailure(IEventExecutionResult result, WorkflowNode node)
-
assertNodeSuccessResultAtKeyEquals
protected static void assertNodeSuccessResultAtKeyEquals(Object expected, IEventExecutionResult result, WorkflowNode node, String key)
-
assertNodeSuccessResultAtKeyEquals
protected static void assertNodeSuccessResultAtKeyEquals(Object expected, IWorkflowNodeResult result, String key)
-
assertSuccess
protected static ITaskExecutionSuccessResult assertSuccess(IEventExecutionResult result)
-
assertSuccess
protected static ISuccessResultData assertSuccess(IEventExecutionResult result, WorkflowNode node)
-
assertWasExecuted
protected static void assertWasExecuted(IEventExecutionResult result, WorkflowNode node)
Asserts that the given node was executed.- Parameters:
result
- Result obtained from executing the workflow.node
- Node to check.
-
assertWasNotExecuted
protected static void assertWasNotExecuted(IEventExecutionResult result, WorkflowNode node)
Asserts that the given node was not executed.- Parameters:
result
- Result obtained from executing the workflow.node
- Node to check.
-
getNodeResult
protected static IWorkflowNodeResult getNodeResult(IEventExecutionResult result, WorkflowNode node)
-
getNodeSuccessResultAtKey
protected static Object getNodeSuccessResultAtKey(IEventExecutionResult result, WorkflowNode node, String key)
-
getNodeSuccessResultAtKey
protected static <T> T getNodeSuccessResultAtKey(IEventExecutionResult result, WorkflowNode node, String key, Class<T> type)
-
getNodeSuccessResultAtKey
protected static Object getNodeSuccessResultAtKey(IWorkflowNodeResult result, String key)
-
getNodeSuccessResultAtKey
protected static <T> T getNodeSuccessResultAtKey(IWorkflowNodeResult result, String key, Class<T> type)
-
getNodeSuccessResultAtKey
protected static <T> T getNodeSuccessResultAtKey(Object successResult, String key, Class<T> type)
-
getNodeSuccessResultData
protected static ISuccessResultData getNodeSuccessResultData(IEventExecutionResult result, WorkflowNode node)
-
getNodeSuccessResultValue
protected static Object getNodeSuccessResultValue(IEventExecutionResult result, WorkflowNode node)
-
getNodeSuccessResultValue
protected static Object getNodeSuccessResultValue(IWorkflowNodeResult nodeResult)
-
getNodeThrewException
protected static NodeThrewException getNodeThrewException(IEventExecutionResult result, WorkflowNode node)
-
getRootNode
protected static WorkflowNode getRootNode(WorkflowTrigger trigger)
-
-