roll back to hamcrest-core

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791570 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2017-04-16 06:10:23 +00:00
parent 3bf6445aa4
commit c43ca904b3
3 changed files with 12 additions and 11 deletions

View File

@ -163,8 +163,8 @@ under the License.
<property name="main.log4j.url" value="${repository.m2}/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar"/> <property name="main.log4j.url" value="${repository.m2}/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar"/>
<property name="main.junit.jar" location="${main.lib}/junit-4.12.jar"/> <property name="main.junit.jar" location="${main.lib}/junit-4.12.jar"/>
<property name="main.junit.url" value="${repository.m2}/maven2/junit/junit/4.12/junit-4.12.jar"/> <property name="main.junit.url" value="${repository.m2}/maven2/junit/junit/4.12/junit-4.12.jar"/>
<property name="main.hamcrest.jar" location="${main.lib}/hamcrest-all-1.3.jar"/> <property name="main.hamcrest.jar" location="${main.lib}/hamcrest-core-1.3.jar"/>
<property name="main.hamcrest.url" value="${repository.m2}/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar"/> <property name="main.hamcrest.url" value="${repository.m2}/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<property name="main.ant.jar" location="${main.lib}/ant-1.9.4.jar"/> <property name="main.ant.jar" location="${main.lib}/ant-1.9.4.jar"/>
<property name="main.ant.url" value="${repository.m2}/maven2/org/apache/ant/ant/1.9.4/ant-1.9.4.jar"/> <property name="main.ant.url" value="${repository.m2}/maven2/org/apache/ant/ant/1.9.4/ant-1.9.4.jar"/>
<property name="main.antlauncher.jar" location="${main.lib}/ant-launcher-1.9.4.jar"/> <property name="main.antlauncher.jar" location="${main.lib}/ant-launcher-1.9.4.jar"/>

View File

@ -81,7 +81,7 @@
<dependency> <dependency>
<groupId>org.hamcrest</groupId> <groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId> <artifactId>hamcrest-core</artifactId>
<scope>test</scope> <scope>test</scope>
<version>1.3</version> <version>1.3</version>
</dependency> </dependency>

View File

@ -30,10 +30,6 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.startsWith; import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import java.lang.reflect.AccessibleObject; import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -266,11 +262,16 @@ public final class POITestCase {
} }
public static void assertBetween(String message, int value, int min, int max) { public static void assertBetween(String message, int value, int min, int max) {
assertThat(message, value, greaterThanOrEqualTo(min)); assertTrue(message + ": " + value + " is less than the minimum value of " + min,
assertThat(message, value, lessThanOrEqualTo(max)); min <= value);
assertTrue(message + ": " + value + " is greater than the maximum value of " + max,
value <= max);
} }
public static void assertStrictlyBetween(String message, int value, int min, int max) { public static void assertStrictlyBetween(String message, int value, int min, int max) {
assertThat(message, value, greaterThan(min)); assertTrue(message + ": " + value + " is less than or equal to the minimum value of " + min,
assertThat(message, value, lessThan(max)); min < value);
assertTrue(message + ": " + value + " is greater than or equal to the maximum value of " + max,
value < max);
} }
} }