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); }
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>(); }
private StubTransport getStubTransport() { return(_host.GetStubTransport()); }
/// <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()); }
/// <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()); }