Skip to content

Commit

Permalink
server: Replacing a dummy class with a proper mock, and fixing test d…
Browse files Browse the repository at this point in the history
…ependencies
  • Loading branch information
barancev committed Jun 7, 2015
1 parent e264833 commit 025b61b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
import org.openqa.selenium.remote.server.log.StdOutHandler;
import org.openqa.selenium.remote.server.log.TerseFormatter;
import org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo;
import org.openqa.selenium.server.browserlaunchers.BrowserLauncher;
import org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory;
import org.openqa.selenium.server.browserlaunchers.BrowserOptions;
import org.openqa.selenium.server.browserlaunchers.DummyLauncher;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -81,7 +81,7 @@ public void testBrowserSessionFactorySetsLastSessionIdOfSeleniumDriverResourceHa
final RemoteControlConfiguration configuration;

BrowserLauncherFactory blf = mock(BrowserLauncherFactory.class);
DummyLauncher launcherMock = mock(DummyLauncher.class);
BrowserLauncher launcherMock = mock(BrowserLauncher.class);

configuration = new RemoteControlConfiguration();
configuration.setTimeoutInSeconds(1);
Expand Down Expand Up @@ -269,13 +269,13 @@ private Set<BrowserSessionInfo> getTestSessionSet() {
}

private BrowserSessionInfo getTestSession1() {
DummyLauncher mockLauncher1 = new DummyLauncher();
BrowserLauncher mockLauncher1 = mock(BrowserLauncher.class);
return new BrowserSessionInfo(
SESSION_ID_1, BROWSER_1, BASEURL1, mockLauncher1, null);
}

private BrowserSessionInfo getTestSession2() {
DummyLauncher mockLauncher2 = new DummyLauncher();
BrowserLauncher mockLauncher2 = mock(BrowserLauncher.class);
return new BrowserSessionInfo(
SESSION_ID_2, BROWSER2, BASEURL2, mockLauncher2, null);
}
Expand Down

This file was deleted.

6 changes: 2 additions & 4 deletions java/server/test/org/openqa/selenium/server/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ java_test(name = "RcServerUnitTests",
srcs = [
"RcServerUnitTests.java",
"*UnitTest.java",
"browserlaunchers/DummyLauncher.java",
"browserlaunchers/*.java",
"htmlrunner/*UnitTest.java",
"log/*.java",
"mock/*.java",
],
deps = [
"//java/client/test/org/openqa/selenium/testing:junit_4",
"//java/server/src/org/openqa/selenium/server:base",
"//java/server/src/org/openqa/selenium/server:logging",
"//java/server/test/org/openqa/selenium/remote/server:test",
"//java/server/test/org/openqa/selenium/remote/server:lib",
"//java/server/test/org/openqa/selenium/remote/server/log:test",
"//java/server/test/org/openqa/selenium/testworker",
"//third_party/java/junit",
Expand All @@ -31,4 +29,4 @@ java_test(name = "RcServerLargeTests",
"//java/client/test/org/openqa/selenium/testing:util",
"//java/server/src/org/openqa/grid/selenium:selenium:uber",
"//java/server/src/org/openqa/selenium/server:base",
])
])

0 comments on commit 025b61b

Please sign in to comment.