From a0fa9e19b1196bc10034f15474d27ce23bf5865a Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Thu, 24 Dec 2020 18:42:29 +0000 Subject: #65026 - Migrate tests to Junit 5 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884783 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/stress/XSSFFileHandler.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java') diff --git a/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java index b1aa5b718c..ec060dee05 100644 --- a/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java @@ -16,10 +16,10 @@ ==================================================================== */ package org.apache.poi.stress; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -54,7 +54,7 @@ import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.extractor.XSSFExportToXml; import org.apache.poi.xssf.usermodel.XSSFMap; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; public class XSSFFileHandler extends SpreadsheetHandler { @@ -78,7 +78,7 @@ public class XSSFFileHandler extends SpreadsheetHandler { Decryptor dec = ei.getDecryptor(); try { boolean b = dec.verifyPassword(pass); - assertTrue("password mismatch", b); + assertTrue( b, "password mismatch" ); } catch (EncryptedDocumentException e) { String msg = "Export Restrictions in place - please install JCE Unlimited Strength Jurisdiction Policy files"; assumeFalse(msg.equals(e.getMessage())); @@ -190,8 +190,7 @@ public class XSSFFileHandler extends SpreadsheetHandler { XLSX2CSV.main(new String[]{file.getAbsolutePath()}); ExcelComparator.main(new String[]{file.getAbsolutePath(), file.getAbsolutePath()}); - assertFalse("Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!", - EXPECTED_ADDITIONAL_FAILURES.contains(testFile)); + assertFalse( EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" ); } catch (OLE2NotOfficeXmlFileException e) { // we have some files that are not actually OOXML and thus cannot be tested here -- cgit v1.2.3