MCPcopy
hub / github.com/lni/dragonboat / TestTransportFactoryAndModuleCanNotBeSetTogether

Function TestTransportFactoryAndModuleCanNotBeSetTogether

config/config_test.go:157–172  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

155}
156
157func TestTransportFactoryAndModuleCanNotBeSetTogether(t *testing.T) {
158 m := &defaultTransport{}
159 c := NodeHostConfig{
160 RaftAddress: "localhost:9010",
161 RTTMillisecond: 100,
162 NodeHostDir: "/data",
163 RaftRPCFactory: m.Create,
164 }
165 if err := c.Validate(); err != nil {
166 t.Fatalf("cfg not valid")
167 }
168 c.Expert.TransportFactory = m
169 if err := c.Validate(); err == nil {
170 t.Fatalf("cfg not considered as invalid")
171 }
172}
173
174func TestLogDBFactoryAndExpertLogDBFactoryCanNotBeSetTogether(t *testing.T) {
175 f := func(NodeHostConfig,

Callers

nothing calls this directly

Calls 2

ValidateMethod · 0.95
FatalfMethod · 0.80

Tested by

no test coverage detected