| 155 | } |
| 156 | |
| 157 | func 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 | |
| 174 | func TestLogDBFactoryAndExpertLogDBFactoryCanNotBeSetTogether(t *testing.T) { |
| 175 | f := func(NodeHostConfig, |