コード例 #1
0
        public void handle_envelope_sent_then_message_successful_tracking_for_the_same_message_to_multiple_nodes()
        {
            MessageHistory.StartListening();

            var envelope1 = new EnvelopeToken();
            var node1     = new StubChannelNode();
            var node2     = new StubChannelNode();

            var messageWatcher = new MessageWatcher();

            messageWatcher.Handle(new EnvelopeSent(envelope1, node1));
            messageWatcher.Handle(new EnvelopeSent(envelope1, node2));

            MessageHistory.Outstanding().Count().ShouldEqual(2);

            envelope1.Destination = node1.Uri;
            messageWatcher.Handle(new MessageSuccessful
            {
                Envelope = envelope1
            });

            MessageHistory.Outstanding().Count().ShouldEqual(1);

            envelope1.Destination = node2.Uri;
            messageWatcher.Handle(new MessageSuccessful
            {
                Envelope = envelope1
            });

            MessageHistory.Outstanding().Any().ShouldBeFalse();
        }
コード例 #2
0
        public void handle_chain_finished()
        {
            MessageHistory.StartListening();

            var @event = new ChainExecutionStarted
            {
                ChainId  = Guid.NewGuid(),
                Envelope = new EnvelopeToken()
            };

            var messageWatcher = new MessageWatcher();

            messageWatcher.Handle(@event);

            var finished = new ChainExecutionFinished
            {
                ChainId  = @event.ChainId,
                Envelope = @event.Envelope
            };

            messageWatcher.Handle(finished);

            var received = MessageHistory.Received().Single();

            received.Id.ShouldEqual(@event.Envelope.CorrelationId);
            received.Description.ShouldEqual(finished.ToString());
            received.Type.ShouldEqual(MessageWatcher.MessageTrackType);

            MessageHistory.Outstanding().Any().ShouldBeFalse();
        }
コード例 #3
0
        public void SetUp()
        {
            FubuTransport.SetupForInMemoryTesting();

            theLogger    = new SagaLogger();
            theContainer = new Container(x =>
            {
                x.For <SagaSettings>().Use(InMemoryTransport.ToInMemory <SagaSettings>());
                x.For <SagaLogger>().Use(theLogger);
                x.For <IListener>().Add <MessageWatcher>();
            });

            theRuntime = FubuTransport.For <SagaTestRegistry>().StructureMap(theContainer).Bootstrap();

            MessageHistory.StartListening();
        }
コード例 #4
0
        public void coordinate_message_history_via_remote_service()
        {
            using (var runner = RemoteServiceRunner.For <SampleBootstrapper>())
            {
                runner.WaitForServiceToStart <SampleService.SampleService>();
                runner.WaitForServiceToStart <SampleService.RemoteService>();

                MessageHistory.StartListening(runner);

                var foo = new Foo();

                EventAggregator.SentMessage(foo);


                EventAggregator.Messaging.WaitForMessage <AllMessagesComplete>(() => runner.SendRemotely(foo), 60000)
                .ShouldNotBeNull();
            }
        }
コード例 #5
0
        public void handle_chain_started()
        {
            MessageHistory.StartListening();


            var @event = new ChainExecutionStarted
            {
                ChainId = Guid.NewGuid(), Envelope = new EnvelopeToken()
            };

            new MessageWatcher().Handle(@event);

            var sent = MessageHistory.Outstanding().Single();

            sent.Id.ShouldEqual(@event.Envelope.CorrelationId);
            sent.Description.ShouldEqual(@event.ToString());
            sent.Type.ShouldEqual(MessageWatcher.MessageTrackType);
        }
コード例 #6
0
ファイル: FubuMvcSystem.cs プロジェクト: stevematney/Serenity
 public void StartListeningForMessages()
 {
     MessageHistory.StartListening(_remoteSubSystems.Select(x => x.Runner).ToArray());
 }