(t *testing.T)
| 334 | } |
| 335 | |
| 336 | func TestEncBuiltinRawMsgSubscribeCB(t *testing.T) { |
| 337 | s := RunServerOnPort(TEST_PORT) |
| 338 | defer s.Shutdown() |
| 339 | |
| 340 | ec := NewDefaultEConn(t) |
| 341 | defer ec.Close() |
| 342 | |
| 343 | ch := make(chan bool) |
| 344 | |
| 345 | testString := "Hello World!" |
| 346 | oSubj := "cb_args" |
| 347 | oReply := "foobar" |
| 348 | |
| 349 | ec.Subscribe(oSubj, func(m *nats.Msg) { |
| 350 | s := string(m.Data) |
| 351 | if s != testString { |
| 352 | t.Fatalf("Received test string of '%s', wanted '%s'\n", s, testString) |
| 353 | } |
| 354 | if m.Subject != oSubj { |
| 355 | t.Fatalf("Received subject of '%s', wanted '%s'\n", m.Subject, oSubj) |
| 356 | } |
| 357 | if m.Reply != oReply { |
| 358 | t.Fatalf("Received reply of '%s', wanted '%s'\n", m.Reply, oReply) |
| 359 | } |
| 360 | ch <- true |
| 361 | }) |
| 362 | ec.PublishRequest(oSubj, oReply, testString) |
| 363 | if e := Wait(ch); e != nil { |
| 364 | if ec.LastError() != nil { |
| 365 | e = ec.LastError() |
| 366 | } |
| 367 | t.Fatalf("Did not receive the message: %s", e) |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | func TestEncBuiltinRequest(t *testing.T) { |
| 372 | s := RunServerOnPort(TEST_PORT) |
nothing calls this directly
no test coverage detected