From 3a1fb48124021d0e66a76996905957a6dd9528e5 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 2 Feb 2022 11:16:39 +0000 Subject: [PATCH] sonarqube git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897693 13f79535-47bb-0310-9956-ffa450edef68 --- .../xssf/eventusermodel/TestXSSFSheetXMLHandler.java | 11 ++++++----- .../poi/ss/formula/functions/TestNumberValue.java | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) 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 -- 2.39.5