Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow.junit
Class WorkflowTestBase

java.lang.Object
  extended by com.amazonaws.services.simpleworkflow.flow.junit.WorkflowTestBase
Direct Known Subclasses:
GenericWorkflowTest, SpringWorkflowTest, WorkflowTest

public abstract class WorkflowTestBase
extends Object


Constructor Summary
WorkflowTestBase(DecisionContext decisionContext)
           
 
Method Summary
 Statement apply(Statement base, FrameworkMethod method, Object target)
           
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowTestBase

public WorkflowTestBase(DecisionContext decisionContext)
Method Detail

isDisableOutstandingTasksCheck

public boolean isDisableOutstandingTasksCheck()

setDisableOutstandingTasksCheck

public 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. Such blockage is usually indicates a bug that can lead to a workflow "getting stuck". Default is true.


getDecisionContext

public DecisionContext getDecisionContext()

setWorkflowExecution

public void setWorkflowExecution(WorkflowExecution workflowExecution)

setWorkflowType

public void setWorkflowType(WorkflowType workflowType)

getWorkflowExecution

public WorkflowExecution getWorkflowExecution()

getWorkflowType

public WorkflowType getWorkflowType()

getDefaultActivitiesTaskListToPoll

public String getDefaultActivitiesTaskListToPoll()

setDefaultActivitiesTaskListToPoll

public void setDefaultActivitiesTaskListToPoll(String defaultActivitiesTaskListToPoll)

getClockAcceleration

public double getClockAcceleration()

setClockAccelerationCoefficient

public void setClockAccelerationCoefficient(double clockAcceleration)
Accelerate workflow clock according the coefficient. Note that the clock acceleration affects time returned by WorkflowClock and timers firing only. The default is 1.0 (no acceleration).

Parameters:
clockAcceleration - value that is larger then 1.0

apply

public Statement apply(Statement base,
                       FrameworkMethod method,
                       Object target)

waitBlocked

public Promise<Void> waitBlocked(Promise<?>... waitFor)
Here blocked means that there are no any tasks that are ready to be executed. Usually these tasks wait for timers or some other external events.

Returns:
Promise that becomes ready when there are not tasks to execute

setClockCurrentTimeMillis

public void setClockCurrentTimeMillis(long timeMillis)

clockAdvanceSeconds

public void clockAdvanceSeconds(long seconds)

clockAdvanceSeconds

public void clockAdvanceSeconds(long seconds,
                                Promise<?>... waitFor)

setTestTimeoutActualTimeMilliseconds

public void setTestTimeoutActualTimeMilliseconds(long timeout)
Test timeout time. Uses real clock that ignores acceleration (see setClockAccelerationCoefficient(double)). Instead of calling this method consider using FlowBlockJUnit4ClassRunner or FlowSpringJUnit4ClassRunner and timeout parameter of @Test annotation.

Parameters:
timeout - time in milliseconds.

setExpectedException

public void setExpectedException(Class<? extends Throwable> expectedException)

setFlowTestRunner

public void setFlowTestRunner(boolean flowTestRunner)


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.