Skip to content

Commit 203090c

Browse files
committedJun 28, 2014
On behalf of [email protected]: Fixing the list of extensions to search for an executable on Windows, and logging process startup errors. Fixes issue 7514
1 parent 9bce67c commit 203090c

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed
 

‎java/client/src/org/openqa/selenium/os/CommandLine.java

+4
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,8 @@ public String toString() {
178178
public void copyOutputTo(OutputStream out) {
179179
process.copyOutputTo(out);
180180
}
181+
182+
public void checkForError() {
183+
process.checkForError();
184+
}
181185
}

‎java/client/src/org/openqa/selenium/os/ExecutableFinder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
class ExecutableFinder {
3636
private static final ImmutableSet<String> ENDINGS = Platform.getCurrent().is(WINDOWS) ?
37-
ImmutableSet.of("", ".exe", ".com", ".bat") : ImmutableSet.of("");
37+
ImmutableSet.of("", ".cmd", ".exe", ".com", ".bat") : ImmutableSet.of("");
3838

3939
private static final Method JDK6_CAN_EXECUTE = findJdk6CanExecuteMethod();
4040

‎java/client/src/org/openqa/selenium/os/OsProcess.java

+2
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ interface OsProcess {
4545
String getStdOut();
4646

4747
boolean isRunning();
48+
49+
void checkForError();
4850
}

‎java/client/src/org/openqa/selenium/os/UnixProcess.java

+6
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ public int getExitCode() {
161161
return handler.getExitValue();
162162
}
163163

164+
public void checkForError() {
165+
if (handler.getException() != null) {
166+
log.severe(handler.getException().toString());
167+
}
168+
}
169+
164170
public String getStdOut() {
165171
if (isRunning()) {
166172
throw new IllegalStateException(

‎java/client/src/org/openqa/selenium/os/WindowsProcessGroup.java

+4
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ public void waitFor(long timeout) throws InterruptedException {
161161
// no-op
162162
}
163163

164+
public void checkForError() {
165+
// no-op
166+
}
167+
164168
public int destroy() {
165169
if (!isRunning()) {
166170
return 0; // Hard code the return value

‎java/client/src/org/openqa/selenium/remote/service/DriverService.java

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public void start() throws IOException {
162162
URL status = new URL(url.toString() + "/status");
163163
new UrlChecker().waitUntilAvailable(20, SECONDS, status);
164164
} catch (UrlChecker.TimeoutException e) {
165+
process.checkForError();
165166
throw new WebDriverException("Timed out waiting for driver server to start.", e);
166167
} finally {
167168
lock.unlock();

0 commit comments

Comments
 (0)
Please sign in to comment.