Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: contains/containsInAnyOrder overloading issue #317

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
dfe25d2
- Adjusted API to work with embedded arrays
gokareless Sep 5, 2020
f0e2d0e
exposed IsEqualCompressingWhiteSpace.string in protected getString in…
Mar 29, 2018
f6abc8c
JavaDoc only @param org.hamcrest.beans
nhojpatrick Feb 13, 2022
934dd7f
JavaDoc only @param org.hamcrest.collection
nhojpatrick Feb 13, 2022
95cf0b2
JavaDoc only @param org.hamcrest.comparator
nhojpatrick Feb 13, 2022
ebb9be2
JavaDoc only @param org.hamcrest.core
nhojpatrick Feb 13, 2022
a393ed9
JavaDoc only @param org.hamcrest.object
nhojpatrick Feb 13, 2022
877f76a
JavaDoc only @param org.hamcrest.number
nhojpatrick Feb 13, 2022
facac84
JavaDoc only @param org.hamcrest.text
nhojpatrick Feb 13, 2022
450e792
JavaDoc only @param org.hamcrest
nhojpatrick Feb 13, 2022
869367a
JavaDoc only @param org.hamcrest.integration
nhojpatrick Feb 13, 2022
9c8ed04
GitHub Actions Default Java/OS first and QA last
nhojpatrick Feb 13, 2022
6294fb5
GitHub Actions job needs usage
nhojpatrick Feb 13, 2022
9629b33
GitHub Actions concurrency cancel-in-progress
nhojpatrick Feb 13, 2022
c884d91
Java Code Style EOF org.hamcrest
nhojpatrick Feb 13, 2022
c8f5c5e
Java Code Style EOF org.hamcrest.beans
nhojpatrick Feb 13, 2022
83801b6
Java Code Style EOF org.hamcrest.collection
nhojpatrick Feb 13, 2022
11370fe
Java Code Style EOF org.hamcrest.comparator
nhojpatrick Feb 13, 2022
0dec084
Java Code Style EOF org.hamcrest.core
nhojpatrick Feb 13, 2022
c8ff256
Java Code Style EOF org.hamcrest.number
nhojpatrick Feb 13, 2022
9300b50
Java Code Style EOF org.hamcrest.object
nhojpatrick Feb 13, 2022
8a2b3b6
Java Code Style EOF org.hamcrest.text
nhojpatrick Feb 13, 2022
d150c74
Java Code Style EOF org.hamcrest.xml
nhojpatrick Feb 13, 2022
e1e1ba7
Java Code Style EOF org.hamcrest.io
nhojpatrick Feb 13, 2022
738f236
Java Code Style EOF org.hamcrest.internal
nhojpatrick Feb 13, 2022
614c6e5
Java Code Style EOF org.hamcrest.integration
nhojpatrick Feb 13, 2022
b2acf09
Java Code Style package spacing
nhojpatrick Feb 13, 2022
34c81df
Java Code Style trailing whitespace org.hamcrest.collection
nhojpatrick Feb 13, 2022
a665d5e
Java Code Style trailing whitespace org.hamcrest
nhojpatrick Feb 13, 2022
02c1d7b
Java Code Style trailing whitespace org.hamcrest.beans
nhojpatrick Feb 13, 2022
19a0779
Java Code Style trailing whitespace org.hamcrest.core
nhojpatrick Feb 13, 2022
1414154
Java Code Style trailing whitespace org.hamcrest.number
nhojpatrick Feb 13, 2022
f52954a
Java Code Style trailing whitespace org.hamcrest.object
nhojpatrick Feb 13, 2022
a04fc20
Java Code Style trailing whitespace org.hamcrest.text
nhojpatrick Feb 13, 2022
6378ae1
Java Code Style trailing whitespace org.hamcrest.internal
nhojpatrick Feb 13, 2022
0e6983a
Java Code Style trailing whitespace org.hamcrest.io
nhojpatrick Feb 13, 2022
cbaf1d2
Java Code Style trailing whitespace org.hamcrest.xml
nhojpatrick Feb 13, 2022
43c0492
Java Code Style squash multiple empty lines
nhojpatrick Feb 13, 2022
9dc17e7
Java Code Style class/enum/interface padding org.hamcrest.integration
nhojpatrick Feb 13, 2022
57252d1
Java Code Style class/enum/interface padding org.hamcrest
nhojpatrick Feb 13, 2022
8a73d32
Java Code Style class/enum/interface padding org.hamcrest.beans
nhojpatrick Feb 13, 2022
972dc77
Java Code Style class/enum/interface padding org.hamcrest.collection
nhojpatrick Feb 13, 2022
6298db7
Java Code Style class/enum/interface padding org.hamcrest.core
nhojpatrick Feb 13, 2022
4d3fe7c
Java Code Style class/enum/interface padding org.hamcrest.internal
nhojpatrick Feb 13, 2022
eb09b4a
Java Code Style class/enum/interface padding org.hamcrest.number
nhojpatrick Feb 13, 2022
541cf0b
Java Code Style class/enum/interface padding org.hamcrest.object
nhojpatrick Feb 13, 2022
3a4aa57
Java Code Style class/enum/interface padding org.hamcrest.text
nhojpatrick Feb 13, 2022
d298634
Java Code Style class/enum/interface padding org.hamcrest.xml
nhojpatrick Feb 13, 2022
5d2da07
Java Code Style <format,whitespace>
nhojpatrick Feb 13, 2022
5d76642
Java Code Style )whitespace{
nhojpatrick Feb 13, 2022
73d89b2
Java 5 Clean Up
nhojpatrick Feb 13, 2022
0ba3f59
IsUnmodifiableCollection matcher feature #249
Andremoniy Mar 3, 2019
3929ae3
Java 7 Clean Up
nhojpatrick Feb 13, 2022
b3e19ce
- Resolved conflicts
gokareless Feb 15, 2022
7df2387
Merge branch 'fix/anyof-allof-cast' of https://github.com/gokareless/…
gokareless Feb 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,56 @@ name: Java CI

on: [push]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build Default Java/OS
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 7
- name: Gradle Clean Build
run: ./gradlew clean build

test:
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
java: [7, 8, 11, 17, 18-ea, 19-ea]
exclude:
- os: ubuntu-18.04
java: 7
fail-fast: false
max-parallel: 4
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build with Gradle
run: ./gradlew clean build javadoc
- name: Gradle Clean Build
run: ./gradlew clean build
qa:
name: QA Steps
needs: test
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 7
- name: Gradle JavaDoc
run: ./gradlew javadoc

...
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public class JMock1Matchers {
public static Constraint equalTo(String string) {
return JMock1Adapter.adapt(IsEqual.equalTo(string));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
* @author Neil Dunn
*/
public class JavaLangMatcherAssert {

private JavaLangMatcherAssert() {};

public static <T> boolean that(T argument, Matcher<? super T> matcher) {
return matcher.matches(argument);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class EasyMock2Adapter implements IArgumentMatcher {
* EasyMock {@link org.easymock.IArgumentMatcher} and
* report it to EasyMock so it can be kept track of.
*
* @param matcher
* the matcher to adapt to EasyMock constraint.
* @return The EasyMock matcher.
*/
public static IArgumentMatcher adapt(Matcher<?> matcher) {
Expand All @@ -42,4 +44,5 @@ public boolean matches(Object argument) {
public void appendTo(StringBuffer buffer) {
hamcrestMatcher.describeTo(new StringDescription(buffer));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class JMock1Adapter implements Constraint {
* Hamcrest {@link org.hamcrest.Matcher} to act as an
* jMock {@link org.jmock.core.Constraint}.
*
* @param matcher
* the matcher to adapt to jMock constraint.
* @return The jMock constraint.
*/
public static Constraint adapt(Matcher<?> matcher) {
Expand All @@ -41,4 +43,5 @@ public StringBuffer describeTo(StringBuffer buffer) {
hamcrestMatcher.describeTo(new StringDescription(buffer));
return buffer;
}

}
29 changes: 18 additions & 11 deletions hamcrest/src/main/java/org/hamcrest/BaseDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public Description appendText(String text) {
append(text);
return this;
}

@Override
public Description appendDescriptionOf(SelfDescribing value) {
value.describeTo(this);
return this;
}

@Override
public Description appendValue(Object value) {
if (value == null) {
Expand Down Expand Up @@ -75,48 +75,54 @@ private String descriptionOf(Object value) {
public final <T> Description appendValueList(String start, String separator, String end, T... values) {
return appendValueList(start, separator, end, Arrays.asList(values));
}

@Override
public <T> Description appendValueList(String start, String separator, String end, Iterable<T> values) {
return appendValueList(start, separator, end, values.iterator());
}

private <T> Description appendValueList(String start, String separator, String end, Iterator<T> values) {
return appendList(start, separator, end, new SelfDescribingValueIterator<>(values));
}

@Override
public Description appendList(String start, String separator, String end, Iterable<? extends SelfDescribing> values) {
return appendList(start, separator, end, values.iterator());
}

private Description appendList(String start, String separator, String end, Iterator<? extends SelfDescribing> i) {
boolean separate = false;

append(start);
while (i.hasNext()) {
if (separate) append(separator);
appendDescriptionOf(i.next());
separate = true;
}
append(end);

return this;
}

/**
* Append the String <var>str</var> to the description.
* The default implementation passes every character to {@link #append(char)}.
* Append the String <var>str</var> to the description.
* The default implementation passes every character to {@link #append(char)}.
* Override in subclasses to provide an efficient implementation.
*
* @param str
* the string to append.
*/
protected void append(String str) {
for (int i = 0; i < str.length(); i++) {
append(str.charAt(i));
}
}

/**
* Append the char <var>c</var> to the description.
* Append the char <var>c</var> to the description.
*
* @param c
* the char to append.
*/
protected abstract void append(char c);

Expand Down Expand Up @@ -149,4 +155,5 @@ private void toJavaSyntax(char ch) {
append(ch);
}
}

}
1 change: 1 addition & 0 deletions hamcrest/src/main/java/org/hamcrest/BaseMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ protected static boolean isNotNull(Object actual, Description mismatch) {
}
return true;
}

}
7 changes: 4 additions & 3 deletions hamcrest/src/main/java/org/hamcrest/Condition.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* Based on https://github.com/npryce/maybe-java
* @author Steve Freeman 2012 http://www.hamcrest.com
*/

public abstract class Condition<T> {
public static final NotMatched<Object> NOT_MATCHED = new NotMatched<Object>();

public static final NotMatched<Object> NOT_MATCHED = new NotMatched<>();

public interface Step<I, O> {
Condition<O> apply(I value, Description mismatch);
Expand All @@ -31,7 +31,7 @@ public static <T> Condition<T> notMatched() {
}

public static <T> Condition<T> matched(final T theValue, final Description mismatch) {
return new Matched<T>(theValue, mismatch);
return new Matched<>(theValue, mismatch);
}

private static final class Matched<T> extends Condition<T> {
Expand Down Expand Up @@ -66,4 +66,5 @@ private static final class NotMatched<T> extends Condition<T> {
return notMatched();
}
}

}
Loading