<commit_before>﻿using System;
using System.IO;
using System.Net;
using System.Diagnostics;

namespace OpenQA.Selenium.Environment
{
    public class TestWebServer
    {
        private Process webserverProcess;

        private string standaloneTestJar = @"build/java/client/test/org/openqa/selenium/tests-standalone.jar";
        private string webserverClassName = "org.openqa.selenium.environment.webserver.Jetty7AppServer";
        private string projectRootPath;

        public TestWebServer(string projectRoot)
        {
            projectRootPath = projectRoot;
        }

        public void Start()
        {
            if (webserverProcess == null || webserverProcess.HasExited)
            {
                standaloneTestJar = standaloneTestJar.Replace('/', Path.DirectorySeparatorChar);
                if (!File.Exists(Path.Combine(projectRootPath, standaloneTestJar)))
                {
                    throw new FileNotFoundException(
                        string.Format(
                            "Standalone test jar at {0} didn't exist - please build it using something like {1}",
                            standaloneTestJar,
                            "go //java/client/test/org/openqa/selenium:tests:uber"));
                }

                string javaExecutableName = "java";
                if (System.Environment.OSVersion.Platform == PlatformID.Win32NT || System.Environment.OSVersion.Platform == PlatformID.Win32Windows)
                {
                    javaExecutableName = javaExecutableName + ".exe";
                }

                webserverProcess = new Process();
                webserverProcess.StartInfo.FileName = javaExecutableName;
                webserverProcess.StartInfo.Arguments = "-cp " + standaloneTestJar + " " + webserverClassName;<commit_msg>Updating startup class for test web server in .NET tests<commit_after>﻿using System;
using System.IO;
using System.Net;
using System.Diagnostics;

namespace OpenQA.Selenium.Environment
{
    public class TestWebServer
    {
        private Process webserverProcess;

        private string standaloneTestJar = @"build/java/client/test/org/openqa/selenium/tests-standalone.jar";
        private string webserverClassName = "org.openqa.selenium.environment.webserver.JettyAppServer";
        private string projectRootPath;

        public TestWebServer(string projectRoot)
        {
            projectRootPath = projectRoot;
        }

        public void Start()
        {
            if (webserverProcess == null || webserverProcess.HasExited)
            {
                standaloneTestJar = standaloneTestJar.Replace('/', Path.DirectorySeparatorChar);
                if (!File.Exists(Path.Combine(projectRootPath, standaloneTestJar)))
                {
                    throw new FileNotFoundException(
                        string.Format(
                            "Standalone test jar at {0} didn't exist - please build it using something like {1}",
                            standaloneTestJar,
                            "go //java/client/test/org/openqa/selenium:tests:uber"));
                }

                string javaExecutableName = "java";
                if (System.Environment.OSVersion.Platform == PlatformID.Win32NT || System.Environment.OSVersion.Platform == PlatformID.Win32Windows)
                {
                    javaExecutableName = javaExecutableName + ".exe";
                }

                webserverProcess = new Process();
                webserverProcess.StartInfo.FileName = javaExecutableName;
                webserverProcess.StartInfo.Arguments = "-cp " + standaloneTestJar + " " + webserverClassName;
{'fraction_non_alphanumeric': 0.08410451823625477, 'fraction_numerical': 0.003538377789874796, 'mean_word_length': 1.9805352798053528, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6952514', 'n_tokens_mistral': 933, 'n_tokens_neox': 871, 'n_words': 180}