Skip to content

Commit

Permalink
Get org.openqa.selenium.SmallTests building with Buck.
Browse files Browse the repository at this point in the history
Note: this includes a buck version bump in order to make things work.
  • Loading branch information
shs96c committed Sep 4, 2014
1 parent 03feed0 commit edffbc4
Show file tree
Hide file tree
Showing 48 changed files with 587 additions and 49 deletions.
1 change: 1 addition & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[test]
# Maximum timeout of 1 minute per test.
timeout = 60000
run_transitive = false

[alias]
chrome = //java/client/src/org/openqa/selenium/chrome:chrome
Expand Down
1 change: 1 addition & 0 deletions .buckjavaargs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError
2 changes: 1 addition & 1 deletion .buckversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8b7dbf7526c747d4d3a5197d8dc56877652cfcf1
7b683678599070e55ff9b0f038f5b1375626dace
44 changes: 31 additions & 13 deletions java/client/src/com/thoughtworks/selenium/webdriven/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ java_library(name = 'webdriven',
resources = [
'htmlutils.js',
'injectableSelenium.js',
'//javascript/selenium-atoms:findElement',
'//javascript/selenium-atoms:findOption',
'//javascript/selenium-atoms:fireEvent',
'//javascript/selenium-atoms:fireEventAt',
'//javascript/selenium-atoms:getAttribute',
'//javascript/selenium-atoms:getText',
'//javascript/selenium-atoms:linkLocator',
'//javascript/selenium-atoms:isElementPresent',
'//javascript/selenium-atoms:isSomethingSelected',
'//javascript/selenium-atoms:isTextPresent',
'//javascript/selenium-atoms:isVisible',
'//javascript/selenium-atoms:type',
'//third_party/js/sizzle:sizzle',
':findElement',
':findOption',
':fireEvent',
':fireEventAt',
':getAttribute',
':getText',
':linkLocator',
':isElementPresent',
':isSomethingSelected',
':isTextPresent',
':isVisible',
':type',
# TODO(simons): remove sizzle. There are no longer any browsers that need it.
':sizzle',
],
exported_deps = [
':emulation-api',
Expand All @@ -37,6 +38,9 @@ java_library(name = 'webdriven',
],
visibility = [
'//java/client/src/com/thoughtworks/selenium/...',
'//java/client/test/org/openqa/selenium/v1:tests',
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:LargeTests',
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:tests',
],
)

Expand All @@ -56,5 +60,19 @@ java_library(name = 'emulation-api',
],
visibility = [
'//java/client/src/com/thoughtworks/selenium/...',
'//java/client/test/org/openqa/selenium/v1/internal/seleniumemulation:tests',
],
)

for name in ['findElement', 'findOption', 'fireEvent', 'fireEventAt', 'getAttribute', 'getText',
'linkLocator', 'isElementPresent', 'isSomethingSelected', 'isTextPresent',
'isVisible', 'type',]:
export_file(name = name,
out = '%s.js' % name,
src = '//javascript/selenium-atoms:%s' % name,
)

