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
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, tempDir, testSystemInfo, user, version
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addTo
(WorkflowTask task, WorkflowNode parent, int index, WorkflowNode childToAdd) Adds the child to the given parent.protected void
addTo
(WorkflowTask task, WorkflowNode parent, WorkflowNode childToAdd) Adds the child to the given parent.protected void
addToRootSequence
(WorkflowTask task, WorkflowNode... nodes) Adds the given node the root node, i.e. the main sequence of actions.protected void
addTriggers
(WorkflowTrigger... triggers) protected void
assertContainsTriggers
(WorkflowTrigger... triggers) protected static void
assertCounterDoesNotChange
(AtomicInteger counter, int expectedInitial, int seconds) protected static void
assertCounterReaches
(AtomicInteger counter, int target, int seconds) protected static void
assertCounterReachesOrHasReached
(AtomicInteger counter, int target, int seconds) protected static void
assertCounterReachesOrHasReachedAtLeast
(AtomicInteger counter, int target, int seconds) protected static void
assertErrorType
(IEventExecutionResult result, WorkflowNode node, String expectedType) protected static void
assertExecutionFinishedOrder
(IEventExecutionResult result, WorkflowNode... nodes) Asserts that node executions finished in the given order.protected static void
assertExecutionStartedOrder
(IEventExecutionResult result, WorkflowNode... nodes) Asserts that node executions started in the given order.protected static ITaskExecutionErrorResult
assertFailure
(IEventExecutionResult result) protected static NodeThrewException
assertFailure
(IEventExecutionResult result, WorkflowNode node) protected void
assertFormRecordIsInState
(Vorgang formRecord, WorkflowState state) protected void
protected IEventExecutionResult
assertInvokesTriggers
(IFormRecordProvidingEvent event, WorkflowTrigger... triggers) Asserts the given event invokes the given triggers, and only the given triggers; in the given order.protected static void
assertNodeSuccessResultAtKeyEquals
(Object expected, IEventExecutionResult result, WorkflowNode node, String key) protected static void
assertNodeSuccessResultAtKeyEquals
(Object expected, IWorkflowNodeResult result, String key) protected static ITaskExecutionSuccessResult
assertSuccess
(IEventExecutionResult result) protected static ISuccessResultData
assertSuccess
(IEventExecutionResult result, WorkflowNode node) protected static void
assertWasExecuted
(IEventExecutionResult result, WorkflowNode node) Asserts that the given node was executed.protected static void
assertWasNotExecuted
(IEventExecutionResult result, WorkflowNode node) Asserts that the given node was not executed.protected Runnable
createAwaitTriggerInvokation
(Duration waitTime, WorkflowTrigger trigger, int count) protected WorkflowNode
createCountExecutionNode
(AtomicInteger counter) protected WorkflowNode
createRecordNameNode
(String name, Collection<String> names) Creates a node that, upon execution, adds the name of the executed node to the given collection.protected IFormRecordProvidingEvent
protected FormSubmissionEventDataBuilder
protected static String
protected static String
getNodeErrorMessage
(IEventExecutionResult result, WorkflowNode node) protected static Object
getNodeErrorResultAtPath
(NodeThrewException result, String path) protected static <T> T
getNodeErrorResultAtPath
(NodeThrewException result, String path, Class<T> type) protected static Object
getNodeErrorResultAtPath
(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> T
getNodeErrorResultAtPath
(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) protected static <T> T
getNodeErrorResultAtPath
(Object errorResult, String path, Class<T> type) protected static Object
getNodeErrorResultValue
(NodeThrewException nodeThrewException) protected static Object
getNodeErrorResultValue
(IEventExecutionResult result, WorkflowNode node) protected static String
protected static String
getNodeErrorType
(IEventExecutionResult result, WorkflowNode node) protected static IWorkflowNodeResult
getNodeResult
(IEventExecutionResult result, WorkflowNode node) protected static NodeSoftErrorException
getNodeSoftError
(IEventExecutionResult result, WorkflowNode node) protected static NodeSoftErrorException
getNodeSoftError
(IWorkflowNodeResult nodeResult) protected static String
getNodeSoftErrorMessage
(IEventExecutionResult result, WorkflowNode node) protected static String
getNodeSoftErrorMessage
(IWorkflowNodeResult nodeResult) getNodeSoftErrorMessages
(IEventExecutionResult result, WorkflowNode node) getNodeSoftErrorMessages
(IWorkflowNodeResult nodeResult) protected static Object
getNodeSoftErrorResultAtPath
(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> T
getNodeSoftErrorResultAtPath
(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) protected static Object
getNodeSoftErrorResultAtPath
(IWorkflowNodeResult nodeResult, String path) protected static <T> T
getNodeSoftErrorResultAtPath
(IWorkflowNodeResult nodeResult, String path, Class<T> type) getNodeSoftErrorResultsAtPath
(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> List<T>
getNodeSoftErrorResultsAtPath
(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) getNodeSoftErrorResultsAtPath
(IWorkflowNodeResult nodeResult, String path) protected static <T> List<T>
getNodeSoftErrorResultsAtPath
(IWorkflowNodeResult nodeResult, String path, Class<T> type) protected static Object
getNodeSoftErrorResultValue
(IEventExecutionResult result, WorkflowNode node) protected static Object
getNodeSoftErrorResultValue
(IWorkflowNodeResult nodeResult) getNodeSoftErrorResultValues
(IEventExecutionResult result, WorkflowNode node) getNodeSoftErrorResultValues
(IWorkflowNodeResult nodeResult) protected static List<NodeSoftErrorException>
getNodeSoftErrors
(IEventExecutionResult result, WorkflowNode node) protected static List<NodeSoftErrorException>
getNodeSoftErrors
(IWorkflowNodeResult nodeResult) protected static String
getNodeSoftErrorType
(IEventExecutionResult result, WorkflowNode node) protected static String
getNodeSoftErrorType
(IWorkflowNodeResult nodeResult) getNodeSoftErrorTypes
(IEventExecutionResult result, WorkflowNode node) getNodeSoftErrorTypes
(IWorkflowNodeResult nodeResult) protected static Object
getNodeSuccessResultAtKey
(IEventExecutionResult result, WorkflowNode node, String key) protected static <T> T
getNodeSuccessResultAtKey
(IEventExecutionResult result, WorkflowNode node, String key, Class<T> type) protected static Object
getNodeSuccessResultAtKey
(IWorkflowNodeResult result, String key) protected static <T> T
getNodeSuccessResultAtKey
(IWorkflowNodeResult result, String key, Class<T> type) protected static <T> T
getNodeSuccessResultAtKey
(Object successResult, String key, Class<T> type) protected static Object
getNodeSuccessResultAtPath
(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> T
getNodeSuccessResultAtPath
(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) protected static Object
getNodeSuccessResultAtPath
(IWorkflowNodeResult result, String path) protected static <T> T
getNodeSuccessResultAtPath
(IWorkflowNodeResult result, String path, Class<T> type) protected static <T> T
getNodeSuccessResultAtPath
(Object successResult, String path, Class<T> type) protected static ISuccessResultData
getNodeSuccessResultData
(IEventExecutionResult result, WorkflowNode node) protected static Object
getNodeSuccessResultValue
(IEventExecutionResult result, WorkflowNode node) protected static Object
getNodeSuccessResultValue
(IWorkflowNodeResult nodeResult) protected static NodeThrewException
getNodeThrewException
(IEventExecutionResult result, WorkflowNode node) protected static WorkflowNode
getRootNode
(WorkflowTrigger trigger) protected IWorkflowEventRunner
runner()
protected void
setFormData
(Map<String, Object> dataToSet) protected List<WorkflowTask>
setTasks
(int taskCount) protected void
setTriggers
(WorkflowTrigger... triggers) protected void
protected void
setXfAction
(String xfAction) protected void
setXfQualifier
(String xfQualifier) protected IEventExecutionResult
Methods inherited from class de.xima.fc.ms.test.workflow.AWorkflowEngineTest
assertAttachmentContentString, assertAttachmentContentString, assertAttachmentContentZippedString, assertAttachmentsContentString, assertAttachmentsContentString, assertAttachmentsContentString, assertEntriesAreEqual, assertHasLogEntriesOfType, assertHasNoAttachments, assertHasSingleLogEntryOfType, binaryResource, cleanupAfterAll, cleanupAfterEach, createClientResource, createClientResource, createClientResource, createFormData, createFormRecordResource, createFormRecordResource, createProjectResource, createProjectResource, createProjectResource, createSleepNode, createTempDir, createTextFile, deleteTempDir, ec, formElement, getAttachmentContentData, getAttachmentContentString, getFormRecordAttachment, getFormRecordAttachment, getFormRecordAttachmentContentString, getFormRecordAttachments, getFormRecordAttachments, getProcessingProtcolEntriesByType, getSuccessValueAs, nodeKey, plainTextResource, plainTextResource, readBinaryFile, readBinaryFile, readFile, readFormRecord, registerQueryListener, reloadFormRecord, reloadProcess, reloadProject, runGenericAfterAllCleanupActions, runGenericAfterEachCleanupActions, 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
-
Constructor Details
-
AEventRunnerTest
public AEventRunnerTest()
-
-
Method Details
-
addTo
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
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
Adds the given node the root node, i.e. the main sequence of actions.- Parameters:
task
- Task to which to add the node.nodes
- Nodes to add.
-
addTriggers
-
assertContainsTriggers
-
assertFormRecordIsInState
-
assertFormRecordIsInState
-
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
-
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
-
formSubmissionEventBuilder
-
runner
-
setFormData
-
setTasks
-
setTriggers
-
setupProcess
protected void setupProcess()- Specified by:
setupProcess
in classAWorkflowEngineTest
-
setXfAction
-
setXfQualifier
-
triggerEvent
-
assertCounterDoesNotChange
protected static void assertCounterDoesNotChange(AtomicInteger counter, int expectedInitial, int seconds) -
assertCounterReaches
-
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
-
assertFailure
-
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
-
assertSuccess
-
assertWasExecuted
Asserts that the given node was executed.- Parameters:
result
- Result obtained from executing the workflow.node
- Node to check.
-
assertWasNotExecuted
Asserts that the given node was not executed.- Parameters:
result
- Result obtained from executing the workflow.node
- Node to check.
-
getNodeResult
-
getNodeSoftErrors
protected static List<NodeSoftErrorException> getNodeSoftErrors(IEventExecutionResult result, WorkflowNode node) -
getNodeSoftErrors
-
getNodeSoftErrorTypes
protected static List<String> getNodeSoftErrorTypes(IEventExecutionResult result, WorkflowNode node) -
getNodeSoftErrorTypes
-
getNodeSoftErrorType
-
getNodeSoftErrorType
-
getNodeSoftErrorMessages
protected static List<String> getNodeSoftErrorMessages(IEventExecutionResult result, WorkflowNode node) -
getNodeSoftErrorMessages
-
getNodeSoftErrorMessage
-
getNodeSoftErrorMessage
-
getNodeSoftError
protected static NodeSoftErrorException getNodeSoftError(IEventExecutionResult result, WorkflowNode node) -
getNodeSoftError
-
getNodeSoftErrorResultValues
protected static List<Object> getNodeSoftErrorResultValues(IEventExecutionResult result, WorkflowNode node) -
getNodeSoftErrorResultValues
-
getNodeSoftErrorResultValue
protected static Object getNodeSoftErrorResultValue(IEventExecutionResult result, WorkflowNode node) -
getNodeSoftErrorResultValue
-
getNodeSoftErrorResultsAtPath
protected static List<Object> getNodeSoftErrorResultsAtPath(IEventExecutionResult result, WorkflowNode node, String path) -
getNodeSoftErrorResultsAtPath
protected static <T> List<T> getNodeSoftErrorResultsAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) -
getNodeSoftErrorResultsAtPath
protected static List<Object> getNodeSoftErrorResultsAtPath(IWorkflowNodeResult nodeResult, String path) -
getNodeSoftErrorResultsAtPath
protected static <T> List<T> getNodeSoftErrorResultsAtPath(IWorkflowNodeResult nodeResult, String path, Class<T> type) -
getNodeSoftErrorResultAtPath
protected static Object getNodeSoftErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path) -
getNodeSoftErrorResultAtPath
protected static <T> T getNodeSoftErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) -
getNodeSoftErrorResultAtPath
-
getNodeSoftErrorResultAtPath
protected static <T> T getNodeSoftErrorResultAtPath(IWorkflowNodeResult nodeResult, String path, Class<T> type) -
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
-
getNodeSuccessResultAtKey
protected static <T> T getNodeSuccessResultAtKey(IWorkflowNodeResult result, String key, Class<T> type) -
getNodeSuccessResultAtKey
-
getNodeSuccessResultAtPath
protected static Object getNodeSuccessResultAtPath(IEventExecutionResult result, WorkflowNode node, String path) -
getNodeSuccessResultAtPath
protected static <T> T getNodeSuccessResultAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) -
getNodeSuccessResultAtPath
-
getNodeSuccessResultAtPath
protected static <T> T getNodeSuccessResultAtPath(IWorkflowNodeResult result, String path, Class<T> type) -
getNodeSuccessResultAtPath
-
getNodeSuccessResultData
protected static ISuccessResultData getNodeSuccessResultData(IEventExecutionResult result, WorkflowNode node) -
getNodeSuccessResultValue
-
getNodeSuccessResultValue
-
getNodeErrorResultValue
-
getNodeErrorResultValue
-
getNodeErrorResultAtPath
protected static Object getNodeErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path) -
getNodeErrorResultAtPath
protected static <T> T getNodeErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) -
getNodeErrorResultAtPath
-
getNodeErrorResultAtPath
protected static <T> T getNodeErrorResultAtPath(NodeThrewException result, String path, Class<T> type) -
getNodeErrorResultAtPath
-
getNodeThrewException
protected static NodeThrewException getNodeThrewException(IEventExecutionResult result, WorkflowNode node) -
getNodeErrorMessage
-
getNodeErrorMessage
-
getNodeErrorType
-
getNodeErrorType
-
getRootNode
-