From 0adb1f443bfca70059a2e2fdd082805916fdcabf Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Mon, 29 Jul 2013 18:42:16 -0700 Subject: [PATCH] Route queue subscriber test --- test/routes_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/routes_test.go b/test/routes_test.go index 92e523b5..2c7287b7 100644 --- a/test/routes_test.go +++ b/test/routes_test.go @@ -231,3 +231,31 @@ func TestRouteOnlySendOnce(t *testing.T) { matches := expectMsgs(1) checkMsg(t, matches[0], "foo", "RSID:2:1", "", "2", "ok") } + +func TestRouteQueueSemantics(t *testing.T) { + s, opts := runRouteServer(t) + defer s.Shutdown() + + client := createClientConn(t, opts.Host, opts.Port) + defer client.Close() + + clientSend, _ := setupConn(t, client) + + route := createRouteConn(t, opts.ClusterHost, opts.ClusterPort) + expectAuthRequired(t, route) + routeSend, routeExpect := setupRoute(t, route, opts) + expectMsgs := expectMsgsCommand(t, routeExpect) + + // Express multiple interest on this route for foo, queue group bar. + routeSend("SUB foo bar RSID:2:1\r\n") + routeSend("SUB foo bar RSID:2:2\r\n") + + // Normal Interest as well. + routeSend("SUB foo RSID:2:1\r\n") + + // Send PUB via client connection + clientSend("PUB foo 2\r\nok\r\n") + + matches := expectMsgs(1) + checkMsg(t, matches[0], "foo", "RSID:2:1", "", "2", "ok") +} \ No newline at end of file