Exemplo n.º 1
0
        public MessageInvocationTests()
        {
            theRuntime = JasperRuntime.For <SampleApp>();

            theRuntime.Get <IDocumentStore>().Advanced.Clean.CompletelyRemoveAll();
        }
Exemplo n.º 2
0
        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);
 }
Exemplo n.º 4
0
        private void writeList(JasperRuntime runtime)
        {
            var json = runtime.Capabilities.ToJson();

            Console.WriteLine(json);
        }
Exemplo n.º 5
0
 private async Task withApp()
 {
     _runtime = await JasperRuntime.ForAsync(theRegistry);
 }
Exemplo n.º 6
0
 public void Describe(JasperRuntime runtime, TextWriter writer)
 {
     // nothing
 }
Exemplo n.º 7
0
 public static JasperRuntime DefaultSingletonIs <T, TConcrete>(this JasperRuntime container) where TConcrete : T
 {
     return(container.DefaultSingletonIs(typeof(T), typeof(TConcrete)));
 }
Exemplo n.º 8
0
 public void Shutdown()
 {
     _runtime.Dispose();
     _runtime = null;
 }
 public composing_request_delegate_order()
 {
     theRegistry.Handlers.DisableConventionalDiscovery(true);
     _runtime = new Lazy <JasperRuntime>(() => JasperRuntime.For(theRegistry));
 }
Exemplo n.º 10
0
        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);
            }
        }
Exemplo n.º 11
0
 public override void TearDown()
 {
     _runtime?.Dispose();
     _runtime = null;
 }
Exemplo n.º 12
0
 public static Envelope[] AllSentThroughTheStubTransport(this JasperRuntime runtime)
 {
     return(runtime.GetStubTransport().Channels.SelectMany(x => x.Sent).ToArray());
 }
Exemplo n.º 13
0
 public static void ClearStubTransportSentList(this JasperRuntime runtime)
 {
     runtime.GetStubTransport().Channels.Each(x => x.Sent.Clear());
 }
Exemplo n.º 14
0
 public static StubTransport GetStubTransport(this JasperRuntime runtime)
 {
     return(runtime.Container.GetAllInstances <ITransport>().OfType <StubTransport>().Single());
 }
Exemplo n.º 15
0
 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>();
 }
Exemplo n.º 17
0
 public Task Activate(JasperRuntime runtime, GenerationRules generation)
 {
     return(Task.CompletedTask);
 }
Exemplo n.º 18
0
 public void Start()
 {
     _runtime = JasperRuntime.For <BusRegistry>();
 }
Exemplo n.º 19
0
        public static JasperRuntime DefaultRegistrationIs <T>(this JasperRuntime runtime, T value) where T : class
        {
            runtime.Get <T>().ShouldBeSameAs(value);

            return(runtime);
        }
Exemplo n.º 20
0
 public void Assert(JasperRuntime runtime)
 {
     throw new Exception("I'm bad!");
 }
Exemplo n.º 21
0
        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");
            }
        }
Exemplo n.º 22
0
 public void Assert(JasperRuntime runtime)
 {
     // all good
 }
Exemplo n.º 23
0
        public void Assert(JasperRuntime runtime)
        {
            StoryTellerAssert.Fail(runtime == null, "runtime should not be null");

            DidAssert = true;
        }
Exemplo n.º 24
0
 public void Assert(JasperRuntime runtime)
 {
     throw new Exception("Kaboom!");
 }
Exemplo n.º 25
0
 public MessagingActivator(JasperRuntime runtime, IMessagingRoot root)
 {
     _runtime = runtime;
     _root    = root;
 }
Exemplo n.º 26
0
 public void Assert(JasperRuntime runtime)
 {
     // do the assertion of valid state
 }
Exemplo n.º 27
0
 public discovering_and_using_extensions()
 {
     theRuntime = JasperRuntime.For <AppWithOverrides>();
 }
Exemplo n.º 28
0
 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);
        }
Exemplo n.º 30
0
 /// <summary>
 /// Clean off any existing state
 /// </summary>
 /// <param name="runtime"></param>
 protected void beforeEach(JasperRuntime runtime)
 {
     runtime.Get <IDocumentStore>().Advanced.Clean.CompletelyRemoveAll();
 }