Documentation
¶
Index ¶
- Constants
- Variables
- func NoOpActivityInterceptor() activity.ActivityInterceptor
- func ShortStubFSM(domain string, client fsm.SWFOps) *fsm.FSM
- func ShortStubState() fsm.Decider
- func StubFSM(domain string, client fsm.SWFOps) *fsm.FSM
- func StubState() fsm.Decider
- func TestDecisionInterceptor(testId string, stubbedWorkflows, stubbedShortWorkflows []string) fsm.DecisionInterceptor
- func TestFailOnceActivityInterceptor() activity.ActivityInterceptor
- func TestReplicator(decisionOutcomes chan DecisionOutcome) fsm.ReplicationHandler
- func TestSWF(client fsm.ClientSWFOps, stubbedWorkflow ...string) fsm.ClientSWFOps
- func TestThrotteCancelsOnceInterceptor() fsm.DecisionInterceptor
- func TestThrotteChildrenOnceInterceptor() fsm.DecisionInterceptor
- func TestThrotteSignalsOnceInterceptor() fsm.DecisionInterceptor
- func TestThrotteTimersOnceInterceptor(numTimers int) fsm.DecisionInterceptor
- type DecisionOutcome
- type NoData
- type StateData
- type StubSWFClient
- type TestAdapter
- type TestConfig
- type TestListener
- func (tl *TestListener) AwaitData(workflowId string, predicate func(*StateData) bool)
- func (tl *TestListener) AwaitDataFor(workflowId string, waitFor time.Duration, predicate func(*StateData) bool)
- func (tl *TestListener) AwaitDecision(workflowId string, predicate func(*swf.Decision) bool)
- func (tl *TestListener) AwaitDecisionFor(workflowId string, waitFor time.Duration, predicate func(*swf.Decision) bool)
- func (tl *TestListener) AwaitEvent(workflowId string, predicate func(*swf.HistoryEvent) bool)
- func (tl *TestListener) AwaitEventFor(workflowId string, waitFor time.Duration, ...)
- func (tl *TestListener) AwaitState(workflowId, state string)
- func (tl *TestListener) AwaitStateFor(workflowId, state string, waitFor time.Duration)
- func (tl *TestListener) RegisterDataInterest(workflowId string)
- func (tl *TestListener) RegisterDecisionInterest(workflowId string)
- func (tl *TestListener) RegisterHistoryInterest(workflowId string)
- func (tl *TestListener) RegisterStateInterest(workflowId string)
- func (tl *TestListener) Start()
- func (tl *TestListener) Stop()
- func (tl *TestListener) TestFsmTaskList() string
- func (tl *TestListener) TestWorkerTaskList(w *activity.ActivityWorker) string
Constants ¶
View Source
const ( StubWorkflow = "stub" ShortStubWorkflow = "stub" StubVersion = "1" )
Variables ¶
View Source
var ( StubTaskList = &swf.TaskList{Name: S(fmt.Sprintf("%s->%s", StubWorkflow, StubVersion))} ShortStubTaskList = &swf.TaskList{Name: S(fmt.Sprintf("%s->%s", ShortStubWorkflow, StubVersion))} )
Functions ¶
func NoOpActivityInterceptor ¶
func NoOpActivityInterceptor() activity.ActivityInterceptor
func ShortStubState ¶
func TestDecisionInterceptor ¶
func TestDecisionInterceptor(testId string, stubbedWorkflows, stubbedShortWorkflows []string) fsm.DecisionInterceptor
intercept any attempts to start a workflow and launch the stub workflow instead.
func TestFailOnceActivityInterceptor ¶
func TestFailOnceActivityInterceptor() activity.ActivityInterceptor
interceptor that fails the activity once per activity and returns to actual result subsequent time used to test error handling and retries of activities in fsms
func TestReplicator ¶
func TestReplicator(decisionOutcomes chan DecisionOutcome) fsm.ReplicationHandler
func TestSWF ¶
func TestSWF(client fsm.ClientSWFOps, stubbedWorkflow ...string) fsm.ClientSWFOps
func TestThrotteCancelsOnceInterceptor ¶
func TestThrotteCancelsOnceInterceptor() fsm.DecisionInterceptor
func TestThrotteChildrenOnceInterceptor ¶
func TestThrotteChildrenOnceInterceptor() fsm.DecisionInterceptor
func TestThrotteSignalsOnceInterceptor ¶
func TestThrotteSignalsOnceInterceptor() fsm.DecisionInterceptor
func TestThrotteTimersOnceInterceptor ¶
func TestThrotteTimersOnceInterceptor(numTimers int) fsm.DecisionInterceptor
This one is a bit weird. OnStart, we need to schedule a bunch of timers that we can use to cause timer id in use failures, that we rewrite to throttles
Types ¶
type DecisionOutcome ¶
type DecisionOutcome struct { DecisionTask *swf.PollForDecisionTaskOutput State *fsm.SerializedState Decisions []*swf.Decision }
type StubSWFClient ¶
type StubSWFClient struct { fsm.ClientSWFOps // contains filtered or unexported fields }
intercept any attempts to start a workflow and launch the stub workflow instead.
func (*StubSWFClient) StartWorkflowExecution ¶
func (s *StubSWFClient) StartWorkflowExecution(req *swf.StartWorkflowExecutionInput) (resp *swf.StartWorkflowExecutionOutput, err error)
type TestAdapter ¶
type TestConfig ¶
type TestConfig struct { Testing TestAdapter FSM *fsm.FSM StubFSM *fsm.FSM Workers []*activity.ActivityWorker StubbedWorkflows []string ShortStubbedWorkflows []string DefaultWaitTimeout int FailActivitiesOnce bool ThrottleSignalsOnce bool ThrottleCancelsOnce bool ThrottleChildrenOnce bool ThrottleTimersOnce bool }
type TestListener ¶
type TestListener struct { DefaultWait time.Duration TestId string // contains filtered or unexported fields }
func NewTestListener ¶
func NewTestListener(t TestConfig) *TestListener
func (*TestListener) AwaitData ¶
func (tl *TestListener) AwaitData(workflowId string, predicate func(*StateData) bool)
func (*TestListener) AwaitDataFor ¶
func (*TestListener) AwaitDecision ¶
func (tl *TestListener) AwaitDecision(workflowId string, predicate func(*swf.Decision) bool)
func (*TestListener) AwaitDecisionFor ¶
func (*TestListener) AwaitEvent ¶
func (tl *TestListener) AwaitEvent(workflowId string, predicate func(*swf.HistoryEvent) bool)
func (*TestListener) AwaitEventFor ¶
func (tl *TestListener) AwaitEventFor(workflowId string, waitFor time.Duration, predicate func(*swf.HistoryEvent) bool)
func (*TestListener) AwaitState ¶
func (tl *TestListener) AwaitState(workflowId, state string)
func (*TestListener) AwaitStateFor ¶
func (tl *TestListener) AwaitStateFor(workflowId, state string, waitFor time.Duration)
func (*TestListener) RegisterDataInterest ¶
func (tl *TestListener) RegisterDataInterest(workflowId string)
func (*TestListener) RegisterDecisionInterest ¶
func (tl *TestListener) RegisterDecisionInterest(workflowId string)
func (*TestListener) RegisterHistoryInterest ¶
func (tl *TestListener) RegisterHistoryInterest(workflowId string)
func (*TestListener) RegisterStateInterest ¶
func (tl *TestListener) RegisterStateInterest(workflowId string)
func (*TestListener) Start ¶
func (tl *TestListener) Start()
func (*TestListener) Stop ¶
func (tl *TestListener) Stop()
func (*TestListener) TestFsmTaskList ¶
func (tl *TestListener) TestFsmTaskList() string
func (*TestListener) TestWorkerTaskList ¶
func (tl *TestListener) TestWorkerTaskList(w *activity.ActivityWorker) string
Click to show internal directories.
Click to hide internal directories.