@@ -194,7 +194,7 @@ protected void waitUntilAvailable() throws MalformedURLException {
194
194
}
195
195
196
196
/**
197
- * Stops this service is it is currently running. This method will attempt to block until the
197
+ * Stops this service if it is currently running. This method will attempt to block until the
198
198
* server has been fully shutdown.
199
199
*
200
200
* @see #start()
@@ -208,13 +208,15 @@ public void stop() {
208
208
return ;
209
209
}
210
210
211
- try {
212
- URL killUrl = new URL (url .toString () + "/shutdown" );
213
- new UrlChecker ().waitUntilUnavailable (3 , SECONDS , killUrl );
214
- } catch (MalformedURLException e ) {
215
- toThrow = new WebDriverException (e );
216
- } catch (UrlChecker .TimeoutException e ) {
217
- toThrow = new WebDriverException ("Timed out waiting for driver server to shutdown." , e );
211
+ if (hasShutdownEndpoint ()) {
212
+ try {
213
+ URL killUrl = new URL (url .toString () + "/shutdown" );
214
+ new UrlChecker ().waitUntilUnavailable (3 , SECONDS , killUrl );
215
+ } catch (MalformedURLException e ) {
216
+ toThrow = new WebDriverException (e );
217
+ } catch (UrlChecker .TimeoutException e ) {
218
+ toThrow = new WebDriverException ("Timed out waiting for driver server to shutdown." , e );
219
+ }
218
220
}
219
221
220
222
process .destroy ();
@@ -228,6 +230,10 @@ public void stop() {
228
230
}
229
231
}
230
232
233
+ protected boolean hasShutdownEndpoint () {
234
+ return true ;
235
+ }
236
+
231
237
public void sendOutputTo (OutputStream outputStream ) {
232
238
this .outputStream = Preconditions .checkNotNull (outputStream );
233
239
}
0 commit comments