MCPcopy
hub / github.com/mcuadros/ofelia / TestContextNextContinueOnStop

Method TestContextNextContinueOnStop

core/common_test.go:119–142  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

117}
118
119func (s *SuiteCommon) TestContextNextContinueOnStop(c *C) {
120 mA := &TestMiddlewareAltA{}
121 mB := &TestMiddlewareAltB{}
122 mC := &TestMiddlewareAltC{}
123 mA.Nested, mB.Nested, mC.Nested = true, true, true
124 mA.Stop = errors.New("foo")
125 mC.OnStop = true
126
127 j := &TestJob{}
128 j.Use(mA, mB, mC)
129
130 e := NewExecution()
131
132 h := NewScheduler(&TestLogger{})
133 ctx := NewContext(h, j, e)
134 ctx.Start()
135
136 err := ctx.Next()
137 c.Assert(err, IsNil)
138 c.Assert(mA.Called, Equals, 1)
139 c.Assert(mB.Called, Equals, 0)
140 c.Assert(mC.Called, Equals, 1)
141 c.Assert(j.Called, Equals, 0)
142}
143
144func (s *SuiteCommon) TestContextNext(c *C) {
145 mA := &TestMiddlewareAltA{}

Callers

nothing calls this directly

Calls 6

StartMethod · 0.95
NextMethod · 0.95
NewExecutionFunction · 0.85
NewSchedulerFunction · 0.85
NewContextFunction · 0.85
UseMethod · 0.65

Tested by

no test coverage detected