From: PJ Fanning Date: Wed, 2 Feb 2022 11:16:39 +0000 (+0000) Subject: sonarqube X-Git-Tag: REL_5_2_1~120 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3a1fb48124021d0e66a76996905957a6dd9528e5;p=poi.git sonarqube git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897693 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFSheetXMLHandler.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFSheetXMLHandler.java index 0ddf7bf678..b3f1215925 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFSheetXMLHandler.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFSheetXMLHandler.java @@ -28,13 +28,14 @@ import org.xml.sax.XMLReader; import java.io.InputStream; import java.util.Iterator; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; -public class TestXSSFSheetXMLHandler { +class TestXSSFSheetXMLHandler { private static final POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance(); @Test - public void testInlineString() throws Exception { + void testInlineString() throws Exception { try (OPCPackage xlsxPackage = OPCPackage.open(_ssTests.openResourceAsStream("InlineString.xlsx"))) { final XSSFReader reader = new XSSFReader(xlsxPackage); @@ -64,13 +65,13 @@ public class TestXSSFSheetXMLHandler { } }, false)); - sheetParser.parse(new InputSource(stream)); + assertDoesNotThrow(() -> sheetParser.parse(new InputSource(stream))); } } } @Test - public void testNumber() throws Exception { + void testNumber() throws Exception { try (OPCPackage xlsxPackage = OPCPackage.open(_ssTests.openResourceAsStream("sample.xlsx"))) { final XSSFReader reader = new XSSFReader(xlsxPackage); @@ -95,7 +96,7 @@ public class TestXSSFSheetXMLHandler { } }, false)); - sheetParser.parse(new InputSource(stream)); + assertDoesNotThrow(() -> sheetParser.parse(new InputSource(stream))); } } } diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumberValue.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumberValue.java index fd6166f33d..f8307698cd 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumberValue.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumberValue.java @@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; /** * Testcase for function NUMBERVALUE() */ -public class TestNumberValue { +class TestNumberValue { //https://support.microsoft.com/en-us/office/numbervalue-function-1b05c8cf-2bfa-4437-af70-596c7ea7d879 @Test