(t *testing.T)
| 1196 | } |
| 1197 | |
| 1198 | func TestIgnoreDiscoveredServers(t *testing.T) { |
| 1199 | opts := GetDefaultOptions() |
| 1200 | opts.IgnoreDiscoveredServers = true |
| 1201 | c := &Conn{Opts: opts} |
| 1202 | c.ps = &parseState{} |
| 1203 | c.setupServerPool() |
| 1204 | |
| 1205 | if len(c.Servers()) != 1 { |
| 1206 | t.Fatalf("Expected 1 server, got %d", len(c.Servers())) |
| 1207 | } |
| 1208 | |
| 1209 | err := c.parse([]byte("INFO {\"connect_urls\":[\"localhost:5222\", \"localhost:6222\"]}\r\n")) |
| 1210 | if err != nil { |
| 1211 | t.Fatalf("Unexpected: %d : %v\n", c.ps.state, err) |
| 1212 | } |
| 1213 | |
| 1214 | if len(c.Servers()) != 1 { |
| 1215 | t.Fatalf("Expected 1 server, got %d: %v", len(c.Servers()), c.Servers()) |
| 1216 | } |
| 1217 | if len(c.DiscoveredServers()) != 0 { |
| 1218 | t.Fatalf("Expected no discovered servers, got %v", c.DiscoveredServers()) |
| 1219 | } |
| 1220 | } |
| 1221 | |
| 1222 | func TestNoEchoOldServer(t *testing.T) { |
| 1223 | opts := GetDefaultOptions() |
nothing calls this directly
no test coverage detected