Beispiel #1
0
        public void run_a_specific_bootstrapper()
        {
            using (var runner = RemoteServiceRunner.For <SampleBootstrapper>())
            {
                runner.WaitForServiceToStart <SampleService.SampleService>();
                runner.WaitForServiceToStart <SampleService.RemoteService>();

                runner.Started.Any().ShouldBeTrue();
            }
        }
Beispiel #2
0
        public void Start(object listener, Action <RemoteDomainExpression> configuration = null)
        {
            _runner = RemoteServiceRunner.For <RemoteFubuMvcBootstrapper>(x => {
                x.RequireAssemblyContainingType <EmbeddedFubuMvcServer>(AssemblyCopyMode.SemVerCompatible);
                x.RequireAssemblyContainingType <RemoteFubuMvcProxy>(AssemblyCopyMode.SemVerCompatible);
                x.RequireAssemblyContainingType <RemoteServiceRunner>(AssemblyCopyMode.SemVerCompatible);
                x.RequireAssemblyContainingType <Owin.IAppBuilder>();
                x.RequireAssemblyContainingType <IActivator>();                                       // Bottles
                x.RequireAssemblyContainingType <IModelBinder>();                                     // FubuCore
                x.RequireAssemblyContainingType <FubuApplication>(AssemblyCopyMode.SemVerCompatible); // FubuMVC.Core
                x.RequireAssemblyContainingType <HtmlTag>(AssemblyCopyMode.SemVerCompatible);         // HtmlTags
                x.RequireAssemblyContainingType <FubuCsProjFile.CodeFile>();                          // FubuCsProjFile just to keep it from whining
                x.RequireAssemblyContainingType <DiagnosticChainsSource>(AssemblyCopyMode.SemVerCompatible);
                x.RequireAssemblyContainingType <SparkViewEngine>(AssemblyCopyMode.SemVerCompatible);
                x.RequireAssemblyContainingType <SparkTemplate>(AssemblyCopyMode.SemVerCompatible);

                x.RequireAssembly("Microsoft.Owin.Hosting");
                x.RequireAssembly("Microsoft.Owin.Host.HttpListener");
                x.RequireAssembly("Microsoft.Owin");
                x.RequireAssembly("Owin");

                x.ServiceDirectory = _request.DirectoryFlag;

                if (_request.ConfigFlag.IsNotEmpty())
                {
                    x.Setup.ConfigurationFile = _request.ConfigFlag;
                }

                x.Setup.PrivateBinPath = _request.DetermineBinPath();

                if (configuration != null)
                {
                    configuration(x);
                }

                Console.WriteLine("Assembly bin path is " + x.Setup.PrivateBinPath);
                Console.WriteLine("The configuration file is " + x.Setup.ConfigurationFile);
            });

            _runner.WaitForServiceToStart <RemoteFubuMvcBootstrapper>();

            _runner.Messaging.AddListener(listener);



            _runner.SendRemotely(new StartApplication
            {
                ApplicationName              = _request.ApplicationFlag,
                PhysicalPath                 = _request.DirectoryFlag,
                PortNumber                   = PortFinder.FindPort(_request.PortFlag),
                UseProductionMode            = _request.ProductionModeFlag,
                AutoRefreshWebSocketsAddress = _request.AutoRefreshWebSocketsAddress
            });
        }
Beispiel #3
0
        public void Start(object listener, Action <RemoteDomainExpression> configuration = null)
        {
            _runner = RemoteServiceRunner.For <RemoteFubuMvcBootstrapper>(x => {
                x.RequireAssemblyContainingType <EmbeddedFubuMvcServer>();
                x.RequireAssemblyContainingType <RemoteFubuMvcProxy>();
                x.RequireAssemblyContainingType <RemoteServiceRunner>();
                x.RequireAssemblyContainingType <Owin.IAppBuilder>();
                x.RequireAssemblyContainingType <IActivator>();              // Bottles
                x.RequireAssemblyContainingType <IModelBinder>();            // FubuCore
                x.RequireAssemblyContainingType <StringToken>();             // FubuLocalization
                x.RequireAssemblyContainingType <FubuApplication>();         // FubuMVC.Core
                x.RequireAssemblyContainingType <FubuCsProjFile.CodeFile>(); // FubuCsProjFile just to keep it from whining

                x.RequireAssembly("Owin.Extensions");
                x.RequireAssembly("Newtonsoft.Json");
                x.RequireAssembly("FubuMVC.OwinHost");
                x.RequireAssembly("Microsoft.Owin.Hosting");
                x.RequireAssembly("Microsoft.Owin.Host.HttpListener");
                x.RequireAssembly("Microsoft.Owin");
                x.RequireAssembly("Owin");

                x.ServiceDirectory = _request.DirectoryFlag;

                x.Setup.PrivateBinPath = _request.DetermineBinPath();

                if (configuration != null)
                {
                    configuration(x);
                }

                Console.WriteLine("Assembly bin path is " + x.Setup.PrivateBinPath);
            });

            _runner.WaitForServiceToStart <RemoteFubuMvcBootstrapper>();

            _runner.Messaging.AddListener(listener);



            _runner.SendRemotely(new StartApplication
            {
                ApplicationName   = _request.ApplicationFlag,
                PhysicalPath      = _request.DirectoryFlag,
                PortNumber        = PortFinder.FindPort(_request.PortFlag),
                UseProductionMode = _request.ProductionModeFlag
            });
        }
Beispiel #4
0
        public void loading_a_custom_application_loader()
        {
            // SAMPLE: bootstrap-custom-loader
            var runner = RemoteServiceRunner.For <IApplicationLoader>(x => {
                // more AppDomain configuration
            });

            // -- or --
            runner = new RemoteServiceRunner(x => {
                // Can be the assembly qualified name of either:
                // 1. An IApplicationLoader class
                // 2. An IApplicationSource<,> class
                // 3. An IBootstrapper class
                x.BootstrapperName = "MyLib.AppLoader, MyLib";
            });
            // ENDSAMPLE
        }
Beispiel #5
0
        public void coordinate_message_history_via_remote_service()
        {
            using (var runner = RemoteServiceRunner.For <SampleBootstrapper>())
            {
                runner.WaitForServiceToStart <SampleService.SampleService>();
                runner.WaitForServiceToStart <SampleService.RemoteService>();

                MessageHistory.ConnectRemoteListeners(runner);

                var foo = new Foo();

                GlobalMessageTracking.SentMessage(foo);


                GlobalMessageTracking.Messaging.WaitForMessage <AllMessagesComplete>(() => runner.SendRemotely(foo), 60000)
                .ShouldNotBeNull();
            }
        }
Beispiel #6
0
        public void coordinate_message_history_via_remote_service_and_clear_data_does_not_remove_listeners()
        {
            using (var runner = RemoteServiceRunner.For <SampleBootstrapper>())
            {
                runner.WaitForServiceToStart <SampleService.SampleService>();
                runner.WaitForServiceToStart <SampleService.RemoteService>();

                MessageHistory.StartListening(runner);
                MessageHistory.ClearHistory();

                var foo = new Foo();

                EventAggregator.SentMessage(foo);


                EventAggregator.Messaging.WaitForMessage <AllMessagesComplete>(() => runner.SendRemotely(foo))
                .ShouldNotBeNull();
            }
        }