MCPcopy
hub / github.com/nats-io/nats.go / TestInProcessConn

Function TestInProcessConn

test/nats_test.go:1197–1217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1195}
1196
1197func TestInProcessConn(t *testing.T) {
1198 s := RunServerOnPort(-1)
1199 defer s.Shutdown()
1200
1201 nc, err := nats.Connect("", nats.InProcessServer(s))
1202 if err != nil {
1203 t.Fatal(err)
1204 }
1205
1206 defer nc.Close()
1207
1208 // Status should be connected.
1209 if nc.Status() != nats.CONNECTED {
1210 t.Fatal("should be status CONNECTED")
1211 }
1212
1213 // The server should respond to a request.
1214 if _, err := nc.RTT(); err != nil {
1215 t.Fatal(err)
1216 }
1217}
1218
1219func TestSkipSubjectValidation(t *testing.T) {
1220 s := RunServerOnPort(-1)

Callers

nothing calls this directly

Calls 5

ConnectMethod · 0.80
RTTMethod · 0.80
RunServerOnPortFunction · 0.70
StatusMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected