Skip to content

Commit

Permalink
Make the AppServerTest work with Buck
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jun 2, 2016
1 parent a01b615 commit 4ebe136
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
27 changes: 27 additions & 0 deletions java/client/test/org/openqa/selenium/environment/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,30 @@ java_library(name = 'environment',
'//java/server/test/...',
],
)

java_binary(name = 'webserver',
main_class = 'org.openqa.selenium.environment.webserver.JettyAppServer',
deps = [
':environment'
]
)

java_test(name = "webserver-test",
srcs = [
"webserver/AppServerTest.java",
],
vm_args = [
'-Dselenium.browser=ff',
],
deps = [
":environment",
"//java/client/src/org/openqa/selenium/remote:remote",
"//java/client/src/org/openqa/selenium/chrome:chrome",
'//java/client/test/org/openqa/selenium/testing/drivers:drivers',
# '//third_party/drivers:chromedriver',
"//third_party/java/guava:guava",
"//third_party/java/httpcomponents:httpclient",
"//third_party/java/junit:junit",
],
)

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.File;
import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.io.Files;

import org.apache.http.Header;
import org.apache.http.HttpResponse;
Expand All @@ -35,16 +37,13 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.os.CommandLine;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;

import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.io.Files;
import java.io.File;

@RunWith(JUnit4.class)
public class AppServerTest {
Expand All @@ -54,8 +53,7 @@ public class AppServerTest {

@BeforeClass
public static void startDriver() throws Throwable {
System.setProperty("webdriver.chrome.driver", CommandLine.find("chromedriver"));
driver = new ChromeDriver();
driver = new WebDriverBuilder().get();
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ java_test(name = "webserver_test",
srcs = [
"AppServerTest.java",
],
sysproperties = [
"-Dselenium.browser=ff",
],
deps = [
":webserver",
"//java/client/src/org/openqa/selenium/chrome",
Expand Down

0 comments on commit 4ebe136

Please sign in to comment.