Skip to content

Commit

Permalink
[java] Building test base with bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 22, 2018
1 parent 9643057 commit c770b54
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
56 changes: 28 additions & 28 deletions java/client/test/org/openqa/selenium/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@ java_library(
],
)

#java_library(
# name = "test-base",
# srcs = [
# "JUnit4TestBase.java",
# "SeleniumTestRunner.java",
# "StaticResources.java",
# "TestUtilities.java",
# ],
# deps = [
# ":annotations",
# ":helpers",
# "//java/client/test/org/openqa/selenium:helpers",
# "//java/client/test/org/openqa/selenium/environment:environment",
# "//java/client/test/org/openqa/selenium/testing/drivers:browser",
# "//java/client/src/org/openqa/selenium:selenium",
# "//java/client/src/org/openqa/selenium/remote:remote",
# "//java/client/src/org/openqa/selenium/support/ui:wait",
# "//java/client/test/org/openqa/selenium/testing/drivers:drivers",
# "//third_party/java/guava:guava",
# "//third_party/java/assertj:assertj",
# "//third_party/java/junit:junit",
# "//third_party/java/selenium:htmlunit-driver",
# ],
# visibility = [
# "//java/client/test:__subpackages__",
# "//java/server/test:__subpackages__",
# ],
#)
java_library(
name = "test-base",
srcs = [
"JUnit4TestBase.java",
"SeleniumTestRunner.java",
"StaticResources.java",
"TestUtilities.java",
],
deps = [
":annotations",
":helpers",
"//java/client/test/org/openqa/selenium:helpers",
"//java/client/test/org/openqa/selenium/environment:environment",
"//java/client/test/org/openqa/selenium/testing/drivers:browser",
"//java/client/src/org/openqa/selenium:selenium",
"//java/client/src/org/openqa/selenium/remote:remote",
"//java/client/src/org/openqa/selenium/support/ui:wait",
"//java/client/test/org/openqa/selenium/testing/drivers:drivers",
"//third_party/java/guava:guava",
"//third_party/java/assertj:assertj",
"//third_party/java/junit:junit",
"//third_party/java/selenium:htmlunit-driver",
],
visibility = [
"//java/client/test:__subpackages__",
"//java/server/test:__subpackages__",
],
)
3 changes: 2 additions & 1 deletion java/client/test/org/openqa/selenium/testing/InProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ public class InProject {
public static Path locate(String path) {
// Find the rakefile first
Path dir = Paths.get(".").toAbsolutePath();
Path pwd = dir;
while (dir != null && !dir.equals(dir.getParent())) {
Path rakefile = dir.resolve("Rakefile");
if (Files.exists(rakefile)) {
break;
}
dir = dir.getParent();
}
Preconditions.checkNotNull(dir, "Unable to find root of project");
Preconditions.checkNotNull(dir, "Unable to find root of project in " + pwd);
dir = dir.normalize();

Path needle = dir.resolve(path);
Expand Down
2 changes: 1 addition & 1 deletion third_party/java/jetty/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ java_library(
":jetty-xml-repacked",
],
visibility = [
"//java/client/test/org/openqa/selenium/environment:__pkg__",
"//java/client/test:__subpackages__",
"//java/server/src/org/openqa:__subpackages__",
],
)
Expand Down
2 changes: 1 addition & 1 deletion third_party/java/servlet/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ java_import(
jars = ["javax.servlet-api-3.1.0.jar"],
srcjar = "javax.servlet-api-3.1.0-sources.jar",
visibility = [
"//java/client/test/org/openqa/selenium/environment:__pkg__",
"//java/client/test:__subpackages__",
"//java/server/src/org/openqa:__subpackages__",
"//third_party/java/jetty:__pkg__",
],
Expand Down

0 comments on commit c770b54

Please sign in to comment.