export_file(name = 'sizzle',
out = 'sizzle.js',
src = '//third_party/js/sizzle:sizzle',
)
5 changes: 5 additions & 0 deletions java/client/src/org/openqa/selenium/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ java_library(name = 'core',
'Keys.java',
'OutputType.java',
'Proxy.java',
'Rotatable.java',
'ScreenOrientation.java',
'SearchContext.java',
'TakesScreenshot.java',
'UnexpectedAlertBehaviour.java',
'WebDriver.java',
'WebElement.java',
'internal/Base64Encoder.java',
Expand Down Expand Up @@ -95,12 +98,14 @@ java_library(name = 'exceptions',
visibility = [
'//java/client/src/org/openqa/selenium/interactions:exceptions',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/test/org/openqa/selenium/testing:helpers',
],
)

java_library(
name = 'platform',
srcs = [
'Architecture.java',
'Platform.java',
],
visibility = ['PUBLIC'],
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/browserlaunchers/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ java_library(name = 'proxies',
'//java/client/src/org/openqa/selenium/firefox:firefox',
'//java/client/src/org/openqa/selenium/htmlunit:htmlunit',
'//java/client/src/org/openqa/selenium/remote:remote',
'//java/client/test/org/openqa/selenium:tests',
],
)
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/chrome/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ java_library(
'//third_party/java/guava-libraries:guava-libraries',
'//third_party/java/json:json',
],
visibility = [ 'PUBLIC' ],
)
11 changes: 11 additions & 0 deletions java/client/src/org/openqa/selenium/ie/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
java_library(name = 'ie',
srcs = glob(['*.java']),
deps = [
'//java/client/src/org/openqa/selenium/net:net',
'//java/client/src/org/openqa/selenium/remote/service:service',
'//java/client/src/org/openqa/selenium/remote:remote',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//third_party/java/guava-libraries:guava-libraries',
],
visibility = [ 'PUBLIC' ],
)
2 changes: 1 addition & 1 deletion java/client/src/org/openqa/selenium/interactions/BUCK
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
java_library(name = 'interactions',
srcs = [
'Actions.java',
] + glob(['*Action.java', 'internal/*Action.java']),
] + glob(['*Action.java', 'internal/*Action.java', 'touch/*.java']),
exported_deps = [
':core',
':exceptions',
Expand Down
2 changes: 2 additions & 0 deletions java/client/src/org/openqa/selenium/os/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ java_library(
visibility = [
'//java/client/src/org/openqa/selenium/firefox:firefox',
'//java/client/src/org/openqa/selenium/remote/service:service',
'//java/client/test/org/openqa/selenium:tests',
'//java/client/test/org/openqa/selenium/testing/drivers:drivers',
],
)

1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/remote/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ java_library(name = 'remote',
'HttpVerb.java',
'JsonException.java',
'JsonToBeanConverter.java',
'LocalFileDetector.java',
'RemoteExecuteMethod.java',
'RemoteKeyboard.java',
'RemoteLogs.java',
Expand Down
87 changes: 87 additions & 0 deletions java/client/test/org/openqa/selenium/BUCK
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
java_test(name = 'SmallTests',
srcs = [
'SmallTests.java',
],
deps = [
':tests',
'//java/client/test/org/openqa/selenium/testing/drivers:SmallTests',
'//java/client/test/org/openqa/selenium/v1:SmallTests',
'//third_party/java/junit:junit',
],
)

java_library(name = 'annotations',
srcs = [
'NeedsFreshDriver.java',
'NoDriverAfterTest.java',
],
deps = [
],
visibility = [
'//java/client/test/org/openqa/selenium/testing:test-base',
],
)

java_library(name = 'doubles',
srcs = [
'StubDriver.java',
Expand All @@ -10,4 +34,67 @@ java_library(name = 'doubles',
'//java/client/test/...',
'//java/server/test/...',
],
)

java_library(name = 'helpers',
srcs = [
'Build.java',
'Pages.java',
'StubElement.java',
'StubRenderedWebElement.java',
'WaitingConditions.java',
],
deps = [
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/support/ui:wait',
'//java/client/test/org/openqa/selenium/environment:environment',
'//java/client/test/org/openqa/selenium/testing:helpers',
'//third_party/java/guava-libraries:guava-libraries',
'//third_party/java/junit:junit',
],
visibility = [
'//java/client/test/...',
'//java/server/test/...',
],
)

java_library(name = 'tests',
srcs = glob([
'*Test.java',
'internal/*Test.java',
'interactions/*Test.java',
'interactions/touch/*Test.java',
'io/*Test.java',
'logging/*.java',
'net/*Test.java',
'os/*Test.java',]) +
[
'Messages.java',
'interactions/StubInputDeviceDriver.java',
'interactions/touch/TouchTestBase.java',
'net/StubNetworkInterfaceProvider.java',
],
resources = [
'messages.properties',
],
deps = [
':doubles',
':helpers',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/browserlaunchers:proxies',
'//java/client/src/org/openqa/selenium/ie:ie',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/net:net',
'//java/client/src/org/openqa/selenium/os:os',
'//java/client/src/org/openqa/selenium/remote:remote',
'//java/client/src/org/openqa/selenium/support:support',
'//java/client/src/org/openqa/selenium/support/ui:wait',
'//java/client/test/org/openqa/selenium/testing:test-base',
'//java/client/test/org/openqa/selenium/testing/drivers:drivers',
'//third_party/java/guava-libraries:guava-libraries',
'//third_party/java/hamcrest:hamcrest',
'//third_party/java/junit:junit',
'//third_party/java/mockito:mockito',
'//third_party/java/webbit:webbit',
],
)
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/SmallTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.openqa.selenium.net.NetworkUtilsTest;
import org.openqa.selenium.os.CommandLineTest;
import org.openqa.selenium.os.WindowsUtilsUnitTest;
import org.openqa.selenium.testing.IgnoreComparitorUnitTest;
import org.openqa.selenium.testing.drivers.IgnoreComparitorUnitTest;

@RunWith(Suite.class)
@Suite.SuiteClasses({
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ java_library(name = "tests",
"//java/client/test/org/openqa/selenium/environment",
"//java/client/test/org/openqa/selenium/testing:junit_4",
"//java/client/test/org/openqa/selenium/testing:proxy",
"//java/client/test/org/openqa/selenium/testing:tests",
"//java/client/test/org/openqa/selenium/testing:util",
"//java/client/test/org/openqa/selenium/testing/drivers:tests",
"//java/client/test/org/openqa/selenium/v1:small_tests",
"//third_party/java/commons-io",
"//third_party/java/junit",
Expand Down
19 changes: 19 additions & 0 deletions java/client/test/org/openqa/selenium/environment/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
java_library(name = 'environment',
srcs = glob(['*.java', 'webserver/*.java'], excludes = ['**/*Test.java']),
deps = [
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/io:io',
'//java/client/src/org/openqa/selenium/net:net',
'//java/client/test/org/openqa/selenium/testing:helpers',
'//third_party/java/apache-httpclient:apache-httpclient',
'//third_party/java/commons-fileupload:commons-fileupload',
'//third_party/java/guava-libraries:guava-libraries',
'//third_party/java/jetty:jetty',
'//third_party/java/servlet-api:servlet-api',
'//third_party/java/webbit:webbit',
],
visibility = [
'//java/client/test/org/openqa/selenium:helpers',
'//java/client/test/org/openqa/selenium/testing:test-base',
],
)
1 change: 0 additions & 1 deletion java/client/test/org/openqa/selenium/support/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ java_library(name = "tests",
"//java/client/test/org/openqa/selenium/support/events:test",
"//java/client/test/org/openqa/selenium/support/pagefactory:test",
"//java/client/test/org/openqa/selenium/support/ui:test",
"//java/client/test/org/openqa/selenium/testing:tests",
"//third_party/java/mockito",
])

Expand Down
62 changes: 62 additions & 0 deletions java/client/test/org/openqa/selenium/testing/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
java_library(name = 'annotations',
srcs = [
'Ignore.java',
'JavascriptEnabled.java',
'NativeEventsRequired.java',
'NeedsLocalEnvironment.java',
],
deps = [
'//java/client/src/org/openqa/selenium:platform',
],
visibility = [
'//java/client/test/org/openqa/selenium/testing/drivers/...',
],
)

java_library(name = 'helpers',
srcs = [
'DevMode.java',
'InProject.java',
],
deps = [
'//java/client/src/org/openqa/selenium:exceptions',
],
visibility = [
'//java/client/test/...',
'//java/server/test/...',
],
)

java_library(name = 'test-base',
srcs = [
'JUnit4TestBase.java',
'ProxyServer.java',
'SeleniumTestRunner.java',
'TestUtilities.java',
],
exported_deps = [
':annotations',
':helpers',
'//java/client/test/org/openqa/selenium:annotations',
'//java/client/test/org/openqa/selenium:helpers',
'//java/client/test/org/openqa/selenium/testing/drivers:browser',
'//java/client/test/org/openqa/selenium/environment:environment',
],
deps = [
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/htmlunit:htmlunit',
'//java/client/src/org/openqa/selenium/net:net',
'//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-libraries:guava-libraries',
'//third_party/java/hamcrest:hamcrest',
'//third_party/java/junit:junit',
'//third_party/java/little_proxy:little_proxy',
'//third_party/java/netty:netty',
],
visibility = [
'//java/client/test/...',
'//java/server/test/...',
],
)
13 changes: 0 additions & 13 deletions java/client/test/org/openqa/selenium/testing/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ java_library(name = "annotations",
"//java/client/src/org/openqa/selenium:base",
])

java_library(name = "tests",
srcs = [
"IgnoreComparitorUnitTest.java",
],
deps = [
":junit",
":junit_4",
"//third_party/java/guava-libraries",
"//third_party/java/junit",
"//third_party/java/mockito",
])

java_library(name = "dev_mode",
srcs = [
"DevMode.java",
Expand All @@ -48,7 +36,6 @@ java_library(name = "util",

java_library(name = "junit",
srcs = [
"IgnoreComparator.java",
"IgnoredTestCallback.java",
],
deps = [
Expand Down
Loading

0 comments on commit edffbc4

Please sign in to comment.