Exemple #1
0
        public void Can_subscribe_and_get_notification_about_new_messages()
        {
            var captureClientIntegration = new CaptureClientIntegration();

            using (var c = new ClientConnection(new IPEndPoint(IPAddress.Loopback, 8182), captureClientIntegration))
            {
                c.Connect().Wait();

                c.Send(JObject.FromObject(new ChangeSubscriptionMessage
                {
                    Queues = { "/queues/abc" },
                    Type   = ChangeSubscriptionType.Add
                })).Wait();

                WaitForSubscription();

                ravenMqServer.Queues.Enqueue(new IncomingMessage
                {
                    Queue = "/queues/abc",
                    Data  = new byte[] { 12, 3 },
                });
                captureClientIntegration.MessageArrived.WaitOne();

                Assert.True(captureClientIntegration.Msgs[0].Value <bool>("Changed"));
            }
        }
Exemple #2
0
        public void Can_subscribe_and_get_notification_about_new_messages()
        {
            var captureClientIntegration = new CaptureClientIntegration();
            using(var c = new ClientConnection(new IPEndPoint(IPAddress.Loopback, 8182), captureClientIntegration))
            {
                c.Connect().Wait();

                c.Send(JObject.FromObject(new ChangeSubscriptionMessage
                {
                    Queues = {"/queues/abc"},
                    Type = ChangeSubscriptionType.Add
                })).Wait();

                WaitForSubscription();

                ravenMqServer.Queues.Enqueue(new IncomingMessage
                {
                    Queue = "/queues/abc",
                    Data = new byte[]{12,3},
                });
                captureClientIntegration.MessageArrived.WaitOne();

                Assert.True(captureClientIntegration.Msgs[0].Value<bool>("Changed"));
            }
        }
Exemple #3
0
        public void Can_get_notificaton_from_server()
        {
            connection.Start();

            var clientIntegration = new CaptureClientIntegration();
            using(var clientConnection = new ClientConnection(new IPEndPoint(IPAddress.Loopback, 8181), clientIntegration))
            {
                clientConnection.Connect().Wait();

                clientIntegration.MessageArrived.WaitOne();

                Assert.Equal("{\"Pong\":\"Ping\"}", clientIntegration.Msgs[0].ToString(Formatting.None));
            }
        }
Exemple #4
0
        public void Can_get_notificaton_from_server()
        {
            connection.Start();

            var clientIntegration = new CaptureClientIntegration();

            using (var clientConnection = new ClientConnection(new IPEndPoint(IPAddress.Loopback, 8181), clientIntegration))
            {
                clientConnection.Connect().Wait();

                clientIntegration.MessageArrived.WaitOne();

                Assert.Equal("{\"Pong\":\"Ping\"}", clientIntegration.Msgs[0].ToString(Formatting.None));
            }
        }