Exemple #1
0
        public void ShouldBeAbleToLaunchServiceInASeparateProcess()
        {
            R.GetOrAdd(WellKnown.Listeners.AlphaListener.EndPoint);

            var service = new SqlDServiceModel()
            {
                Name     = "separate-process",
                Database = SqlDStart.NewId(),
                Port     = WellKnown.EndPoints.Free2.Port - 100,
                Host     = WellKnown.EndPoints.Free2.Host,
                Pragma   = SqlDPragmaModel.Default
            };

            using (var process = SqlD.Process.Service.Start(typeof(StartTests).Assembly, service))
            {
                var wait = new ManualResetEvent(false);
                using (var endPointMonitor = new EndPointMonitor(service.ToEndPoint()))
                {
                    endPointMonitor.OnUp += (args) => wait.Set();
                    wait.WaitOne(TimeSpan.FromSeconds(30));
                }
                process.Kill();
            }
        }
Exemple #2
0
            public static void SetUp()
            {
                lock (Synchronise)
                {
                    RegistryListener = SqlDStart.NewListener().Hosting(typeof(SqlDStart).Assembly, SqlDStart.NewId(), SqlDStart.NewId(), SqlDPragmaModel.Default, EndPoints.Registry);
                    EndPointMonitor.WaitUntil(RegistryListener.EndPoint, EndPointIs.Up);

                    AlphaListener = SqlDStart.NewListener().Hosting(typeof(SqlDStart).Assembly, SqlDStart.NewId(), SqlDStart.NewId(), SqlDPragmaModel.Default, EndPoints.Alpha);
                    EndPointMonitor.WaitUntil(AlphaListener.EndPoint, EndPointIs.Up);

                    BetaListener = SqlDStart.NewListener().Hosting(typeof(SqlDStart).Assembly, SqlDStart.NewId(), SqlDStart.NewId(), SqlDPragmaModel.Default, EndPoints.Beta);
                    EndPointMonitor.WaitUntil(BetaListener.EndPoint, EndPointIs.Up);

                    Free1Listener = SqlDStart.NewListener().Hosting(typeof(SqlDStart).Assembly, SqlDStart.NewId(), SqlDStart.NewId(), SqlDPragmaModel.Default, EndPoints.Free1, EndPoints.Free2);
                    EndPointMonitor.WaitUntil(Free1Listener.EndPoint, EndPointIs.Up);

                    Free2Listener = SqlDStart.NewListener().Hosting(typeof(SqlDStart).Assembly, SqlDStart.NewId(), SqlDStart.NewId(), SqlDPragmaModel.Default, EndPoints.Free2);
                    EndPointMonitor.WaitUntil(Free2Listener.EndPoint, EndPointIs.Up);
                }
            }