Beispiel #1
0
        public virtual TestReport Run()
        {
            DateTime startOfRun = DateTime.Now;

            _logger.Information("{1}{1}Starting Test Run: {0}{1}{1}"
                                .FormatWith(DateTime.Now, Environment.NewLine));

            _webServer.Start();
            foreach (var browser in _webBrowsers)
            {
                browser.Start();
            }
            _dialogMonitorRunner.Start();

            _browserThreadWaitHandle.WaitOne();

            _dialogMonitorRunner.Stop();
            foreach (var browser in _webBrowsers)
            {
                browser.Stop();
            }
            _webServer.Stop();

            var testReport = _testResultAggregator.CurrentReport;

            ConsoleTestCompleteMessage.WriteOutCompletionStatement(testReport, startOfRun);
            return(testReport);
        }
Beispiel #2
0
        public virtual TestReport Run()
        {
            _logger.Information("{1}{1}Starting Test Run: {0}{1}{1}"
                                .FormatWith(DateTime.Now, Environment.NewLine));

            _webServer.Start();
            foreach (var browser in _webBrowsers)
            {
                browser.Start();
            }
            _dialogMonitorRunner.Start();

            _browserThreadWaitHandle.WaitOne();

            _dialogMonitorRunner.Stop();
            foreach (var browser in _webBrowsers)
            {
                browser.Stop();
            }
            _webServer.Stop();

            var testReport = _testResultAggregator.CurrentReport;

            return(testReport);
        }
Beispiel #3
0
 private void StartStopButton_Click(object sender, EventArgs e)
 {
     if (webServer.IsStarted)
     {
         webServer.Stop();
     }
     else
     {
         webServer.Start();
     }
 }
Beispiel #4
0
 private void MessagesTextBox_DoubleClick(object sender, EventArgs e)
 {
     if (webServer.IsStarted)
     {
         webServer.Stop();
     }
     else
     {
         webServer.Start();
     }
 }
 private void StopEverything()
 {
     if (_controller != null)
     {
         _controller.Stop();
         _controller.Dispose();
         _controller = null;
     }
     if (_webServer != null)
     {
         _webServer.Stop();
         _webServer.Dispose();
         _webServer = null;
     }
     _factory.CreateGarbage().Collect();
 }
Beispiel #6
0
        private static void Main(string[] args)
        {
            _ws               = new WebServer();
            _ws.PortNumber    = 8086;
            _ws.ServerAddress = "127.0.0.1";
            _ws.AllowBrowsing = true;

            Console.WriteLine(string.Format("Browsing started on {0}:{1}", _ws.ServerAddress, _ws.PortNumber));
            Console.WriteLine("Root directory : " + _ws.RootDirectory);

            Thread thread1 = new Thread(Program.ThreadFunc);

            thread1.Start();

            _ws.Start();
            Console.WriteLine(" Press a key to quit.");
            Console.ReadKey();
            _ws.Stop();
        }
Beispiel #7
0
        public static int RunWebServer(IWebServer webServer, Logger log, ManualResetEvent exitLatch)
        {
            try
            {
                log.Info("Starting web server instance...");
                webServer.Start();
                Console.WriteLine("Server Started.... press CTRL + C to stop");
                Warmup(webServer);
                exitLatch.WaitOne();
                Console.WriteLine("Server shutting down, please wait...");
                webServer.Stop();

                return 0;
            }
            catch (WebCorePortException)
            {
                log.Error("Please allow the user to access the port. eg. 'netsh http add urlacl url=http://*:9999/ user={0}'", WindowsIdentity.GetCurrent().Name);
                return 1;
            }
        }
        public static int RunWebServer(IWebServer webServer, Logger log, ManualResetEvent exitLatch)
        {
            try
            {
                log.Info("Starting web server instance...");
                webServer.Start();
                Console.WriteLine("Server Started.... press CTRL + C to stop");
                Warmup(webServer);
                exitLatch.WaitOne();
                Console.WriteLine("Server shutting down, please wait...");
                webServer.Stop();

                return(0);
            }
            catch (WebCorePortException)
            {
                log.Error("Please allow the user to access the port. eg. 'netsh http add urlacl url=http://*:9999/ user={0}'", WindowsIdentity.GetCurrent().Name);
                return(1);
            }
        }
Beispiel #9
0
 private void OnExitClick(object sender, EventArgs e)
 {
     _webServer?.Stop();
     Close();
 }
Beispiel #10
0
 public async Task Stop()
 {
     await _server.Stop();
 }