MCPcopy
hub / github.com/vulcand/vulcand / TestInitFromExistingConfig

Method TestInitFromExistingConfig

supervisor/supervisor_test.go:48–67  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

46}
47
48func (s *SupervisorSuite) TestInitFromExistingConfig(c *C) {
49 e := testutils.NewResponder("Hi, I'm endpoint")
50 defer e.Close()
51
52 b := MakeBatch(Batch{Addr: "localhost:11800", Route: `Path("/")`, URL: e.URL})
53 c.Assert(s.ng.UpsertBackend(b.B), IsNil)
54 c.Assert(s.ng.UpsertServer(b.BK, b.S, engine.NoTTL), IsNil)
55 c.Assert(s.ng.UpsertFrontend(b.F, engine.NoTTL), IsNil)
56 c.Assert(s.ng.UpsertListener(b.L), IsNil)
57
58 sup := New(newProxy, s.ng, Options{Clock: s.clock})
59
60 // When
61 c.Assert(sup.Start(), IsNil)
62 defer sup.Stop()
63
64 // Then
65 time.Sleep(10 * time.Millisecond)
66 c.Assert(GETResponse(c, b.FrontendURL("/")), Equals, "Hi, I'm endpoint")
67}
68
69func (s *SupervisorSuite) TestInitOnTheFly(c *C) {
70 e := testutils.NewResponder("Hi, I'm endpoint")

Callers

nothing calls this directly

Calls 11

MakeBatchFunction · 0.85
FrontendURLMethod · 0.80
NewFunction · 0.70
GETResponseFunction · 0.70
CloseMethod · 0.65
UpsertBackendMethod · 0.65
UpsertServerMethod · 0.65
UpsertFrontendMethod · 0.65
UpsertListenerMethod · 0.65
StartMethod · 0.65
StopMethod · 0.65

Tested by

no test coverage detected