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, tempDir, 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, 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
-
-
-
-
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... nodes)
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
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)
-
getNodeSoftErrors
protected static List<NodeSoftErrorException> getNodeSoftErrors(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrors
protected static List<NodeSoftErrorException> getNodeSoftErrors(IWorkflowNodeResult nodeResult)
-
getNodeSoftErrorTypes
protected static List<String> getNodeSoftErrorTypes(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrorTypes
protected static List<String> getNodeSoftErrorTypes(IWorkflowNodeResult nodeResult)
-
getNodeSoftErrorType
protected static String getNodeSoftErrorType(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrorType
protected static String getNodeSoftErrorType(IWorkflowNodeResult nodeResult)
-
getNodeSoftErrorMessages
protected static List<String> getNodeSoftErrorMessages(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrorMessages
protected static List<String> getNodeSoftErrorMessages(IWorkflowNodeResult nodeResult)
-
getNodeSoftErrorMessage
protected static String getNodeSoftErrorMessage(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrorMessage
protected static String getNodeSoftErrorMessage(IWorkflowNodeResult nodeResult)
-
getNodeSoftError
protected static NodeSoftErrorException getNodeSoftError(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftError
protected static NodeSoftErrorException getNodeSoftError(IWorkflowNodeResult nodeResult)
-
getNodeSoftErrorResultValues
protected static List<Object> getNodeSoftErrorResultValues(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrorResultValues
protected static List<Object> getNodeSoftErrorResultValues(IWorkflowNodeResult nodeResult)
-
getNodeSoftErrorResultValue
protected static Object getNodeSoftErrorResultValue(IEventExecutionResult result, WorkflowNode node)
-
getNodeSoftErrorResultValue
protected static Object getNodeSoftErrorResultValue(IWorkflowNodeResult nodeResult)
-
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
protected static Object getNodeSoftErrorResultAtPath(IWorkflowNodeResult nodeResult, String path)
-
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
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)
-
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
protected static Object getNodeSuccessResultAtPath(IWorkflowNodeResult result, String path)
-
getNodeSuccessResultAtPath
protected static <T> T getNodeSuccessResultAtPath(IWorkflowNodeResult result, String path, Class<T> type)
-
getNodeSuccessResultAtPath
protected static <T> T getNodeSuccessResultAtPath(Object successResult, String path, 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)
-
getNodeErrorResultValue
protected static Object getNodeErrorResultValue(IEventExecutionResult result, WorkflowNode node)
-
getNodeErrorResultValue
protected static Object getNodeErrorResultValue(NodeThrewException nodeThrewException)
-
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
protected static Object getNodeErrorResultAtPath(NodeThrewException result, String path)
-
getNodeErrorResultAtPath
protected static <T> T getNodeErrorResultAtPath(NodeThrewException result, String path, Class<T> type)
-
getNodeErrorResultAtPath
protected static <T> T getNodeErrorResultAtPath(Object errorResult, String path, Class<T> type)
-
getNodeThrewException
protected static NodeThrewException getNodeThrewException(IEventExecutionResult result, WorkflowNode node)
-
getNodeErrorMessage
protected static String getNodeErrorMessage(IEventExecutionResult result, WorkflowNode node)
-
getNodeErrorMessage
protected static String getNodeErrorMessage(NodeThrewException error)
-
getNodeErrorType
protected static String getNodeErrorType(IEventExecutionResult result, WorkflowNode node)
-
getNodeErrorType
protected static String getNodeErrorType(NodeThrewException error)
-
getRootNode
protected static WorkflowNode getRootNode(WorkflowTrigger trigger)
-
-