Skip to content

Commit

Permalink
Bump hamcrest version
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Aug 24, 2019
1 parent 3177fbb commit 753dcb8
Show file tree
Hide file tree
Showing 24 changed files with 10 additions and 67 deletions.
2 changes: 1 addition & 1 deletion java/client/src/org/openqa/selenium/lift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ java_export(
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/support",
"//third_party/java/guava",
"//third_party/java/hamcrest:hamcrest-library",
"//third_party/java/hamcrest",
"//third_party/java/junit",
],
)
3 changes: 0 additions & 3 deletions java/client/src/org/openqa/selenium/lift/find/DivFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.openqa.selenium.lift.match.AttributeMatcher.attribute;

import org.hamcrest.Factory;

/**
* {@link Finder} for HTML div tags.
*/
Expand All @@ -37,7 +35,6 @@ protected String tagName() {
return "div";
}

@Factory
public static HtmlTagFinder div() {
return new DivFinder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.openqa.selenium.lift.find;

import org.hamcrest.Factory;

/**
* {@link Finder} for HTML image tags.
*/
Expand All @@ -34,12 +32,10 @@ protected String tagName() {
return "img";
}

@Factory
public static HtmlTagFinder image() {
return new ImageFinder();
}

@Factory
public static HtmlTagFinder images() {
return new ImageFinder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.openqa.selenium.lift.Matchers.attribute;
import static org.openqa.selenium.lift.Matchers.value;

import org.hamcrest.Factory;

/**
* {@link Finder} for HTML input tags.
*/
Expand All @@ -38,37 +36,30 @@ protected String tagName() {
return "input";
}

@Factory
public static HtmlTagFinder textbox() {
return new InputFinder().with(attribute("type", equalTo("text")));
}

@Factory
public static HtmlTagFinder imageButton() {
return new InputFinder().with(attribute("type", equalTo("image")));
}

@Factory
public static HtmlTagFinder imageButton(String label) {
return imageButton().with(value((label)));
}

@Factory
public static HtmlTagFinder radioButton() {
return new InputFinder().with(attribute("type", equalTo("radio")));
}

@Factory
public static HtmlTagFinder radioButton(String id) {
return radioButton().with(attribute("id", equalTo(id)));
}

@Factory
public static HtmlTagFinder submitButton() {
return new InputFinder().with(attribute("type", equalTo("submit")));
}

@Factory
public static HtmlTagFinder submitButton(String label) {
return submitButton().with(value(label));
}
Expand Down
5 changes: 0 additions & 5 deletions java/client/src/org/openqa/selenium/lift/find/LinkFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.openqa.selenium.lift.match.TextMatcher.text;

import org.hamcrest.Factory;

public class LinkFinder extends HtmlTagFinder {

private LinkFinder() {
Expand All @@ -41,17 +39,14 @@ protected String tagDescription() {
return "link";
}

@Factory
public static HtmlTagFinder link() {
return new LinkFinder();
}

@Factory
public static HtmlTagFinder link(String linkText) {
return new LinkFinder().with(text(equalTo(linkText)));
}

@Factory
public static HtmlTagFinder links() {
return link();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.openqa.selenium.lift.match.TextMatcher.text;

import org.hamcrest.Factory;

/**
* A {@link Finder} for HTML title tags.
*/
Expand All @@ -43,17 +41,14 @@ protected String tagDescription() {
return "page title";
}

@Factory
public static HtmlTagFinder title() {
return new PageTitleFinder();
}

@Factory
public static HtmlTagFinder title(String title) {
return new PageTitleFinder().with(text(equalTo(title)));
}

@Factory
public static HtmlTagFinder titles() {
return new PageTitleFinder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.openqa.selenium.lift.find;

import org.hamcrest.Factory;

/**
* A {@link Finder} for HTML table cell "td" tags.
*/
Expand All @@ -37,12 +35,10 @@ protected String tagDescription() {
return "table cell";
}

@Factory
public static HtmlTagFinder cell() {
return new TableCellFinder();
}

@Factory
public static HtmlTagFinder cells() {
return cell();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.openqa.selenium.lift.find;

import org.hamcrest.Factory;

/**
* A {@link Finder} for HTML table tags.
*
Expand All @@ -38,12 +36,10 @@ protected String tagDescription() {
return "table";
}

@Factory
public static HtmlTagFinder table() {
return new TableFinder();
}

@Factory
public static HtmlTagFinder tables() {
return table();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium.lift.match;

import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.openqa.selenium.WebElement;
Expand Down Expand Up @@ -47,7 +46,6 @@ public void describeTo(Description description) {
matcher.describeTo(description);
}

@Factory
public static Matcher<WebElement> attribute(final String name, final Matcher<String> valueMatcher) {
return new AttributeMatcher(name, valueMatcher);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.openqa.selenium.lift.match;

import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.openqa.selenium.WebElement;
Expand All @@ -41,7 +40,6 @@ public boolean matchesSafely(WebElement item) {
return item.isDisplayed();
}

@Factory
public static Matcher<WebElement> displayed() {
return new DisplayedMatcher();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@

package org.openqa.selenium.lift.match;

import org.hamcrest.Matcher;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;

import org.hamcrest.Factory;
import org.hamcrest.Matcher;

/**
* Various numerical hamcrest {@link Matcher}s.
*/
public class NumericalMatchers {

@Factory
public static Matcher<Integer> atLeast(int i) {
return greaterThan(i - 1);
}

@Factory
public static Matcher<Integer> exactly(int i) {
return equalTo(i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium.lift.match;

import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.openqa.selenium.WebElement;
Expand All @@ -38,7 +37,6 @@ public void describeTo(Description description) {
description.appendText("should be selected");
}

@Factory
public static Matcher<WebElement> selection() {
return new SelectionMatcher();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium.lift.match;

import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.openqa.selenium.WebElement;
Expand All @@ -45,7 +44,6 @@ public void describeTo(Description description) {
matcher.describeTo(description);
}

@Factory
public static Matcher<WebElement> text(final Matcher<String> textMatcher) {
return new TextMatcher(textMatcher);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium.lift.match;

import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.openqa.selenium.WebElement;
Expand All @@ -44,7 +43,6 @@ public void describeTo(Description description) {
description.appendText("should have value ").appendValue(value);
}

@Factory
public static Matcher<WebElement> value(final Object value) {
return new ValueMatcher(value);
}
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/atoms/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ java_library(
deps = [
"//java/client/test/org/openqa/selenium/build",
"//third_party/java/guava",
"//third_party/java/hamcrest:hamcrest-core",
"//third_party/java/hamcrest",
"//third_party/java/junit",
],
)
Expand Down
3 changes: 1 addition & 2 deletions java/client/test/org/openqa/selenium/lift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ java_test_suite(
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/lift",
"//java/client/test/org/openqa/selenium/support/ui:clock",
"//third_party/java/hamcrest:hamcrest-core",
"//third_party/java/hamcrest:hamcrest-library",
"//third_party/java/hamcrest:hamcrest",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
],
Expand Down
17 changes: 4 additions & 13 deletions third_party/java/hamcrest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@ licenses(["notice"])
package(default_visibility = ["//visibility:public"])

maven_java_import(
name = "hamcrest-core",
coords = "org.hamcrest:hamcrest-core:jar:1.3",
jar = "hamcrest-core-1.3.jar",
srcjar = "hamcrest-core-1.3-sources.jar",
name = "hamcrest",
coords = "org.hamcrest:hamcrest:jar:2.1",
jar = "hamcrest-2.1.jar",
srcjar = "hamcrest-2.1-sources.jar",
)

maven_java_import(
name = "hamcrest-library",
coords = "org.hamcrest:hamcrest-library:jar:1.3",
jar = "hamcrest-library-1.3.jar",
srcjar = "hamcrest-library-1.3-sources.jar",
deps = [
":hamcrest-core",
],
)
Binary file not shown.
Binary file added third_party/java/hamcrest/hamcrest-2.1.jar
Binary file not shown.
Binary file not shown.
Binary file removed third_party/java/hamcrest/hamcrest-core-1.3.jar
Binary file not shown.
Binary file not shown.
Binary file removed third_party/java/hamcrest/hamcrest-library-1.3.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion third_party/java/junit/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ maven_java_import(
jar = "junit-4.12.jar",
srcjar = "junit-4.12-sources.jar",
deps = [
"//third_party/java/hamcrest:hamcrest-core",
"//third_party/java/hamcrest",
],
)

0 comments on commit 753dcb8

Please sign in to comment.