Exemplo n.º 1
0
        public void SendMessage([SelectionList("MessageTypes")] string messageType,
                                [SelectionList("Channels")] Uri channel)
        {
            var type = messageTypeFor(messageType);

            _registry.SendMessages(type.Name, t => t == type).To(channel);

            // Just makes the test harness listen for things
            _registry.ListenForMessagesFrom(channel);
        }
Exemplo n.º 2
0
        public override void SetUp()
        {
            _transport = new StubTransport();
            _tracker   = new AttemptTracker();

            var registry = new JasperBusRegistry();

            registry.ListenForMessagesFrom("stub://1".ToUri());
            registry.Services.AddService <ITransport>(_transport);
            registry.Services.AddService(_tracker);
            registry.SendMessage <ErrorCausingMessage>()
            .To("stub://1".ToUri());

            _runtime = JasperRuntime.For(registry);

            _graph = _runtime.Container.GetInstance <HandlerGraph>();
            _chain = _graph.ChainFor <ErrorCausingMessage>();


            _bus = _runtime.Container.GetInstance <IServiceBus>();
        }