Ejemplo n.º 1
0
        void StartSeleniumStandalone()
        {
            Mara.Log("StartSeleniumStandalone");
            _seleniumStandalone = new Process();
            _seleniumStandalone.StartInfo.FileName        = "java";
            _seleniumStandalone.StartInfo.Arguments       = string.Format("-jar {0} -port {1}", Path.GetFullPath(SeleniumServerJar), SeleniumServerPort);
            _seleniumStandalone.StartInfo.UseShellExecute = false;
            _seleniumStandalone.StartInfo.CreateNoWindow  = true;

            // TODO document and test SELENIUM_LOG variable
            if (Environment.GetEnvironmentVariable("SELENIUM_LOG") == null) // if there's no SELENIUM_LOG variable, don't print STDOUT
            {
                _seleniumStandalone.StartInfo.RedirectStandardOutput = true;
            }

            Mara.Log("Selenium Standalone starting ... ");
            _seleniumStandalone.Start();
            Mara.WaitForLocalPortToBecomeUnavailable(SeleniumServerPort, 100, 200); // 20 seconds max ... checking every 0.1 seconds
            Mara.Log("done");
        }
Ejemplo n.º 2
0
        public void Start()
        {
            if (_started == true)
            {
                return;
            }
            _started = true;

            Mara.Log("XSP.Start()");
            _server = new ApplicationServer(new XSPWebSource(IPAddress.Any, Port));
            _server.AddApplicationsFromCommandLine(string.Format("{0}:/:{1}", Port, App));

            Mara.Log("XSP2 starting ... ");
            try {
                _server.Start(true);
            } catch (SocketException ex) {
                // it gets mad sometimes?
                Mara.Log("SocketException while starting XSP: {0}", ex.Message);
            }
            Mara.WaitForLocalPortToBecomeUnavailable(Port);
            Mara.Log("done");
        }