@@ -33,7 +33,7 @@ public class TestWebServer
33
33
{
34
34
private Process webserverProcess ;
35
35
36
- private string standaloneTestJar = @"_main/java/test/org/openqa/selenium/environment/appserver" ;
36
+ private string standaloneAppserverPath ;
37
37
private string projectRootPath ;
38
38
private bool captureWebServerOutput ;
39
39
private bool hideCommandPrompt ;
@@ -58,73 +58,44 @@ public async Task StartAsync()
58
58
try
59
59
{
60
60
var runfiles = Runfiles . Create ( ) ;
61
- standaloneTestJar = runfiles . Rlocation ( standaloneTestJar ) ;
61
+ standaloneAppserverPath = runfiles . Rlocation ( standaloneAppserverPath ) ;
62
62
}
63
63
catch ( FileNotFoundException )
64
64
{
65
65
var baseDirectory = AppContext . BaseDirectory ;
66
- standaloneTestJar = Path . Combine ( baseDirectory , "../../../../../../bazel-bin/java/test/org/openqa/selenium/environment/appserver" ) ;
66
+ standaloneAppserverPath = Path . Combine ( baseDirectory , "../../../../../../bazel-bin/java/test/org/openqa/selenium/environment/appserver" ) ;
67
67
}
68
68
69
69
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
70
70
{
71
- standaloneTestJar += ".exe" ;
71
+ standaloneAppserverPath += ".exe" ;
72
72
}
73
73
74
- Console . Write ( "Standalone jar is " + standaloneTestJar ) ;
74
+ Console . Write ( "Test Appserver is " + standaloneAppserverPath ) ;
75
75
76
- if ( ! File . Exists ( standaloneTestJar ) )
76
+ if ( ! File . Exists ( standaloneAppserverPath ) )
77
77
{
78
78
throw new FileNotFoundException (
79
79
string . Format (
80
- "Test webserver jar at {0} didn't exist. Project root is {2}. Please build it using something like {1}." ,
81
- standaloneTestJar ,
82
- "bazel build //java/test/org/openqa/selenium/environment:appserver_deploy.jar " ,
80
+ "Test Appserver at {0} didn't exist. Project root is {2}. Please build it using something like {1}." ,
81
+ standaloneAppserverPath ,
82
+ "bazel build //java/test/org/openqa/selenium/environment:appserver " ,
83
83
projectRootPath ) ) ;
84
84
}
85
85
86
- //List<string> javaSystemProperties = new List<string>();
87
-
88
86
StringBuilder processArgsBuilder = new StringBuilder ( ) ;
89
- // foreach (string systemProperty in javaSystemProperties)
90
- // {
91
- // if (processArgsBuilder.Length > 0)
92
- // {
93
- // processArgsBuilder.Append(" ");
94
- // }
95
- //
96
- // processArgsBuilder.AppendFormat("-D{0}", systemProperty);
97
- // }
98
- //
99
- // if (processArgsBuilder.Length > 0)
100
- // {
101
- // processArgsBuilder.Append(" ");
102
- // }
103
- //
104
- // processArgsBuilder.AppendFormat("-jar {0}", standaloneTestJar);
87
+
105
88
processArgsBuilder . AppendFormat ( " {0}" , this . port ) ;
106
89
107
90
Console . Write ( processArgsBuilder . ToString ( ) ) ;
108
91
109
92
webserverProcess = new Process ( ) ;
110
- webserverProcess . StartInfo . FileName = standaloneTestJar ;
111
- // if (!string.IsNullOrEmpty(javaExecutablePath))
112
- // {
113
- // webserverProcess.StartInfo.FileName = Path.Combine(javaExecutablePath, javaExecutableName);
114
- // }
115
- // else
116
- // {
117
- // webserverProcess.StartInfo.FileName = javaExecutableName;
118
- // }
93
+ webserverProcess . StartInfo . FileName = standaloneAppserverPath ;
119
94
120
95
webserverProcess . StartInfo . Arguments = processArgsBuilder . ToString ( ) ;
121
96
webserverProcess . StartInfo . WorkingDirectory = projectRootPath ;
122
97
webserverProcess . StartInfo . UseShellExecute = ! ( hideCommandPrompt || captureWebServerOutput ) ;
123
98
webserverProcess . StartInfo . CreateNoWindow = hideCommandPrompt ;
124
- if ( ! string . IsNullOrEmpty ( this . javaHomeDirectory ) )
125
- {
126
- webserverProcess . StartInfo . EnvironmentVariables [ "JAVA_HOME" ] = this . javaHomeDirectory ;
127
- }
128
99
129
100
captureWebServerOutput = true ;
130
101
0 commit comments