Skip to content

Commit

Permalink
Deleting deprecated (in 3.6) methods
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Mar 3, 2018
1 parent 5d88c7b commit f9cba0f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 84 deletions.
55 changes: 0 additions & 55 deletions java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,6 @@ public RemoteWebDriver(CommandExecutor executor, Capabilities capabilities) {
((NeedsLocalLogs)executor).setLocalLogs(localLogs);
}

try {
startClient(capabilities);
} catch (RuntimeException e) {
try {
stopClient(capabilities);
} catch (Exception ignored) {
// Ignore the clean-up exception. We'll propagate the original failure.
}

throw e;
}

try {
startSession(capabilities);
} catch (RuntimeException e) {
Expand Down Expand Up @@ -259,48 +247,6 @@ protected void startSession(Capabilities capabilities) {
sessionId = new SessionId(response.getSessionId());
}

/**
* Method called before {@link #startSession(Capabilities) starting a new session}. The default
* implementation is a no-op, but subtypes should override this method to define custom behavior.
*
* @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
@Deprecated
protected void startClient() {
}

/**
* Method called before {@link #startSession(Capabilities) starting a new session}. The default
* implementation is a no-op, but subtypes should override this method to define custom behavior.
*
* @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
@Deprecated
protected void startClient(Capabilities capabilities) {
startClient();
}

/**
* Method called after executing a {@link #quit()} command. The default implementation is a no-op,
* but subtypes should override this method to define custom behavior.
*
* @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
@Deprecated
protected void stopClient() {
}

/**
* Method called after executing a {@link #quit()} command. The default implementation is a no-op,
* but subtypes should override this method to define custom behavior.
*
* @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
@Deprecated
protected void stopClient(Capabilities capabilities) {
stopClient();
}

public ErrorHandler getErrorHandler() {
return errorHandler;
}
Expand Down Expand Up @@ -497,7 +443,6 @@ public void quit() {
execute(DriverCommand.QUIT);
} finally {
sessionId = null;
stopClient();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,8 @@

@RunWith(JUnit4.class)
public class RemoteWebDriverInitializationTest {
private boolean stopClientCalled = false;
private boolean quitCalled = false;

@Test
public void testStopsClientIfStartClientFails() {
Throwable ex = TestUtilities.catchThrowable(
() -> new BadStartClientRemoteWebDriver(mock(CommandExecutor.class),
new ImmutableCapabilities()));

assertNotNull(ex);
assertThat(ex.getMessage(), containsString("Stub client that should fail"));
assertTrue(stopClientCalled);
}

@Test
public void testQuitsIfStartSessionFails() {
Throwable ex = TestUtilities.catchThrowable(
Expand All @@ -75,23 +63,6 @@ public void canHandleNonStandardCapabilitiesReturnedByRemoteEnd() throws IOExcep
assertThat(driver.getCapabilities().getCapability("platform"), equalTo(Platform.UNIX));
}

private class BadStartClientRemoteWebDriver extends RemoteWebDriver {
public BadStartClientRemoteWebDriver(CommandExecutor executor,
Capabilities desiredCapabilities) {
super(executor, desiredCapabilities);
}

@Override
protected void startClient() {
throw new RuntimeException("Stub client that should fail");
}

@Override
protected void stopClient() {
stopClientCalled = true;
}
}

private class BadStartSessionRemoteWebDriver extends RemoteWebDriver {
public BadStartSessionRemoteWebDriver(CommandExecutor executor,
Capabilities desiredCapabilities) {
Expand Down

0 comments on commit f9cba0f

Please sign in to comment.