(t *testing.T)
| 111 | } |
| 112 | |
| 113 | func TestServerStopDisconnectedErrCB(t *testing.T) { |
| 114 | s := RunDefaultServer() |
| 115 | defer s.Shutdown() |
| 116 | |
| 117 | ch := make(chan bool) |
| 118 | o := nats.GetDefaultOptions() |
| 119 | o.Url = nats.DefaultURL |
| 120 | o.AllowReconnect = false |
| 121 | o.DisconnectedErrCB = func(nc *nats.Conn, _ error) { |
| 122 | ch <- true |
| 123 | } |
| 124 | nc, err := o.Connect() |
| 125 | if err != nil { |
| 126 | t.Fatalf("Should have connected ok: %v", err) |
| 127 | } |
| 128 | defer nc.Close() |
| 129 | |
| 130 | s.Shutdown() |
| 131 | if e := Wait(ch); e != nil { |
| 132 | t.Fatalf("Disconnected callback not triggered\n") |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func TestServerSecureConnections(t *testing.T) { |
| 137 | s, opts := RunServerWithConfig("./configs/tls.conf") |
nothing calls this directly
no test coverage detected