Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A8425200C65 for ; Sat, 15 Apr 2017 05:19:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A6D52160BA3; Sat, 15 Apr 2017 03:19:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EE605160B8C for ; Sat, 15 Apr 2017 05:19:29 +0200 (CEST) Received: (qmail 30242 invoked by uid 500); 15 Apr 2017 03:19:29 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 30233 invoked by uid 99); 15 Apr 2017 03:19:29 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Apr 2017 03:19:29 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 1598B3A04C4 for ; Sat, 15 Apr 2017 03:19:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1791444 - in /poi/trunk: build.xml src/testcases/org/apache/poi/POITestCase.java Date: Sat, 15 Apr 2017 03:19:27 -0000 To: commits@poi.apache.org From: onealj@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170415031928.1598B3A04C4@svn01-us-west.apache.org> archived-at: Sat, 15 Apr 2017 03:19:30 -0000 Author: onealj Date: Sat Apr 15 03:19:27 2017 New Revision: 1791444 URL: http://svn.apache.org/viewvc?rev=1791444&view=rev Log: change from hamcrest-core-1.3 to hamcrest-all-1.3 Modified: poi/trunk/build.xml poi/trunk/src/testcases/org/apache/poi/POITestCase.java Modified: poi/trunk/build.xml URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1791444&r1=1791443&r2=1791444&view=diff ============================================================================== --- poi/trunk/build.xml (original) +++ poi/trunk/build.xml Sat Apr 15 03:19:27 2017 @@ -163,8 +163,8 @@ under the License. - - + + @@ -567,6 +567,7 @@ under the License. + Modified: poi/trunk/src/testcases/org/apache/poi/POITestCase.java URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/POITestCase.java?rev=1791444&r1=1791443&r2=1791444&view=diff ============================================================================== --- poi/trunk/src/testcases/org/apache/poi/POITestCase.java (original) +++ poi/trunk/src/testcases/org/apache/poi/POITestCase.java Sat Apr 15 03:19:27 2017 @@ -30,6 +30,10 @@ import static org.hamcrest.CoreMatchers. import static org.hamcrest.CoreMatchers.startsWith; import static org.hamcrest.CoreMatchers.endsWith; 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.Field; @@ -57,6 +61,12 @@ public final class POITestCase { assertThat(string, startsWith(prefix)); } + public static void assertStartsWith(String message, String string, String prefix) { + assertNotNull(message, string); + assertNotNull(message, prefix); + assertThat(message, string, startsWith(prefix)); + } + public static void assertEndsWith(String string, String suffix) { assertNotNull(string); assertNotNull(suffix); @@ -69,6 +79,12 @@ public final class POITestCase { assertThat(haystack, containsString(needle)); } + public static void assertContains(String message, String haystack, String needle) { + assertNotNull(message, haystack); + assertNotNull(message, needle); + assertThat(message, haystack, containsString(needle)); + } + public static void assertContainsIgnoreCase(String haystack, String needle, Locale locale) { assertNotNull(haystack); assertNotNull(needle); @@ -250,15 +266,11 @@ public final class POITestCase { } public static void assertBetween(String message, int value, int min, int max) { - assertTrue(message + ": " + value + " is less than the minimum value of " + min, - min <= value); - assertTrue(message + ": " + value + " is greater than the maximum value of " + max, - value <= max); + assertThat(message, value, greaterThanOrEqualTo(min)); + assertThat(message, value, lessThanOrEqualTo(max)); } public static void assertStrictlyBetween(String message, int value, int min, int max) { - assertTrue(message + ": " + value + " is less than or equal to the minimum value of " + min, - min < value); - assertTrue(message + ": " + value + " is greater than or equal to the maximum value of " + max, - value < max); + assertThat(message, value, greaterThan(min)); + assertThat(message, value, lessThan(max)); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org