]> source.dussan.org Git - poi.git/commitdiff
sonarqube
authorPJ Fanning <fanningpj@apache.org>
Wed, 2 Feb 2022 11:16:39 +0000 (11:16 +0000)
committerPJ Fanning <fanningpj@apache.org>
Wed, 2 Feb 2022 11:16:39 +0000 (11:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897693 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFSheetXMLHandler.java
poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumberValue.java

index 0ddf7bf678f54487f4021a25f590f49e854c0e50..b3f121592569fdddc7a23aa1ea171a6ebbba14ff 100644 (file)
@@ -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)));
             }
         }
     }
index fd6166f33df2dd9aff1dfffa522026d5359467f3..f8307698cd7cbaaa2c3283cc48aa560a1ff57304 100644 (file)
@@ -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