(t *testing.T)
| 506 | } |
| 507 | |
| 508 | func TestFlush(t *testing.T) { |
| 509 | s := RunDefaultServer() |
| 510 | defer s.Shutdown() |
| 511 | nc := NewDefaultConnection(t) |
| 512 | defer nc.Close() |
| 513 | |
| 514 | omsg := []byte("Hello World") |
| 515 | for i := 0; i < 10000; i++ { |
| 516 | nc.Publish("flush", omsg) |
| 517 | } |
| 518 | if err := nc.FlushTimeout(0); err == nil { |
| 519 | t.Fatal("Calling FlushTimeout() with invalid timeout should fail") |
| 520 | } |
| 521 | if err := nc.Flush(); err != nil { |
| 522 | t.Fatalf("Received error from flush: %s\n", err) |
| 523 | } |
| 524 | if nb, _ := nc.Buffered(); nb > 0 { |
| 525 | t.Fatalf("Outbound buffer not empty: %d bytes\n", nb) |
| 526 | } |
| 527 | |
| 528 | nc.Close() |
| 529 | if _, err := nc.Buffered(); err == nil { |
| 530 | t.Fatal("Calling Buffered() on closed connection should fail") |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | func TestQueueSubscriber(t *testing.T) { |
| 535 | s := RunDefaultServer() |
nothing calls this directly
no test coverage detected