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 voidaddTo(WorkflowTask task, WorkflowNode parent, int index, WorkflowNode childToAdd) Adds the child to the given parent.protected voidaddTo(WorkflowTask task, WorkflowNode parent, WorkflowNode childToAdd) Adds the child to the given parent.protected voidaddToRootSequence(WorkflowTask task, WorkflowNode... nodes) Adds the given node the root node, i.e. the main sequence of actions.protected voidaddTriggers(WorkflowTrigger... triggers) protected voidassertContainsTriggers(WorkflowTrigger... triggers) protected static voidassertCounterDoesNotChange(AtomicInteger counter, int expectedInitial, int seconds) protected static voidassertCounterReaches(AtomicInteger counter, int target, int seconds) protected static voidassertCounterReachesOrHasReached(AtomicInteger counter, int target, int seconds) protected static voidassertCounterReachesOrHasReachedAtLeast(AtomicInteger counter, int target, int seconds) protected static voidassertErrorType(IEventExecutionResult result, WorkflowNode node, String expectedType) protected static voidassertExecutionFinishedOrder(IEventExecutionResult result, WorkflowNode... nodes) Asserts that node executions finished in the given order.protected static voidassertExecutionStartedOrder(IEventExecutionResult result, WorkflowNode... nodes) Asserts that node executions started in the given order.protected static ITaskExecutionErrorResultassertFailure(IEventExecutionResult result) protected static NodeThrewExceptionassertFailure(IEventExecutionResult result, WorkflowNode node) protected voidassertFormRecordIsInState(Vorgang formRecord, WorkflowState state) protected voidprotected IEventExecutionResultassertInvokesTriggers(IFormRecordProvidingEvent event, WorkflowTrigger... triggers) Asserts the given event invokes the given triggers, and only the given triggers; in the given order.protected static voidassertNodeSuccessResultAtKeyEquals(Object expected, IEventExecutionResult result, WorkflowNode node, String key) protected static voidassertNodeSuccessResultAtKeyEquals(Object expected, IWorkflowNodeResult result, String key) protected static ITaskExecutionSuccessResultassertSuccess(IEventExecutionResult result) protected static ISuccessResultDataassertSuccess(IEventExecutionResult result, WorkflowNode node) protected static voidassertWasExecuted(IEventExecutionResult result, WorkflowNode node) Asserts that the given node was executed.protected static voidassertWasNotExecuted(IEventExecutionResult result, WorkflowNode node) Asserts that the given node was not executed.protected RunnablecreateAwaitTriggerInvokation(Duration waitTime, WorkflowTrigger trigger, int count) protected WorkflowNodecreateCountExecutionNode(AtomicInteger counter) protected WorkflowNodecreateRecordNameNode(String name, Collection<String> names) Creates a node that, upon execution, adds the name of the executed node to the given collection.protected IFormRecordProvidingEventprotected FormSubmissionEventDataBuilderprotected static Stringprotected static StringgetNodeErrorMessage(IEventExecutionResult result, WorkflowNode node) protected static ObjectgetNodeErrorResultAtPath(NodeThrewException result, String path) protected static <T> TgetNodeErrorResultAtPath(NodeThrewException result, String path, Class<T> type) protected static ObjectgetNodeErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> TgetNodeErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) protected static <T> TgetNodeErrorResultAtPath(Object errorResult, String path, Class<T> type) protected static ObjectgetNodeErrorResultValue(NodeThrewException nodeThrewException) protected static ObjectgetNodeErrorResultValue(IEventExecutionResult result, WorkflowNode node) protected static Stringprotected static StringgetNodeErrorType(IEventExecutionResult result, WorkflowNode node) protected static IWorkflowNodeResultgetNodeResult(IEventExecutionResult result, WorkflowNode node) protected static NodeSoftErrorExceptiongetNodeSoftError(IEventExecutionResult result, WorkflowNode node) protected static NodeSoftErrorExceptiongetNodeSoftError(IWorkflowNodeResult nodeResult) protected static StringgetNodeSoftErrorMessage(IEventExecutionResult result, WorkflowNode node) protected static StringgetNodeSoftErrorMessage(IWorkflowNodeResult nodeResult) getNodeSoftErrorMessages(IEventExecutionResult result, WorkflowNode node) getNodeSoftErrorMessages(IWorkflowNodeResult nodeResult) protected static ObjectgetNodeSoftErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> TgetNodeSoftErrorResultAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) protected static ObjectgetNodeSoftErrorResultAtPath(IWorkflowNodeResult nodeResult, String path) protected static <T> TgetNodeSoftErrorResultAtPath(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 ObjectgetNodeSoftErrorResultValue(IEventExecutionResult result, WorkflowNode node) protected static ObjectgetNodeSoftErrorResultValue(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 StringgetNodeSoftErrorType(IEventExecutionResult result, WorkflowNode node) protected static StringgetNodeSoftErrorType(IWorkflowNodeResult nodeResult) getNodeSoftErrorTypes(IEventExecutionResult result, WorkflowNode node) getNodeSoftErrorTypes(IWorkflowNodeResult nodeResult) protected static ObjectgetNodeSuccessResultAtKey(IEventExecutionResult result, WorkflowNode node, String key) protected static <T> TgetNodeSuccessResultAtKey(IEventExecutionResult result, WorkflowNode node, String key, Class<T> type) protected static ObjectgetNodeSuccessResultAtKey(IWorkflowNodeResult result, String key) protected static <T> TgetNodeSuccessResultAtKey(IWorkflowNodeResult result, String key, Class<T> type) protected static <T> TgetNodeSuccessResultAtKey(Object successResult, String key, Class<T> type) protected static ObjectgetNodeSuccessResultAtPath(IEventExecutionResult result, WorkflowNode node, String path) protected static <T> TgetNodeSuccessResultAtPath(IEventExecutionResult result, WorkflowNode node, String path, Class<T> type) protected static ObjectgetNodeSuccessResultAtPath(IWorkflowNodeResult result, String path) protected static <T> TgetNodeSuccessResultAtPath(IWorkflowNodeResult result, String path, Class<T> type) protected static <T> TgetNodeSuccessResultAtPath(Object successResult, String path, Class<T> type) protected static ISuccessResultDatagetNodeSuccessResultData(IEventExecutionResult result, WorkflowNode node) protected static ObjectgetNodeSuccessResultValue(IEventExecutionResult result, WorkflowNode node) protected static ObjectgetNodeSuccessResultValue(IWorkflowNodeResult nodeResult) protected static NodeThrewExceptiongetNodeThrewException(IEventExecutionResult result, WorkflowNode node) protected static WorkflowNodegetRootNode(WorkflowTrigger trigger) protected IWorkflowEventRunnerrunner()protected voidsetFormData(Map<String, Object> dataToSet) protected List<WorkflowTask>setTasks(int taskCount) protected voidsetTriggers(WorkflowTrigger... triggers) protected voidprotected voidsetXfAction(String xfAction) protected voidsetXfQualifier(String xfQualifier) protected IEventExecutionResultMethods 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, waitUntilFormRecordUnlockedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
setupProcessin 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
-