Exemplo n.º 1
0
        public async Task send_message_to_self()
        {
            using (var queue = ObjectMother.NewQueue(_testDirectory.CreateNewDirectoryForTest()))
            {
                var message = ObjectMother.NewMessage <OutgoingMessage>("test");
                message.Destination = new Uri($"lq.tcp://localhost:{queue.Endpoint.Port}");
                queue.Send(message);
                var received = await queue.Receive("test").FirstAsyncWithTimeout();

                received.ShouldNotBeNull();
                received.Message.Queue.ShouldBe(message.Queue);
                received.Message.Data.ShouldBe(message.Data);
            }
        }
Exemplo n.º 2
0
        public async Task sending_to_bad_endpoint_no_retries_integration_test()
        {
            using (var queue = ObjectMother.NewQueue(_testDirectory.CreateNewDirectoryForTest()))
            {
                var message = ObjectMother.NewMessage <OutgoingMessage>("test");
                message.MaxAttempts = 1;
                message.Destination = new Uri($"lq.tcp://boom:{queue.Endpoint.Port + 1}");
                queue.Send(message);
                await Task.Delay(TimeSpan.FromSeconds(10));

                var store = (LmdbMessageStore)queue.Store;
                store.PersistedOutgoingMessages().ToEnumerable().Any().ShouldBeFalse();
            }
        }
Exemplo n.º 3
0
 public EncryptedTransportQueueTests(SharedTestDirectory testDirectory)
 {
     _testDirectory = testDirectory;
     _scheduler     = new TestScheduler();
     _queue         = ObjectMother.NewQueue(testDirectory.CreateNewDirectoryForTest(), scheduler: _scheduler, secureTransport: true);
 }
Exemplo n.º 4
0
 public ProfilingTests(SharedTestDirectory testDirectory)
 {
     _sender   = ObjectMother.NewQueue(testDirectory.CreateNewDirectoryForTest(), logger: new NulloLogger());
     _receiver = ObjectMother.NewQueue(testDirectory.CreateNewDirectoryForTest(), logger: new NulloLogger());
 }
Exemplo n.º 5
0
 public IntegrationTests(SharedTestDirectory testDirectory)
 {
     _senderLogger = new RecordingLogger();
     _receiver     = ObjectMother.NewQueue(testDirectory.CreateNewDirectoryForTest(), "receiver");
     _sender       = ObjectMother.NewQueue(testDirectory.CreateNewDirectoryForTest(), "sender", _senderLogger);
 }
Exemplo n.º 6
0
 public QueueTests(SharedTestDirectory testDirectory)
 {
     _testDirectory = testDirectory;
     _scheduler     = new TestScheduler();
     _queue         = ObjectMother.NewQueue(testDirectory.CreateNewDirectoryForTest(), scheduler: _scheduler);
 }