(t *testing.T)
| 56 | } |
| 57 | |
| 58 | func TestReconnectDisallowedFlags(t *testing.T) { |
| 59 | ts := startReconnectServer(t) |
| 60 | defer ts.Shutdown() |
| 61 | |
| 62 | ch := make(chan bool) |
| 63 | opts := nats.GetDefaultOptions() |
| 64 | opts.Url = fmt.Sprintf("nats://127.0.0.1:%d", TEST_PORT) |
| 65 | opts.AllowReconnect = false |
| 66 | opts.ClosedCB = func(_ *nats.Conn) { |
| 67 | ch <- true |
| 68 | } |
| 69 | nc, err := opts.Connect() |
| 70 | if err != nil { |
| 71 | t.Fatalf("Should have connected ok: %v", err) |
| 72 | } |
| 73 | defer nc.Close() |
| 74 | |
| 75 | ts.Shutdown() |
| 76 | |
| 77 | if e := Wait(ch); e != nil { |
| 78 | t.Fatal("Did not trigger ClosedCB correctly") |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func TestReconnectAllowedFlags(t *testing.T) { |
| 83 | ts := startReconnectServer(t) |
nothing calls this directly
no test coverage detected