public void ChannelIsLatched(Uri channel)
        {
            _host.GetStubTransport().Channels[channel].Latched = true;

            // Gotta do this so that the query on latched channels works correctly
            _host.Get <ISubscriberGraph>().GetOrBuild(channel);
        }
Ejemplo n.º 2
0
        public override void SetUp()
        {
            _tracker = new AttemptTracker();

            var registry = new JasperRegistry();

            registry.Transports.ListenForMessagesFrom("stub://1".ToUri());
            registry.Services.AddSingleton(_tracker);
            registry.Publish.Message <ErrorCausingMessage>()
            .To("stub://1".ToUri());

            _host = JasperHost.For(registry);

            _transport = _host.GetStubTransport();

            _graph = _host.Get <HandlerGraph>();
            _chain = _graph.ChainFor <ErrorCausingMessage>();


            _bus = _host.Get <IMessageContext>();
        }
Ejemplo n.º 3
0
 private StubTransport getStubTransport()
 {
     return(_host.GetStubTransport());
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Retrieves an array of all the envelopes sent through the stub transport
 /// </summary>
 /// <param name="runtime"></param>
 /// <returns></returns>
 public static Envelope[] GetAllEnvelopesSent(this IJasperHost runtime)
 {
     return(runtime.GetStubTransport().Channels.SelectMany(x => x.Sent).ToArray());
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     Clears all record of messages sent to the stub transport
 /// </summary>
 /// <param name="runtime"></param>
 public static void ClearStubTransportSentList(this IJasperHost runtime)
 {
     runtime.GetStubTransport().Channels.Each(x => x.Sent.Clear());
 }