public abstract class WorkflowTestBase extends Object implements org.junit.rules.MethodRule
Modifier and Type | Field and Description |
---|---|
protected DecisionContext |
decisionContext |
protected String |
defaultActivitiesTaskListToPoll |
protected TestWorkflowClock |
workflowClock |
protected TestWorkflowContext |
workflowContext |
Constructor and Description |
---|
WorkflowTestBase(DecisionContext decisionContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterEvaluate() |
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
Object target) |
protected void |
beforeEvaluate(DecisionContext decisionContext) |
void |
clockAdvanceSeconds(long seconds) |
void |
clockAdvanceSeconds(long seconds,
Promise<?>... waitFor) |
double |
getClockAcceleration() |
DecisionContext |
getDecisionContext() |
String |
getDefaultActivitiesTaskListToPoll() |
WorkflowExecution |
getWorkflowExecution() |
WorkflowType |
getWorkflowType() |
boolean |
isDisableOutstandingTasksCheck() |
void |
setClockAccelerationCoefficient(double clockAcceleration)
Accelerate workflow clock according the coefficient.
|
void |
setClockCurrentTimeMillis(long timeMillis) |
void |
setDefaultActivitiesTaskListToPoll(String defaultActivitiesTaskListToPoll) |
void |
setDisableOutstandingTasksCheck(boolean disableOutstandingTasksCheck)
When set to
true it is considered a test failure to have
outstanding tasks that are blocked on non external events or timers. |
void |
setExpectedException(Class<? extends Throwable> expectedException) |
void |
setFlowTestRunner(boolean flowTestRunner) |
void |
setTestTimeoutActualTimeMilliseconds(long timeout)
Test timeout time.
|
void |
setWorkflowExecution(WorkflowExecution workflowExecution) |
void |
setWorkflowType(WorkflowType workflowType) |
Promise<Void> |
waitBlocked(Promise<?>... waitFor)
Here blocked means that there are no any tasks that are ready to be
executed.
|
protected String defaultActivitiesTaskListToPoll
protected DecisionContext decisionContext
protected TestWorkflowContext workflowContext
protected TestWorkflowClock workflowClock
public WorkflowTestBase(DecisionContext decisionContext)
public boolean isDisableOutstandingTasksCheck()
public void setDisableOutstandingTasksCheck(boolean disableOutstandingTasksCheck)
true
it is considered a test failure to have
outstanding tasks that are blocked on non external events or timers. Such
blockage is usually indicates a bug that can lead to a workflow
"getting stuck". Default is true
.public DecisionContext getDecisionContext()
public void setWorkflowExecution(WorkflowExecution workflowExecution)
public void setWorkflowType(WorkflowType workflowType)
public WorkflowExecution getWorkflowExecution()
public WorkflowType getWorkflowType()
public String getDefaultActivitiesTaskListToPoll()
public void setDefaultActivitiesTaskListToPoll(String defaultActivitiesTaskListToPoll)
public double getClockAcceleration()
public void setClockAccelerationCoefficient(double clockAcceleration)
WorkflowClock
and timers
firing only. The default is 1.0 (no acceleration).clockAcceleration
- value that is larger then 1.0public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target)
apply
in interface org.junit.rules.MethodRule
public Promise<Void> waitBlocked(Promise<?>... waitFor)
public void setClockCurrentTimeMillis(long timeMillis)
public void clockAdvanceSeconds(long seconds)
public void clockAdvanceSeconds(long seconds, Promise<?>... waitFor)
protected void beforeEvaluate(DecisionContext decisionContext)
protected void afterEvaluate()
public void setTestTimeoutActualTimeMilliseconds(long timeout)
setClockAccelerationCoefficient(double)
). Instead of calling
this method consider using FlowBlockJUnit4ClassRunner
or
FlowSpringJUnit4ClassRunner
and timeout parameter of @Test
annotation.timeout
- time in milliseconds.public void setFlowTestRunner(boolean flowTestRunner)
Copyright © 2014. All rights reserved.