public MessageInvocationTests() { theRuntime = JasperRuntime.For <SampleApp>(); theRuntime.Get <IDocumentStore>().Advanced.Clean.CompletelyRemoveAll(); }
public end_to_end_with_in_memory() { DelayedMessageHandler.Reset(); theRuntime = JasperRuntime.For <DelayedMessageApp>(); }
public static JasperRuntime DefaultRegistrationIs <T, TConcrete>(this JasperRuntime runtime) where TConcrete : T { runtime.Get <T>().ShouldBeOfType <TConcrete>(); return(runtime); }
private void writeList(JasperRuntime runtime) { var json = runtime.Capabilities.ToJson(); Console.WriteLine(json); }
private async Task withApp() { _runtime = await JasperRuntime.ForAsync(theRegistry); }
public void Describe(JasperRuntime runtime, TextWriter writer) { // nothing }
public static JasperRuntime DefaultSingletonIs <T, TConcrete>(this JasperRuntime container) where TConcrete : T { return(container.DefaultSingletonIs(typeof(T), typeof(TConcrete))); }
public void Shutdown() { _runtime.Dispose(); _runtime = null; }
public composing_request_delegate_order() { theRegistry.Handlers.DisableConventionalDiscovery(true); _runtime = new Lazy <JasperRuntime>(() => JasperRuntime.For(theRegistry)); }
public void BuildRoutingTree(ConnegRules rules, JasperGenerationRules generation, JasperRuntime runtime) { Router.HandlerBuilder = new RouteHandlerBuilder(runtime.Container, rules, generation); assertNoDuplicateRoutes(); foreach (var route in _chains.Select(x => x.Route)) { Router.Add(route); } }
public override void TearDown() { _runtime?.Dispose(); _runtime = null; }
public static Envelope[] AllSentThroughTheStubTransport(this JasperRuntime runtime) { return(runtime.GetStubTransport().Channels.SelectMany(x => x.Sent).ToArray()); }
public static void ClearStubTransportSentList(this JasperRuntime runtime) { runtime.GetStubTransport().Channels.Each(x => x.Sent.Clear()); }
public static StubTransport GetStubTransport(this JasperRuntime runtime) { return(runtime.Container.GetAllInstances <ITransport>().OfType <StubTransport>().Single()); }
public HttpTransport(BusSettings settings, HttpTransportSettings httpSettings, JasperRuntime runtime, IPersistence persistence, CompositeTransportLogger logger) { _settings = settings; _httpSettings = httpSettings; _runtime = runtime; _persistence = persistence; _logger = logger; }
public cascading_message_with_outbox() { theSender = JasperRuntime.For(new OutboxSender(theTracker)); theReceiver = JasperRuntime.For <OutboxReceiver>(); }
public Task Activate(JasperRuntime runtime, GenerationRules generation) { return(Task.CompletedTask); }
public void Start() { _runtime = JasperRuntime.For <BusRegistry>(); }
public static JasperRuntime DefaultRegistrationIs <T>(this JasperRuntime runtime, T value) where T : class { runtime.Get <T>().ShouldBeSameAs(value); return(runtime); }
public void Assert(JasperRuntime runtime) { throw new Exception("I'm bad!"); }
private void validate(JasperRuntime runtime, SubscriptionsInput input) { var files = new FileSystem(); var dict = new Dictionary <string, ServiceCapabilities>(); files.FindFiles(input.DirectoryFlag, FileSet.Shallow("*.capabilities.json")) .Each(file => { try { Console.WriteLine("Reading " + file); var capabilities = ServiceCapabilities.ReadFromFile(file); if (dict.ContainsKey(capabilities.ServiceName)) { ConsoleWriter.Write(ConsoleColor.Yellow, $"Duplicate service name '{capabilities.ServiceName}' from file {file}"); } else { dict.Add(capabilities.ServiceName, capabilities); } } catch (Exception e) { ConsoleWriter.Write(ConsoleColor.Yellow, "Failed to read capabilities from file " + file); Console.WriteLine(e); } }); if (dict.ContainsKey(runtime.ServiceName)) { dict[runtime.ServiceName] = runtime.Capabilities; } else { dict.Add(runtime.ServiceName, runtime.Capabilities); } var messaging = new MessagingGraph(dict.Values.ToArray()); Console.WriteLine(messaging.ToJson()); if (input.FileFlag.IsNotEmpty()) { Console.WriteLine("Writing the messaging graph to " + input.FileFlag); messaging.WriteToFile(input.FileFlag); } if (messaging.HasAnyErrors()) { ConsoleWriter.Write(ConsoleColor.Yellow, "Messaging errors detected!"); if (!input.IgnoreFailuresFlag) { throw new Exception("Validation failures detected."); } } else { ConsoleWriter.Write(ConsoleColor.Green, "All messages have matching, valid publishers and subscribers"); } }
public void Assert(JasperRuntime runtime) { // all good }
public void Assert(JasperRuntime runtime) { StoryTellerAssert.Fail(runtime == null, "runtime should not be null"); DidAssert = true; }
public void Assert(JasperRuntime runtime) { throw new Exception("Kaboom!"); }
public MessagingActivator(JasperRuntime runtime, IMessagingRoot root) { _runtime = runtime; _root = root; }
public void Assert(JasperRuntime runtime) { // do the assertion of valid state }
public discovering_and_using_extensions() { theRuntime = JasperRuntime.For <AppWithOverrides>(); }
public void Assert(JasperRuntime runtime) { // do something here }
public static JasperRuntime DefaultRegistrationIs(this JasperRuntime runtime, Type pluginType, Type concreteType) { runtime.Get(pluginType).ShouldBeOfType(concreteType); return(runtime); }
/// <summary> /// Clean off any existing state /// </summary> /// <param name="runtime"></param> protected void beforeEach(JasperRuntime runtime) { runtime.Get <IDocumentStore>().Advanced.Clean.CompletelyRemoveAll(); }