use maven surefire 2.22.0 for compatibility with Junit 5 reenable FullyBufferedReaderTest.java
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/872657be Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/872657be Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/872657be Branch: refs/heads/master Commit: 872657be912e99e0c022d5974e3a9b3a0360c8df Parents: 67e228d Author: renoth <[email protected]> Authored: Sat Sep 1 08:24:09 2018 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Wed Sep 26 15:40:03 2018 +0300 ---------------------------------------------------------------------- pom.xml | 3 +- .../wicket/util/io/FullyBufferedReaderTest.java | 82 ++++++++++---------- 2 files changed, 44 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/872657be/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index cf61347..73ff1e1 100644 --- a/pom.xml +++ b/pom.xml @@ -129,8 +129,9 @@ <spring.version>5.1.0.RELEASE</spring.version> <servlet-api.version>3.1.0</servlet-api.version> <maven.javadoc.version>3.0.1</maven.javadoc.version> - <maven.surefire.version>2.20</maven.surefire.version> + <maven.surefire.version>2.22.0</maven.surefire.version> <mockito.version>2.22.0</mockito.version> + <mockito.version>2.18.3</mockito.version> <slf4j.version>1.7.25</slf4j.version> <logback.version>1.2.3</logback.version> <hamcrest.version>2.0.0.0</hamcrest.version> http://git-wip-us.apache.org/repos/asf/wicket/blob/872657be/wicket-util/src/test/java/org/apache/wicket/util/io/FullyBufferedReaderTest.java ---------------------------------------------------------------------- diff --git a/wicket-util/src/test/java/org/apache/wicket/util/io/FullyBufferedReaderTest.java b/wicket-util/src/test/java/org/apache/wicket/util/io/FullyBufferedReaderTest.java index 5215765..7ae2495 100644 --- a/wicket-util/src/test/java/org/apache/wicket/util/io/FullyBufferedReaderTest.java +++ b/wicket-util/src/test/java/org/apache/wicket/util/io/FullyBufferedReaderTest.java @@ -13,29 +13,28 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - *//* + */ package org.apache.wicket.util.io; -import java.text.ParseException; - import org.junit.jupiter.api.Test; +import java.text.ParseException; + import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; -*/ /** * Tests for {@link FullyBufferedReader} - *//* + */ public class FullyBufferedReaderTest { - */ -/** + /** * * @throws ParseException - *//* + */ @Test public void nestedQuotes() throws ParseException @@ -53,11 +52,11 @@ public class FullyBufferedReaderTest assertEquals(testTag.length(), position + 1); } - */ -/** + + /** * * @throws ParseException - *//* + */ @Test public void quotedEsclamationQuotationMark() throws ParseException @@ -75,87 +74,90 @@ public class FullyBufferedReaderTest assertEquals(testTag.length(), position + 1); } - */ -/** + + /** * https://issues.apache.org/jira/browse/WICKET-4117 * * Test exception when we forgot to close quote * * @throws ParseException - *//* + */ @Test public void missingClosingQuote() throws ParseException { - thrown.expect(ParseException.class); - thrown.expectMessage("Opening/closing quote not found for quote at (line 1, column 9)"); - String testTag = "<a href='blabla>"; FullyBufferedReader fullyBufferedReader = new FullyBufferedReader(testTag); - fullyBufferedReader.findOutOfQuotes('>', 0); + final ParseException e = assertThrows(ParseException.class, () -> { + fullyBufferedReader.findOutOfQuotes('>', 0); + }); + + assertEquals("Opening/closing quote not found for quote at (line 1, column 9)", e.getMessage()); } - */ -/** + + /** * https://issues.apache.org/jira/browse/WICKET-4117 * * Test exception when we forgot to close quote * * @throws ParseException - *//* + */ @Test public void missingOpeningQuote() throws ParseException { - thrown.expect(ParseException.class); - thrown.expectMessage("Opening/closing quote not found for quote at (line 1, column 15)"); - String testTag = "<a href=blabla'>"; FullyBufferedReader fullyBufferedReader = new FullyBufferedReader(testTag); - fullyBufferedReader.findOutOfQuotes('>', 0); + final ParseException e = assertThrows(ParseException.class, () -> { + fullyBufferedReader.findOutOfQuotes('>', 0); + }); + + assertEquals("Opening/closing quote not found for quote at (line 1, column 15)", e.getMessage()); } - */ -/** + /** * https://issues.apache.org/jira/browse/WICKET-4117 * * Test exception when we forgot to close quote * * @throws ParseException - *//* + */ @Test public void missingClosingDoubleQuote() throws ParseException { - thrown.expect(ParseException.class); - thrown.expectMessage("Opening/closing quote not found for quote at (line 1, column 9)"); - String testTag = "<a href=\"blabla>"; FullyBufferedReader fullyBufferedReader = new FullyBufferedReader(testTag); - fullyBufferedReader.findOutOfQuotes('>', 0); + final ParseException e = assertThrows(ParseException.class, () -> { + fullyBufferedReader.findOutOfQuotes('>', 0); + }); + + assertEquals("Opening/closing quote not found for quote at (line 1, column 9)", e.getMessage()); } - */ -/** + + /** * https://issues.apache.org/jira/browse/WICKET-4117 * * Test exception when we forgot to close quote * * @throws ParseException - *//* + */ @Test public void missingOpeningDoubleQuote() throws ParseException { - thrown.expect(ParseException.class); - thrown.expectMessage("Opening/closing quote not found for quote at (line 1, column 15)"); - String testTag = "<a href=blabla\">"; FullyBufferedReader fullyBufferedReader = new FullyBufferedReader(testTag); - fullyBufferedReader.findOutOfQuotes('>', 0); + final ParseException e = assertThrows(ParseException.class, () -> { + fullyBufferedReader.findOutOfQuotes('>', 0); + }); + + assertEquals("Opening/closing quote not found for quote at (line 1, column 15)", e.getMessage()); } -}*/ +}
