diff --git a/src/multimodule/ooxml/test9/module-info.class b/src/multimodule/ooxml/test9/module-info.class index ccbebf6019..a9ad223786 100644 Binary files a/src/multimodule/ooxml/test9/module-info.class and b/src/multimodule/ooxml/test9/module-info.class differ diff --git a/src/multimodule/ooxml/test9/module-info.java b/src/multimodule/ooxml/test9/module-info.java index 1874f558e4..447384a492 100644 --- a/src/multimodule/ooxml/test9/module-info.java +++ b/src/multimodule/ooxml/test9/module-info.java @@ -78,7 +78,7 @@ module org.apache.poi.ooxml { exports org.apache.poi.poifs.crypt.dsig.services; exports org.apache.poi.poifs.crypt.temp; - opens org.apache.poi.openxml4j.opc to org.apache.poi.poi; + opens org.apache.poi.openxml4j.opc to org.apache.poi.poi, org.junit.platform.commons; /* optional dependencies for xml signatures - you need to add a require entry your module-info @@ -122,5 +122,66 @@ module org.apache.poi.ooxml { exports org.apache.poi.xssf.usermodel.charts to org.junit.platform.commons; exports org.apache.poi.xwpf to org.junit.platform.commons; - + opens org.apache.poi.extractor.ooxml to org.junit.platform.commons; + opens org.apache.poi.openxml4j.opc.compliance to org.junit.platform.commons; + opens org.apache.poi.poifs.crypt.tests to org.junit.platform.commons; + opens org.apache.poi.sl.tests to org.junit.platform.commons; + opens org.apache.poi.sl.tests.draw to org.junit.platform.commons; + opens org.apache.poi.ss.tests to org.junit.platform.commons; + opens org.apache.poi.ss.tests.extractor to org.junit.platform.commons; + opens org.apache.poi.ss.tests.format to org.junit.platform.commons; + opens org.apache.poi.ss.tests.formula to org.junit.platform.commons; + opens org.apache.poi.ss.tests.formula.eval to org.junit.platform.commons; + opens org.apache.poi.ss.tests.formula.functions to org.junit.platform.commons; + opens org.apache.poi.ss.tests.usermodel to org.junit.platform.commons; + opens org.apache.poi.ss.tests.util to org.junit.platform.commons; + opens org.apache.poi.util.tests to org.junit.platform.commons; + opens org.apache.poi.xslf to org.junit.platform.commons; + opens org.apache.poi.xslf.extractor to org.junit.platform.commons; + opens org.apache.poi.xssf.io to org.junit.platform.commons; + opens org.apache.poi.xssf.usermodel.charts to org.junit.platform.commons; + opens org.apache.poi.xwpf to org.junit.platform.commons; + opens org.apache.poi.xwpf.extractor to org.junit.platform.commons; + opens org.apache.poi.xwpf.usermodel to org.junit.platform.commons; + opens org.apache.poi.xwpf.model to org.junit.platform.commons; + opens org.apache.poi.xdgf.extractor to org.junit.platform.commons; + opens org.apache.poi.xdgf.exceptions to org.junit.platform.commons; + opens org.apache.poi.xdgf.usermodel to org.junit.platform.commons; + opens org.apache.poi.xdgf.usermodel.section to org.junit.platform.commons; + opens org.apache.poi.xdgf.usermodel.section.geometry to org.junit.platform.commons; + opens org.apache.poi.xdgf.usermodel.shape to org.junit.platform.commons; + opens org.apache.poi.xdgf.usermodel.shape.exceptions to org.junit.platform.commons; + opens org.apache.poi.xdgf.xml to org.junit.platform.commons; + opens org.apache.poi.xdgf.util to org.junit.platform.commons; + opens org.apache.poi.xdgf.geom to org.junit.platform.commons; + opens org.apache.poi.ooxml to org.junit.platform.commons; + opens org.apache.poi.ooxml.dev to org.junit.platform.commons; + opens org.apache.poi.ooxml.extractor to org.junit.platform.commons; + opens org.apache.poi.ooxml.util to org.junit.platform.commons; + opens org.apache.poi.xddf.usermodel to org.junit.platform.commons; + opens org.apache.poi.xddf.usermodel.text to org.junit.platform.commons; + opens org.apache.poi.xddf.usermodel.chart to org.junit.platform.commons; + opens org.apache.poi.openxml4j.exceptions to org.junit.platform.commons; + opens org.apache.poi.openxml4j.opc.internal to org.junit.platform.commons; + opens org.apache.poi.openxml4j.opc.internal.marshallers to org.junit.platform.commons; + opens org.apache.poi.openxml4j.opc.internal.unmarshallers to org.junit.platform.commons; + opens org.apache.poi.openxml4j.util to org.junit.platform.commons; + opens org.apache.poi.xssf to org.junit.platform.commons; + opens org.apache.poi.xssf.extractor to org.junit.platform.commons; + opens org.apache.poi.xssf.eventusermodel to org.junit.platform.commons; + opens org.apache.poi.xssf.usermodel to org.junit.platform.commons; + opens org.apache.poi.xssf.usermodel.helpers to org.junit.platform.commons; + opens org.apache.poi.xssf.usermodel.extensions to org.junit.platform.commons; + opens org.apache.poi.xssf.binary to org.junit.platform.commons; + opens org.apache.poi.xssf.model to org.junit.platform.commons; + opens org.apache.poi.xssf.streaming to org.junit.platform.commons; + opens org.apache.poi.xssf.util to org.junit.platform.commons; + opens org.apache.poi.xslf.draw to org.junit.platform.commons; + opens org.apache.poi.xslf.usermodel to org.junit.platform.commons; + opens org.apache.poi.xslf.model to org.junit.platform.commons; + opens org.apache.poi.xslf.util to org.junit.platform.commons; + opens org.apache.poi.poifs.crypt.dsig to org.junit.platform.commons; + opens org.apache.poi.poifs.crypt.dsig.facets to org.junit.platform.commons; + opens org.apache.poi.poifs.crypt.dsig.services to org.junit.platform.commons; + opens org.apache.poi.poifs.crypt.temp to org.junit.platform.commons; } \ No newline at end of file diff --git a/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java b/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java index 6ea3b2132e..5187227505 100644 --- a/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java +++ b/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java @@ -142,7 +142,7 @@ public class TestExtractorFactory { @ParameterizedTest @MethodSource("testFileData") - public void testFile(String testcase, File file, String extractor, int count) throws Exception { + void testFile(String testcase, File file, String extractor, int count) throws Exception { try (POITextExtractor ext = createExtractor(file)) { assertNotNull(ext); testExtractor(ext, testcase, extractor, count); @@ -151,7 +151,7 @@ public class TestExtractorFactory { @ParameterizedTest @MethodSource("testScratchData") - public void testPOIFS(String testcase, File testFile, String extractor, int count) throws Exception { + void testPOIFS(String testcase, File testFile, String extractor, int count) throws Exception { // test processing of InputStream try (FileInputStream fis = new FileInputStream(testFile); POIFSFileSystem poifs = new POIFSFileSystem(fis); @@ -163,7 +163,7 @@ public class TestExtractorFactory { @ParameterizedTest @MethodSource("testFileData") - public void testOOXML(String testcase, File testFile, String extractor, int count) throws Exception { + void testOOXML(String testcase, File testFile, String extractor, int count) throws Exception { // test processing of InputStream try (FileInputStream fis = new FileInputStream(testFile); POITextExtractor ext = createExtractor(fis)) { @@ -174,7 +174,7 @@ public class TestExtractorFactory { @ParameterizedTest @MethodSource("testOOXMLData") - public void testPackage(String testcase, File testFile, String extractor, int count) throws Exception { + void testPackage(String testcase, File testFile, String extractor, int count) throws Exception { try (final OPCPackage pkg = OPCPackage.open(testFile, PackageAccess.READ); final POITextExtractor ext = xmlFactory.create(pkg)) { assertNotNull(ext); @@ -184,13 +184,13 @@ public class TestExtractorFactory { } @Test - public void testFileInvalid() { + void testFileInvalid() { IOException ex = assertThrows(IOException.class, () -> createExtractor(txt)); assertEquals("Can't create extractor - unsupported file type: UNKNOWN", ex.getMessage()); } @Test - public void testInputStreamInvalid() throws IOException { + void testInputStreamInvalid() throws IOException { try (FileInputStream fis = new FileInputStream(txt)) { IOException ex = assertThrows(IOException.class, () -> createExtractor(fis)); assertTrue(ex.getMessage().contains(FileMagic.UNKNOWN.name())); @@ -198,7 +198,7 @@ public class TestExtractorFactory { } @Test - public void testPOIFSInvalid() { + void testPOIFSInvalid() { // Not really an Extractor test, but we'll leave it to test POIFS reaction anyway ... IOException ex = assertThrows(IOException.class, () -> new POIFSFileSystem(txt)); assertTrue(ex.getMessage().contains("Invalid header signature; read 0x3D20726F68747541, expected 0xE11AB1A1E011CFD0")); @@ -214,13 +214,13 @@ public class TestExtractorFactory { } } @Test - public void testPackageInvalid() { + void testPackageInvalid() { // Text assertThrows(NotOfficeXmlFileException.class, () -> OPCPackage.open(txt, PackageAccess.READ)); } @Test - public void testPreferEventBased() throws Exception { + void testPreferEventBased() throws Exception { assertFalse(ExtractorFactory.getPreferEventExtractor()); assertFalse(ExtractorFactory.getThreadPrefersEventExtractors()); assertNull(ExtractorFactory.getAllThreadsPreferEventExtractors()); @@ -300,7 +300,7 @@ public class TestExtractorFactory { */ @ParameterizedTest @MethodSource("testEmbeddedData") - public void testEmbedded(String format, File file, String expected) throws Exception { + void testEmbedded(String format, File file, String expected) throws Exception { int numWord = 0, numXls = 0, numPpt = 0, numMsg = 0, numWordX = 0; try (final POIOLE2TextExtractor ext = (POIOLE2TextExtractor) createExtractor(file)) { @@ -417,7 +417,7 @@ public class TestExtractorFactory { "spreadsheet/WithChartSheet.xlsx", "spreadsheet/chart_sheet.xlsx" }) - public void testFileLeak(String file) { + void testFileLeak(String file) { // run a number of files that might fail in order to catch // leaked file resources when using file-leak-detector while // running the test @@ -437,7 +437,7 @@ public class TestExtractorFactory { } @Test - public void testGetEmbeddedFromXMLExtractor() { + void testGetEmbeddedFromXMLExtractor() { // currently not implemented assertThrows(IllegalStateException.class, () -> ExtractorFactory.getEmbeddedDocsTextExtractors(null)); } @@ -446,7 +446,7 @@ public class TestExtractorFactory { // When this happens, change this from @Test(expected=...) to @Test // bug 45565: text within TextBoxes is extracted by ExcelExtractor and WordExtractor @Test - public void test45565() throws Exception { + void test45565() throws Exception { try (POITextExtractor extractor = ex("45565.xls")) { String text = extractor.getText(); assertThrows(AssertionError.class, () -> { diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestDetectAsOOXML.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestDetectAsOOXML.java index 3aebdd1bce..11972f86d5 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestDetectAsOOXML.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestDetectAsOOXML.java @@ -42,7 +42,7 @@ import org.junit.jupiter.params.provider.CsvSource; @SuppressWarnings("deprecation") public class TestDetectAsOOXML { @Test - public void testOpensProperly() throws IOException, InvalidFormatException { + void testOpensProperly() throws IOException, InvalidFormatException { try (InputStream is = openSampleFileStream("sample.xlsx"); OPCPackage pkg = OPCPackage.open(is)) { assertNotNull(pkg); @@ -51,7 +51,7 @@ public class TestDetectAsOOXML { @ParameterizedTest @CsvSource({"SampleSS.xlsx, OOXML", "SampleSS.xls, OLE2", "SampleSS.txt, UNKNOWN"}) - public void testDetectAsPOIFS(String file, FileMagic fm) throws IOException { + void testDetectAsPOIFS(String file, FileMagic fm) throws IOException { try (InputStream is = FileMagic.prepareToCheckMagic(openSampleFileStream(file))) { FileMagic act = FileMagic.valueOf(is); @@ -63,7 +63,7 @@ public class TestDetectAsOOXML { } @Test - public void testFileCorruption() throws Exception { + void testFileCorruption() throws Exception { // create test InputStream byte[] testData = { 1, 2, 3 }; ByteArrayInputStream testInput = new ByteArrayInputStream(testData); diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestEmbedded.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestEmbedded.java index 5000c9956a..8b36c6678c 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestEmbedded.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestEmbedded.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; */ public class TestEmbedded { @Test - public void testExcel() throws Exception { + void testExcel() throws Exception { POIXMLDocument doc = new XSSFWorkbook( POIDataSamples.getSpreadSheetInstance().openResourceAsStream("ExcelWithAttachments.xlsm") ); @@ -45,7 +45,7 @@ public class TestEmbedded { } @Test - public void testWord() throws Exception { + void testWord() throws Exception { POIXMLDocument doc = new XWPFDocument( POIDataSamples.getDocumentInstance().openResourceAsStream("WordWithAttachments.docx") ); @@ -53,7 +53,7 @@ public class TestEmbedded { } @Test - public void testPowerPoint() throws Exception { + void testPowerPoint() throws Exception { POIXMLDocument doc = new XSLFSlideShow(OPCPackage.open( POIDataSamples.getSlideShowInstance().openResourceAsStream("PPTWithAttachments.pptm")) ); diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLDocument.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLDocument.java index a50561c6dd..3370ca7d17 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLDocument.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLDocument.java @@ -177,22 +177,22 @@ public final class TestPOIXMLDocument { } @Test - public void testPPTX() throws Exception { + void testPPTX() throws Exception { assertReadWrite(POIDataSamples.getSlideShowInstance(), "PPTWithAttachments.pptm"); } @Test - public void testXLSX() throws Exception { + void testXLSX() throws Exception { assertReadWrite(POIDataSamples.getSpreadSheetInstance(), "ExcelWithAttachments.xlsm"); } @Test - public void testDOCX() throws Exception { + void testDOCX() throws Exception { assertReadWrite(POIDataSamples.getDocumentInstance(), "WordWithAttachments.docx"); } @Test - public void testRelationOrder() throws Exception { + void testRelationOrder() throws Exception { POIDataSamples pds = POIDataSamples.getDocumentInstance(); try (InputStream is = pds.openResourceAsStream("WordWithAttachments.docx"); OPCPackage pkg = PackageHelper.open(is); @@ -207,7 +207,7 @@ public final class TestPOIXMLDocument { } @Test - public void testGetNextPartNumber() throws Exception { + void testGetNextPartNumber() throws Exception { POIDataSamples pds = POIDataSamples.getDocumentInstance(); try (InputStream is = pds.openResourceAsStream("WordWithAttachments.docx"); OPCPackage pkg = PackageHelper.open(is); @@ -237,7 +237,7 @@ public final class TestPOIXMLDocument { } @Test - public void testCommitNullPart() throws IOException { + void testCommitNullPart() throws IOException { POIXMLDocumentPart part = new POIXMLDocumentPart(); part.prepareForCommit(); part.commit(); @@ -253,7 +253,7 @@ public final class TestPOIXMLDocument { } @Test - public void testVSDX() throws Exception { + void testVSDX() throws Exception { POIDataSamples pds = POIDataSamples.getDiagramInstance(); try (InputStream is = pds.openResourceAsStream("test.vsdx"); OPCPackage open = PackageHelper.open(is); @@ -264,7 +264,7 @@ public final class TestPOIXMLDocument { } @Test - public void testVSDXPart() throws IOException { + void testVSDXPart() throws IOException { POIDataSamples pds = POIDataSamples.getDiagramInstance(); try (InputStream is = pds.openResourceAsStream("test.vsdx"); OPCPackage open = PackageHelper.open(is)) { @@ -277,7 +277,7 @@ public final class TestPOIXMLDocument { } @Test - public void testInvalidCoreRel() throws IOException { + void testInvalidCoreRel() throws IOException { POIDataSamples pds = POIDataSamples.getDiagramInstance(); try (OPCPackage open = PackageHelper.open(pds.openResourceAsStream("test.vsdx"))) { assertThrows(POIXMLException.class, () -> new POIXMLDocumentPart(open, "somethingillegal")); @@ -297,7 +297,7 @@ public final class TestPOIXMLDocument { } @Test - public void testOSGIClassLoading() throws IOException { + void testOSGIClassLoading() throws IOException { byte[] data; try (InputStream is = POIDataSamples.getSlideShowInstance().openResourceAsStream("table_test.pptx")) { data = IOUtils.toByteArray(is); diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java index 55441a03df..eeeae65037 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java @@ -72,7 +72,7 @@ public final class TestPOIXMLProperties { } @Test - public void testWorkbookExtendedProperties() throws Exception { + void testWorkbookExtendedProperties() throws Exception { XSSFWorkbook workbook = new XSSFWorkbook(); POIXMLProperties props = workbook.getProperties(); assertNotNull(props); @@ -114,7 +114,7 @@ public final class TestPOIXMLProperties { } @Test - public void testWorkbookExtendedPropertiesGettersSetters() throws Exception { + void testWorkbookExtendedPropertiesGettersSetters() throws Exception { XSSFWorkbook workbook = new XSSFWorkbook(); POIXMLProperties props = workbook.getProperties(); assertNotNull(props); @@ -154,7 +154,7 @@ public final class TestPOIXMLProperties { * Test usermodel API for setting custom properties */ @Test - public void testCustomProperties() throws Exception { + void testCustomProperties() throws Exception { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { POIXMLProperties.CustomProperties customProps = wb1.getProperties().getCustomProperties(); @@ -200,7 +200,7 @@ public final class TestPOIXMLProperties { } @Test - public void testDocumentProperties() { + void testDocumentProperties() { String category = _coreProperties.getCategory(); assertEquals("test", category); String contentStatus = "Draft"; @@ -218,7 +218,7 @@ public final class TestPOIXMLProperties { } @Test - public void testTransitiveSetters() throws IOException { + void testTransitiveSetters() throws IOException { XWPFDocument doc = new XWPFDocument(); CoreProperties cp = doc.getProperties().getCoreProperties(); @@ -236,7 +236,7 @@ public final class TestPOIXMLProperties { } @Test - public void testGetSetRevision() { + void testGetSetRevision() { String revision = _coreProperties.getRevision(); assertTrue(Integer.parseInt(revision) > 1, "Revision number is 1"); _coreProperties.setRevision("20"); @@ -246,7 +246,7 @@ public final class TestPOIXMLProperties { } @Test - public void testLastModifiedByUserProperty() { + void testLastModifiedByUserProperty() { String lastModifiedByUser = _coreProperties.getLastModifiedByUser(); assertEquals("Paolo Mottadelli", lastModifiedByUser); _coreProperties.setLastModifiedByUser("Test User"); @@ -268,7 +268,7 @@ public final class TestPOIXMLProperties { @Disabled("Fails to add some of the thumbnails, needs more investigation") @Test - public void testThumbnails() throws Exception { + void testThumbnails() throws Exception { POIXMLProperties noThumbProps = sampleNoThumb.getProperties(); assertNotNull(_props.getThumbnailPart()); @@ -308,7 +308,7 @@ public final class TestPOIXMLProperties { } @Test - public void testAddProperty() throws IOException { + void testAddProperty() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("documentProperties.docx")) { POIXMLProperties.CustomProperties cps = doc.getProperties().getCustomProperties(); assertEquals(1, cps.getLastPid()); @@ -320,7 +320,7 @@ public final class TestPOIXMLProperties { } @Test - public void testBug60977() throws IOException { + void testBug60977() throws IOException { try (final XSSFWorkbook workbook = new XSSFWorkbook()) { final Sheet sheet = workbook.createSheet("sheet"); diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java index 3839a460ef..a26aaf2a72 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestTriggerCoverage.java @@ -85,7 +85,7 @@ public class TestTriggerCoverage { @ParameterizedTest @MethodSource("files") - public void testFile(File file) throws Exception { + void testFile(File file) throws Exception { try (InputStream stream = new FileInputStream(file)) { if (file.getName().endsWith(".docx")) { try (XWPFDocument doc = new XWPFDocument(stream)) { diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestXMLPropertiesTextExtractor.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestXMLPropertiesTextExtractor.java index 7913bfa283..c077e15085 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestXMLPropertiesTextExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestXMLPropertiesTextExtractor.java @@ -35,7 +35,7 @@ public final class TestXMLPropertiesTextExtractor { private static final POIDataSamples _slSamples = POIDataSamples.getSlideShowInstance(); @Test - public void testGetFromMainExtractor() throws Exception { + void testGetFromMainExtractor() throws Exception { OPCPackage pkg = PackageHelper.open(_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm")); XSSFWorkbook wb = new XSSFWorkbook(pkg); @@ -59,7 +59,7 @@ public final class TestXMLPropertiesTextExtractor { } @Test - public void testCore() throws Exception { + void testCore() throws Exception { OPCPackage pkg = PackageHelper.open( _ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm") ); @@ -79,7 +79,7 @@ public final class TestXMLPropertiesTextExtractor { } @Test - public void testExtended() throws Exception { + void testExtended() throws Exception { OPCPackage pkg = OPCPackage.open( _ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm") ); @@ -101,7 +101,7 @@ public final class TestXMLPropertiesTextExtractor { } @Test - public void testCustom() throws Exception { + void testCustom() throws Exception { OPCPackage pkg = OPCPackage.open( _ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm") ); @@ -125,7 +125,7 @@ public final class TestXMLPropertiesTextExtractor { * dates can be null */ @Test - public void testWithSomeNulls() throws Exception { + void testWithSomeNulls() throws Exception { OPCPackage pkg = OPCPackage.open( _slSamples.openResourceAsStream("49386-null_dates.pptx") ); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestContentType.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestContentType.java index 3831e51ad9..7847507017 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestContentType.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestContentType.java @@ -51,7 +51,7 @@ public final class TestContentType { */ @ParameterizedTest @ValueSource(strings = {"text/xml", "application/pgp-key", "application/vnd.hp-PCLXL", "application/vnd.lotus-1-2-3"}) - public void testContentTypeValidation(String contentType) throws InvalidFormatException { + void testContentTypeValidation(String contentType) throws InvalidFormatException { assertDoesNotThrow(() -> new ContentType(contentType)); } @@ -78,7 +78,7 @@ public final class TestContentType { "text[/xml", "text]/xml", "text?/xml", "tex=t/xml", "te{xt/xml", "tex}t/xml", "te xt/xml", "text\u0009/xml", "text xml", " text/xml "}) - public void testContentTypeValidationFailure(String contentType) { + void testContentTypeValidationFailure(String contentType) { assertThrows(InvalidFormatException.class, () -> new ContentType(contentType), "Must have fail for content type: '" + contentType + "' !"); } @@ -94,7 +94,7 @@ public final class TestContentType { "text/xml;a=b;c=d", "text/xml;key1=param1;key2=param2", "application/pgp-key;version=\"2\"", "application/x-resqml+xml;version=2.0;type=obj_global2dCrs"}) - public void testContentTypeParam(String contentType) { + void testContentTypeParam(String contentType) { assertDoesNotThrow(() -> new ContentType(contentType)); } @@ -108,7 +108,7 @@ public final class TestContentType { "mail/toto;titi = tata", // spaces not allowed "text/\u0080" // characters above ASCII are not allowed }) - public void testContentTypeParameterFailure(String contentType) { + void testContentTypeParameterFailure(String contentType) { assertThrows(InvalidFormatException.class, () -> new ContentType(contentType), "Must have fail for content type: '" + contentType + "' !"); } @@ -120,7 +120,7 @@ public final class TestContentType { */ @ParameterizedTest @ValueSource(strings = {"text/xml(comment)"}) - public void testContentTypeCommentFailure(String contentType) { + void testContentTypeCommentFailure(String contentType) { assertThrows(InvalidFormatException.class, () -> new ContentType(contentType), "Must have fail for content type: '" + contentType + "' !"); } @@ -131,7 +131,7 @@ public final class TestContentType { * (expected = InvalidFormatException.class) */ @Test - public void testFileWithContentTypeEntities() throws Exception { + void testFileWithContentTypeEntities() throws Exception { try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("ContentTypeHasEntities.ooxml")) { if (isOldXercesActive()) { OPCPackage.open(is); @@ -146,7 +146,7 @@ public final class TestContentType { * parameters on a content type */ @Test - public void testFileWithContentTypeParams() throws Exception { + void testFileWithContentTypeParams() throws Exception { try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("ContentTypeHasParameters.ooxml"); OPCPackage p = OPCPackage.open(is)) { diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java index f32286dc71..7a5d012fed 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java @@ -38,7 +38,7 @@ public final class TestFileHelper { * {@link File#getName()} instead of {@link FileHelper#getFilename(File) */ @Test - public void testGetDirectory() { + void testGetDirectory() { TreeMap expectedValue = new TreeMap<>(); expectedValue.put("/dir1/test.doc", "/dir1"); expectedValue.put("/dir1/dir2/test.doc.xml", "/dir1/dir2"); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java index 7f0b1fdeb8..02d4d70368 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestListParts.java @@ -85,7 +85,7 @@ public final class TestListParts { * List all parts of a package. */ @Test - public void testListParts() throws InvalidFormatException, IOException { + void testListParts() throws InvalidFormatException, IOException { try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("sample.docx"); OPCPackage p = OPCPackage.open(is)) { diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java index f467b4fa07..5e1cb6647d 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java @@ -711,7 +711,7 @@ public final class TestPackage { } @Test - public void testZipEntityExpansionTerminates() { + void testZipEntityExpansionTerminates() { IllegalStateException ex = assertThrows( IllegalStateException.class, () -> openXmlBombFile("poc-shared-strings.xlsx") @@ -720,7 +720,7 @@ public final class TestPackage { } @Test - public void testZipEntityExpansionSharedStringTableEvents() { + void testZipEntityExpansionSharedStringTableEvents() { boolean before = ExtractorFactory.getThreadPrefersEventExtractors(); ExtractorFactory.setThreadPrefersEventExtractors(true); try { @@ -736,7 +736,7 @@ public final class TestPackage { @Test - public void testZipEntityExpansionExceedsMemory() { + void testZipEntityExpansionExceedsMemory() { IOException ex = assertThrows( IOException.class, () -> openXmlBombFile("poc-xmlbomb.xlsx") @@ -746,7 +746,7 @@ public final class TestPackage { } @Test - public void testZipEntityExpansionExceedsMemory2() { + void testZipEntityExpansionExceedsMemory2() { IOException ex = assertThrows( IOException.class, () -> openXmlBombFile("poc-xmlbomb-empty.xlsx") @@ -845,7 +845,7 @@ public final class TestPackage { } @Test - public void testConstructors() throws IOException { + void testConstructors() throws IOException { // verify the various ways to construct a ZipSecureFile File file = getSampleFile("sample.xlsx"); try (ZipSecureFile zipFile = new ZipSecureFile(file)) { @@ -858,7 +858,7 @@ public final class TestPackage { } @Test - public void testMaxTextSize() { + void testMaxTextSize() { long before = ZipSecureFile.getMaxTextSize(); try { ZipSecureFile.setMaxTextSize(12345); @@ -870,7 +870,7 @@ public final class TestPackage { // bug 60128 @Test - public void testCorruptFile() { + void testCorruptFile() { File file = getSampleFile("invalid.xlsx"); assertThrows(NotOfficeXmlFileException.class, () -> OPCPackage.open(file, PackageAccess.READ)); } @@ -881,7 +881,7 @@ public final class TestPackage { // bug 61381 @Test - public void testTooShortFilterStreams() throws IOException { + void testTooShortFilterStreams() throws IOException { for (String file : new String[]{"sample.xlsx","SampleSS.xls"}) { for (CountingStream cs : new CountingStream[]{PushbackInputStream::new, BufferedInputStream::new}) { try (InputStream is = cs.create(xlsSamples.openResourceAsStream(file), 2); @@ -893,7 +893,7 @@ public final class TestPackage { } @Test - public void testBug56479() throws Exception { + void testBug56479() throws Exception { try (InputStream is = openSampleStream("dcterms_bug_56479.zip"); OPCPackage p = OPCPackage.open(is)) { @@ -933,7 +933,7 @@ public final class TestPackage { } @Test - public void testClosingStreamOnException() throws IOException { + void testClosingStreamOnException() throws IOException { File tmp = File.createTempFile("poi-test-truncated-zip", ""); // create a corrupted zip file by truncating a valid zip file to the first 100 bytes @@ -959,34 +959,34 @@ public final class TestPackage { * See bug #60128 for more */ @Test - public void testTidyStreamOnInvalidFile1() throws Exception { + void testTidyStreamOnInvalidFile1() throws Exception { openInvalidFile("SampleSS.ods", false); } @Test - public void testTidyStreamOnInvalidFile2() throws Exception { + void testTidyStreamOnInvalidFile2() throws Exception { openInvalidFile("SampleSS.ods", true); } @Test - public void testTidyStreamOnInvalidFile3() throws Exception { + void testTidyStreamOnInvalidFile3() throws Exception { openInvalidFile("SampleSS.txt", false); } @Test - public void testTidyStreamOnInvalidFile4() throws Exception { + void testTidyStreamOnInvalidFile4() throws Exception { openInvalidFile("SampleSS.txt", true); } @Test - public void testBug62592() throws Exception { + void testBug62592() throws Exception { try (InputStream is = openSampleStream("62592.thmx")) { assertThrows(InvalidFormatException.class, () -> OPCPackage.open(is)); } } @Test - public void testBug62592SequentialCallsToGetParts() throws Exception { + void testBug62592SequentialCallsToGetParts() throws Exception { //make absolutely certain that sequential calls don't throw InvalidFormatExceptions String originalFile = getSampleFileName("TestPackageCommon.docx"); try (OPCPackage p2 = OPCPackage.open(originalFile, PackageAccess.READ)) { @@ -996,7 +996,7 @@ public final class TestPackage { } @Test - public void testDoNotCloseStream() throws IOException { + void testDoNotCloseStream() throws IOException { // up to JDK 10 we did use Mockito here, but OutputStream is // an abstract class and fails mocking with some changes in JDK 11 // so we use a simple empty output stream implementation instead @@ -1047,7 +1047,7 @@ public final class TestPackage { @SuppressWarnings("UnstableApiUsage") @Test - public void testBug63029() throws Exception { + void testBug63029() throws Exception { File testFile = getSampleFile("sample.docx"); File tmpFile = getOutputFile("Bug63029.docx"); Files.copy(testFile, tmpFile); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java index 441f24d9ad..317d1009a0 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java @@ -44,7 +44,7 @@ public final class TestPackageCoreProperties { * Test package core properties getters. */ @Test - public void testGetProperties() throws Exception { + void testGetProperties() throws Exception { // Open the package @SuppressWarnings("resource") OPCPackage p = OPCPackage.open(OpenXML4JTestDataSamples.openSampleStream("TestPackageCoreProperiesGetters.docx")); @@ -56,7 +56,7 @@ public final class TestPackageCoreProperties { * Test package core properties setters. */ @Test - public void testSetProperties() throws Exception { + void testSetProperties() throws Exception { String inputPath = OpenXML4JTestDataSamples.getSampleFileName("TestPackageCoreProperiesSetters.docx"); File outputFile = OpenXML4JTestDataSamples.getOutputFile("TestPackageCoreProperiesSettersOUTPUT.docx"); @@ -151,7 +151,7 @@ public final class TestPackageCoreProperties { } @Test - public void testCoreProperties_bug51374() throws Exception { + void testCoreProperties_bug51374() throws Exception { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ROOT); df.setTimeZone(LocaleUtil.TIMEZONE_UTC); String strDate = "2007-05-12T08:00:00Z"; @@ -210,7 +210,7 @@ public final class TestPackageCoreProperties { } @Test - public void testGetPropertiesLO() throws Exception { + void testGetPropertiesLO() throws Exception { // Open the package OPCPackage pkg1 = OPCPackage.open(OpenXML4JTestDataSamples.openSampleStream("51444.xlsx")); PackageProperties props1 = pkg1.getPackageProperties(); @@ -228,7 +228,7 @@ public final class TestPackageCoreProperties { } @Test - public void testEntitiesInCoreProps_56164() throws Exception { + void testEntitiesInCoreProps_56164() throws Exception { try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("CorePropertiesHasEntities.ooxml"); OPCPackage p = OPCPackage.open(is)) { @@ -255,7 +255,7 @@ public final class TestPackageCoreProperties { } @Test - public void testListOfCustomProperties() throws Exception { + void testListOfCustomProperties() throws Exception { File inp = POIDataSamples.getSpreadSheetInstance().getFile("ExcelWithAttachments.xlsm"); OPCPackage pkg = OPCPackage.open(inp, PackageAccess.READ); XSSFWorkbook wb = new XSSFWorkbook(pkg); @@ -272,7 +272,7 @@ public final class TestPackageCoreProperties { } @Test - public void testAlternateCorePropertyTimezones() throws Exception { + void testAlternateCorePropertyTimezones() throws Exception { InputStream is = OpenXML4JTestDataSamples.openSampleStream("OPCCompliance_CoreProperties_AlternateTimezones.docx"); OPCPackage pkg = OPCPackage.open(is); PackagePropertiesPart props = (PackagePropertiesPart)pkg.getPackageProperties(); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagePartName.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagePartName.java index 78fe47a4ca..2572aadfad 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagePartName.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagePartName.java @@ -27,7 +27,7 @@ public final class TestPackagePartName { * Test method getExtension(). */ @Test - public void testGetExtension() throws Exception{ + void testGetExtension() throws Exception{ PackagePartName name1 = PackagingURIHelper.createPartName("/doc/props/document.xml"); PackagePartName name2 = PackagingURIHelper.createPartName("/root/document"); assertEquals("xml", name1.getExtension()); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageThumbnail.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageThumbnail.java index 81a0afdf44..e68a92d200 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageThumbnail.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageThumbnail.java @@ -35,7 +35,7 @@ public final class TestPackageThumbnail { * Test package addThumbnail() method. */ @Test - public void testSetProperties() throws Exception { + void testSetProperties() throws Exception { String inputPath = OpenXML4JTestDataSamples.getSampleFileName("TestPackageThumbnail.docx"); String imagePath = OpenXML4JTestDataSamples.getSampleFileName("thumbnail.jpg"); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagingURIHelper.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagingURIHelper.java index 71689cc200..fc047c887c 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagingURIHelper.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackagingURIHelper.java @@ -30,7 +30,7 @@ public class TestPackagingURIHelper { * Test relativizePartName() method. */ @Test - public void testRelativizeURI() throws Exception { + void testRelativizeURI() throws Exception { URI uri1 = new URI("/word/document.xml"); URI uri2 = new URI("/word/media/image1.gif"); URI uri3 = new URI("/word/media/image1.gif#Sheet1!A1"); @@ -79,7 +79,7 @@ public class TestPackagingURIHelper { * Test createPartName(String, y) */ @Test - public void testCreatePartNameRelativeString() + void testCreatePartNameRelativeString() throws InvalidFormatException { PackagePartName partNameToValid = PackagingURIHelper .createPartName("/word/media/image1.gif"); @@ -100,7 +100,7 @@ public class TestPackagingURIHelper { * Test createPartName(URI, y) */ @Test - public void testCreatePartNameRelativeURI() throws Exception { + void testCreatePartNameRelativeURI() throws Exception { PackagePartName partNameToValid = PackagingURIHelper .createPartName("/word/media/image1.gif"); @@ -117,7 +117,7 @@ public class TestPackagingURIHelper { } @Test - public void testCreateURIFromString() throws Exception { + void testCreateURIFromString() throws Exception { String[] href = { "..\\\\\\cygwin\\home\\yegor\\.vim\\filetype.vim", "..\\Program%20Files\\AGEIA%20Technologies\\v2.3.3\\NxCooking.dll", @@ -136,7 +136,7 @@ public class TestPackagingURIHelper { } @Test - public void test53734() throws Exception { + void test53734() throws Exception { URI uri = PackagingURIHelper.toURI("javascript://"); // POI appends a trailing slash tpo avoid "Expected authority at index 13: javascript://" // https://issues.apache.org/bugzilla/show_bug.cgi?id=53734 diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java index 4c681e8623..0afcfe4e1f 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java @@ -53,7 +53,7 @@ public class TestRelationships { * really look also for not yet loaded parts. */ @Test - public void testLoadRelationships() throws Exception { + void testLoadRelationships() throws Exception { InputStream is = openSampleStream("sample.xlsx"); try (OPCPackage pkg = OPCPackage.open(is)) { logger.log(POILogger.DEBUG, "1: " + pkg); @@ -76,7 +76,7 @@ public class TestRelationships { * type, then grab from within there by id */ @Test - public void testFetchFromCollection() throws Exception { + void testFetchFromCollection() throws Exception { InputStream is = openSampleStream("ExcelWithHyperlinks.xlsx"); try (OPCPackage pkg = OPCPackage.open(is)) { PackagePart sheet = pkg.getPart( @@ -119,7 +119,7 @@ public class TestRelationships { * external hyperlinks. Check we can load these ok. */ @Test - public void testLoadExcelHyperlinkRelations() throws Exception { + void testLoadExcelHyperlinkRelations() throws Exception { InputStream is = openSampleStream("ExcelWithHyperlinks.xlsx"); try (OPCPackage pkg = OPCPackage.open(is)) { PackagePart sheet = pkg.getPart( @@ -155,7 +155,7 @@ public class TestRelationships { * then still read them later */ @Test - public void testCreateExcelHyperlinkRelations() throws Exception { + void testCreateExcelHyperlinkRelations() throws Exception { String filepath = OpenXML4JTestDataSamples.getSampleFileName("ExcelWithHyperlinks.xlsx"); OPCPackage pkg = OPCPackage.open(filepath, PackageAccess.READ_WRITE); PackagePart sheet = pkg.getPart( @@ -227,7 +227,7 @@ public class TestRelationships { } @Test - public void testCreateRelationsFromScratch() throws Exception { + void testCreateRelationsFromScratch() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); OPCPackage pkg = OPCPackage.create(baos); @@ -296,7 +296,7 @@ public class TestRelationships { } @Test - public void testTargetWithSpecialChars() throws Exception{ + void testTargetWithSpecialChars() throws Exception{ OPCPackage pkg; String filepath = OpenXML4JTestDataSamples.getSampleFileName("50154.xlsx"); @@ -358,7 +358,7 @@ public class TestRelationships { } @Test - public void testSelfRelations_bug51187() throws Exception { + void testSelfRelations_bug51187() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PackageRelationship rel1; try (OPCPackage pkg = OPCPackage.create(baos)) { @@ -394,7 +394,7 @@ public class TestRelationships { } @Test - public void testTrailingSpacesInURI_53282() throws Exception { + void testTrailingSpacesInURI_53282() throws Exception { try (InputStream is = openSampleStream("53282.xlsx"); OPCPackage pkg1 = OPCPackage.open(is)) { @@ -423,7 +423,7 @@ public class TestRelationships { } @Test - public void testEntitiesInRels_56164() throws Exception { + void testEntitiesInRels_56164() throws Exception { try (InputStream is = openSampleStream("PackageRelsHasEntities.ooxml"); OPCPackage p = OPCPackage.open(is)) { diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCComplianceCoreProperties.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCComplianceCoreProperties.java index b0a7630255..b6e72042c9 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCComplianceCoreProperties.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCComplianceCoreProperties.java @@ -80,7 +80,7 @@ import org.junit.jupiter.api.Test; public final class TestOPCComplianceCoreProperties { @Test - public void testCorePropertiesPart() { + void testCorePropertiesPart() { OPCPackage pkg; try { InputStream is = openComplianceSampleStream("OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx"); @@ -103,7 +103,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.1 rule. */ @Test - public void testOnlyOneCorePropertiesPart() throws Exception { + void testOnlyOneCorePropertiesPart() throws Exception { // We have relaxed this check, so we can read the file anyway assertDoesNotThrow(() -> { try (InputStream is = openSampleStream("OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx"); @@ -141,7 +141,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.1 rule. */ @Test - public void testOnlyOneCorePropertiesPart_AddRelationship() throws IOException, InvalidFormatException { + void testOnlyOneCorePropertiesPart_AddRelationship() throws IOException, InvalidFormatException { try (InputStream is = openComplianceSampleStream("OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx")) { OPCPackage pkg = OPCPackage.open(is); URI partUri = createURI("/docProps/core2.xml"); @@ -158,7 +158,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.1 rule. */ @Test - public void testOnlyOneCorePropertiesPart_AddPart() throws InvalidFormatException, IOException { + void testOnlyOneCorePropertiesPart_AddPart() throws InvalidFormatException, IOException { String sampleFileName = "OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx"; try (OPCPackage pkg = OPCPackage.open(POIDataSamples.getOpenXML4JInstance().getFile(sampleFileName).getPath())) { @@ -175,7 +175,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.2 rule. */ @Test - public void testDoNotUseCompatibilityMarkup() throws IOException { + void testDoNotUseCompatibilityMarkup() throws IOException { String msg = extractInvalidFormatMessage("DoNotUseCompatibilityMarkupFAIL.docx"); assertEquals("OPC Compliance error [M4.2]: A format consumer shall consider the use of the Markup Compatibility namespace to be an error.", msg); } @@ -184,7 +184,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.3 rule. */ @Test - public void testDCTermsNamespaceLimitedUse() throws IOException { + void testDCTermsNamespaceLimitedUse() throws IOException { String msg = extractInvalidFormatMessage("DCTermsNamespaceLimitedUseFAIL.docx"); assertEquals("OPC Compliance error [M4.3]: Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: and Consumers shall consider a document element that violates this constraint to be an error.", msg); } @@ -193,7 +193,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.4 rule. */ @Test - public void testUnauthorizedXMLLangAttribute() throws IOException { + void testUnauthorizedXMLLangAttribute() throws IOException { String msg = extractInvalidFormatMessage("UnauthorizedXMLLangAttributeFAIL.docx"); assertEquals("OPC Compliance error [M4.4]: Producers shall not create a document element that contains the xml:lang attribute. Consumers shall consider a document element that violates this constraint to be an error.", msg); } @@ -202,7 +202,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.5 rule. */ @Test - public void testLimitedXSITypeAttribute_NotPresent() throws IOException { + void testLimitedXSITypeAttribute_NotPresent() throws IOException { String msg = extractInvalidFormatMessage("LimitedXSITypeAttribute_NotPresentFAIL.docx"); assertEquals("The element 'created' must have the 'xsi:type' attribute present !", msg); } @@ -211,7 +211,7 @@ public final class TestOPCComplianceCoreProperties { * Test M4.5 rule. */ @Test - public void testLimitedXSITypeAttribute_PresentWithUnauthorizedValue() throws IOException { + void testLimitedXSITypeAttribute_PresentWithUnauthorizedValue() throws IOException { String msg = extractInvalidFormatMessage("LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx"); assertEquals("The element 'modified' must have the 'xsi:type' attribute with the value 'dcterms:W3CDTF', but had 'W3CDTF' !", msg); } @@ -221,7 +221,7 @@ public final class TestOPCComplianceCoreProperties { * saving into a new stream */ @Test - public void testNoCoreProperties_saveNew() throws Exception { + void testNoCoreProperties_saveNew() throws Exception { String sampleFileName = "OPCCompliance_NoCoreProperties.xlsx"; ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -267,7 +267,7 @@ public final class TestOPCComplianceCoreProperties { * from a temp-file, saving in-place */ @Test - public void testNoCoreProperties_saveInPlace() throws Exception { + void testNoCoreProperties_saveInPlace() throws Exception { String sampleFileName = "OPCCompliance_NoCoreProperties.xlsx"; // Copy this into a temp file, so we can play with it diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePackageModel.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePackageModel.java index 5eba3cf2bf..bd2386d274 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePackageModel.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePackageModel.java @@ -66,7 +66,7 @@ public class TestOPCCompliancePackageModel { * [M1.11] */ @Test - public void testPartNameDerivationAdditionFailure() throws InvalidFormatException, IOException { + void testPartNameDerivationAdditionFailure() throws InvalidFormatException, IOException { try (OPCPackage pkg = OPCPackage.create(TESTFILE)) { PackagePartName name = PackagingURIHelper.createPartName("/word/document.xml"); PackagePartName nameDerived = PackagingURIHelper.createPartName("/word/document.xml/image1.gif"); @@ -85,7 +85,7 @@ public class TestOPCCompliancePackageModel { * [M1.11] */ @Test - public void testPartNameDerivationReadingFailure() { + void testPartNameDerivationReadingFailure() { String filename = "OPCCompliance_DerivedPartNameFAIL.docx"; assertThrows(InvalidFormatException.class, () -> OPCPackage.open(POIDataSamples.getOpenXML4JInstance().openResourceAsStream(filename)), @@ -100,7 +100,7 @@ public class TestOPCCompliancePackageModel { * part names. */ @Test - public void testAddPackageAlreadyAddFailure() throws Exception { + void testAddPackageAlreadyAddFailure() throws Exception { try (OPCPackage pkg = OPCPackage.create(TESTFILE)) { PackagePartName name1 = PackagingURIHelper.createPartName("/word/document.xml"); PackagePartName name2 = PackagingURIHelper.createPartName("/word/document.xml"); @@ -120,7 +120,7 @@ public class TestOPCCompliancePackageModel { * part names. */ @Test - public void testAddPackageAlreadyAddFailure2() throws Exception { + void testAddPackageAlreadyAddFailure2() throws Exception { try (OPCPackage pkg = OPCPackage.create(TESTFILE)) { PackagePartName partName = PackagingURIHelper.createPartName("/word/document.xml"); pkg.createPart(partName, ContentTypes.XML); @@ -141,7 +141,7 @@ public class TestOPCCompliancePackageModel { * relationship as invalid. */ @Test - public void testAddRelationshipRelationshipsPartFailure() throws IOException, InvalidFormatException { + void testAddRelationshipRelationshipsPartFailure() throws IOException, InvalidFormatException { try (OPCPackage pkg = OPCPackage.create(TESTFILE)) { PackagePartName name1 = PackagingURIHelper.createPartName("/test/_rels/document.xml.rels"); diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java index 781d3b4f30..edfe0fea3e 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java @@ -91,7 +91,7 @@ public final class TestOPCCompliancePartName { * A segment shall not contain percent-encoded unreserved characters. [M1.8] */ @Test - public void testInvalidPartNames() { + void testInvalidPartNames() { String[] invalidNames = { "/", "/xml./doc.xml", "[Content_Types].xml", "//xml/." }; for (String s : invalidNames) { URI uri = null; @@ -109,7 +109,7 @@ public final class TestOPCCompliancePartName { * Test some common valid names. */ @Test - public void testValidPartNames() throws URISyntaxException { + void testValidPartNames() throws URISyntaxException { String[] validNames = { "/xml/item1.xml", "/document.xml", "/a/%D1%86.xml" }; for (String s : validNames) { assertTrue(isValidPartName(new URI(s)), "This part name SHOULD be valid: " + s); @@ -120,7 +120,7 @@ public final class TestOPCCompliancePartName { * A part name shall not be empty. [M1.1] */ @Test - public void testEmptyPartNameFailure() { + void testEmptyPartNameFailure() { assertThrows(InvalidFormatException.class, () -> createPartName(new URI("")), "A part name shall not be empty. [M1.1]"); } @@ -133,7 +133,7 @@ public final class TestOPCCompliancePartName { * A segment shall include at least one non-dot character. [M1.10] */ @Test - public void testPartNameWithInvalidSegmentsFailure() throws URISyntaxException { + void testPartNameWithInvalidSegmentsFailure() throws URISyntaxException { String[] invalidNames = { "//document.xml", "//word/document.xml", "/word//document.rels", "/word//rels//document.rels", "/xml./doc.xml", "/document.", "/./document.xml", @@ -148,7 +148,7 @@ public final class TestOPCCompliancePartName { * [M1.6]. */ @Test - public void testPartNameWithNonPCharCharacters() throws URISyntaxException { + void testPartNameWithNonPCharCharacters() throws URISyntaxException { String[] validNames = { "/doc&.xml" }; for (String s : validNames) { assertTrue(isValidPartName(new URI(s)), @@ -160,7 +160,7 @@ public final class TestOPCCompliancePartName { * A segment shall not contain percent-encoded unreserved characters [M1.8]. */ @Test - public void testPartNameWithUnreservedEncodedCharactersFailure() throws URISyntaxException { + void testPartNameWithUnreservedEncodedCharactersFailure() throws URISyntaxException { String[] invalidNames = { "/a/docum%65nt.xml" }; for (String s : invalidNames) { assertFalse(isValidPartName(new URI(s)), "A segment shall not contain percent-encoded unreserved characters [M1.8] : " + s); @@ -171,7 +171,7 @@ public final class TestOPCCompliancePartName { * A part name shall start with a forward slash ('/') character. [M1.4] */ @Test - public void testPartNameStartsWithAForwardSlashFailure() { + void testPartNameStartsWithAForwardSlashFailure() { assertThrows(InvalidFormatException.class, () -> createPartName(new URI("document.xml")), "A part name shall start with a forward slash ('/') character. [M1.4]"); } @@ -180,7 +180,7 @@ public final class TestOPCCompliancePartName { * A part name shall not have a forward slash as the last character. [M1.5] */ @Test - public void testPartNameEndsWithAForwardSlashFailure() { + void testPartNameEndsWithAForwardSlashFailure() { assertThrows(InvalidFormatException.class, () -> createPartName(new URI("/document.xml/")), "A part name shall not have a forward slash as the last character. [M1.5]"); } @@ -190,7 +190,7 @@ public final class TestOPCCompliancePartName { * case-insensitive ASCII strings. [M1.12] */ @Test - public void testPartNameComparaison() throws Exception { + void testPartNameComparaison() throws Exception { String[] partName1 = { "/word/document.xml", "/docProps/core.xml", "/rels/.rels" }; String[] partName2 = { "/WORD/DocUment.XML", "/docProps/core.xml", "/rels/.rels" }; for (int i = 0; i < partName1.length || i < partName2.length; ++i) { @@ -209,7 +209,7 @@ public final class TestOPCCompliancePartName { * All the comparisons MUST FAIL ! */ @Test - public void testPartNameComparaisonFailure() throws Exception { + void testPartNameComparaisonFailure() throws Exception { String[] partName1 = { "/word/document.xml", "/docProps/core.xml", "/rels/.rels" }; String[] partName2 = { "/WORD/DocUment.XML2", "/docProp/core.xml", "/rels/rels" }; for (int i = 0; i < partName1.length || i < partName2.length; ++i) { diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java index 89b3696372..f59db0e1f0 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java @@ -57,7 +57,7 @@ public final class TestContentTypeManager { * Test the properties part content parsing. */ @Test - public void testContentType() throws Exception { + void testContentType() throws Exception { String filepath = OpenXML4JTestDataSamples.getSampleFileName("sample.docx"); // Retrieves core properties part @@ -74,7 +74,7 @@ public final class TestContentTypeManager { * Test the addition of several default and override content types. */ @Test - public void testContentTypeAddition() throws Exception { + void testContentTypeAddition() throws Exception { ContentTypeManager ctm = new ZipContentTypeManager(null, null); PackagePartName name1 = PackagingURIHelper.createPartName("/foo/foo.XML"); @@ -98,7 +98,7 @@ public final class TestContentTypeManager { * Test the addition then removal of content types. */ @Test - public void testContentTypeRemoval() throws Exception { + void testContentTypeRemoval() throws Exception { ContentTypeManager ctm = new ZipContentTypeManager(null, null); PackagePartName name1 = PackagingURIHelper.createPartName("/foo/foo.xml"); @@ -128,7 +128,7 @@ public final class TestContentTypeManager { */ @Disabled @Test - public void testContentTypeRemovalPackage() { + void testContentTypeRemovalPackage() { // TODO } diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/util/TestZipSecureFile.java b/src/ooxml/testcases/org/apache/poi/openxml4j/util/TestZipSecureFile.java index a4d2d7b8c3..449b725d44 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/util/TestZipSecureFile.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/util/TestZipSecureFile.java @@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class TestZipSecureFile { @Test - public void testThresholdInputStream() throws Exception { + void testThresholdInputStream() throws Exception { // This fails in Java 10 because our reflection injection of the ThresholdInputStream causes a // ClassCastException in ZipFile now // The relevant change in the JDK is http://hg.openjdk.java.net/jdk/jdk10/rev/85ea7e83af30#l5.66 diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureConfig.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureConfig.java index 96fe630e90..b10c53f284 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureConfig.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureConfig.java @@ -29,7 +29,7 @@ public class TestSignatureConfig { @Test @Disabled("failing in automated builds, due to issues loading security classes") - public void testDigestAlgo() throws Exception { + void testDigestAlgo() throws Exception { SignatureConfig sc = new SignatureConfig(); assertEquals(HashAlgorithm.sha256, sc.getDigestAlgo()); sc.setDigestAlgo(HashAlgorithm.sha1); @@ -37,7 +37,7 @@ public class TestSignatureConfig { } @Test - public void testHashOids() throws IOException { + void testHashOids() throws IOException { final String[][] checks = { { "sha1", "MCEwCQYFKw4DAhoFAAQU" }, { "sha224", "MC0wDQYJYIZIAWUDBAIEBQAEHA==" }, diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java index 528bc8aa24..25ca9c320f 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java @@ -395,7 +395,7 @@ public class TestSignatureInfo { } @Test - public void testSignSpreadsheet() throws Exception { + void testSignSpreadsheet() throws Exception { String testFile = "hello-world-unsigned.xlsx"; try (OPCPackage pkg = OPCPackage.open(copy(testdata.getFile(testFile)), PackageAccess.READ_WRITE)) { sign(pkg); @@ -412,7 +412,7 @@ public class TestSignatureInfo { } @Test - public void testManipulation() throws Exception { + void testManipulation() throws Exception { // sign & validate String testFile = "hello-world-unsigned.xlsx"; try (OPCPackage pkg = OPCPackage.open(copy(testdata.getFile(testFile)), PackageAccess.READ_WRITE)) { @@ -439,7 +439,7 @@ public class TestSignatureInfo { } @Test - public void testSignSpreadsheetWithSignatureInfo() throws Exception { + void testSignSpreadsheetWithSignatureInfo() throws Exception { initKeyPair(); String testFile = "hello-world-unsigned.xlsx"; try (OPCPackage pkg = OPCPackage.open(copy(testdata.getFile(testFile)), PackageAccess.READ_WRITE)) { @@ -462,7 +462,7 @@ public class TestSignatureInfo { } @Test - public void testSignEnvelopingDocument() throws Exception { + void testSignEnvelopingDocument() throws Exception { String testFile = "hello-world-unsigned.xlsx"; File sigCopy = testdata.getFile(testFile); ByteArrayOutputStream bos = new ByteArrayOutputStream(50000); @@ -662,7 +662,7 @@ public class TestSignatureInfo { } @Test - public void testCertChain() throws Exception { + void testCertChain() throws Exception { final boolean isIBM = System.getProperty("java.vendor").contains("IBM"); KeyStore keystore = KeyStore.getInstance("PKCS12"); @@ -711,7 +711,7 @@ public class TestSignatureInfo { } @Test - public void testNonSha1() throws Exception { + void testNonSha1() throws Exception { String testFile = "hello-world-unsigned.xlsx"; initKeyPair(); @@ -764,7 +764,7 @@ public class TestSignatureInfo { } @Test - public void testMultiSign() throws Exception { + void testMultiSign() throws Exception { cal = LocaleUtil.getLocaleCalendar(LocaleUtil.TIMEZONE_UTC); cal.clear(); cal.setTimeZone(LocaleUtil.TIMEZONE_UTC); @@ -846,7 +846,7 @@ public class TestSignatureInfo { } @Test - public void testRetrieveCertificate() throws InvalidFormatException, IOException { + void testRetrieveCertificate() throws InvalidFormatException, IOException { SignatureConfig sic = new SignatureConfig(); final File file = testdata.getFile("PPT2016withComment.pptx"); try (final OPCPackage pkg = OPCPackage.open(file, PackageAccess.READ)) { @@ -871,7 +871,7 @@ public class TestSignatureInfo { } @Test - public void testSignatureImage() throws Exception { + void testSignatureImage() throws Exception { initKeyPair(); List> lines = Arrays.asList(XSSFSignatureLine::new, XWPFSignatureLine::new); diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestAgileEncryptionParameters.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestAgileEncryptionParameters.java index a05f6f6dcf..3d41fe6304 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestAgileEncryptionParameters.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestAgileEncryptionParameters.java @@ -75,7 +75,7 @@ public class TestAgileEncryptionParameters { @ParameterizedTest @MethodSource("data") - public void testAgileEncryptionModes(CipherAlgorithm ca, HashAlgorithm ha, ChainingMode cm) throws Exception { + void testAgileEncryptionModes(CipherAlgorithm ca, HashAlgorithm ha, ChainingMode cm) throws Exception { int maxKeyLen = Cipher.getMaxAllowedKeyLength(ca.jceId); assumeTrue(maxKeyLen >= ca.defaultKeySize, "Please install JCE Unlimited Strength Jurisdiction Policy files"); diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestDecryptor.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestDecryptor.java index 83d1136b8a..f2d38ebc73 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestDecryptor.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestDecryptor.java @@ -153,7 +153,7 @@ public class TestDecryptor { } @Test - public void test58616() throws IOException, GeneralSecurityException { + void test58616() throws IOException, GeneralSecurityException { try (InputStream is = POIDataSamples.getSpreadSheetInstance().openResourceAsStream("58616.xlsx"); POIFSFileSystem pfs = new POIFSFileSystem(is)) { EncryptionInfo info = new EncryptionInfo(pfs); diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestEncryptionInfo.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestEncryptionInfo.java index 16c4b47adc..5fd6f6e46f 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestEncryptionInfo.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/tests/TestEncryptionInfo.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public class TestEncryptionInfo { @Test - public void testEncryptionInfo() throws IOException { + void testEncryptionInfo() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(POIDataSamples.getPOIFSInstance().openResourceAsStream("protect.xlsx")); EncryptionInfo info = new EncryptionInfo(fs); @@ -49,7 +49,7 @@ public class TestEncryptionInfo { } @Test - public void testEncryptionInfoSHA512() throws Exception { + void testEncryptionInfoSHA512() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(POIDataSamples.getPOIFSInstance().openResourceAsStream("protected_sha512.xlsx")); EncryptionInfo info = new EncryptionInfo(fs); diff --git a/src/ooxml/testcases/org/apache/poi/sl/tests/draw/TestDrawPictureShape.java b/src/ooxml/testcases/org/apache/poi/sl/tests/draw/TestDrawPictureShape.java index 8a300988d6..6a73596b68 100644 --- a/src/ooxml/testcases/org/apache/poi/sl/tests/draw/TestDrawPictureShape.java +++ b/src/ooxml/testcases/org/apache/poi/sl/tests/draw/TestDrawPictureShape.java @@ -64,18 +64,18 @@ public class TestDrawPictureShape { } @Test - public void testResizeHSLF() throws IOException { + void testResizeHSLF() throws IOException { assumeFalse(xslfOnly); testResize("pictures.ppt"); } @Test - public void testResizeXSLF() throws IOException { + void testResizeXSLF() throws IOException { testResize("shapes.pptx"); } - public void testResize(String file) throws IOException { + void testResize(String file) throws IOException { SlideShow ss = openSampleDocument(file); Slide slide = ss.getSlides().get(0); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/TestWorkbookFactory.java b/src/ooxml/testcases/org/apache/poi/ss/tests/TestWorkbookFactory.java index 8bf02dfb13..2232d9a37b 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/TestWorkbookFactory.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/TestWorkbookFactory.java @@ -105,7 +105,7 @@ public final class TestWorkbookFactory { } @Test - public void testCreateNative() throws Exception { + void testCreateNative() throws Exception { // POIFS -> hssf try (Workbook wb = WorkbookFactory.create( new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream(xls)) @@ -132,7 +132,7 @@ public final class TestWorkbookFactory { } @Test - public void testCreateReadOnly() throws Exception { + void testCreateReadOnly() throws Exception { // POIFS -> hssf try (Workbook wb = WorkbookFactory.create(HSSFTestDataSamples.getSampleFile(xls), null, true)) { assertNotNull(wb); @@ -154,7 +154,7 @@ public final class TestWorkbookFactory { * InputStream, then creating what's required. */ @Test - public void testCreateGeneric() throws Exception { + void testCreateGeneric() throws Exception { // InputStream -> either try (Workbook wb = WorkbookFactory.create(HSSFTestDataSamples.openSampleFileStream(xls))) { assertNotNull(wb); @@ -208,7 +208,7 @@ public final class TestWorkbookFactory { */ @ParameterizedTest @MethodSource("workbookPass") - public void testCreateWithPasswordFromStream(String file, String pass, boolean fails, Class clazz) throws Exception { + void testCreateWithPasswordFromStream(String file, String pass, boolean fails, Class clazz) throws Exception { try (InputStream is = HSSFTestDataSamples.openSampleFileStream(file)) { if (fails) { assertThrows(EncryptedDocumentException.class, () -> WorkbookFactory.create(is, pass), @@ -227,7 +227,7 @@ public final class TestWorkbookFactory { */ @ParameterizedTest @MethodSource("workbookPass") - public void testCreateWithPasswordFromFile(String fileName, String pass, boolean fails, Class clazz) throws Exception { + void testCreateWithPasswordFromFile(String fileName, String pass, boolean fails, Class clazz) throws Exception { File file = HSSFTestDataSamples.getSampleFile(fileName); if (fails) { assertThrows(EncryptedDocumentException.class, () -> WorkbookFactory.create(file, pass), @@ -245,7 +245,7 @@ public final class TestWorkbookFactory { * Check that a helpful exception is given on an empty input stream */ @Test - public void testEmptyInputStream() { + void testEmptyInputStream() { InputStream emptyStream = new ByteArrayInputStream(new byte[0]); assertThrows(EmptyFileException.class, () -> WorkbookFactory.create(emptyStream)); } @@ -254,7 +254,7 @@ public final class TestWorkbookFactory { * Check that a helpful exception is given on an empty file */ @Test - public void testEmptyFile() throws Exception { + void testEmptyFile() throws Exception { File emptyFile = TempFile.createTempFile("empty", ".poi"); assertThrows(EmptyFileException.class, () -> WorkbookFactory.create(emptyFile), "Shouldn't be able to create for an empty file"); @@ -265,7 +265,7 @@ public final class TestWorkbookFactory { * Check that a helpful exception is raised on a non-existing file */ @Test - public void testNonExistingFile() { + void testNonExistingFile() { File nonExistingFile = new File("notExistingFile"); assertFalse(nonExistingFile.exists()); assertThrows(FileNotFoundException.class, () -> WorkbookFactory.create(nonExistingFile, "password", true)); @@ -276,7 +276,7 @@ public final class TestWorkbookFactory { * to work for sub-classes of File too, eg JFileChooser */ @Test - public void testFileSubclass() throws Exception { + void testFileSubclass() throws Exception { File normalXLS = HSSFTestDataSamples.getSampleFile(xls); File normalXLSX = HSSFTestDataSamples.getSampleFile(xlsx); File altXLS = new TestFile(normalXLS.getAbsolutePath()); @@ -307,7 +307,7 @@ public final class TestWorkbookFactory { * Check that the overloaded file methods which take passwords work properly */ @Test - public void testCreateEmpty() throws Exception { + void testCreateEmpty() throws Exception { Workbook wb = WorkbookFactory.create(false); assertTrue(wb instanceof HSSFWorkbook); closeOrRevert(wb); @@ -319,7 +319,7 @@ public final class TestWorkbookFactory { @Test @SuppressForbidden("test code") - public void testOpenManyHSSF() throws Exception { + void testOpenManyHSSF() throws Exception { final int size = 1000; ExecutorService executorService = Executors.newFixedThreadPool(10); ArrayList> futures = new ArrayList<>(size); @@ -332,7 +332,7 @@ public final class TestWorkbookFactory { } @Test - public void testInvalidFormatException() throws IOException { + void testInvalidFormatException() throws IOException { String filename = "OPCCompliance_DerivedPartNameFAIL.docx"; try (InputStream is = POIDataSamples.getOpenXML4JInstance().openResourceAsStream(filename)) { assertThrows(IOException.class, () -> WorkbookFactory.create(is)); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/extractor/TestEmbeddedExtractor.java b/src/ooxml/testcases/org/apache/poi/ss/tests/extractor/TestEmbeddedExtractor.java index ae7eaefa3e..322a94836b 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/extractor/TestEmbeddedExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/extractor/TestEmbeddedExtractor.java @@ -119,7 +119,7 @@ public class TestEmbeddedExtractor { @Test - public void testNPE() throws IOException { + void testNPE() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("angelo.edu_content_files_19555-nsse-2011-multiyear-benchmark.xls"); EmbeddedExtractor ee = new EmbeddedExtractor(); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/format/TestCellFormatPart.java b/src/ooxml/testcases/org/apache/poi/ss/tests/format/TestCellFormatPart.java index e4f9ff80b2..8978c1a4a4 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/format/TestCellFormatPart.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/format/TestCellFormatPart.java @@ -85,7 +85,7 @@ public class TestCellFormatPart { } @Test - public void testGeneralFormat() throws IOException { + void testGeneralFormat() throws IOException { runFormatTests("GeneralFormatTests.xlsx", cell -> { assertNotNull(cell); switch (CellFormat.ultimateType(cell)) { @@ -100,12 +100,12 @@ public class TestCellFormatPart { } @Test - public void testNumberFormat() throws IOException { + void testNumberFormat() throws IOException { runFormatTests("NumberFormatTests.xlsx", Cell::getNumericCellValue); } @Test - public void testNumberApproxFormat() throws IOException { + void testNumberApproxFormat() throws IOException { runFormatTests("NumberFormatApproxTests.xlsx", new CellValue() { @Override public Object getValue(Cell cell) { @@ -125,7 +125,7 @@ public class TestCellFormatPart { } @Test - public void testDateFormat() throws IOException { + void testDateFormat() throws IOException { TimeZone tz = LocaleUtil.getUserTimeZone(); LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CET")); try { @@ -136,19 +136,19 @@ public class TestCellFormatPart { } @Test - public void testElapsedFormat() throws IOException { + void testElapsedFormat() throws IOException { runFormatTests("ElapsedFormatTests.xlsx", Cell::getNumericCellValue); } @Test - public void testTextFormat() throws IOException { + void testTextFormat() throws IOException { runFormatTests("TextFormatTests.xlsx", cell -> (CellFormat.ultimateType(cell) == CellType.BOOLEAN) ? cell.getBooleanCellValue() : cell.getStringCellValue() ); } @Test - public void testConditions() throws IOException { + void testConditions() throws IOException { runFormatTests("FormatConditionTests.xlsx", Cell::getNumericCellValue); } diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestFormulaParser.java b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestFormulaParser.java index 3314754906..42a8e47d60 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestFormulaParser.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestFormulaParser.java @@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test; public class TestFormulaParser { @Test - public void testHSSFFailsForOver65536() { + void testHSSFFailsForOver65536() { FormulaParsingWorkbook workbook = HSSFEvaluationWorkbook.create(new HSSFWorkbook()); assertThrows(FormulaParseException.class, () -> FormulaParser.parse("Sheet1!1:65537", workbook, FormulaType.CELL, 0)); @@ -73,17 +73,17 @@ public class TestFormulaParser { } @Test - public void testHSSFPassCase() { + void testHSSFPassCase() { checkHSSFFormula("Sheet1!1:65536"); } @Test - public void testXSSFWorksForOver65536() { + void testXSSFWorksForOver65536() { checkXSSFFormula("Sheet1!1:65537"); } @Test - public void testXSSFFailCase() { + void testXSSFFailCase() { FormulaParsingWorkbook workbook = XSSFEvaluationWorkbook.create(new XSSFWorkbook()); assertThrows(FormulaParseException.class, () -> FormulaParser.parse("Sheet1!1:1048577", workbook, FormulaType.CELL, 0), "one more than max rows"); @@ -91,7 +91,7 @@ public class TestFormulaParser { // copied from org.apache.poi.hssf.model.TestFormulaParser @Test - public void testMacroFunction() throws Exception { + void testMacroFunction() throws Exception { // testNames.xlsm contains a VB function called 'myFunc' final String testFile = "testNames.xlsm"; try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook(testFile)) { @@ -144,7 +144,7 @@ public class TestFormulaParser { } @Test - public void testParserErrors() throws Exception { + void testParserErrors() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("testNames.xlsm")) { XSSFEvaluationWorkbook workbook = XSSFEvaluationWorkbook.create(wb); @@ -172,7 +172,7 @@ public class TestFormulaParser { // trivial case for bug 60219: FormulaParser can't parse external references when sheet name is quoted @Test - public void testParseExternalReferencesWithUnquotedSheetName() throws Exception { + void testParseExternalReferencesWithUnquotedSheetName() throws Exception { XSSFWorkbook wb = new XSSFWorkbook(); XSSFEvaluationWorkbook fpwb = XSSFEvaluationWorkbook.create(wb); Ptg[] ptgs = FormulaParser.parse("[1]Sheet1!A1", fpwb, FormulaType.CELL, -1); @@ -189,7 +189,7 @@ public class TestFormulaParser { // bug 60219: FormulaParser can't parse external references when sheet name is quoted @Test - public void testParseExternalReferencesWithQuotedSheetName() throws Exception { + void testParseExternalReferencesWithQuotedSheetName() throws Exception { XSSFWorkbook wb = new XSSFWorkbook(); XSSFEvaluationWorkbook fpwb = XSSFEvaluationWorkbook.create(wb); Ptg[] ptgs = FormulaParser.parse("'[1]Sheet 1'!A1", fpwb, FormulaType.CELL, -1); @@ -206,7 +206,7 @@ public class TestFormulaParser { // bug 60260 @Test - public void testUnicodeSheetName() { + void testUnicodeSheetName() { checkFormula("'Sheet\u30FB1'!A1:A6"); } } diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestStructuredReferences.java b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestStructuredReferences.java index f5d3de2b1e..9e7930737b 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestStructuredReferences.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/TestStructuredReferences.java @@ -48,7 +48,7 @@ public class TestStructuredReferences { * Test the regular expression used in INDIRECT() evaluation to recognize structured references */ @Test - public void testTableExpressionSyntax() { + void testTableExpressionSyntax() { assertTrue(Table.isStructuredReference.matcher("abc[col1]").matches(), "Valid structured reference syntax didn't match expression"); assertTrue(Table.isStructuredReference.matcher("_abc[col1]").matches(), "Valid structured reference syntax didn't match expression"); assertTrue(Table.isStructuredReference.matcher("_[col1]").matches(), "Valid structured reference syntax didn't match expression"); @@ -62,7 +62,7 @@ public class TestStructuredReferences { } @Test - public void testTableFormulas() throws Exception { + void testTableFormulas() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) { final FormulaEvaluator eval = new XSSFFormulaEvaluator(wb); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/CountifsTests.java b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/CountifsTests.java index 103c6814b5..f7fa9e8a50 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/CountifsTests.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/CountifsTests.java @@ -65,7 +65,7 @@ public class CountifsTests { * Basic call */ @Test - public void testCallFunction() { + void testCallFunction() { Sheet sheet = workbook.createSheet("test"); Row row1 = sheet.createRow(0); Cell cellA1 = row1.createCell(0, CellType.FORMULA); @@ -88,7 +88,7 @@ public class CountifsTests { * Test argument count check */ @Test - public void testCallFunction_invalidArgs() { + void testCallFunction_invalidArgs() { Sheet sheet = workbook.createSheet("test"); Row row1 = sheet.createRow(0); Cell cellA1 = row1.createCell(0, CellType.FORMULA); @@ -110,7 +110,7 @@ public class CountifsTests { * the bug returned the wrong count, this verifies the fix */ @Test - public void testBug56822() { + void testBug56822() { workbook = XSSFTestDataSamples.openSampleWorkbook("56822-Countifs.xlsx"); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); Cell cell = SheetUtil.getCell(workbook.getSheetAt(0), 0, 3); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestProper.java b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestProper.java index 2dde03663f..c1a80cb5a4 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestProper.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestProper.java @@ -40,7 +40,7 @@ public final class TestProper { private FormulaEvaluator evaluator; @Test - public void testValidHSSF() { + void testValidHSSF() { HSSFWorkbook wb = new HSSFWorkbook(); evaluator = new HSSFFormulaEvaluator(wb); @@ -48,7 +48,7 @@ public final class TestProper { } @Test - public void testValidXSSF() { + void testValidXSSF() { XSSFWorkbook wb = new XSSFWorkbook(); evaluator = new XSSFFormulaEvaluator(wb); @@ -99,7 +99,7 @@ public final class TestProper { } @Test - public void test() { + void test() { checkProper("", ""); checkProper("a", "A"); checkProper("abc", "Abc"); @@ -118,7 +118,7 @@ public final class TestProper { } @Test - public void testMicroBenchmark() { + void testMicroBenchmark() { ValueEval strArg = new StringEval("some longer text that needs a number of replacements to check for runtime of different implementations"); // long start = System.currentTimeMillis(); for(int i = 0;i < 300000;i++) { diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestSumifsXSSF.java b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestSumifsXSSF.java index e0783bf778..98d8c479f2 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestSumifsXSSF.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestSumifsXSSF.java @@ -39,7 +39,7 @@ public class TestSumifsXSSF { * handle null cell predicate */ @Test - public void testBug60858() throws IOException { + void testBug60858() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("bug60858.xlsx")) { FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestVlookup.java b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestVlookup.java index e6b7d73794..564e1a08ed 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestVlookup.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/formula/functions/TestVlookup.java @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; public class TestVlookup { @Test - public void testFullColumnAreaRef61841() throws IOException { + void testFullColumnAreaRef61841() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("VLookupFullColumn.xlsx")) { FormulaEvaluator feval = wb.getCreationHelper().createFormulaEvaluator(); feval.evaluateAll(); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/BaseTestXCell.java b/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/BaseTestXCell.java index 294f14337a..f43609c392 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/BaseTestXCell.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/BaseTestXCell.java @@ -45,7 +45,7 @@ public abstract class BaseTestXCell extends BaseTestCell { } @Test - public void testXmlEncoding() throws IOException { + void testXmlEncoding() throws IOException { Workbook wb1 = _testDataProvider.createWorkbook(); Sheet sh = wb1.createSheet(); Row row = sh.createRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/ConditionalFormattingEvalTest.java b/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/ConditionalFormattingEvalTest.java index 71847270ef..d0e960cc7e 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/ConditionalFormattingEvalTest.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/ConditionalFormattingEvalTest.java @@ -66,7 +66,7 @@ public class ConditionalFormattingEvalTest { } @Test - public void testFormattingEvaluation() { + void testFormattingEvaluation() { sheet = wb.getSheet("Products1"); getRulesFor(12, 1); @@ -142,7 +142,7 @@ public class ConditionalFormattingEvalTest { } @Test - public void testFormattingOnUndefinedCell() { + void testFormattingOnUndefinedCell() { wb = XSSFTestDataSamples.openSampleWorkbook("conditional_formatting_with_formula_on_second_sheet.xlsx"); formulaEval = new XSSFFormulaEvaluator(wb); cfe = new ConditionalFormattingEvaluator(wb, formulaEval); @@ -154,7 +154,7 @@ public class ConditionalFormattingEvalTest { } @Test - public void testRepeatedEval() { + void testRepeatedEval() { wb = XSSFTestDataSamples.openSampleWorkbook("test_conditional_formatting.xlsx"); formulaEval = new XSSFFormulaEvaluator(wb); cfe = new ConditionalFormattingEvaluator(wb, formulaEval); @@ -167,7 +167,7 @@ public class ConditionalFormattingEvalTest { } @Test - public void testCellValueIsWrongType() { + void testCellValueIsWrongType() { wb = XSSFTestDataSamples.openSampleWorkbook("conditional_formatting_cell_is.xlsx"); formulaEval = new XSSFFormulaEvaluator(wb); cfe = new ConditionalFormattingEvaluator(wb, formulaEval); @@ -178,7 +178,7 @@ public class ConditionalFormattingEvalTest { } @Test - public void testRangeCondition() { + void testRangeCondition() { wb = XSSFTestDataSamples.openSampleWorkbook("conditional_formatting_multiple_ranges.xlsx"); formulaEval = new XSSFFormulaEvaluator(wb); cfe = new ConditionalFormattingEvaluator(wb, formulaEval); diff --git a/src/ooxml/testcases/org/apache/poi/util/tests/TestIdentifierManager.java b/src/ooxml/testcases/org/apache/poi/util/tests/TestIdentifierManager.java index aac5a2acf5..4ec87d9362 100644 --- a/src/ooxml/testcases/org/apache/poi/util/tests/TestIdentifierManager.java +++ b/src/ooxml/testcases/org/apache/poi/util/tests/TestIdentifierManager.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public class TestIdentifierManager { @Test - public void testBasic() + void testBasic() { IdentifierManager manager = new IdentifierManager(0L,100L); assertEquals(101L,manager.getRemainingIdentifiers()); @@ -39,7 +39,7 @@ public class TestIdentifierManager { } @Test - public void testLongLimits() { + void testLongLimits() { long min = IdentifierManager.MIN_ID; long max = IdentifierManager.MAX_ID; IdentifierManager manager = new IdentifierManager(min,max); @@ -53,7 +53,7 @@ public class TestIdentifierManager { } @Test - public void testReserve() { + void testReserve() { IdentifierManager manager1 = new IdentifierManager(10L, 30L); assertEquals(12L, manager1.reserve(12L)); long reserve = manager1.reserve(12L); @@ -73,7 +73,7 @@ public class TestIdentifierManager { } @Test - public void testReserveNew() { + void testReserveNew() { IdentifierManager manager = new IdentifierManager(10L,12L); assertSame(10L,manager.reserveNew()); assertSame(11L,manager.reserveNew()); @@ -82,7 +82,7 @@ public class TestIdentifierManager { } @Test - public void testRelease() { + void testRelease() { IdentifierManager manager = new IdentifierManager(10L,20L); assertEquals(10L,manager.reserve(10L)); assertEquals(11L,manager.reserve(11L)); diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java index f318f998d5..700785ab1e 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java @@ -32,7 +32,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.*; public class TestNecessaryOOXMLClasses { @Test - public void testProblemClasses() { + void testProblemClasses() { CTXYAdjustHandle ctxyAdjustHandle = CTXYAdjustHandle.Factory.newInstance(); assertNotNull(ctxyAdjustHandle); CTPolarAdjustHandle ctPolarAdjustHandle = CTPolarAdjustHandle.Factory.newInstance(); diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestXDDFColor.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestXDDFColor.java index fc9f9c0f89..cf8145ec46 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestXDDFColor.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestXDDFColor.java @@ -41,7 +41,7 @@ public class TestXDDFColor { private static final String XMLNS = "xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"/>"; @Test - public void testSchemeColor() throws IOException { + void testSchemeColor() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFTheme theme = ppt.createSlide().getTheme(); @@ -72,7 +72,7 @@ public class TestXDDFColor { } @Test - public void testPreset() { + void testPreset() { CTColor xml = CTColor.Factory.newInstance(); xml.addNewPrstClr().setVal(STPresetColorVal.AQUAMARINE); XDDFColor color = XDDFColor.forColorContainer(xml); @@ -83,7 +83,7 @@ public class TestXDDFColor { } @Test - public void testSystemDefined() { + void testSystemDefined() { CTColor xml = CTColor.Factory.newInstance(); CTSystemColor sys = xml.addNewSysClr(); sys.setVal(STSystemColorVal.CAPTION_TEXT); @@ -99,7 +99,7 @@ public class TestXDDFColor { } @Test - public void testRgbBinary() { + void testRgbBinary() { CTColor xml = CTColor.Factory.newInstance(); CTSRgbColor color = xml.addNewSrgbClr(); byte[] bs = new byte[]{-1, -1, -1}; @@ -114,7 +114,7 @@ public class TestXDDFColor { } @Test - public void testRgbPercent() { + void testRgbPercent() { CTColor xml = CTColor.Factory.newInstance(); CTScRgbColor color = xml.addNewScrgbClr(); color.setR(0); diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java index fcd55bd090..efb5ad7e39 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java @@ -28,7 +28,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace; public class TestXDDFChart { @Test - public void testConstruct() { + void testConstruct() { // minimal test to cause ooxml-lite to include all the classes in poi-ooxml-lite XDDFChart xddfChart = newXDDFChart(); @@ -37,7 +37,7 @@ public class TestXDDFChart { } @Test - public void testSetExternalId() { + void testSetExternalId() { XDDFChart xddfChart = newXDDFChart(); CTChartSpace ctChartSpace = xddfChart.getCTChartSpace(); diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java index f4991ef013..84b02fe509 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java @@ -140,7 +140,7 @@ public class TestXDDFChartRemoveSeries { * This used to corrupt the workbook but the returned List is unmodifiable. */ @Test - public void testRemoveSeries0() { + void testRemoveSeries0() { procName = "testRemoveSeries0"; fileName = procName + ".xlsx"; @@ -157,7 +157,7 @@ public class TestXDDFChartRemoveSeries { * This will not corrupt the workbook. */ @Test - public void testBugFixRemoveSeries0() { + void testBugFixRemoveSeries0() { procName = "testBugFixRemoveSeries0"; fileName = procName + ".xlsx"; @@ -171,7 +171,7 @@ public class TestXDDFChartRemoveSeries { * This will not corrupt the workbook. */ @Test - public void testBugFixRemoveSeries1() { + void testBugFixRemoveSeries1() { procName = "testBugFixRemoveSeries1"; fileName = procName + ".xlsx"; @@ -183,7 +183,7 @@ public class TestXDDFChartRemoveSeries { * Do not remove any series from the chart. */ @Test - public void testDontRemoveSeries() { + void testDontRemoveSeries() { procName = "testDontRemoveSeries"; fileName = procName + ".xlsx"; } diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFDataSourcesFactory.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFDataSourcesFactory.java index 67e8fd01b7..b512d1dd1d 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFDataSourcesFactory.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFDataSourcesFactory.java @@ -48,7 +48,7 @@ public class TestXDDFDataSourcesFactory { }; @Test - public void testNumericArrayDataSource() { + void testNumericArrayDataSource() { Double[] doubles = new Double[]{1.0, 2.0, 3.0, 4.0, 5.0}; XDDFDataSource doubleDataSource = XDDFDataSourcesFactory.fromArray(doubles, null); assertTrue(doubleDataSource.isNumeric()); @@ -57,7 +57,7 @@ public class TestXDDFDataSourcesFactory { } @Test - public void testStringArrayDataSource() { + void testStringArrayDataSource() { String[] strings = new String[]{"one", "two", "three", "four", "five"}; XDDFDataSource stringDataSource = XDDFDataSourcesFactory.fromArray(strings, null); assertFalse(stringDataSource.isNumeric()); @@ -66,7 +66,7 @@ public class TestXDDFDataSourcesFactory { } @Test - public void testNumericCellDataSource() { + void testNumericCellDataSource() { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, numericCells).build(); CellRangeAddress numCellRange = CellRangeAddress.valueOf("A2:E2"); @@ -81,7 +81,7 @@ public class TestXDDFDataSourcesFactory { } @Test - public void testStringCellDataSource() { + void testStringCellDataSource() { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, stringCells).build(); CellRangeAddress numCellRange = CellRangeAddress.valueOf("A2:E2"); @@ -95,7 +95,7 @@ public class TestXDDFDataSourcesFactory { } @Test - public void testMixedCellDataSource() { + void testMixedCellDataSource() { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, mixedCells).build(); CellRangeAddress mixedCellRange = CellRangeAddress.valueOf("A1:F1"); @@ -114,7 +114,7 @@ public class TestXDDFDataSourcesFactory { } @Test - public void testIOBExceptionOnInvalidIndex() { + void testIOBExceptionOnInvalidIndex() { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, numericCells).build(); CellRangeAddress rangeAddress = CellRangeAddress.valueOf("A2:E2"); diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextBodyProperties.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextBodyProperties.java index 4c865f4f3e..cf9cdd00b8 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextBodyProperties.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextBodyProperties.java @@ -29,7 +29,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties; public class TestXDDFTextBodyProperties { @Test - public void testProperties() throws IOException { + void testProperties() throws IOException { XDDFTextBody text = new XDDFTextBody(null); text.initialize(); XDDFBodyProperties body = text.getBodyProperties(); diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextRun.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextRun.java index 5e096afb55..80314f1f17 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextRun.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/text/TestXDDFTextRun.java @@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test; public class TestXDDFTextRun { @Test - public void testTextRunPropertiesInSlide() throws IOException { + void testTextRunPropertiesInSlide() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); XSLFTextShape sh = slide.createAutoShape(); @@ -87,7 +87,7 @@ public class TestXDDFTextRun { } @Test - public void testTextRunPropertiesInSheet() throws IOException { + void testTextRunPropertiesInSheet() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -139,7 +139,7 @@ public class TestXDDFTextRun { } @Test - public void testDefaultRunProperties() throws IOException { + void testDefaultRunProperties() throws IOException { // bug #63290 POIDataSamples pds = POIDataSamples.getSlideShowInstance(); try (InputStream is = pds.openResourceAsStream("bug63290.pptx"); diff --git a/src/ooxml/testcases/org/apache/poi/xdgf/extractor/TestXDGFVisioExtractor.java b/src/ooxml/testcases/org/apache/poi/xdgf/extractor/TestXDGFVisioExtractor.java index e8f5f06f01..24471d440f 100644 --- a/src/ooxml/testcases/org/apache/poi/xdgf/extractor/TestXDGFVisioExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xdgf/extractor/TestXDGFVisioExtractor.java @@ -50,7 +50,7 @@ public class TestXDGFVisioExtractor { } @Test - public void testGetSimpleText() throws IOException { + void testGetSimpleText() throws IOException { new XDGFVisioExtractor(xml).close(); new XDGFVisioExtractor(pkg).close(); @@ -68,7 +68,7 @@ public class TestXDGFVisioExtractor { //the point of this is to trigger the addition of //some common visio classes -- ConnectsType @Test - public void testVisioConnects() throws IOException { + void testVisioConnects() throws IOException { InputStream is = SAMPLES.openResourceAsStream("60489.vsdx"); XmlVisioDocument document = new XmlVisioDocument(is); is.close(); @@ -86,7 +86,7 @@ public class TestXDGFVisioExtractor { * at org.apache.poi.xdgf.usermodel.section.geometry.GeometryRowFactory.load */ @Test - public void testPolylineTo() throws IOException { + void testPolylineTo() throws IOException { InputStream is = SAMPLES.openResourceAsStream("60973.vsdx"); XmlVisioDocument document = new XmlVisioDocument(is); is.close(); diff --git a/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java b/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java index 93977e9ddd..03d739d83e 100644 --- a/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java +++ b/src/ooxml/testcases/org/apache/poi/xdgf/usermodel/section/CombinedIteratorTest.java @@ -42,7 +42,7 @@ public class CombinedIteratorTest { } @Test - public void testNullMaster() { + void testNullMaster() { SortedMap base = new TreeMap<>(); base.put(1L, "B1"); @@ -54,7 +54,7 @@ public class CombinedIteratorTest { } @Test - public void testNoMatchesBaseFirst() { + void testNoMatchesBaseFirst() { SortedMap base = new TreeMap<>(); base.put(1L, "B1"); @@ -71,7 +71,7 @@ public class CombinedIteratorTest { } @Test - public void testNoMatchesMasterFirst() { + void testNoMatchesMasterFirst() { SortedMap base = new TreeMap<>(); base.put(4L, "B4"); @@ -88,7 +88,7 @@ public class CombinedIteratorTest { } @Test - public void testInterleaved1() { + void testInterleaved1() { SortedMap base = new TreeMap<>(); base.put(1L, "B1"); @@ -105,7 +105,7 @@ public class CombinedIteratorTest { } @Test - public void testInterleaved2() { + void testInterleaved2() { SortedMap base = new TreeMap<>(); base.put(1L, "B1"); @@ -124,7 +124,7 @@ public class CombinedIteratorTest { } @Test - public void testAllMatching() { + void testAllMatching() { SortedMap base = new TreeMap<>(); base.put(1L, "B1"); @@ -141,7 +141,7 @@ public class CombinedIteratorTest { } @Test - public void testAllMatching2() { + void testAllMatching2() { SortedMap base = new TreeMap<>(); base.put(1L, "B1"); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/TestNecessaryOOXMLClasses.java b/src/ooxml/testcases/org/apache/poi/xslf/TestNecessaryOOXMLClasses.java index 244b511ff0..7dc7ed7876 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/TestNecessaryOOXMLClasses.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/TestNecessaryOOXMLClasses.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public class TestNecessaryOOXMLClasses { @Test - public void testProblemClasses() { + void testProblemClasses() { List> sup = Arrays.asList( org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderSize.Factory::newInstance, org.openxmlformats.schemas.presentationml.x2006.main.CTHeaderFooter.Factory::newInstance diff --git a/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java b/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java index c95d074b3f..91178e0326 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java @@ -558,7 +558,7 @@ public class TestXSLFBugs { * that image10.foo isn't between image1.foo and image2.foo */ @Test - public void test57552() throws Exception { + void test57552() throws Exception { XMLSlideShow ss = new XMLSlideShow(); for (String s : new String[]{"Slide1", "Slide2"}) { ss.createSlide().createTextBox().setText(s); @@ -888,7 +888,7 @@ public class TestXSLFBugs { } @Test - public void test60810() throws IOException { + void test60810() throws IOException { XMLSlideShow ppt = openSampleDocument("60810.pptx"); for (XSLFSlide slide : ppt.getSlides()) { XSLFNotes notesSlide = ppt.getNotesSlide(slide); @@ -899,7 +899,7 @@ public class TestXSLFBugs { } @Test - public void test60042() throws IOException { + void test60042() throws IOException { try (XMLSlideShow ppt = openSampleDocument("60042.pptx")) { ppt.removeSlide(0); ppt.createSlide(); @@ -908,7 +908,7 @@ public class TestXSLFBugs { } @Test - public void test61515() throws IOException { + void test61515() throws IOException { try (XMLSlideShow ppt = openSampleDocument("61515.pptx")) { ppt.removeSlide(0); assertEquals(1, ppt.createSlide().getRelations().size()); @@ -921,7 +921,7 @@ public class TestXSLFBugs { } @Test - public void testAptia() throws IOException { + void testAptia() throws IOException { try (XMLSlideShow ppt = openSampleDocument("aptia.pptx"); XMLSlideShow saved = XSLFTestDataSamples.writeOutAndReadBack(ppt)) { assertEquals(ppt.getSlides().size(), saved.getSlides().size()); @@ -930,7 +930,7 @@ public class TestXSLFBugs { @Disabled @Test - public void testDivinoRevelado() throws IOException { + void testDivinoRevelado() throws IOException { try (XMLSlideShow ppt = openSampleDocument("Divino_Revelado.pptx"); XMLSlideShow saved = XSLFTestDataSamples.writeOutAndReadBack(ppt)) { assertEquals(ppt.getSlides().size(), saved.getSlides().size()); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java b/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java index c6179fa095..c724064af9 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java @@ -57,7 +57,7 @@ public class TestXSLFSlideShow { } @Test - public void testContainsMainContentType() throws Exception { + void testContainsMainContentType() throws Exception { boolean found = false; for(PackagePart part : pack.getParts()) { if(part.getContentType().equals(XSLFRelation.MAIN.getContentType())) { @@ -68,7 +68,7 @@ public class TestXSLFSlideShow { } @Test - public void testOpen() throws IOException, OpenXML4JException, XmlException { + void testOpen() throws IOException, OpenXML4JException, XmlException { // With the finalized uri, should be fine XSLFSlideShow xml = new XSLFSlideShow(pack); // Check the core @@ -82,7 +82,7 @@ public class TestXSLFSlideShow { } @Test - public void testSlideBasics() throws IOException, OpenXML4JException, XmlException { + void testSlideBasics() throws IOException, OpenXML4JException, XmlException { XSLFSlideShow xml = new XSLFSlideShow(pack); // Should have 1 master @@ -119,7 +119,7 @@ public class TestXSLFSlideShow { } @Test - public void testMetadataBasics() throws IOException, OpenXML4JException, XmlException { + void testMetadataBasics() throws IOException, OpenXML4JException, XmlException { XSLFSlideShow xml = new XSLFSlideShow(pack); assertNotNull(xml.getProperties().getCoreProperties()); @@ -138,7 +138,7 @@ public class TestXSLFSlideShow { } @Test - public void testMasterBackground() throws IOException { + void testMasterBackground() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFBackground b = ppt.getSlideMasters().get(0).getBackground(); b.setFillColor(Color.RED); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java b/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java index f8459a89c5..7b2f7ed83b 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java @@ -46,7 +46,7 @@ public class TestXSLFPowerPointExtractor { * Get text out of the simple file */ @Test - public void testGetSimpleText() throws IOException { + void testGetSimpleText() throws IOException { try (XMLSlideShow xmlA = openPPTX("sample.pptx"); SlideShowExtractor extractor = new SlideShowExtractor<>(xmlA)) { @@ -158,7 +158,7 @@ public class TestXSLFPowerPointExtractor { } @Test - public void testGetComments() throws IOException { + void testGetComments() throws IOException { try (XMLSlideShow xml = openPPTX("45545_Comment.pptx"); SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { extractor.setCommentsByDefault(true); @@ -176,7 +176,7 @@ public class TestXSLFPowerPointExtractor { } @Test - public void testGetMasterText() throws Exception { + void testGetMasterText() throws Exception { try (XMLSlideShow xml = openPPTX("WithMaster.pptx"); SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { extractor.setSlidesByDefault(true); @@ -213,7 +213,7 @@ public class TestXSLFPowerPointExtractor { } @Test - public void testTable() throws Exception { + void testTable() throws Exception { try (XMLSlideShow xml = openPPTX("present1.pptx"); SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { @@ -231,7 +231,7 @@ public class TestXSLFPowerPointExtractor { * well as from the normal file */ @Test - public void testDifferentSubformats() throws Exception { + void testDifferentSubformats() throws Exception { String[] extensions = new String[] { "pptx", "pptm", "ppsm", "ppsx", "thmx", // "xps" - Doesn't have a core document @@ -260,7 +260,7 @@ public class TestXSLFPowerPointExtractor { } @Test - public void test45541() throws IOException { + void test45541() throws IOException { // extract text from a powerpoint that has a header in the notes-element final File headerFile = slTests.getFile("45541_Header.pptx"); //noinspection rawtypes diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXMLSlideShow.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXMLSlideShow.java index 3e529ed96e..93067fd436 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXMLSlideShow.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXMLSlideShow.java @@ -56,7 +56,7 @@ public class TestXMLSlideShow extends BaseTestSlideShow data = findChartData(chart); @@ -78,7 +78,7 @@ public class TestXSLFChart { } @Test - public void testFillBarChartTemplate() throws IOException { + void testFillBarChartTemplate() throws IOException { XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("bar-chart.pptx"); XSLFSlide slide = pptx.getSlides().get(0); // duplicate slide and chart before applying "destructive" tests to it @@ -103,7 +103,7 @@ public class TestXSLFChart { } @Test - public void testFillLineChartTemplate() throws IOException { + void testFillLineChartTemplate() throws IOException { XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("line-chart.pptx"); XSLFChart chart = findChart(pptx.getSlides().get(0)); List data = findChartData(chart); @@ -118,7 +118,7 @@ public class TestXSLFChart { } @Test - public void testFillRadarChartTemplate() throws IOException { + void testFillRadarChartTemplate() throws IOException { XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("radar-chart.pptx"); XSLFChart chart = findChart(pptx.getSlides().get(0)); List data = findChartData(chart); @@ -133,7 +133,7 @@ public class TestXSLFChart { } @Test - public void testFillScatterChartTemplate() throws IOException { + void testFillScatterChartTemplate() throws IOException { XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("scatter-chart.pptx"); XSLFChart chart = findChart(pptx.getSlides().get(0)); List data = findChartData(chart); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFColor.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFColor.java index 1a870c59ac..b73cbc11ec 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFColor.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFColor.java @@ -35,7 +35,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STSystemColorVal; public class TestXSLFColor { @Test - public void testGetters() { + void testGetters() { CTColor xml = CTColor.Factory.newInstance(); CTSRgbColor c = xml.addNewSrgbClr(); c.setVal(new byte[]{(byte)0xFF, 0, 0}); @@ -96,7 +96,7 @@ public class TestXSLFColor { } @Test - public void testHSL() { + void testHSL() { CTColor xml = CTColor.Factory.newInstance(); CTHslColor c = xml.addNewHslClr(); c.setHue2(14400000); @@ -108,7 +108,7 @@ public class TestXSLFColor { } @Test - public void testSRgb() { + void testSRgb() { CTColor xml = CTColor.Factory.newInstance(); xml.addNewSrgbClr().setVal(new byte[]{ (byte)0xFF, (byte)0xFF, 0}); @@ -117,7 +117,7 @@ public class TestXSLFColor { } @Test - public void testSchemeColor() throws IOException { + void testSchemeColor() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSheet slide = ppt.createSlide(); XSLFTheme theme = slide.getTheme(); @@ -145,7 +145,7 @@ public class TestXSLFColor { } @Test - public void testPresetColor() { + void testPresetColor() { CTColor xml = CTColor.Factory.newInstance(); xml.addNewPrstClr().setVal(STPresetColorVal.AQUAMARINE); XSLFColor color = new XSLFColor(xml, null, null, null); @@ -169,7 +169,7 @@ public class TestXSLFColor { } @Test - public void testSys() { + void testSys() { CTColor xml = CTColor.Factory.newInstance(); CTSystemColor sys = xml.addNewSysClr(); sys.setVal(STSystemColorVal.CAPTION_TEXT); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java index 19c620bc3b..5b6d5eee9e 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java @@ -41,7 +41,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector; public class TestXSLFConnectorShape { @Test - public void testLineDecorations() throws IOException { + void testLineDecorations() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); @@ -122,7 +122,7 @@ public class TestXSLFConnectorShape { } @Test - public void testAddConnector() throws IOException { + void testAddConnector() throws IOException { try (XMLSlideShow pptx = new XMLSlideShow()) { XSLFSlide slide = pptx.createSlide(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFFreeformShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFFreeformShape.java index 28055881ce..3972041508 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFFreeformShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFFreeformShape.java @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class TestXSLFFreeformShape { @Test - public void testSetPath() throws IOException { + void testSetPath() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFFreeformShape shape1 = slide.createFreeform(); @@ -63,7 +63,7 @@ public class TestXSLFFreeformShape { } @Test - public void testZeroWidth() throws IOException { + void testZeroWidth() throws IOException { // see #61633 try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFGroupShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFGroupShape.java index 7ebf9c2960..ae0be875d6 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFGroupShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFGroupShape.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; public class TestXSLFGroupShape { @Test - public void testCreateShapes() throws Exception { + void testCreateShapes() throws Exception { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); @@ -87,7 +87,7 @@ public class TestXSLFGroupShape { } @Test - public void testRemoveShapes() throws Exception { + void testRemoveShapes() throws Exception { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java index 734e0e5c3e..74969f6fdf 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFHyperlink.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public class TestXSLFHyperlink { @Test - public void testRead() throws IOException{ + void testRead() throws IOException{ XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx"); XSLFSlide slide = ppt.getSlides().get(4); @@ -61,7 +61,7 @@ public class TestXSLFHyperlink { } @Test - public void testCreate() throws IOException, InvalidFormatException { + void testCreate() throws IOException, InvalidFormatException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide1 = ppt.createSlide(); XSLFSlide slide2 = ppt.createSlide(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java index ff44c00cb6..355c206fba 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFPictureShape.java @@ -49,7 +49,7 @@ public class TestXSLFPictureShape { private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); @Test - public void testCreate() throws Exception { + void testCreate() throws Exception { XMLSlideShow ppt1 = new XMLSlideShow(); assertEquals(0, ppt1.getPictureData().size()); byte[] data1 = new byte[100]; @@ -86,7 +86,7 @@ public class TestXSLFPictureShape { } @Test - public void testCreateMultiplePictures() throws Exception { + void testCreateMultiplePictures() throws Exception { XMLSlideShow ppt1 = new XMLSlideShow(); XSLFSlide slide1 = ppt1.createSlide(); XSLFGroupShape group1 = slide1.createGroup(); @@ -139,7 +139,7 @@ public class TestXSLFPictureShape { } @Test - public void testImageCaching() throws Exception { + void testImageCaching() throws Exception { XMLSlideShow ppt = new XMLSlideShow(); byte[] img1 = new byte[]{1,2,3}; byte[] img2 = new byte[]{3,4,5}; @@ -160,7 +160,7 @@ public class TestXSLFPictureShape { } @Test - public void testMerge() throws Exception { + void testMerge() throws Exception { XMLSlideShow ppt1 = new XMLSlideShow(); byte[] data1 = new byte[100]; XSLFPictureData pdata1 = ppt1.addPicture(data1, PictureType.JPEG); @@ -241,7 +241,7 @@ public class TestXSLFPictureShape { } @Test - public void testTiffImageBug59742() throws Exception { + void testTiffImageBug59742() throws Exception { XMLSlideShow slideShow = new XMLSlideShow(); final InputStream tiffStream = _slTests.openResourceAsStream("testtiff.tif"); final byte[] pictureData = IOUtils.toByteArray(tiffStream); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShape.java index 502f0eba1e..a426640c74 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShape.java @@ -30,7 +30,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STTextUnderlineType; public class TestXSLFShape { @Test - public void testReadTextShapes() throws IOException { + void testReadTextShapes() throws IOException { XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx"); List slides = ppt.getSlides(); @@ -84,7 +84,7 @@ public class TestXSLFShape { } @Test - public void testProblemFile() throws IOException { + void testProblemFile() throws IOException { try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("ececapstonespring2012.pptx")) { List slides = ppt.getSlides(); assertEquals(24, slides.size()); @@ -92,7 +92,7 @@ public class TestXSLFShape { } @Test - public void testCreateShapes() throws IOException { + void testCreateShapes() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); assertTrue(slide.getShapes().isEmpty()); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShapeContainer.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShapeContainer.java index 865f95fa4e..46524349c5 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShapeContainer.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShapeContainer.java @@ -50,7 +50,7 @@ public class TestXSLFShapeContainer { } @Test - public void testSheet() throws IOException { + void testSheet() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSheet sheet = ppt.createSlide(); verifyContainer(sheet); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSheet.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSheet.java index a81c3baf9d..f7526f1bb0 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSheet.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public class TestXSLFSheet { @Test - public void testCreateShapes() throws IOException { + void testCreateShapes() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); assertTrue(slide.getShapes().isEmpty()); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java index c96c7eecbb..4b2f777abe 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java @@ -50,7 +50,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType; public class TestXSLFSimpleShape { @Test - public void testLineStyles() throws IOException { + void testLineStyles() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); @@ -141,7 +141,7 @@ public class TestXSLFSimpleShape { } @Test - public void testFill() throws IOException { + void testFill() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); @@ -167,7 +167,7 @@ public class TestXSLFSimpleShape { } @Test - public void testDefaultProperties() throws IOException { + void testDefaultProperties() throws IOException { try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx")) { XSLFSlide slide6 = ppt.getSlides().get(5); List shapes = slide6.getShapes(); @@ -236,7 +236,7 @@ public class TestXSLFSimpleShape { } @Test - public void testAnchor() throws IOException { + void testAnchor() throws IOException { try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx")) { List slide = ppt.getSlides(); @@ -270,7 +270,7 @@ public class TestXSLFSimpleShape { @SuppressWarnings({"unused", "deprecation"}) @Test - public void testShadowEffects() throws IOException{ + void testShadowEffects() throws IOException{ try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); CTStyleMatrix styleMatrix = slide.getTheme().getXmlObject().getThemeElements().getFmtScheme(); @@ -283,7 +283,7 @@ public class TestXSLFSimpleShape { } @Test - public void testValidGeometry() throws Exception { + void testValidGeometry() throws Exception { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); @@ -305,7 +305,7 @@ public class TestXSLFSimpleShape { } @Test - public void testArrayStoreException() throws Exception { + void testArrayStoreException() throws Exception { File tmpDir = new File("build/tmp/"); // fix maven build errors diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlide.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlide.java index b7dbf9f685..08e5ae9262 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlide.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlide.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public class TestXSLFSlide { @Test - public void testReadShapes() throws IOException { + void testReadShapes() throws IOException { XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx"); List slides = ppt.getSlides(); @@ -107,7 +107,7 @@ public class TestXSLFSlide { } @Test - public void testCreateSlide() throws IOException { + void testCreateSlide() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); assertEquals(0, ppt.getSlides().size()); @@ -122,7 +122,7 @@ public class TestXSLFSlide { } @Test - public void testImportContent() throws IOException { + void testImportContent() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XMLSlideShow src = XSLFTestDataSamples.openSampleDocument("themes.pptx"); @@ -180,7 +180,7 @@ public class TestXSLFSlide { } @Test - public void testMergeSlides() throws IOException { + void testMergeSlides() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); String[] pptx = {"shapes.pptx", "themes.pptx", "layouts.pptx", "backgrounds.pptx"}; @@ -197,7 +197,7 @@ public class TestXSLFSlide { } @Test - public void testCreateChart() throws IOException { + void testCreateChart() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFChart chart = ppt.createChart(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java index e9e35bd9b7..9e6d00e2af 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; */ public class TestXSLFSlideShow { @Test - public void testCreateSlide() throws IOException { + void testCreateSlide() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); assertEquals(0, ppt.getSlides().size()); @@ -62,7 +62,7 @@ public class TestXSLFSlideShow { } @Test - public void testRemoveSlide() throws IOException { + void testRemoveSlide() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); assertEquals(0, ppt.getSlides().size()); @@ -87,7 +87,7 @@ public class TestXSLFSlideShow { } @Test - public void testDimension() throws IOException { + void testDimension() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); Dimension sz = ppt.getPageSize(); assertEquals(720, sz.width); @@ -100,7 +100,7 @@ public class TestXSLFSlideShow { } @Test - public void testSlideMasters() throws IOException { + void testSlideMasters() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); List masters = ppt.getSlideMasters(); assertEquals(1, masters.size()); @@ -111,7 +111,7 @@ public class TestXSLFSlideShow { } @Test - public void testSlideLayout() throws IOException { + void testSlideLayout() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); List masters = ppt.getSlideMasters(); assertEquals(1, masters.size()); @@ -125,7 +125,7 @@ public class TestXSLFSlideShow { } @Test - public void testSlideLayoutNames() throws IOException { + void testSlideLayoutNames() throws IOException { final String[] names = { "Blank", "Title Only", "Section Header", "Picture with Caption", "Title and Content" , "Title Slide", "Title and Vertical Text", "Vertical Title and Text", "Comparison" diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java index 94bddc9e4f..89436fcbf0 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java @@ -47,7 +47,7 @@ public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory { "The unit test needs to be updated by deleting the expected exception code. Status and close any related bugs."; @Test - public void testFactoryFromFile() { + void testFactoryFromFile() { // Remove thrown.* when bug 58779 is resolved // In the mean time, this function will modify SampleShow.pptx on disk. AssertionError ex = assertThrows(AssertionError.class, () -> testFactoryFromFile(filename), @@ -56,12 +56,12 @@ public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory { } @Test - public void testFactoryFromStream() throws Exception { + void testFactoryFromStream() throws Exception { testFactoryFromStream(filename); } @Test - public void testFactoryFromNative() { + void testFactoryFromNative() { // Remove thrown.* when unit test for XSLF SlideShowFactory.create(OPCPackage) is implemented UnsupportedOperationException ex = assertThrows(UnsupportedOperationException.class, () -> testFactoryFromNative(filename), removeExpectedExceptionMsg @@ -70,19 +70,19 @@ public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory { } @Test - public void testFactoryFromProtectedFile() throws Exception { + void testFactoryFromProtectedFile() throws Exception { File pFile = createProtected(); testFactoryFromProtectedFile(pFile.getAbsolutePath(), password); } @Test - public void testFactoryFromProtectedStream() throws Exception { + void testFactoryFromProtectedStream() throws Exception { File pFile = createProtected(); testFactoryFromProtectedStream(pFile.getAbsolutePath(), password); } @Test - public void testFactoryFromProtectedNative() throws Exception { + void testFactoryFromProtectedNative() throws Exception { File pFile = createProtected(); testFactoryFromProtectedNative(pFile.getAbsolutePath(), password); } diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java index 5b9ceedf1c..46263605ad 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java @@ -50,7 +50,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFra public class TestXSLFTable { @Test - public void testResize() throws Exception { + void testResize() throws Exception { String[][] data = getDummyData(20); final int maxHeight = 400; @@ -159,7 +159,7 @@ public class TestXSLFTable { @Test - public void testRead() throws IOException { + void testRead() throws IOException { XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx"); XSLFSlide slide = ppt.getSlides().get(3); @@ -201,7 +201,7 @@ public class TestXSLFTable { } @Test - public void testCreate() throws IOException { + void testCreate() throws IOException { XMLSlideShow ppt1 = new XMLSlideShow(); XSLFSlide slide = ppt1.createSlide(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableRow.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableRow.java index c9338715ca..73c8103b40 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableRow.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableRow.java @@ -61,7 +61,7 @@ public class TestXSLFTableRow { } @Test - public void testHeight() { + void testHeight() { final double h = 10.0; row.setHeight(h); assertEquals(h, row.getHeight(), 1e-16); @@ -76,7 +76,7 @@ public class TestXSLFTableRow { } @Test - public void testIterator() { + void testIterator() { int i = 0; for (XSLFTableCell cell : row) { i++; diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableStyles.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableStyles.java index 5cf4843db5..eda61ee6d2 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableStyles.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTableStyles.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; public class TestXSLFTableStyles { @Test - public void testRead() throws IOException { + void testRead() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFTableStyles tblStyles = ppt.getTableStyles(); assertNotNull(tblStyles); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java index 475f26b17c..44969a3026 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java @@ -31,7 +31,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties public class TestXSLFTextBox { @Test - public void testPlaceholder() throws IOException { + void testPlaceholder() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); @@ -50,7 +50,7 @@ public class TestXSLFTextBox { * text box inherits default text proeprties from presentation.xml */ @Test - public void testDefaultTextStyle() throws IOException { + void testDefaultTextStyle() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java index 3ca8b173b6..d6d200871c 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java @@ -65,7 +65,7 @@ public class TestXSLFTextParagraph { } @Test - public void testWrappingWidth() throws IOException { + void testWrappingWidth() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFTextShape sh = slide.createAutoShape(); @@ -158,7 +158,7 @@ public class TestXSLFTextParagraph { * This test requires that the Arial font is available and will run only on windows */ @Test - public void testBreakLines() throws IOException { + void testBreakLines() throws IOException { String os = System.getProperty("os.name"); assumeTrue((os != null && os.contains("Windows")), "Skipping testBreakLines(), it is executed only on Windows machines"); @@ -250,7 +250,7 @@ public class TestXSLFTextParagraph { } @Test - public void testThemeInheritance() throws IOException { + void testThemeInheritance() throws IOException { XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("prProps.pptx"); List shapes = ppt.getSlides().get(0).getShapes(); XSLFTextShape sh1 = (XSLFTextShape)shapes.get(0); @@ -266,7 +266,7 @@ public class TestXSLFTextParagraph { } @Test - public void testParagraphProperties() throws IOException { + void testParagraphProperties() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFTextShape sh = slide.createAutoShape(); @@ -365,7 +365,7 @@ public class TestXSLFTextParagraph { } @Test - public void testLineBreak() throws IOException { + void testLineBreak() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); XSLFTextShape sh = slide.createAutoShape(); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java index e1558eb427..ae4ab6ceb1 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java @@ -42,7 +42,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; public class TestXSLFTextRun { @Test - public void testRunProperties() throws IOException { + void testRunProperties() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlide slide = ppt.createSlide(); XSLFTextShape sh = slide.createAutoShape(); @@ -87,7 +87,7 @@ public class TestXSLFTextRun { } @Test - public void testUnicodeSurrogates() throws Exception { + void testUnicodeSurrogates() throws Exception { final String unicodeSurrogates = "\uD835\uDF4A\uD835\uDF4B\uD835\uDF4C\uD835\uDF4D\uD835\uDF4E" + "\uD835\uDF4F\uD835\uDF50\uD835\uDF51\uD835\uDF52\uD835\uDF53\uD835\uDF54\uD835" + "\uDF55\uD835\uDF56\uD835\uDF57\uD835\uDF58\uD835\uDF59\uD835\uDF5A\uD835\uDF5B" @@ -109,7 +109,7 @@ public class TestXSLFTextRun { } @Test - public void testCopyNullFontSize() throws IOException { + void testCopyNullFontSize() throws IOException { try (XMLSlideShow ppt = new XMLSlideShow()) { XSLFSlide slide = ppt.createSlide(); XSLFTextShape sh = slide.createAutoShape(); @@ -125,7 +125,7 @@ public class TestXSLFTextRun { } @Test - public void testDefaultRunProperties() throws IOException { + void testDefaultRunProperties() throws IOException { // bug #63290 POIDataSamples pds = POIDataSamples.getSlideShowInstance(); try (InputStream is = pds.openResourceAsStream("bug63290.pptx"); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java index 2b8cc173de..3a33257511 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java @@ -65,7 +65,7 @@ public class TestXSLFTextShape { } @Test - public void testLayouts() throws IOException { + void testLayouts() throws IOException { XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("layouts.pptx"); List slide = ppt.getSlides(); @@ -663,7 +663,7 @@ public class TestXSLFTextShape { } @Test - public void testTitleStyles() throws IOException { + void testTitleStyles() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlideMaster master = ppt.getSlideMasters().get(0); @@ -746,7 +746,7 @@ public class TestXSLFTextShape { } @Test - public void testBodyStyles() throws IOException { + void testBodyStyles() throws IOException { XMLSlideShow ppt = new XMLSlideShow(); XSLFSlideMaster master = ppt.getSlideMasters().get(0); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTheme.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTheme.java index 38add3136a..2fbeceb0ba 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTheme.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTheme.java @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; */ public class TestXSLFTheme { @Test - public void testRead(){ + void testRead(){ XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("themes.pptx"); List slides = ppt.getSlides(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/TestNecessaryOOXMLClasses.java b/src/ooxml/testcases/org/apache/poi/xssf/TestNecessaryOOXMLClasses.java index 5938498387..f27bdf856c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/TestNecessaryOOXMLClasses.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/TestNecessaryOOXMLClasses.java @@ -27,7 +27,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetData; public class TestNecessaryOOXMLClasses { @Test - public void testProblemClasses() { + void testProblemClasses() { CTRow row = CTRow.Factory.newInstance(); CTSheetData sheetData = CTSheetData.Factory.newInstance(); // need to get the inner class that implements the row list class loaded diff --git a/src/ooxml/testcases/org/apache/poi/xssf/TestSheetProtection.java b/src/ooxml/testcases/org/apache/poi/xssf/TestSheetProtection.java index 23e1e65b4e..c03931a45f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/TestSheetProtection.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/TestSheetProtection.java @@ -43,7 +43,7 @@ public class TestSheetProtection { } @Test - public void testShouldReadWorkbookProtection() throws IOException { + void testShouldReadWorkbookProtection() throws IOException { assertFalse(sheet.isAutoFilterLocked()); assertFalse(sheet.isDeleteColumnsLocked()); assertFalse(sheet.isDeleteRowsLocked()); @@ -84,7 +84,7 @@ public class TestSheetProtection { } @Test - public void testWriteAutoFilter() { + void testWriteAutoFilter() { assertFalse(sheet.isAutoFilterLocked()); sheet.lockAutoFilter(true); assertFalse(sheet.isAutoFilterLocked()); @@ -95,7 +95,7 @@ public class TestSheetProtection { } @Test - public void testWriteDeleteColumns() { + void testWriteDeleteColumns() { assertFalse(sheet.isDeleteColumnsLocked()); sheet.lockDeleteColumns(true); assertFalse(sheet.isDeleteColumnsLocked()); @@ -106,7 +106,7 @@ public class TestSheetProtection { } @Test - public void testWriteDeleteRows() { + void testWriteDeleteRows() { assertFalse(sheet.isDeleteRowsLocked()); sheet.lockDeleteRows(true); assertFalse(sheet.isDeleteRowsLocked()); @@ -117,7 +117,7 @@ public class TestSheetProtection { } @Test - public void testWriteFormatCells() { + void testWriteFormatCells() { assertFalse(sheet.isFormatCellsLocked()); sheet.lockFormatCells(true); assertFalse(sheet.isFormatCellsLocked()); @@ -128,7 +128,7 @@ public class TestSheetProtection { } @Test - public void testWriteFormatColumns() { + void testWriteFormatColumns() { assertFalse(sheet.isFormatColumnsLocked()); sheet.lockFormatColumns(true); assertFalse(sheet.isFormatColumnsLocked()); @@ -139,7 +139,7 @@ public class TestSheetProtection { } @Test - public void testWriteFormatRows() { + void testWriteFormatRows() { assertFalse(sheet.isFormatRowsLocked()); sheet.lockFormatRows(true); assertFalse(sheet.isFormatRowsLocked()); @@ -150,7 +150,7 @@ public class TestSheetProtection { } @Test - public void testWriteInsertColumns() { + void testWriteInsertColumns() { assertFalse(sheet.isInsertColumnsLocked()); sheet.lockInsertColumns(true); assertFalse(sheet.isInsertColumnsLocked()); @@ -161,7 +161,7 @@ public class TestSheetProtection { } @Test - public void testWriteInsertHyperlinks() { + void testWriteInsertHyperlinks() { assertFalse(sheet.isInsertHyperlinksLocked()); sheet.lockInsertHyperlinks(true); assertFalse(sheet.isInsertHyperlinksLocked()); @@ -172,7 +172,7 @@ public class TestSheetProtection { } @Test - public void testWriteInsertRows() { + void testWriteInsertRows() { assertFalse(sheet.isInsertRowsLocked()); sheet.lockInsertRows(true); assertFalse(sheet.isInsertRowsLocked()); @@ -183,7 +183,7 @@ public class TestSheetProtection { } @Test - public void testWritePivotTables() { + void testWritePivotTables() { assertFalse(sheet.isPivotTablesLocked()); sheet.lockPivotTables(true); assertFalse(sheet.isPivotTablesLocked()); @@ -194,7 +194,7 @@ public class TestSheetProtection { } @Test - public void testWriteSort() { + void testWriteSort() { assertFalse(sheet.isSortLocked()); sheet.lockSort(true); assertFalse(sheet.isSortLocked()); @@ -205,7 +205,7 @@ public class TestSheetProtection { } @Test - public void testWriteObjects() { + void testWriteObjects() { assertFalse(sheet.isObjectsLocked()); sheet.lockObjects(true); assertFalse(sheet.isObjectsLocked()); @@ -216,7 +216,7 @@ public class TestSheetProtection { } @Test - public void testWriteScenarios() { + void testWriteScenarios() { assertFalse(sheet.isScenariosLocked()); sheet.lockScenarios(true); assertFalse(sheet.isScenariosLocked()); @@ -227,7 +227,7 @@ public class TestSheetProtection { } @Test - public void testWriteSelectLockedCells() { + void testWriteSelectLockedCells() { assertFalse(sheet.isSelectLockedCellsLocked()); sheet.lockSelectLockedCells(true); assertFalse(sheet.isSelectLockedCellsLocked()); @@ -238,7 +238,7 @@ public class TestSheetProtection { } @Test - public void testWriteSelectUnlockedCells() { + void testWriteSelectUnlockedCells() { assertFalse(sheet.isSelectUnlockedCellsLocked()); sheet.lockSelectUnlockedCells(true); assertFalse(sheet.isSelectUnlockedCellsLocked()); @@ -249,7 +249,7 @@ public class TestSheetProtection { } @Test - public void testWriteSelectEnableLocking() throws IOException { + void testWriteSelectEnableLocking() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("sheetProtection_allLocked.xlsx")) { sheet = workbook.getSheetAt(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/TestWorkbookProtection.java b/src/ooxml/testcases/org/apache/poi/xssf/TestWorkbookProtection.java index 8d81d71d90..092174f802 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/TestWorkbookProtection.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/TestWorkbookProtection.java @@ -169,7 +169,7 @@ public class TestWorkbookProtection { @SuppressWarnings("resource") @Test - public void testHashPassword() throws Exception { + void testHashPassword() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { wb.lockRevision(); wb.setRevisionsPassword("test", HashAlgorithm.sha1); @@ -184,7 +184,7 @@ public class TestWorkbookProtection { @SuppressWarnings("resource") @Test - public void testIntegration() throws Exception { + void testIntegration() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { wb.createSheet("Testing purpose sheet"); assertFalse(wb.isRevisionLocked()); @@ -201,7 +201,7 @@ public class TestWorkbookProtection { } @Test - public void testEncryptDecrypt() throws Exception { + void testEncryptDecrypt() throws Exception { final String password = "abc123"; final String sheetName = "TestSheet1"; final String cellValue = "customZipEntrySource"; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFCloneSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFCloneSheet.java index fb0404705e..659466f9aa 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFCloneSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFCloneSheet.java @@ -49,20 +49,20 @@ public class TestXSSFCloneSheet extends BaseTestCloneSheet { } @Test - public void testCloneSheetIntStringValidName() { + void testCloneSheetIntStringValidName() { XSSFSheet cloned = wb.cloneSheet(0, OTHER_SHEET_NAME); assertEquals(OTHER_SHEET_NAME, cloned.getSheetName()); assertEquals(2, wb.getNumberOfSheets()); } @Test - public void testCloneSheetIntStringInvalidName() { + void testCloneSheetIntStringInvalidName() { assertThrows(IllegalArgumentException.class, () -> wb.cloneSheet(0, VALID_SHEET_NAME)); assertEquals(1, wb.getNumberOfSheets()); } @Test - public void test60512() throws IOException { + void test60512() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60512.xlsm"); assertEquals(1, wb.getNumberOfSheets()); @@ -79,7 +79,7 @@ public class TestXSSFCloneSheet extends BaseTestCloneSheet { } @Test - public void test61605() throws IOException { + void test61605() throws IOException { try (Workbook template_wb = XSSFTestDataSamples.openSampleWorkbook("61605.xlsx")) { Sheet template_sh = template_wb.getSheetAt(0); assertNotNull(template_sh); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFOffset.java b/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFOffset.java index 1ae0a89657..a8dc775152 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFOffset.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/TestXSSFOffset.java @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class TestXSSFOffset { @Test - public void testOffsetWithEmpty23Arguments() throws IOException { + void testOffsetWithEmpty23Arguments() throws IOException { try (Workbook workbook = new XSSFWorkbook()) { Cell cell = workbook.createSheet().createRow(0).createCell(0); cell.setCellFormula("OFFSET(B1,,)"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/XSSFMemoryLeakTests.java b/src/ooxml/testcases/org/apache/poi/xssf/XSSFMemoryLeakTests.java index 385a4593e7..0de2331ff5 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/XSSFMemoryLeakTests.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/XSSFMemoryLeakTests.java @@ -60,7 +60,7 @@ public class XSSFMemoryLeakTests { } @Test - public void testWriteRow() throws IOException { + void testWriteRow() throws IOException { final XSSFWorkbook wb = new XSSFWorkbook(); final XSSFSheet sheet1 = wb.createSheet("Sheet1"); final XSSFRow row = sheet1.createRow(0); @@ -83,7 +83,7 @@ public class XSSFMemoryLeakTests { } @Test - public void testRemoveCellFromRow() throws IOException { + void testRemoveCellFromRow() throws IOException { final XSSFWorkbook wb = new XSSFWorkbook(); final XSSFSheet sheet1 = wb.createSheet("Sheet1"); final XSSFRow rowToCheck = sheet1.createRow(0); @@ -102,7 +102,7 @@ public class XSSFMemoryLeakTests { } @Test - public void testRemove2CellsFromRow() throws IOException { + void testRemove2CellsFromRow() throws IOException { final XSSFWorkbook wb = new XSSFWorkbook(); final XSSFSheet sheet1 = wb.createSheet("Sheet1"); final XSSFRow rowToCheck = sheet1.createRow(0); @@ -126,7 +126,7 @@ public class XSSFMemoryLeakTests { } @Test - public void testRemoveRowFromSheet() throws IOException { + void testRemoveRowFromSheet() throws IOException { final XSSFWorkbook wb1 = new XSSFWorkbook(); final XSSFSheet sheetToCheck = wb1.createSheet("Sheet1"); references.add(sheetToCheck); @@ -146,14 +146,14 @@ public class XSSFMemoryLeakTests { } @Test - public void testFileLeak() { + void testFileLeak() { File file = XSSFTestDataSamples.getSampleFile("xlsx-corrupted.xlsx"); verifier.addObject(file); assertThrows(POIXMLException.class, () -> new XSSFWorkbook(file), "Should catch exception as the file is corrupted"); } @Test - public void testFileLeak2() throws IOException, InvalidFormatException { + void testFileLeak2() throws IOException, InvalidFormatException { File file = XSSFTestDataSamples.getSampleFile("xlsx-corrupted.xlsx"); verifier.addObject(file); try (OPCPackage pkg = OPCPackage.open(file)) { diff --git a/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSharedStringsTable.java b/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSharedStringsTable.java index 86ee2289fa..71d31d12c0 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSharedStringsTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSharedStringsTable.java @@ -31,7 +31,7 @@ public class TestXSSFBSharedStringsTable { private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance(); @Test - public void testBasic() throws Exception { + void testBasic() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("51519.xlsb"))) { List parts = pkg.getPartsByName(Pattern.compile("/xl/sharedStrings.bin")); assertEquals(1, parts.size()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSheetHyperlinkManager.java b/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSheetHyperlinkManager.java index d11b8a8cb0..3e9d8a1734 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSheetHyperlinkManager.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/binary/TestXSSFBSheetHyperlinkManager.java @@ -33,7 +33,7 @@ public class TestXSSFBSheetHyperlinkManager { private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance(); @Test - public void testBasic() throws Exception { + void testBasic() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("hyperlink.xlsb"))) { XSSFBReader reader = new XSSFBReader(pkg); XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) reader.getSheetsData(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java index 2a329d83b0..3d59980c05 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java @@ -41,7 +41,7 @@ public final class TestReadOnlySharedStringsTable { private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance(); @Test - public void testParse() throws Exception { + void testParse() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) { List parts = pkg.getPartsByName(Pattern.compile("/xl/sharedStrings.xml")); assertEquals(1, parts.size()); @@ -64,7 +64,7 @@ public final class TestReadOnlySharedStringsTable { //51519 @Test - public void testPhoneticRuns() throws Exception { + void testPhoneticRuns() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("51519.xlsx"))) { List < PackagePart > parts = pkg.getPartsByName(Pattern.compile("/xl/sharedStrings.xml")); assertEquals(1, parts.size()); @@ -85,7 +85,7 @@ public final class TestReadOnlySharedStringsTable { } @Test - public void testEmptySSTOnPackageObtainedViaWorkbook() throws Exception { + void testEmptySSTOnPackageObtainedViaWorkbook() throws Exception { XSSFWorkbook wb = new XSSFWorkbook(_ssTests.openResourceAsStream("noSharedStringTable.xlsx")); OPCPackage pkg = wb.getPackage(); assertEmptySST(pkg); @@ -93,7 +93,7 @@ public final class TestReadOnlySharedStringsTable { } @Test - public void testEmptySSTOnPackageDirect() throws Exception { + void testEmptySSTOnPackageDirect() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("noSharedStringTable.xlsx"))) { assertEmptySST(pkg); } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java index 2b8676666d..942fda8e2a 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java @@ -39,7 +39,7 @@ public class TestXSSFBReader { private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance(); @Test - public void testBasic() throws Exception { + void testBasic() throws Exception { List sheetTexts = getSheets("testVarious.xlsb"); assertEquals(1, sheetTexts.size()); @@ -94,7 +94,7 @@ public class TestXSSFBReader { } @Test - public void testComments() throws Exception { + void testComments() throws Exception { List sheetTexts = getSheets("comments.xlsb"); String xsxml = sheetTexts.get(0); assertContains(xsxml, @@ -119,7 +119,7 @@ public class TestXSSFBReader { } @Test - public void testAbsPath() throws Exception { + void testAbsPath() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("testVarious.xlsb"))) { XSSFBReader r = new XSSFBReader(pkg); assertEquals("C:\\Users\\tallison\\Desktop\\working\\xlsb\\", r.getAbsPathMetadata()); @@ -158,7 +158,7 @@ public class TestXSSFBReader { } @Test - public void testDate() throws Exception { + void testDate() throws Exception { List sheets = getSheets("date.xlsb"); assertEquals(1, sheets.size()); assertContains(sheets.get(0), "1/12/13"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java index f2734134b4..060ead5620 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java @@ -55,7 +55,7 @@ public final class TestXSSFReader { private static final POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance(); @Test - public void testGetBits() throws Exception { + void testGetBits() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) { XSSFReader r = new XSSFReader(pkg); @@ -70,7 +70,7 @@ public final class TestXSSFReader { } @Test - public void testStyles() throws Exception { + void testStyles() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) { XSSFReader r = new XSSFReader(pkg); @@ -88,7 +88,7 @@ public final class TestXSSFReader { } @Test - public void testStrings() throws Exception { + void testStrings() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) { XSSFReader r = new XSSFReader(pkg); @@ -99,7 +99,7 @@ public final class TestXSSFReader { } @Test - public void testSheets() throws Exception { + void testSheets() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) { XSSFReader r = new XSSFReader(pkg); @@ -133,7 +133,7 @@ public final class TestXSSFReader { * (as they are defined in the workbook.xml) */ @Test - public void testOrderOfSheets() throws Exception { + void testOrderOfSheets() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("reordered_sheets.xlsx"))) { XSSFReader r = new XSSFReader(pkg); @@ -155,7 +155,7 @@ public final class TestXSSFReader { } @Test - public void testComments() throws Exception { + void testComments() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("comments.xlsx")) { XSSFReader r = new XSSFReader(pkg); XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) r.getSheetsData(); @@ -184,7 +184,7 @@ public final class TestXSSFReader { * XSSFReader method */ @Test - public void test50119() throws Exception { + void test50119() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("WithChartSheet.xlsx")) { XSSFReader r = new XSSFReader(pkg); XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) r.getSheetsData(); @@ -200,7 +200,7 @@ public final class TestXSSFReader { * Test text extraction from text box using getShapes() */ @Test - public void testShapes() throws Exception { + void testShapes() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("WithTextBox.xlsx")) { XSSFReader r = new XSSFReader(pkg); XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) r.getSheetsData(); @@ -230,7 +230,7 @@ public final class TestXSSFReader { } @Test - public void testBug57914() throws Exception { + void testBug57914() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("57914.xlsx")) { // for now expect this to fail, when we fix 57699, this one should fail so we know we should adjust // this test as well @@ -253,7 +253,7 @@ public final class TestXSSFReader { * the openpyxl library */ @Test - public void test58747() throws Exception { + void test58747() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("58747.xlsx")) { ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg); assertNotNull(strings); @@ -275,7 +275,7 @@ public final class TestXSSFReader { * 60825 */ @Test - public void testSheetWithNoRelationshipId() throws Exception { + void testSheetWithNoRelationshipId() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("60825.xlsx")) { ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg); assertNotNull(strings); @@ -302,7 +302,7 @@ public final class TestXSSFReader { * <sheet name="Sheet6" sheetId="4" r:id="rId6"/> */ @Test - public void test61034() throws Exception { + void test61034() throws Exception { try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("61034.xlsx")) { XSSFReader reader = new XSSFReader(pkg); XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData(); @@ -319,7 +319,7 @@ public final class TestXSSFReader { @Test @Disabled("until we fix issue https://bz.apache.org/bugzilla/show_bug.cgi?id=61701") - public void test61701() throws Exception { + void test61701() throws Exception { try(Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("simple-table-named-range.xlsx")) { Name name = workbook.getName("total"); System.out.println("workbook.getName(\"total\").getSheetName() returned: " + name.getSheetName()); @@ -327,7 +327,7 @@ public final class TestXSSFReader { } @Test - public void test64420() throws Exception { + void test64420() throws Exception { try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("64420.xlsm"))) { XSSFReader reader = new XSSFReader(pkg); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFBEventBasedExcelExtractor.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFBEventBasedExcelExtractor.java index 165b13770e..82cf53cb39 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFBEventBasedExcelExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFBEventBasedExcelExtractor.java @@ -43,7 +43,7 @@ public class TestXSSFBEventBasedExcelExtractor { * Get text out of the simple file */ @Test - public void testGetSimpleText() throws Exception { + void testGetSimpleText() throws Exception { // a very simple file try (XSSFEventBasedExcelExtractor extractor = getExtractor("sample.xlsb")) { extractor.setIncludeCellComments(true); @@ -87,7 +87,7 @@ public class TestXSSFBEventBasedExcelExtractor { * Test text extraction from text box using getShapes() */ @Test - public void testShapes() throws Exception { + void testShapes() throws Exception { try (XSSFEventBasedExcelExtractor ooxmlExtractor = getExtractor("WithTextBox.xlsb")) { String text = ooxmlExtractor.getText(); assertContains(text, "Line 1"); @@ -97,7 +97,7 @@ public class TestXSSFBEventBasedExcelExtractor { } @Test - public void testBeta() throws Exception { + void testBeta() throws Exception { try (XSSFEventBasedExcelExtractor extractor = getExtractor("Simple.xlsb")) { extractor.setIncludeCellComments(true); String text = extractor.getText(); @@ -107,7 +107,7 @@ public class TestXSSFBEventBasedExcelExtractor { } @Test - public void test62815() throws Exception { + void test62815() throws Exception { //test file based on http://oss.sheetjs.com/test_files/RkNumber.xlsb try (XSSFEventBasedExcelExtractor extractor = getExtractor("62815.xlsb")) { extractor.setIncludeCellComments(true); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFEventBasedExcelExtractor.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFEventBasedExcelExtractor.java index 4f1ef18f12..dd206dba1b 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFEventBasedExcelExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFEventBasedExcelExtractor.java @@ -48,7 +48,7 @@ public class TestXSSFEventBasedExcelExtractor { * Get text out of the simple file */ @Test - public void testGetSimpleText() throws Exception { + void testGetSimpleText() throws Exception { // a very simple file XSSFEventBasedExcelExtractor extractor = getExtractor("sample.xlsx"); extractor.getText(); @@ -109,7 +109,7 @@ public class TestXSSFEventBasedExcelExtractor { } @Test - public void testGetComplexText() throws Exception { + void testGetComplexText() throws Exception { // A fairly complex file XSSFEventBasedExcelExtractor extractor = getExtractor("AverageTaxRates.xlsx"); extractor.getText(); @@ -127,7 +127,7 @@ public class TestXSSFEventBasedExcelExtractor { } @Test - public void testInlineStrings() throws Exception { + void testInlineStrings() throws Exception { XSSFEventBasedExcelExtractor extractor = getExtractor("InlineStrings.xlsx"); extractor.setFormulasNotResults(true); String text = extractor.getText(); @@ -157,7 +157,7 @@ public class TestXSSFEventBasedExcelExtractor { * the same file, just saved as xls and xlsx */ @Test - public void testComparedToOLE2() throws Exception { + void testComparedToOLE2() throws Exception { // A fairly simple file - ooxml XSSFEventBasedExcelExtractor ooxmlExtractor = getExtractor("SampleSS.xlsx"); @@ -180,7 +180,7 @@ public class TestXSSFEventBasedExcelExtractor { /** Test text extraction from text box using getShapes() */ @Test - public void testShapes() throws Exception{ + void testShapes() throws Exception{ try (XSSFEventBasedExcelExtractor ooxmlExtractor = getExtractor("WithTextBox.xlsx")) { String text = ooxmlExtractor.getText(); @@ -195,7 +195,7 @@ public class TestXSSFEventBasedExcelExtractor { * non-event-based XSSFExcelExtractor. */ @Test - public void testUnstyledNumbersComparedToNonEventBasedExtractor() + void testUnstyledNumbersComparedToNonEventBasedExtractor() throws Exception { String expectedOutput = "Sheet1\n99.99\n"; @@ -216,7 +216,7 @@ public class TestXSSFEventBasedExcelExtractor { * non-event-based XSSFExcelExtractor. */ @Test - public void testHeadersAndFootersComparedToNonEventBasedExtractor() + void testHeadersAndFootersComparedToNonEventBasedExtractor() throws Exception { String expectedOutputWithHeadersAndFooters = @@ -254,7 +254,7 @@ public class TestXSSFEventBasedExcelExtractor { * XSSFExcelExtractor. */ @Test - public void testCommentsComparedToNonEventBasedExtractor() + void testCommentsComparedToNonEventBasedExtractor() throws Exception { String expectedOutputWithoutComments = @@ -303,7 +303,7 @@ public class TestXSSFEventBasedExcelExtractor { } @Test - public void testFile56278_normal() throws Exception { + void testFile56278_normal() throws Exception { // first with normal Text Extractor try (POIXMLTextExtractor extractor = new XSSFExcelExtractor( XSSFTestDataSamples.openSampleWorkbook("56278.xlsx"))) { @@ -312,7 +312,7 @@ public class TestXSSFEventBasedExcelExtractor { } @Test - public void testFile56278_event() throws Exception { + void testFile56278_event() throws Exception { // then with event based one try (POIXMLTextExtractor extractor = getExtractor("56278.xlsx")) { assertNotNull(extractor.getText()); @@ -320,7 +320,7 @@ public class TestXSSFEventBasedExcelExtractor { } @Test - public void test59021() throws Exception { + void test59021() throws Exception { XSSFEventBasedExcelExtractor ex = new XSSFEventBasedExcelExtractor( XSSFTestDataSamples.openSamplePackage("59021.xlsx")); @@ -331,7 +331,7 @@ public class TestXSSFEventBasedExcelExtractor { } @Test - public void test51519() throws Exception { + void test51519() throws Exception { //default behavior: include phonetic runs XSSFEventBasedExcelExtractor ex = new XSSFEventBasedExcelExtractor( diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java index e0eb4d2f89..1b66a2fbe4 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java @@ -49,7 +49,7 @@ public class TestXSSFExcelExtractor { * Get text out of the simple file */ @Test - public void testGetSimpleText() throws IOException { + void testGetSimpleText() throws IOException { // a very simple file XSSFExcelExtractor extractor = getExtractor("sample.xlsx"); @@ -109,7 +109,7 @@ public class TestXSSFExcelExtractor { } @Test - public void testGetComplexText() throws IOException { + void testGetComplexText() throws IOException { // A fairly complex file XSSFExcelExtractor extractor = getExtractor("AverageTaxRates.xlsx"); @@ -131,7 +131,7 @@ public class TestXSSFExcelExtractor { * the same file, just saved as xls and xlsx */ @Test - public void testComparedToOLE2() throws IOException { + void testComparedToOLE2() throws IOException { // A fairly simple file - ooxml XSSFExcelExtractor ooxmlExtractor = getExtractor("SampleSS.xlsx"); @@ -160,7 +160,7 @@ public class TestXSSFExcelExtractor { * From bug #45540 */ @Test - public void testHeaderFooter() throws IOException { + void testHeaderFooter() throws IOException { String[] files = new String[] { "45540_classic_Header.xlsx", "45540_form_Header.xlsx", "45540_classic_Footer.xlsx", "45540_form_Footer.xlsx", @@ -180,7 +180,7 @@ public class TestXSSFExcelExtractor { * From bug #45544 */ @Test - public void testComments() throws IOException { + void testComments() throws IOException { XSSFExcelExtractor extractor = getExtractor("45544.xlsx"); String text = extractor.getText(); @@ -198,7 +198,7 @@ public class TestXSSFExcelExtractor { } @Test - public void testInlineStrings() throws IOException { + void testInlineStrings() throws IOException { XSSFExcelExtractor extractor = getExtractor("InlineStrings.xlsx"); extractor.setFormulasNotResults(true); String text = extractor.getText(); @@ -226,7 +226,7 @@ public class TestXSSFExcelExtractor { * Simple test for text box text */ @Test - public void testTextBoxes() throws IOException { + void testTextBoxes() throws IOException { try (XSSFExcelExtractor extractor = getExtractor("WithTextBox.xlsx")) { extractor.setFormulasNotResults(true); String text = extractor.getText(); @@ -237,7 +237,7 @@ public class TestXSSFExcelExtractor { } @Test - public void testPhoneticRuns() throws Exception { + void testPhoneticRuns() throws Exception { try (XSSFExcelExtractor extractor = getExtractor("51519.xlsx")) { String text = extractor.getText(); assertContains(text, "\u8C4A\u7530"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java index 4c79f5f65b..5a6afb7e20 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java @@ -56,7 +56,7 @@ import org.xml.sax.SAXParseException; public final class TestXSSFExportToXML { @Test - public void testExportToXML() throws Exception { + void testExportToXML() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx")) { boolean found = false; @@ -103,7 +103,7 @@ public final class TestXSSFExportToXML { } @Test - public void testExportToXMLInverseOrder() throws Exception { + void testExportToXMLInverseOrder() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples .openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx")) { @@ -151,7 +151,7 @@ public final class TestXSSFExportToXML { } @Test - public void testXPathOrdering() throws IOException { + void testXPathOrdering() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples .openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx")) { @@ -175,7 +175,7 @@ public final class TestXSSFExportToXML { } @Test - public void testMultiTable() throws Exception { + void testMultiTable() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples .openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) { @@ -220,7 +220,7 @@ public final class TestXSSFExportToXML { @Test @Disabled(value="Fails, but I don't know if it is ok or not...") - public void testExportToXMLSingleAttributeNamespace() throws Exception { + void testExportToXMLSingleAttributeNamespace() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMapping-singleattributenamespace.xlsx")) { for (XSSFMap map : wb.getCustomXMLMappings()) { @@ -233,7 +233,7 @@ public final class TestXSSFExportToXML { } @Test - public void test55850ComplexXmlExport() throws Exception { + void test55850ComplexXmlExport() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55850.xlsx")) { boolean found = false; @@ -277,7 +277,7 @@ public final class TestXSSFExportToXML { } @Test - public void testFormulaCells_Bugzilla_55927() throws Exception { + void testFormulaCells_Bugzilla_55927() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55927.xlsx")) { boolean found = false; @@ -312,7 +312,7 @@ public final class TestXSSFExportToXML { } @Test - public void testFormulaCells_Bugzilla_55926() throws Exception { + void testFormulaCells_Bugzilla_55926() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55926.xlsx")) { boolean found = false; @@ -351,7 +351,7 @@ public final class TestXSSFExportToXML { } @Test - public void testXmlExportIgnoresEmptyCells_Bugzilla_55924() throws Exception { + void testXmlExportIgnoresEmptyCells_Bugzilla_55924() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55924.xlsx")) { boolean found = false; @@ -387,7 +387,7 @@ public final class TestXSSFExportToXML { } @Test - public void testXmlExportSchemaWithXSAllTag_Bugzilla_56169() throws Exception { + void testXmlExportSchemaWithXSAllTag_Bugzilla_56169() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56169.xlsx")) { for (XSSFMap map : wb.getCustomXMLMappings()) { @@ -424,7 +424,7 @@ public final class TestXSSFExportToXML { @SuppressWarnings("EqualsWithItself") @Test - public void testXmlExportCompare_Bug_55923() throws Exception { + void testXmlExportCompare_Bug_55923() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) { boolean found = false; @@ -455,7 +455,7 @@ public final class TestXSSFExportToXML { } @Test - public void testXmlExportSchemaOrderingBug_Bugzilla_55923() throws Exception { + void testXmlExportSchemaOrderingBug_Bugzilla_55923() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) { boolean found = false; @@ -509,7 +509,7 @@ public final class TestXSSFExportToXML { } @Test - public void testExportDataTypes() throws Exception { + void testExportDataTypes() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) { Sheet sheet = wb.getSheetAt(0); @@ -565,7 +565,7 @@ public final class TestXSSFExportToXML { } @Test - public void testValidateFalse() throws Exception { + void testValidateFalse() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) { boolean found = false; for (POIXMLDocumentPart p : wb.getRelations()) { @@ -596,7 +596,7 @@ public final class TestXSSFExportToXML { } @Test - public void testRefElementsInXmlSchema_Bugzilla_56730() throws Exception { + void testRefElementsInXmlSchema_Bugzilla_56730() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56730.xlsx")) { boolean found = false; @@ -631,7 +631,7 @@ public final class TestXSSFExportToXML { } @Test - public void testBug59026() throws Exception { + void testBug59026() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("59026.xlsx")) { Collection mappings = wb.getCustomXMLMappings(); assertTrue(mappings.size() > 0); @@ -646,7 +646,7 @@ public final class TestXSSFExportToXML { } @Test - public void testExportTableWithNonMappedColumn_Bugzilla_61281() throws Exception { + void testExportTableWithNonMappedColumn_Bugzilla_61281() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("61281.xlsx")) { for (XSSFMap map : wb.getCustomXMLMappings()) { XSSFExportToXml exporter = new XSSFExportToXml(map); @@ -660,7 +660,7 @@ public final class TestXSSFExportToXML { } @Test - public void testXXEInSchema() throws Exception { + void testXXEInSchema() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("xxe_in_schema.xlsx")) { for (XSSFMap map : wb.getCustomXMLMappings()) { XSSFExportToXml exporter = new XSSFExportToXml(map); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFImportFromXML.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFImportFromXML.java index 84f7e41863..0ae7c5dc7d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFImportFromXML.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFImportFromXML.java @@ -45,7 +45,7 @@ import org.xml.sax.SAXException; public class TestXSSFImportFromXML { @Test - public void testImportFromXML() throws IOException, XPathExpressionException, SAXException{ + void testImportFromXML() throws IOException, XPathExpressionException, SAXException{ try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx")) { String name = "name"; String teacher = "teacher"; @@ -89,7 +89,7 @@ public class TestXSSFImportFromXML { @Timeout(value = 60, unit = SECONDS) @Test - public void testMultiTable() throws IOException, XPathExpressionException, SAXException{ + void testMultiTable() throws IOException, XPathExpressionException, SAXException{ try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) { String cellC6 = "c6"; String cellC7 = "c7"; @@ -139,7 +139,7 @@ public class TestXSSFImportFromXML { @Test - public void testSingleAttributeCellWithNamespace() throws IOException, XPathExpressionException, SAXException{ + void testSingleAttributeCellWithNamespace() throws IOException, XPathExpressionException, SAXException{ try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMapping-singleattributenamespace.xlsx")) { int id = 1; String displayName = "dispName"; @@ -166,7 +166,7 @@ public class TestXSSFImportFromXML { } @Test - public void testOptionalFields_Bugzilla_55864() throws IOException, XPathExpressionException, SAXException { + void testOptionalFields_Bugzilla_55864() throws IOException, XPathExpressionException, SAXException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55864.xlsx")) { String testXML = "" + "" + @@ -204,7 +204,7 @@ public class TestXSSFImportFromXML { } @Test - public void testOptionalFields_Bugzilla_57890() throws IOException, ParseException, XPathExpressionException, SAXException { + void testOptionalFields_Bugzilla_57890() throws IOException, ParseException, XPathExpressionException, SAXException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57890.xlsx"); String testXML = "" + "" diff --git a/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java b/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java index dd01b9a6e6..be192b3f03 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/io/TestLoadSaveXSSF.java @@ -36,7 +36,7 @@ public class TestLoadSaveXSSF { private static final POIDataSamples _ssSamples = POIDataSamples.getSpreadSheetInstance(); @Test - public void testLoadSample() throws Exception { + void testLoadSample() throws Exception { try (XSSFWorkbook workbook = new XSSFWorkbook(_ssSamples.openResourceAsStream("sample.xlsx"))) { assertEquals(3, workbook.getNumberOfSheets()); assertEquals("Sheet1", workbook.getSheetName(0)); @@ -51,7 +51,7 @@ public class TestLoadSaveXSSF { } @Test - public void testLoadStyles() throws Exception { + void testLoadStyles() throws Exception { try (XSSFWorkbook workbook = new XSSFWorkbook(_ssSamples.openResourceAsStream("styles.xlsx"))) { Sheet sheet = workbook.getSheetAt(0); Row row = sheet.getRow(0); @@ -62,7 +62,7 @@ public class TestLoadSaveXSSF { } @Test - public void testLoadPictures() throws Exception { + void testLoadPictures() throws Exception { try (XSSFWorkbook workbook = new XSSFWorkbook(_ssSamples.openResourceAsStream("picture.xlsx"))) { List pictures = workbook.getAllPictures(); assertEquals(1, pictures.size()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java index 487a7e6a2e..8f89223e73 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java @@ -32,7 +32,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCalcCell; public final class TestCalculationChain { @Test - public void test46535() throws IOException { + void test46535() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("46535.xlsx")) { CalculationChain chain = wb.getCalculationChain(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java index 624fe77cca..290e5fcd0c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java @@ -35,7 +35,7 @@ import org.w3c.dom.Node; */ public final class TestMapInfo { @Test - public void testMapInfoExists() throws IOException { + void testMapInfoExists() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx")) { MapInfo mapInfo = null; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java index 00720aa6ec..ae9d6398d4 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java @@ -45,7 +45,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst; */ public final class TestSharedStringsTable { @Test - public void testCreateNew() { + void testCreateNew() { SharedStringsTable sst = new SharedStringsTable(); CTRst st; @@ -115,7 +115,7 @@ public final class TestSharedStringsTable { } @Test - public void testCreateUsingRichTextStrings() { + void testCreateUsingRichTextStrings() { SharedStringsTable sst = new SharedStringsTable(); // Check defaults @@ -182,7 +182,7 @@ public final class TestSharedStringsTable { } @Test - public void testReadWrite() throws IOException { + void testReadWrite() throws IOException { XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("sample.xlsx"); SharedStringsTable sst1 = wb1.getSharedStringSource(); @@ -208,7 +208,7 @@ public final class TestSharedStringsTable { * A specific sequence of strings can result in broken CDATA section in sharedStrings.xml file. */ @Test - public void testBug48936() throws IOException { + void testBug48936() throws IOException { Workbook w1 = new XSSFWorkbook(); Sheet s = w1.createSheet(); int i = 0; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java index ff5dd42d69..fa775bf45c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java @@ -47,7 +47,7 @@ public final class TestStylesTable { } @Test - public void testCreateNew() { + void testCreateNew() { StylesTable st = new StylesTable(); // Check defaults @@ -58,7 +58,7 @@ public final class TestStylesTable { } @Test - public void testCreateSaveLoad() throws IOException { + void testCreateSaveLoad() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { StylesTable st = wb.getStylesSource(); @@ -79,7 +79,7 @@ public final class TestStylesTable { } @Test - public void testLoadExisting() throws IOException { + void testLoadExisting() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile)) { assertNotNull(workbook.getStylesSource()); @@ -92,7 +92,7 @@ public final class TestStylesTable { } @Test - public void testLoadSaveLoad() throws IOException { + void testLoadSaveLoad() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile)) { assertNotNull(workbook.getStylesSource()); @@ -316,7 +316,7 @@ public final class TestStylesTable { } @Test - public void testLoadWithAlternateContent() throws IOException { + void testLoadWithAlternateContent() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("style-alternate-content.xlsx")) { assertNotNull(workbook.getStylesSource()); @@ -328,7 +328,7 @@ public final class TestStylesTable { } @Test - public void testReplaceStyle() throws IOException { + void testReplaceStyle() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("style-alternate-content.xlsx")) { assertNotNull(workbook.getStylesSource()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java index c01bee1cd9..75b81a9888 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java @@ -68,7 +68,7 @@ public class TestThemesTable { }; @Test - public void testThemesTableColors() throws Exception { + void testThemesTableColors() throws Exception { // Load our two test workbooks String testFileSimple = "Themes.xlsx"; XSSFWorkbook simple = XSSFTestDataSamples.openSampleWorkbook(testFileSimple); @@ -247,7 +247,7 @@ public class TestThemesTable { @Test @SuppressWarnings("resource") - public void testAddNew() { + void testAddNew() { XSSFWorkbook wb = new XSSFWorkbook(); wb.createSheet(); assertNull(wb.getTheme()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestOutlining.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestOutlining.java index 4cca84c00f..2132956a66 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestOutlining.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestOutlining.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public final class TestOutlining { @Test - public void testSetRowGroupCollapsed() throws IOException { + void testSetRowGroupCollapsed() throws IOException { SXSSFWorkbook wb2 = new SXSSFWorkbook(100); wb2.setCompressTempFiles(true); SXSSFSheet sheet2 = wb2.createSheet("new sheet"); @@ -62,7 +62,7 @@ public final class TestOutlining { } @Test - public void testSetRowGroupCollapsedError() throws IOException { + void testSetRowGroupCollapsedError() throws IOException { SXSSFWorkbook wb2 = new SXSSFWorkbook(100); wb2.setCompressTempFiles(true); SXSSFSheet sheet2 = wb2.createSheet("new sheet"); @@ -101,7 +101,7 @@ public final class TestOutlining { } @Test - public void testOutlineGettersHSSF() throws IOException { + void testOutlineGettersHSSF() throws IOException { HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); HSSFSheet hssfSheet = hssfWorkbook.createSheet(); hssfSheet.createRow(0); @@ -121,7 +121,7 @@ public final class TestOutlining { } @Test - public void testOutlineGettersXSSF() throws IOException { + void testOutlineGettersXSSF() throws IOException { XSSFWorkbook xssfWorkbook = new XSSFWorkbook(); XSSFSheet xssfSheet = xssfWorkbook.createSheet(); xssfSheet.createRow(0); @@ -141,7 +141,7 @@ public final class TestOutlining { } @Test - public void testOutlineGettersSXSSF() throws IOException { + void testOutlineGettersSXSSF() throws IOException { SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(); SXSSFSheet sxssfSheet = sxssfWorkbook.createSheet(); sxssfSheet.createRow(0); @@ -184,7 +184,7 @@ public final class TestOutlining { } @Test - public void testOutlineGettersSXSSFSetOutlineLevel() throws IOException { + void testOutlineGettersSXSSFSetOutlineLevel() throws IOException { SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(); SXSSFSheet sxssfSheet = sxssfWorkbook.createSheet(); sxssfSheet.createRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java index 3ab01d05d3..ebf0f2c134 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFCell.java @@ -64,7 +64,7 @@ public class TestSXSSFCell extends BaseTestXCell { } @Test - public void testPreserveSpaces() throws IOException { + void testPreserveSpaces() throws IOException { String[] samplesWithSpaces = { " POI", "POI ", diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFDataValidation.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFDataValidation.java index be8f895ae9..a3dfdfae8f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFDataValidation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFDataValidation.java @@ -36,7 +36,7 @@ public class TestSXSSFDataValidation extends BaseTestDataValidation { } @Test - public void test53965() throws Exception { + void test53965() throws Exception { try (SXSSFWorkbook wb = new SXSSFWorkbook()) { Sheet sheet = wb.createSheet(); List lst = sheet.getDataValidations(); //<-- works diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFFormulaEvaluation.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFFormulaEvaluation.java index ec97fdf769..4fada399c3 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFFormulaEvaluation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFFormulaEvaluation.java @@ -48,7 +48,7 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator super(SXSSFITestDataProvider.instance); } - public void testSharedFormulas() throws IOException { + void testSharedFormulas() throws IOException { /* not implemented */ } @@ -58,7 +58,7 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator * non-active sheets will fail */ @Test - public void testEvaluateAllFails() throws IOException { + void testEvaluateAllFails() throws IOException { try (SXSSFWorkbook wb = new SXSSFWorkbook(5)) { SXSSFSheet s = wb.createSheet(); @@ -95,7 +95,7 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator } @Test - public void testEvaluateRefOutsideWindowFails() throws IOException { + void testEvaluateRefOutsideWindowFails() throws IOException { try (SXSSFWorkbook wb = new SXSSFWorkbook(5)) { SXSSFSheet s = wb.createSheet(); @@ -123,7 +123,7 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator * then evaluation works */ @Test - public void testEvaluateAllInWindow() throws IOException { + void testEvaluateAllInWindow() throws IOException { SXSSFWorkbook wb = new SXSSFWorkbook(5); SXSSFSheet s = wb.createSheet(); s.createRow(0).createCell(0).setCellFormula("1+2"); @@ -141,7 +141,7 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator } @Test - public void testEvaluateRefInsideWindow() throws IOException { + void testEvaluateRefInsideWindow() throws IOException { SXSSFWorkbook wb = new SXSSFWorkbook(5); SXSSFSheet s = wb.createSheet(); @@ -161,7 +161,7 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator } @Test - public void testEvaluateSimple() throws IOException { + void testEvaluateSimple() throws IOException { SXSSFWorkbook wb = new SXSSFWorkbook(5); SXSSFSheet s = wb.createSheet(); @@ -187,6 +187,6 @@ public final class TestSXSSFFormulaEvaluation extends BaseTestFormulaEvaluator "handling of errors in formulas is slightly different than in XSSF, " + "but this proved to be non-trivial to solve..." ) - public void testUpdateCachedFormulaResultFromErrorToNumber_bug46479() { + void testUpdateCachedFormulaResultFromErrorToNumber_bug46479() { } } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java index 59431a4b71..338bdec0ac 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFSheetAutoSizeColumn.java @@ -91,7 +91,7 @@ public class TestSXSSFSheetAutoSizeColumn { @ParameterizedTest @MethodSource("data") - public void test_EmptySheet_NoException(boolean useMergedCells) { + void test_EmptySheet_NoException(boolean useMergedCells) { workbook = new SXSSFWorkbook(); sheet = workbook.createSheet(); sheet.trackAllColumnsForAutoSizing(); @@ -103,7 +103,7 @@ public class TestSXSSFSheetAutoSizeColumn { @ParameterizedTest @MethodSource("data") - public void test_WindowSizeDefault_AllRowsFitIntoWindowSize(boolean useMergedCells) { + void test_WindowSizeDefault_AllRowsFitIntoWindowSize(boolean useMergedCells) { workbook = new SXSSFWorkbook(); sheet = workbook.createSheet(); sheet.trackAllColumnsForAutoSizing(); @@ -121,7 +121,7 @@ public class TestSXSSFSheetAutoSizeColumn { @ParameterizedTest @MethodSource("data") - public void test_WindowSizeEqualsOne_ConsiderFlushedRows(boolean useMergedCells) { + void test_WindowSizeEqualsOne_ConsiderFlushedRows(boolean useMergedCells) { workbook = new SXSSFWorkbook(null, 1); // Window size 1 so only last row will be in memory sheet = workbook.createSheet(); sheet.trackAllColumnsForAutoSizing(); @@ -139,7 +139,7 @@ public class TestSXSSFSheetAutoSizeColumn { @ParameterizedTest @MethodSource("data") - public void test_WindowSizeEqualsOne_lastRowIsNotWidest(boolean useMergedCells) { + void test_WindowSizeEqualsOne_lastRowIsNotWidest(boolean useMergedCells) { workbook = new SXSSFWorkbook(null, 1); // Window size 1 so only last row will be in memory sheet = workbook.createSheet(); sheet.trackAllColumnsForAutoSizing(); @@ -157,7 +157,7 @@ public class TestSXSSFSheetAutoSizeColumn { @ParameterizedTest @MethodSource("data") - public void test_WindowSizeEqualsOne_lastRowIsWidest(boolean useMergedCells) { + void test_WindowSizeEqualsOne_lastRowIsWidest(boolean useMergedCells) { workbook = new SXSSFWorkbook(null, 1); // Window size 1 so only last row will be in memory sheet = workbook.createSheet(); sheet.trackAllColumnsForAutoSizing(); @@ -176,7 +176,7 @@ public class TestSXSSFSheetAutoSizeColumn { // fails only for useMergedCell=true @ParameterizedTest @MethodSource("data") - public void test_WindowSizeEqualsOne_flushedRowHasMergedCell(boolean useMergedCells) { + void test_WindowSizeEqualsOne_flushedRowHasMergedCell(boolean useMergedCells) { workbook = new SXSSFWorkbook(null, 1); // Window size 1 so only last row will be in memory sheet = workbook.createSheet(); sheet.trackAllColumnsForAutoSizing(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java index 60b4c0de69..7d50ad410d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java @@ -44,7 +44,7 @@ public class TestSXSSFUnicodeSurrogates { "\uD835\uDF77\uD835\uDF78\uD835\uDF79\uD835\uDF7A"; @Test - public void testWriteUnicodeSurrogates() throws IOException { + void testWriteUnicodeSurrogates() throws IOException { String sheetName = "Sheet1"; File tf = TempFile.createTempFile("poi-xmlbeans-test", ".xlsx"); try (SXSSFWorkbook wb = new SXSSFWorkbook()) { diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java index 91cf6d6b9f..c50e29abf8 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java @@ -456,7 +456,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook { * so we use shared strings */ @Test - public void testZipBombNotTriggeredOnUselessContent() throws IOException { + void testZipBombNotTriggeredOnUselessContent() throws IOException { SXSSFWorkbook swb = new SXSSFWorkbook(null, 1, true, true); SXSSFSheet s = swb.createSheet(); char[] useless = new char[32767]; @@ -520,7 +520,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook { @Test - public void test56557() throws IOException { + void test56557() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56557.xlsx"); // Using streaming XSSFWorkbook makes the output file invalid diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSheetDataWriter.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSheetDataWriter.java index 257196cc75..864ec3bc0d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSheetDataWriter.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSheetDataWriter.java @@ -43,7 +43,7 @@ public final class TestSheetDataWriter { + "\uD835\uDF76\uD835\uDF77\uD835\uDF78\uD835\uDF79\uD835\uDF7A"; @Test - public void testReplaceWithQuestionMark() { + void testReplaceWithQuestionMark() { for(int i = 0; i < unicodeSurrogates.length(); i++) { assertFalse(SheetDataWriter.replaceWithQuestionMark(unicodeSurrogates.charAt(i))); } @@ -55,7 +55,7 @@ public final class TestSheetDataWriter { } @Test - public void testWriteUnicodeSurrogates() throws IOException { + void testWriteUnicodeSurrogates() throws IOException { SheetDataWriter writer = new SheetDataWriter(); try { writer.outputEscapedString(unicodeSurrogates); @@ -70,7 +70,7 @@ public final class TestSheetDataWriter { } } @Test - public void testWriteNewLines() throws IOException { + void testWriteNewLines() throws IOException { SheetDataWriter writer = new SheetDataWriter(); try { writer.outputEscapedString("\r\n"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/BaseTestXSSFPivotTable.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/BaseTestXSSFPivotTable.java index b79aeac621..b48865f350 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/BaseTestXSSFPivotTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/BaseTestXSSFPivotTable.java @@ -65,7 +65,7 @@ public abstract class BaseTestXSSFPivotTable { * and the count is increased by one. */ @Test - public void testAddRowLabelToPivotTable() { + void testAddRowLabelToPivotTable() { int columnIndex = 0; assertEquals(0, pivotTable.getRowLabelColumns().size()); @@ -89,7 +89,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's not possible to create a row label outside of the referenced area. */ @Test - public void testAddRowLabelOutOfRangeThrowsException() { + void testAddRowLabelOutOfRangeThrowsException() { assertThrows(IndexOutOfBoundsException.class, () -> pivotTable.addRowLabel(5)); } @@ -97,7 +97,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that when creating one column label, no col fields are being created. */ @Test - public void testAddOneColumnLabelToPivotTableDoesNotCreateColField() { + void testAddOneColumnLabelToPivotTableDoesNotCreateColField() { int columnIndex = 0; pivotTable.addColumnLabel(DataConsolidateFunction.SUM, columnIndex); @@ -110,7 +110,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's possible to create three column labels with different DataConsolidateFunction */ @Test - public void testAddThreeDifferentColumnLabelsToPivotTable() { + void testAddThreeDifferentColumnLabelsToPivotTable() { int columnOne = 0; int columnTwo = 1; int columnThree = 2; @@ -128,7 +128,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's possible to create three column labels with the same DataConsolidateFunction */ @Test - public void testAddThreeSametColumnLabelsToPivotTable() { + void testAddThreeSametColumnLabelsToPivotTable() { int columnOne = 0; int columnTwo = 1; int columnThree = 2; @@ -145,7 +145,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that when creating two column labels, a col field is being created and X is set to -2. */ @Test - public void testAddTwoColumnLabelsToPivotTable() { + void testAddTwoColumnLabelsToPivotTable() { int columnOne = 0; int columnTwo = 1; @@ -160,7 +160,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that a data field is created when creating a data column */ @Test - public void testColumnLabelCreatesDataField() { + void testColumnLabelCreatesDataField() { int columnIndex = 0; pivotTable.addColumnLabel(DataConsolidateFunction.SUM, columnIndex); @@ -176,7 +176,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's possible to set a custom name when creating a data column */ @Test - public void testColumnLabelSetCustomName() { + void testColumnLabelSetCustomName() { int columnIndex = 0; String customName = "Custom Name"; @@ -193,7 +193,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's possible to set the format to the data column */ @Test - public void testColumnLabelSetDataFormat() { + void testColumnLabelSetDataFormat() { int columnIndex = 0; String format = "#,##0.0"; @@ -210,7 +210,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's not possible to create a column label outside of the referenced area. */ @Test - public void testAddColumnLabelOutOfRangeThrowsException() { + void testAddColumnLabelOutOfRangeThrowsException() { assertThrows(IndexOutOfBoundsException.class, () -> pivotTable.addColumnLabel(DataConsolidateFunction.SUM, 5)); } @@ -219,7 +219,7 @@ public abstract class BaseTestXSSFPivotTable { * column index will be set to true. */ @Test - public void testAddDataColumn() { + void testAddDataColumn() { int columnIndex = 0; boolean isDataField = true; @@ -232,7 +232,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's not possible to create a data column outside of the referenced area. */ @Test - public void testAddDataColumnOutOfRangeThrowsException() { + void testAddDataColumnOutOfRangeThrowsException() { assertThrows(IndexOutOfBoundsException.class, () -> pivotTable.addDataColumn(5, true)); } @@ -240,7 +240,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's possible to create a new filter */ @Test - public void testAddReportFilter() { + void testAddReportFilter() { int columnIndex = 0; pivotTable.addReportFilter(columnIndex); @@ -255,7 +255,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's not possible to create a new filter outside of the referenced area. */ @Test - public void testAddReportFilterOutOfRangeThrowsException() { + void testAddReportFilterOutOfRangeThrowsException() { assertThrows(IndexOutOfBoundsException.class, () -> pivotTable.addReportFilter(5)); } @@ -264,7 +264,7 @@ public abstract class BaseTestXSSFPivotTable { * first column of the referenced area is not index 0. */ @Test - public void testAddDataColumnWithOffsetData() { + void testAddDataColumnWithOffsetData() { offsetPivotTable.addColumnLabel(DataConsolidateFunction.SUM, 1); assertEquals(CellType.NUMERIC, offsetOuterCell.getCellType()); @@ -272,7 +272,7 @@ public abstract class BaseTestXSSFPivotTable { } @Test - public void testPivotTableSheetNamesAreCaseInsensitive() { + void testPivotTableSheetNamesAreCaseInsensitive() { wb.setSheetName(0, "original"); wb.setSheetName(1, "offset"); XSSFSheet original = wb.getSheet("OriginaL"); @@ -294,7 +294,7 @@ public abstract class BaseTestXSSFPivotTable { * and the count is increased by one. */ @Test - public void testAddColLabelToPivotTable() { + void testAddColLabelToPivotTable() { int columnIndex = 0; assertEquals(0, pivotTable.getColLabelColumns().size()); @@ -318,7 +318,7 @@ public abstract class BaseTestXSSFPivotTable { * Verify that it's not possible to create a col label outside of the referenced area. */ @Test - public void testAddColLabelOutOfRangeThrowsException() { + void testAddColLabelOutOfRangeThrowsException() { assertThrows(IndexOutOfBoundsException.class, () -> pivotTable.addColLabel(5)); } } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFBugs.java index ad85072249..4cb0991d5c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFBugs.java @@ -178,7 +178,7 @@ public final class TestSXSSFBugs extends BaseTestBugzillaIssues { @Test @Disabled("takes too long for the normal test run") - public void test62872() throws Exception { + void test62872() throws Exception { final int COLUMN_COUNT = 300; final int ROW_COUNT = 600000; final int TEN_MINUTES = 1000*60*10; @@ -217,7 +217,7 @@ public final class TestSXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test63960() throws Exception { + void test63960() throws Exception { try (Workbook workbook = new SXSSFWorkbook(100)) { Sheet sheet = workbook.createSheet("RawData"); @@ -244,7 +244,7 @@ public final class TestSXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test64595() throws Exception { + void test64595() throws Exception { try (Workbook workbook = new SXSSFWorkbook(100)) { Sheet sheet = workbook.createSheet("RawData"); Row row = sheet.createRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestTableStyles.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestTableStyles.java index b7ad0e9d38..1149d13014 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestTableStyles.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestTableStyles.java @@ -41,7 +41,7 @@ public class TestTableStyles { * Test that a built-in style is initialized properly */ @Test - public void testBuiltinStyleInit() { + void testBuiltinStyleInit() { TableStyle style = XSSFBuiltinTableStyle.TableStyleMedium2.getStyle(); assertNotNull(style, "no style found for Medium2"); assertNull(style.getStyle(TableStyleType.blankRow), "Should not have style info for blankRow"); @@ -56,7 +56,7 @@ public class TestTableStyles { } @Test - public void testCustomStyle() throws Exception { + void testCustomStyle() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("tableStyle.xlsx")) { Table table = wb.getTable("Table1"); assertNotNull(table, "missing table"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java index 64d4c15f5f..c2a989bbaa 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java @@ -66,7 +66,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow; */ public final class TestUnfixedBugs { @Test - public void test54071() throws Exception { + void test54071() throws Exception { Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("54071.xlsx"); Sheet sheet = workbook.getSheetAt(0); int rows = sheet.getPhysicalNumberOfRows(); @@ -95,7 +95,7 @@ public final class TestUnfixedBugs { } @Test - public void test54071Simple() { + void test54071Simple() { double value1 = 41224.999988425923; double value2 = 41224.999988368058; @@ -136,7 +136,7 @@ public final class TestUnfixedBugs { // When this is fixed, the test case should go to BaseTestXCell with // adjustments to use _testDataProvider to also verify this for XSSF @Test - public void testBug57294() throws IOException { + void testBug57294() throws IOException { Workbook wb = SXSSFITestDataProvider.instance.createWorkbook(); Sheet sheet = wb.createSheet(); @@ -167,7 +167,7 @@ public final class TestUnfixedBugs { // This test will run green, but the resulting file is formatted incorrectly, // see the bug at https://bz.apache.org/bugzilla/show_bug.cgi?id=55752 @Test - public void testBug55752() throws IOException { + void testBug55752() throws IOException { try (Workbook wb = new XSSFWorkbook()) { Sheet sheet = wb.createSheet("test"); @@ -223,7 +223,7 @@ public final class TestUnfixedBugs { } @Test - public void test57423() throws IOException { + void test57423() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57423.xlsx"); Sheet testSheet = wb.getSheetAt(0); @@ -347,7 +347,7 @@ public final class TestUnfixedBugs { } @Test - public void testBug60355() throws IOException { + void testBug60355() throws IOException { try (Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("HsGetVal.xlsx")){ Sheet sheet = workbook.getSheetAt(workbook.getActiveSheetIndex()); @@ -396,7 +396,7 @@ public final class TestUnfixedBugs { } @Test - public void testBug64759() throws IOException { + void testBug64759() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64759.xlsx")) { Sheet cloned = wb.cloneSheet(0); assertNotNull(cloned); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 034cdf1613..cf98288e2f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -1601,7 +1601,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Test - public void testBug53798XLSX() throws IOException { + void testBug53798XLSX() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53798_shiftNegative_TMPL.xlsx")) { File xlsOutput = TempFile.createTempFile("testBug53798", ".xlsx"); bug53798Work(wb, xlsOutput); @@ -1610,7 +1610,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Disabled("Shifting rows is not yet implemented in SXSSFSheet") @Test - public void testBug53798XLSXStream() throws IOException { + void testBug53798XLSXStream() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53798_shiftNegative_TMPL.xlsx")) { File xlsOutput = TempFile.createTempFile("testBug53798", ".xlsx"); SXSSFWorkbook wb2 = new SXSSFWorkbook(wb); @@ -1620,7 +1620,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug53798XLS() throws IOException { + void testBug53798XLS() throws IOException { Workbook wb = HSSFTestDataSamples.openSampleWorkbook("53798_shiftNegative_TMPL.xls"); File xlsOutput = TempFile.createTempFile("testBug53798", ".xls"); bug53798Work(wb, xlsOutput); @@ -1631,7 +1631,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * SUMIF was throwing a NPE on some formulas */ @Test - public void testBug56420SumIfNPE() throws IOException { + void testBug56420SumIfNPE() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56420.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); @@ -1793,28 +1793,28 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug56688_1() throws IOException { + void testBug56688_1() throws IOException { XSSFWorkbook excel = XSSFTestDataSamples.openSampleWorkbook("56688_1.xlsx"); checkValue(excel, "-1.0"); /* Not 0.0 because POI sees date "0" minus one month as invalid date, which is -1! */ excel.close(); } @Test - public void testBug56688_2() throws IOException { + void testBug56688_2() throws IOException { XSSFWorkbook excel = XSSFTestDataSamples.openSampleWorkbook("56688_2.xlsx"); checkValue(excel, "#VALUE!"); excel.close(); } @Test - public void testBug56688_3() throws IOException { + void testBug56688_3() throws IOException { XSSFWorkbook excel = XSSFTestDataSamples.openSampleWorkbook("56688_3.xlsx"); checkValue(excel, "#VALUE!"); excel.close(); } @Test - public void testBug56688_4() throws IOException { + void testBug56688_4() throws IOException { XSSFWorkbook excel = XSSFTestDataSamples.openSampleWorkbook("56688_4.xlsx"); Calendar calendar = LocaleUtil.getLocaleCalendar(); @@ -1831,7 +1831,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * to be able to change it */ @Test - public void testBug56527() throws IOException { + void testBug56527() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFCreationHelper creationHelper = wb.getCreationHelper(); @@ -1911,7 +1911,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test54764WithSAXHelper() throws Exception { + void test54764WithSAXHelper() throws Exception { File testFile = XSSFTestDataSamples.getSampleFile("54764.xlsx"); try (ZipFile zip = new ZipFile(testFile)) { ZipArchiveEntry ze = zip.getEntry("xl/sharedStrings.xml"); @@ -1924,7 +1924,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test54764WithDocumentHelper() throws Exception { + void test54764WithDocumentHelper() throws Exception { File testFile = XSSFTestDataSamples.getSampleFile("54764.xlsx"); try (ZipFile zip = new ZipFile(testFile)) { ZipArchiveEntry ze = zip.getEntry("xl/sharedStrings.xml"); @@ -1983,7 +1983,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug57196() throws IOException { + void testBug57196() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57196.xlsx")) { Sheet sheet = wb.getSheet("Feuil1"); Row mod = sheet.getRow(1); @@ -1996,7 +1996,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test57196_Detail() throws IOException { + void test57196_Detail() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet("Sheet1"); XSSFRow row = sheet.createRow(0); @@ -2010,7 +2010,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test57196_Detail2() throws IOException { + void test57196_Detail2() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet("Sheet1"); XSSFRow row = sheet.createRow(0); @@ -2024,7 +2024,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test57196_WorkbookEvaluator() throws IOException { + void test57196_WorkbookEvaluator() throws IOException { String previousLogger = System.getProperty("org.apache.poi.util.POILogger"); //System.setProperty("org.apache.poi.util.POILogger", "org.apache.poi.util.SystemOutLogger"); //System.setProperty("poi.log.level", "3"); @@ -2179,7 +2179,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Test - public void test57165() throws IOException { + void test57165() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx")) { removeAllSheetsBut(3, wb); wb.cloneSheet(0); // Throws exception here @@ -2192,7 +2192,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test57165_create() throws IOException { + void test57165_create() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx")) { removeAllSheetsBut(3, wb); wb.createSheet("newsheet"); // Throws exception here @@ -2235,7 +2235,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * [ 0][ 2][ 4] */ @Test - public void testBug56820_Formula1() throws IOException { + void testBug56820_Formula1() throws IOException { try (Workbook wb = new XSSFWorkbook()) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Sheet sh = wb.createSheet(); @@ -2262,7 +2262,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * [ 4] <- formula */ @Test - public void testBug56820_Formula2() throws IOException { + void testBug56820_Formula2() throws IOException { try (Workbook wb = new XSSFWorkbook()) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Sheet sh = wb.createSheet(); @@ -2282,7 +2282,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test56467() throws IOException { + void test56467() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("picture.xlsx")) { Sheet orig = wb.getSheetAt(0); assertNotNull(orig); @@ -2305,7 +2305,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { */ @Test @Disabled("XMLBeans namespace mis-match on ooxml-strict files") - public void test57699() throws IOException { + void test57699() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("sample.strict.xlsx")) { assertEquals(3, wb.getNumberOfSheets()); // TODO Check sheet contents @@ -2320,7 +2320,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug56295_MergeXlslsWithStyles() throws IOException { + void testBug56295_MergeXlslsWithStyles() throws IOException { XSSFWorkbook xlsToAppendWorkbook = XSSFTestDataSamples.openSampleWorkbook("56295.xlsx"); XSSFSheet sheet = xlsToAppendWorkbook.getSheetAt(0); XSSFRow srcRow = sheet.getRow(0); @@ -2370,7 +2370,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * Excel treats this as not-bulleted, so now do we */ @Test - public void testBug57826() throws IOException { + void testBug57826() throws IOException { XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("57826.xlsx"); assertTrue(workbook.getNumberOfSheets() >= 1, "no sheets in workbook"); @@ -2468,7 +2468,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Test - public void test56574() throws IOException { + void test56574() throws IOException { runTest56574(false); runTest56574(true); } @@ -2566,7 +2566,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test48962() throws IOException { + void test48962() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("48962.xlsx")) { Sheet sh = wb.getSheetAt(0); Row row = sh.getRow(1); @@ -2591,7 +2591,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test50755_workday_formula_example() throws IOException { + void test50755_workday_formula_example() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("50755_workday_formula_example.xlsx")) { Sheet sheet = wb.getSheet("Sheet1"); for (Row aRow : sheet) { @@ -2608,7 +2608,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test51626() throws IOException { + void test51626() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("51626.xlsx"); assertNotNull(wb); wb.close(); @@ -2629,7 +2629,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test51451() throws IOException { + void test51451() throws IOException { Workbook wb = new XSSFWorkbook(); Sheet sh = wb.createSheet(); @@ -2651,7 +2651,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test53105() throws IOException { + void test53105() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("53105.xlsx")) { assertNotNull(wb); @@ -2668,7 +2668,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Test - public void test58315() throws IOException { + void test58315() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58315.xlsx")) { Cell cell = wb.getSheetAt(0).getRow(0).getCell(0); assertNotNull(cell); @@ -2687,7 +2687,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test55406() throws IOException { + void test55406() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("55406_Conditional_formatting_sample.xlsx")) { Sheet sheet = wb.getSheetAt(0); Cell cellA1 = sheet.getRow(0).getCell(0); @@ -2714,7 +2714,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test51998() throws IOException { + void test51998() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("51998.xlsx"); Set sheetNames = new HashSet<>(); @@ -2743,7 +2743,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test58731() throws IOException { + void test58731() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58731.xlsx")) { Sheet sheet = wb.createSheet("Java Books"); @@ -2785,7 +2785,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * ! Rule: Package require content types when retrieving a part from a package. [M.1.14] */ @Test - public void test58760() throws IOException { + void test58760() throws IOException { Workbook wb1 = XSSFTestDataSamples.openSampleWorkbook("58760.xlsx"); assertEquals(1, wb1.getNumberOfSheets()); assertEquals("Sheet1", wb1.getSheetName(0)); @@ -2797,7 +2797,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test57236() throws IOException { + void test57236() throws IOException { // Having very small numbers leads to different formatting, Excel uses the scientific notation, but POI leads to "0" /* @@ -2852,13 +2852,13 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Disabled("Creates files for checking results manually, actual values are tested in Test*CellStyle") @Test - public void test58043() throws IOException { + void test58043() throws IOException { saveRotatedTextExample(new HSSFWorkbook(), TempFile.createTempFile("rotated", ".xls")); saveRotatedTextExample(new XSSFWorkbook(), TempFile.createTempFile("rotated", ".xlsx")); } @Test - public void test59132() throws IOException { + void test59132() throws IOException { Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("59132.xlsx"); Sheet worksheet = workbook.getSheet("sheet1"); @@ -2909,7 +2909,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Disabled("bug 59442") @Test - public void testSetRGBBackgroundColor() throws IOException { + void testSetRGBBackgroundColor() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFCell cell = workbook.createSheet().createRow(0).createCell(0); @@ -2953,7 +2953,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Disabled("currently fails on POI 3.15 beta 2") @Test - public void test55273() throws IOException { + void test55273() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("ExcelTables.xlsx")) { Sheet sheet = wb.getSheet("ExcelTable"); @@ -2971,7 +2971,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test57523() throws IOException { + void test57523() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57523.xlsx")) { Sheet sheet = wb.getSheet("Attribute Master"); Row row = sheet.getRow(15); @@ -3005,7 +3005,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testWorkdayFunction() throws IOException { + void testWorkdayFunction() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("59106.xlsx")) { XSSFSheet sheet = workbook.getSheet("Test"); Row row = sheet.getRow(1); @@ -3020,7 +3020,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { // This bug is currently open. When this bug is fixed, it should not throw an AssertionError @Test - public void test55076_collapseColumnGroups() throws Exception { + void test55076_collapseColumnGroups() throws Exception { try (Workbook wb = new XSSFWorkbook()) { Sheet sheet = wb.createSheet(); @@ -3103,7 +3103,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test53611() throws IOException { + void test53611() throws IOException { Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(1); @@ -3126,7 +3126,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test61798() throws IOException { + void test61798() throws IOException { Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(1); @@ -3220,7 +3220,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test61652() throws IOException { + void test61652() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("61652.xlsx")) { Sheet sheet = wb.getSheet("IRPPCalc"); Row row = sheet.getRow(11); @@ -3239,7 +3239,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test61543() throws IOException { + void test61543() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFTable table1 = sheet.createTable(null); @@ -3262,7 +3262,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * errors like ArrayIndexOutOfBoundsException: -32765 */ @Test - public void test62108() throws IOException { + void test62108() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFRow row = sheet.createRow(0); @@ -3302,14 +3302,14 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test61905xlsx() throws IOException { + void test61905xlsx() throws IOException { try (Workbook wb = new XSSFWorkbook()) { checkActiveSheet(wb, XSSFITestDataProvider.instance); } } @Test - public void test61905xls() throws IOException { + void test61905xls() throws IOException { try (Workbook wb = new HSSFWorkbook()) { checkActiveSheet(wb, HSSFITestDataProvider.instance); } @@ -3327,7 +3327,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug54084Unicode() throws IOException { + void testBug54084Unicode() throws IOException { // sample XLSX with the same text-contents as the text-file above try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("54084 - Greek - beyond BMP.xlsx")) { @@ -3451,7 +3451,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug63509() throws IOException { + void testBug63509() throws IOException { try (XSSFWorkbook workbook = new XSSFWorkbook()) { XSSFSheet sheet = workbook.createSheet("sheet1"); @@ -3476,13 +3476,13 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test64045() { + void test64045() { File file = XSSFTestDataSamples.getSampleFile("xlsx-corrupted.xlsx"); assertThrows(POIXMLException.class, () -> new XSSFWorkbook(file), "Should catch exception as the file is corrupted"); } @Test - public void test58896WithFile() throws IOException { + void test58896WithFile() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58896.xlsx")) { Sheet sheet = wb.getSheetAt(0); Instant start = Instant.now(); @@ -3505,7 +3505,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug63845() throws IOException { + void testBug63845() throws IOException { try (Workbook wb = new XSSFWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -3537,7 +3537,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug63845_2() throws IOException { + void testBug63845_2() throws IOException { try (Workbook wb = new XSSFWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -3560,7 +3560,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug64508() throws IOException { + void testBug64508() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64508.xlsx")) { int activeSheet = wb.getActiveSheetIndex(); Sheet sheet1 = wb.getSheetAt(activeSheet); @@ -3573,7 +3573,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void testBug64667() throws IOException { + void testBug64667() throws IOException { //test that an NPE isn't thrown on opening try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64667.xlsx")) { int activeSheet = wb.getActiveSheetIndex(); @@ -3585,7 +3585,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { @Test - public void testXLSXinPPT() throws Exception { + void testXLSXinPPT() throws Exception { assumeFalse(Boolean.getBoolean("scratchpad.ignore")); try (SlideShow ppt = SlideShowFactory.create( @@ -3630,7 +3630,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test64986() { + void test64986() { XSSFWorkbook w = new XSSFWorkbook(); XSSFSheet s = w.createSheet(); XSSFRow r = s.createRow(0); @@ -3654,7 +3654,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test64750() throws IOException { + void test64750() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64750.xlsx")) { Sheet sheet = wb.getSheet("Sheet1"); assertEquals(1, sheet.getDataValidations().size()); @@ -3662,14 +3662,14 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } @Test - public void test64450() throws IOException { + void test64450() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64450.xlsx")) { assertNotNull(wb); } } @Test - public void test64494() throws IOException { + void test64494() throws IOException { try (Workbook wb = new XSSFWorkbook()) { CellStyle styleRight = wb.createCellStyle(); CellStyle styleLeft = wb.createCellStyle(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java index 18aa00d032..ab7ffc734e 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java @@ -74,7 +74,7 @@ public final class TestXSSFCell extends BaseTestXCell { * Shared String Table */ @Test - public void test47026_1() throws IOException { + void test47026_1() throws IOException { Workbook wb = _testDataProvider.openSampleWorkbook("47026.xlsm"); Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(0); @@ -84,7 +84,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void test47026_2() throws IOException { + void test47026_2() throws IOException { Workbook wb = _testDataProvider.openSampleWorkbook("47026.xlsm"); Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(0); @@ -102,7 +102,7 @@ public final class TestXSSFCell extends BaseTestXCell { * instead of using the shared string table. See bug 47206 */ @Test - public void testInlineString() throws IOException { + void testInlineString() throws IOException { XSSFWorkbook wb = (XSSFWorkbook)_testDataProvider.openSampleWorkbook("xlsx-jdbc.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); XSSFRow row = sheet.getRow(1); @@ -128,7 +128,7 @@ public final class TestXSSFCell extends BaseTestXCell { * Bug 47278 - xsi:nil attribute for tag caused Excel 2007 to fail to open workbook */ @Test - public void test47278() throws IOException { + void test47278() throws IOException { XSSFWorkbook wb = (XSSFWorkbook)_testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -159,7 +159,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testFormulaString() throws IOException { + void testFormulaString() throws IOException { try (XSSFWorkbook wb = (XSSFWorkbook) _testDataProvider.createWorkbook()) { XSSFCell cell = wb.createSheet().createRow(0).createCell(0); CTCell ctCell = cell.getCTCell(); //low-level bean holding cell's xml @@ -218,7 +218,7 @@ public final class TestXSSFCell extends BaseTestXCell { * Bug 47889: problems when calling XSSFCell.getStringCellValue() on a workbook created in Gnumeric */ @Test - public void test47889() throws IOException { + void test47889() throws IOException { XSSFWorkbook wb = (XSSFWorkbook)_testDataProvider.openSampleWorkbook("47889.xlsx"); XSSFSheet sh = wb.getSheetAt(0); @@ -245,7 +245,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testMissingRAttribute() throws IOException { + void testMissingRAttribute() throws IOException { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); XSSFRow row = sheet.createRow(0); @@ -300,7 +300,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testMissingRAttributeBug54288() throws IOException { + void testMissingRAttributeBug54288() throws IOException { // workbook with cells missing the R attribute XSSFWorkbook wb = (XSSFWorkbook)_testDataProvider.openSampleWorkbook("54288.xlsx"); // same workbook re-saved in Excel 2010, the R attribute is updated for every cell with the right value. @@ -343,7 +343,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void test56170() throws IOException { + void test56170() throws IOException { final Workbook wb1 = XSSFTestDataSamples.openSampleWorkbook("56170.xlsx"); final XSSFSheet sheet = (XSSFSheet) wb1.getSheetAt(0); @@ -400,7 +400,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void test56170Reproduce() throws IOException { + void test56170Reproduce() throws IOException { try (Workbook wb = new XSSFWorkbook()) { final Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -442,7 +442,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testBug56644ReturnNull() throws IOException { + void testBug56644ReturnNull() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56644.xlsx")) { wb.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL); Sheet sheet = wb.getSheet("samplelist"); @@ -452,7 +452,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testBug56644ReturnBlank() throws IOException { + void testBug56644ReturnBlank() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56644.xlsx")) { wb.setMissingCellPolicy(MissingCellPolicy.RETURN_NULL_AND_BLANK); Sheet sheet = wb.getSheet("samplelist"); @@ -462,7 +462,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testBug56644CreateBlank() throws IOException { + void testBug56644CreateBlank() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56644.xlsx")) { wb.setMissingCellPolicy(MissingCellPolicy.CREATE_NULL_AS_BLANK); Sheet sheet = wb.getSheet("samplelist"); @@ -472,7 +472,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testEncodingBelowAscii() throws IOException { + void testEncodingBelowAscii() throws IOException { StringBuilder sb = new StringBuilder(); // test all possible characters for(int i = 0; i < Character.MAX_VALUE; i++) { @@ -681,7 +681,7 @@ public final class TestXSSFCell extends BaseTestXCell { * Bug 61869: updating a shared formula produces an unreadable file */ @Test - public void test61869() throws Exception { + void test61869() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("61869.xlsx")) { XSSFSheet sheet = wb.getSheetAt(0); XSSFCell c2 = sheet.getRow(1).getCell(2); @@ -708,7 +708,7 @@ public final class TestXSSFCell extends BaseTestXCell { } @Test - public void testBug58106RemoveSharedFormula() throws Exception { + void testBug58106RemoveSharedFormula() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("58106.xlsx")) { XSSFSheet sheet = wb.getSheetAt(0); XSSFRow row = sheet.getRow(12); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java index dbea37c010..b828511e15 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java @@ -107,7 +107,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetBorderBottom() { + void testGetSetBorderBottom() { //default values assertEquals(BorderStyle.NONE, cellStyle.getBorderBottom()); @@ -145,7 +145,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetBorderRight() { + void testGetSetBorderRight() { //default values assertEquals(BorderStyle.NONE, cellStyle.getBorderRight()); @@ -183,7 +183,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetBorderLeft() { + void testGetSetBorderLeft() { //default values assertEquals(BorderStyle.NONE, cellStyle.getBorderLeft()); @@ -221,7 +221,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetBorderTop() { + void testGetSetBorderTop() { //default values assertEquals(BorderStyle.NONE, cellStyle.getBorderTop()); @@ -271,7 +271,7 @@ public class TestXSSFCellStyle { // Border Styles, in BorderStyle/STBorderStyle enum order @Test - public void testGetSetBorderNone() { + void testGetSetBorderNone() { cellStyle.setBorderTop(BorderStyle.NONE); assertEquals(BorderStyle.NONE, cellStyle.getBorderTop()); int borderId = (int)cellStyle.getCoreXf().getBorderId(); @@ -288,72 +288,72 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetBorderThin() { + void testGetSetBorderThin() { testGetSetBorderXMLBean(BorderStyle.THIN, STBorderStyle.THIN); } @Test - public void testGetSetBorderMedium() { + void testGetSetBorderMedium() { testGetSetBorderXMLBean(BorderStyle.MEDIUM, STBorderStyle.MEDIUM); } @Test - public void testGetSetBorderDashed() { + void testGetSetBorderDashed() { testGetSetBorderXMLBean(BorderStyle.DASHED, STBorderStyle.DASHED); } @Test - public void testGetSetBorderDotted() { + void testGetSetBorderDotted() { testGetSetBorderXMLBean(BorderStyle.DOTTED, STBorderStyle.DOTTED); } @Test - public void testGetSetBorderThick() { + void testGetSetBorderThick() { testGetSetBorderXMLBean(BorderStyle.THICK, STBorderStyle.THICK); } @Test - public void testGetSetBorderDouble() { + void testGetSetBorderDouble() { testGetSetBorderXMLBean(BorderStyle.DOUBLE, STBorderStyle.DOUBLE); } @Test - public void testGetSetBorderHair() { + void testGetSetBorderHair() { testGetSetBorderXMLBean(BorderStyle.HAIR, STBorderStyle.HAIR); } @Test - public void testGetSetBorderMediumDashed() { + void testGetSetBorderMediumDashed() { testGetSetBorderXMLBean(BorderStyle.MEDIUM_DASHED, STBorderStyle.MEDIUM_DASHED); } @Test - public void testGetSetBorderDashDot() { + void testGetSetBorderDashDot() { testGetSetBorderXMLBean(BorderStyle.DASH_DOT, STBorderStyle.DASH_DOT); } @Test - public void testGetSetBorderMediumDashDot() { + void testGetSetBorderMediumDashDot() { testGetSetBorderXMLBean(BorderStyle.MEDIUM_DASH_DOT, STBorderStyle.MEDIUM_DASH_DOT); } @Test - public void testGetSetBorderDashDotDot() { + void testGetSetBorderDashDotDot() { testGetSetBorderXMLBean(BorderStyle.DASH_DOT_DOT, STBorderStyle.DASH_DOT_DOT); } @Test - public void testGetSetBorderMediumDashDotDot() { + void testGetSetBorderMediumDashDotDot() { testGetSetBorderXMLBean(BorderStyle.MEDIUM_DASH_DOT_DOT, STBorderStyle.MEDIUM_DASH_DOT_DOT); } @Test - public void testGetSetBorderSlantDashDot() { + void testGetSetBorderSlantDashDot() { testGetSetBorderXMLBean(BorderStyle.SLANTED_DASH_DOT, STBorderStyle.SLANT_DASH_DOT); } @Test - public void testGetSetBottomBorderColor() { + void testGetSetBottomBorderColor() { //defaults assertEquals(IndexedColors.BLACK.getIndex(), cellStyle.getBottomBorderColor()); assertNull(cellStyle.getBottomBorderXSSFColor()); @@ -394,7 +394,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetTopBorderColor() { + void testGetSetTopBorderColor() { //defaults assertEquals(IndexedColors.BLACK.getIndex(), cellStyle.getTopBorderColor()); assertNull(cellStyle.getTopBorderXSSFColor()); @@ -435,7 +435,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetLeftBorderColor() { + void testGetSetLeftBorderColor() { //defaults assertEquals(IndexedColors.BLACK.getIndex(), cellStyle.getLeftBorderColor()); assertNull(cellStyle.getLeftBorderXSSFColor()); @@ -476,7 +476,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetRightBorderColor() { + void testGetSetRightBorderColor() { //defaults assertEquals(IndexedColors.BLACK.getIndex(), cellStyle.getRightBorderColor()); assertNull(cellStyle.getRightBorderXSSFColor()); @@ -517,7 +517,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetFillBackgroundColor() { + void testGetSetFillBackgroundColor() { assertEquals(IndexedColors.AUTOMATIC.getIndex(), cellStyle.getFillBackgroundColor()); assertNull(cellStyle.getFillBackgroundXSSFColor()); @@ -559,7 +559,7 @@ public class TestXSSFCellStyle { } @Test - public void testDefaultStyles() throws IOException { + void testDefaultStyles() throws IOException { XSSFWorkbook wb1 = new XSSFWorkbook(); @@ -591,7 +591,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetFillForegroundColor() throws IOException { + void testGetFillForegroundColor() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); StylesTable styles = wb.getStylesSource(); assertEquals(1, wb.getNumCellStyles()); @@ -629,7 +629,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetFillPattern() { + void testGetFillPattern() { assertEquals(STPatternType.INT_DARK_GRAY-1, cellStyle.getFillPattern().getCode()); @@ -657,12 +657,12 @@ public class TestXSSFCellStyle { } @Test - public void testGetFont() { + void testGetFont() { assertNotNull(cellStyle.getFont()); } @Test - public void testGetSetHidden() { + void testGetSetHidden() { assertFalse(cellStyle.getHidden()); cellStyle.setHidden(true); assertTrue(cellStyle.getHidden()); @@ -671,7 +671,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetLocked() { + void testGetSetLocked() { assertTrue(cellStyle.getLocked()); cellStyle.setLocked(true); assertTrue(cellStyle.getLocked()); @@ -680,7 +680,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetIndent() { + void testGetSetIndent() { assertEquals((short)0, cellStyle.getIndention()); cellStyle.setIndention((short)3); assertEquals((short)3, cellStyle.getIndention()); @@ -689,7 +689,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetAlignment() { + void testGetSetAlignment() { assertNull(cellStyle.getCellAlignment().getCTCellAlignment().getHorizontal()); assertEquals(HorizontalAlignment.GENERAL, cellStyle.getAlignment()); @@ -707,7 +707,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetReadingOrder() { + void testGetSetReadingOrder() { assertEquals(ReadingOrder.CONTEXT, cellStyle.getReadingOrder()); assertEquals(ReadingOrder.CONTEXT.getCode(), cellStyle.getCellAlignment().getCTCellAlignment().getReadingOrder()); @@ -725,7 +725,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetVerticalAlignment() { + void testGetSetVerticalAlignment() { assertEquals(VerticalAlignment.BOTTOM, cellStyle.getVerticalAlignment()); assertFalse(cellStyle.getCellAlignment().getCTCellAlignment().isSetVertical()); assertEquals(STVerticalAlignment.BOTTOM, cellStyle.getCellAlignment().getCTCellAlignment().getVertical()); @@ -740,7 +740,7 @@ public class TestXSSFCellStyle { } @Test - public void testGetSetWrapText() { + void testGetSetWrapText() { assertFalse(cellStyle.getWrapText()); cellStyle.setWrapText(true); assertTrue(cellStyle.getWrapText()); @@ -752,7 +752,7 @@ public class TestXSSFCellStyle { * Cloning one XSSFCellStyle onto Another, same XSSFWorkbook */ @Test - public void testCloneStyleSameWB() throws IOException { + void testCloneStyleSameWB() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); assertEquals(1, wb.getNumberOfFonts()); @@ -791,7 +791,7 @@ public class TestXSSFCellStyle { * Cloning one XSSFCellStyle onto Another, different XSSFWorkbooks */ @Test - public void testCloneStyleDiffWB() throws IOException { + void testCloneStyleDiffWB() throws IOException { XSSFWorkbook wbOrig = new XSSFWorkbook(); assertEquals(1, wbOrig.getNumberOfFonts()); assertEquals(0, wbOrig.getStylesSource().getNumberFormats().size()); @@ -883,7 +883,7 @@ public class TestXSSFCellStyle { * in a workbook that has an empty xf table. */ @Test - public void testBug52348() throws IOException { + void testBug52348() throws IOException { XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("52348.xlsx"); StylesTable st = workbook.getStylesSource(); assertEquals(0, st._getStyleXfsSize()); @@ -902,7 +902,7 @@ public class TestXSSFCellStyle { * in a workbook that has an empty xf table. */ @Test - public void testBug55650() throws IOException { + void testBug55650() throws IOException { XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("52348.xlsx"); StylesTable st = workbook.getStylesSource(); assertEquals(0, st._getStyleXfsSize()); @@ -919,7 +919,7 @@ public class TestXSSFCellStyle { } @Test - public void testShrinkToFit() throws IOException { + void testShrinkToFit() throws IOException { // Existing file XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("ShrinkToFit.xlsx"); Sheet s = wb1.getSheetAt(0); @@ -963,7 +963,7 @@ public class TestXSSFCellStyle { } @Test - public void testSetColor() throws IOException { + void testSetColor() throws IOException { try(Workbook wb = new XSSFWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -1011,7 +1011,7 @@ public class TestXSSFCellStyle { } @Test - public void test58084() throws IOException { + void test58084() throws IOException { Workbook reference = XSSFTestDataSamples.openSampleWorkbook("template.xlsx"); Workbook target = new XSSFWorkbook(); copyStyles(reference, target); @@ -1041,7 +1041,7 @@ public class TestXSSFCellStyle { } @Test - public void test58043() { + void test58043() { assertEquals(0, cellStyle.getRotation()); cellStyle.setRotation((short)89); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChart.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChart.java index 984416cc4a..7f6978683f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChart.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChart.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public final class TestXSSFChart { @Test - public void testGetAccessors() throws IOException { + void testGetAccessors() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithThreeCharts.xlsx")) { XSSFSheet s1 = wb.getSheetAt(0); XSSFSheet s2 = wb.getSheetAt(1); @@ -43,7 +43,7 @@ public final class TestXSSFChart { } @Test - public void testGetCharts() throws Exception { + void testGetCharts() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithThreeCharts.xlsx")) { XSSFSheet s1 = wb.getSheetAt(0); XSSFSheet s2 = wb.getSheetAt(1); @@ -72,7 +72,7 @@ public final class TestXSSFChart { } @Test - public void testAddChartsToNewWorkbook() throws Exception { + void testAddChartsToNewWorkbook() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet s1 = wb.createSheet(); XSSFDrawing d1 = s1.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChartSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChartSheet.java index 4f605cc82d..a97ca36e94 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChartSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFChartSheet.java @@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.*; public final class TestXSSFChartSheet { @Test - public void testXSSFFactory() throws IOException { + void testXSSFFactory() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chart_sheet.xlsx")) { assertEquals(4, wb.getNumberOfSheets()); @@ -44,7 +44,7 @@ public final class TestXSSFChartSheet { } @Test - public void testGetAccessors() throws IOException { + void testGetAccessors() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chart_sheet.xlsx")) { XSSFChartSheet sheet = (XSSFChartSheet) wb.getSheetAt(2); @@ -69,7 +69,7 @@ public final class TestXSSFChartSheet { } @Test - public void testGetCharts() throws Exception { + void testGetCharts() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chart_sheet.xlsx")) { XSSFSheet ns = wb.getSheetAt(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java index d7b1a865da..de61983508 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java @@ -51,7 +51,7 @@ public class TestXSSFColGrouping { * POI-52186 */ @Test - public void testNoColsWithoutWidthWhenGrouping() throws IOException { + void testNoColsWithoutWidthWhenGrouping() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { XSSFSheet sheet = wb1.createSheet("test"); @@ -79,7 +79,7 @@ public class TestXSSFColGrouping { * POI-52186 */ @Test - public void testNoColsWithoutWidthWhenGroupingAndCollapsing() throws IOException { + void testNoColsWithoutWidthWhenGroupingAndCollapsing() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { XSSFSheet sheet = wb1.createSheet("test"); @@ -111,7 +111,7 @@ public class TestXSSFColGrouping { * Test the cols element is correct in case of NumericRanges.OVERLAPS_2_WRAPS */ @Test - public void testMergingOverlappingCols_OVERLAPS_2_WRAPS() throws IOException { + void testMergingOverlappingCols_OVERLAPS_2_WRAPS() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { XSSFSheet sheet = wb1.createSheet("test"); @@ -159,7 +159,7 @@ public class TestXSSFColGrouping { * Test the cols element is correct in case of NumericRanges.OVERLAPS_1_WRAPS */ @Test - public void testMergingOverlappingCols_OVERLAPS_1_WRAPS() throws IOException { + void testMergingOverlappingCols_OVERLAPS_1_WRAPS() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { XSSFSheet sheet = wb1.createSheet("test"); @@ -207,7 +207,7 @@ public class TestXSSFColGrouping { * Test the cols element is correct in case of NumericRanges.OVERLAPS_1_MINOR */ @Test - public void testMergingOverlappingCols_OVERLAPS_1_MINOR() throws IOException { + void testMergingOverlappingCols_OVERLAPS_1_MINOR() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { XSSFSheet sheet = wb1.createSheet("test"); @@ -256,7 +256,7 @@ public class TestXSSFColGrouping { * Test the cols element is correct in case of NumericRanges.OVERLAPS_2_MINOR */ @Test - public void testMergingOverlappingCols_OVERLAPS_2_MINOR() throws IOException { + void testMergingOverlappingCols_OVERLAPS_2_MINOR() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { XSSFSheet sheet = wb1.createSheet("test"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java index 70c594cf34..88c54d7386 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java @@ -32,7 +32,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRgbColor; public final class TestXSSFColor { @Test - public void testIndexedColour() throws Exception { + void testIndexedColour() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48779.xlsx")) { // Check the CTColor is as expected XSSFColor indexed = wb.getCellStyleAt(1).getFillBackgroundXSSFColor(); @@ -77,7 +77,7 @@ public final class TestXSSFColor { } @Test - public void testRGBColour() throws IOException { + void testRGBColour() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50299.xlsx")) { // Check the CTColor is as expected @@ -134,7 +134,7 @@ public final class TestXSSFColor { } @Test - public void testARGBColour() throws IOException { + void testARGBColour() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48779.xlsx")) { // Check the CTColor is as expected @@ -183,7 +183,7 @@ public final class TestXSSFColor { } @Test - public void testCustomIndexedColour() throws Exception { + void testCustomIndexedColour() throws Exception { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("customIndexedColors.xlsx")) { XSSFCell cell = wb.getSheetAt(1).getRow(0).getCell(0); XSSFColor color = cell.getCellStyle().getFillForegroundColorColor(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java index 177f4f3ae8..f72eb5c3e6 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java @@ -195,7 +195,7 @@ public final class TestXSSFComment extends BaseTestCellComment { } @Test - public void testBug58175() throws IOException { + void testBug58175() throws IOException { try (SXSSFWorkbook wb = new SXSSFWorkbook()) { Sheet sheet = wb.createSheet(); @@ -264,7 +264,7 @@ public final class TestXSSFComment extends BaseTestCellComment { @Disabled("Used for manual testing with opening the resulting Workbook in Excel") @Test - public void testBug58175a() throws IOException { + void testBug58175a() throws IOException { try (Workbook wb = new SXSSFWorkbook()) { Sheet sheet = wb.createSheet(); @@ -305,7 +305,7 @@ public final class TestXSSFComment extends BaseTestCellComment { } @Test - public void testBug55814() throws IOException { + void testBug55814() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("55814.xlsx")) { int oldsheetIndex = wb.getSheetIndex("example"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFConditionalFormatting.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFConditionalFormatting.java index 6ae7f31bf9..308b14b270 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFConditionalFormatting.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFConditionalFormatting.java @@ -58,19 +58,19 @@ public class TestXSSFConditionalFormatting extends BaseTestConditionalFormatting } @Test - public void testRead() throws IOException { + void testRead() throws IOException { testRead("WithConditionalFormatting.xlsx"); } @Test - public void testReadOffice2007() throws IOException { + void testReadOffice2007() throws IOException { testReadOffice2007("NewStyleConditionalFormattings.xlsx"); } private final static java.awt.Color PEAK_ORANGE = new java.awt.Color(255, 239, 221); @Test - public void testFontFormattingColor() { + void testFontFormattingColor() { XSSFWorkbook wb = XSSFITestDataProvider.instance.createWorkbook(); final Sheet sheet = wb.createSheet(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java index a2c556fe93..b9e2474309 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java @@ -48,7 +48,7 @@ public final class TestXSSFDataFormat extends BaseTestDataFormat { * [Bug 58778] Built-in number formats can be overridden with XSSFDataFormat.putFormat(int id, String fmt) */ @Test - public void test58778() throws IOException { + void test58778() throws IOException { try (XSSFWorkbook wb1 = new XSSFWorkbook()) { Cell cell = wb1.createSheet("bug58778").createRow(0).createCell(0); cell.setCellValue(5.25); @@ -77,7 +77,7 @@ public final class TestXSSFDataFormat extends BaseTestDataFormat { } @Test - public void testConditionalFormattingEvaluation() throws IOException { + void testConditionalFormattingEvaluation() throws IOException { try (Workbook wb = openSampleWorkbook("61060-conditional-number-formatting.xlsx")) { final DataFormatter formatter = new DataFormatter(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java index 9cc9a8f9cf..d7ef99714b 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java @@ -49,7 +49,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testAddValidations() throws Exception { + void testAddValidations() throws Exception { XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("DataValidations-49244.xlsx"); XSSFSheet sheet = wb1.getSheetAt(0); List dataValidations = sheet.getDataValidations(); @@ -255,7 +255,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void test53965() throws Exception { + void test53965() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); List lst = sheet.getDataValidations(); //<-- works @@ -277,7 +277,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testDefaultErrorStyle() throws IOException { + void testDefaultErrorStyle() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -290,7 +290,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testSetErrorStyles() throws IOException { + void testSetErrorStyles() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -316,7 +316,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testDefaultAllowBlank() throws IOException { + void testDefaultAllowBlank() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -329,7 +329,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testSetAllowBlankToFalse() throws IOException { + void testSetAllowBlankToFalse() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -344,7 +344,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testSetAllowBlankToTrue() throws IOException { + void testSetAllowBlankToTrue() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -370,7 +370,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { } @Test - public void testTableBasedValidationList() throws IOException { + void testTableBasedValidationList() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("dataValidationTableRange.xlsx")) { XSSFFormulaEvaluator fEval = wb.getCreationHelper().createFormulaEvaluator(); DataValidationEvaluator dve = new DataValidationEvaluator(wb, fEval); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java index 4141a2b0a4..acaa97c62f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java @@ -34,7 +34,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDialogsheet; public class TestXSSFDialogSheet { @Test - public void testCreateDialogSheet() throws IOException { + void testCreateDialogSheet() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); Sheet dialogsheet = workbook.createDialogsheet("Dialogsheet 1", CTDialogsheet.Factory.newInstance()); assertNotNull(dialogsheet); @@ -42,7 +42,7 @@ public class TestXSSFDialogSheet { } @Test - public void testGetDialog() throws IOException { + void testGetDialog() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet dialogsheet = workbook.createDialogsheet("Dialogsheet 1", null); assertTrue(dialogsheet.getDialog()); @@ -50,7 +50,7 @@ public class TestXSSFDialogSheet { } @Test - public void testAddRow() throws IOException { + void testAddRow() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); Sheet dialogsheet = workbook.createDialogsheet("Dialogsheet 1", CTDialogsheet.Factory.newInstance()); assertNotNull(dialogsheet); @@ -60,7 +60,7 @@ public class TestXSSFDialogSheet { } @Test - public void testGetSetAutoBreaks() throws IOException { + void testGetSetAutoBreaks() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertTrue(sheet.getAutobreaks()); @@ -70,7 +70,7 @@ public class TestXSSFDialogSheet { } @Test - public void testIsSetFitToPage() throws IOException { + void testIsSetFitToPage() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertFalse(sheet.getFitToPage()); @@ -83,7 +83,7 @@ public class TestXSSFDialogSheet { @Test - public void testGetFooter() throws IOException { + void testGetFooter() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertNotNull(sheet.getFooter()); @@ -93,7 +93,7 @@ public class TestXSSFDialogSheet { } @Test - public void testGetAllHeadersFooters() throws IOException { + void testGetAllHeadersFooters() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertNotNull(sheet); @@ -131,7 +131,7 @@ public class TestXSSFDialogSheet { } @Test - public void testGetSetHorizontallyCentered() throws IOException { + void testGetSetHorizontallyCentered() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertFalse(sheet.getHorizontallyCenter()); @@ -143,7 +143,7 @@ public class TestXSSFDialogSheet { } @Test - public void testGetSetVerticallyCentered() throws IOException { + void testGetSetVerticallyCentered() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertFalse(sheet.getVerticallyCenter()); @@ -155,7 +155,7 @@ public class TestXSSFDialogSheet { } @Test - public void testIsSetPrintGridlines() throws IOException { + void testIsSetPrintGridlines() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertFalse(sheet.isPrintGridlines()); @@ -165,7 +165,7 @@ public class TestXSSFDialogSheet { } @Test - public void testIsSetDisplayFormulas() throws IOException { + void testIsSetDisplayFormulas() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertFalse(sheet.isDisplayFormulas()); @@ -175,7 +175,7 @@ public class TestXSSFDialogSheet { } @Test - public void testIsSetDisplayGridLines() throws IOException { + void testIsSetDisplayGridLines() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertTrue(sheet.isDisplayGridlines()); @@ -185,7 +185,7 @@ public class TestXSSFDialogSheet { } @Test - public void testIsSetDisplayRowColHeadings() throws IOException { + void testIsSetDisplayRowColHeadings() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertTrue(sheet.isDisplayRowColHeadings()); @@ -195,7 +195,7 @@ public class TestXSSFDialogSheet { } @Test - public void testGetScenarioProtect() throws IOException { + void testGetScenarioProtect() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFDialogsheet sheet = workbook.createDialogsheet("Dialogsheet 1", null); assertFalse(sheet.getScenarioProtect()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java index e2bd1e9a31..2cdc0baf22 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java @@ -50,7 +50,7 @@ public class TestXSSFDrawing { } @Test - public void testRead() throws IOException { + void testRead() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithDrawing.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); //the sheet has one relationship and it is XSSFDrawing @@ -85,7 +85,7 @@ public class TestXSSFDrawing { } @Test - public void testNew() throws IOException { + void testNew() throws IOException { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); //multiple calls of createDrawingPatriarch should return the same instance of XSSFDrawing @@ -163,7 +163,7 @@ public class TestXSSFDrawing { } @Test - public void testMultipleDrawings() throws IOException{ + void testMultipleDrawings() throws IOException{ XSSFWorkbook wb = new XSSFWorkbook(); for (int i = 0; i < 3; i++) { XSSFSheet sheet = wb.createSheet(); @@ -178,7 +178,7 @@ public class TestXSSFDrawing { } @Test - public void testClone() throws Exception{ + void testClone() throws Exception{ XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithDrawing.xlsx"); XSSFSheet sheet1 = wb.getSheetAt(0); @@ -220,7 +220,7 @@ public class TestXSSFDrawing { * See Bugzilla 52219. */ @Test - public void testRichText() throws IOException { + void testRichText() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -256,7 +256,7 @@ public class TestXSSFDrawing { * test that anchor is not null when reading shapes from existing drawings */ @Test - public void testReadAnchors() throws IOException { + void testReadAnchors() throws IOException { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -294,7 +294,7 @@ public class TestXSSFDrawing { * See Bugzilla 54969. */ @Test - public void testRichTextFontAndColor() throws IOException { + void testRichTextFontAndColor() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -325,7 +325,7 @@ public class TestXSSFDrawing { * Test setText single paragraph to ensure backwards compatibility */ @Test - public void testSetTextSingleParagraph() throws IOException { + void testSetTextSingleParagraph() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -361,7 +361,7 @@ public class TestXSSFDrawing { * Test addNewTextParagraph */ @Test - public void testAddNewTextParagraph() throws IOException { + void testAddNewTextParagraph() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -386,7 +386,7 @@ public class TestXSSFDrawing { * Test addNewTextParagraph using RichTextString */ @Test - public void testAddNewTextParagraphWithRTS() throws IOException { + void testAddNewTextParagraphWithRTS() throws IOException { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -459,7 +459,7 @@ public class TestXSSFDrawing { * Test add multiple paragraphs and retrieve text */ @Test - public void testAddMultipleParagraphs() throws IOException { + void testAddMultipleParagraphs() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -487,7 +487,7 @@ public class TestXSSFDrawing { * Test setting the text, then adding multiple paragraphs and retrieve text */ @Test - public void testSetAddMultipleParagraphs() throws IOException { + void testSetAddMultipleParagraphs() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -514,7 +514,7 @@ public class TestXSSFDrawing { * Test reading text from a textbox in an existing file */ @Test - public void testReadTextBox() throws IOException { + void testReadTextBox() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithDrawing.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); //the sheet has one relationship and it is XSSFDrawing @@ -549,7 +549,7 @@ public class TestXSSFDrawing { * Test reading multiple paragraphs from a textbox in an existing file */ @Test - public void testReadTextBoxParagraphs() throws IOException { + void testReadTextBoxParagraphs() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithTextBox.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); //the sheet has one relationship and it is XSSFDrawing @@ -611,7 +611,7 @@ public class TestXSSFDrawing { * Test adding and reading back paragraphs as bullet points */ @Test - public void testAddBulletParagraphs() throws IOException { + void testAddBulletParagraphs() throws IOException { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); @@ -724,7 +724,7 @@ public class TestXSSFDrawing { * Test reading bullet numbering from a textbox in an existing file */ @Test - public void testReadTextBox2() throws IOException { + void testReadTextBox2() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithTextBox2.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -748,7 +748,7 @@ public class TestXSSFDrawing { } @Test - public void testXSSFSimpleShapeCausesNPE56514() throws IOException { + void testXSSFSimpleShapeCausesNPE56514() throws IOException { XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("56514.xlsx"); XSSFSheet sheet = wb1.getSheetAt(0); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -766,7 +766,7 @@ public class TestXSSFDrawing { } @Test - public void testXSSFSAddPicture() throws Exception { + void testXSSFSAddPicture() throws Exception { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); //multiple calls of createDrawingPatriarch should return the same instance of XSSFDrawing @@ -831,7 +831,7 @@ public class TestXSSFDrawing { } @Test - public void testBug56835CellComment() throws IOException { + void testBug56835CellComment() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -847,7 +847,7 @@ public class TestXSSFDrawing { } @Test - public void testGroupShape() throws Exception { + void testGroupShape() throws Exception { XSSFWorkbook wb1 = new XSSFWorkbook(); XSSFSheet sheet = wb1.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvaluationSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvaluationSheet.java index 0a92d72c58..32a883b356 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvaluationSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvaluationSheet.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; public class TestXSSFEvaluationSheet extends BaseTestXEvaluationSheet { @Test - public void test() throws Exception { + void test() throws Exception { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet("test"); XSSFRow row = sheet.createRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenFooter.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenFooter.java index 2f737647ce..938b4636ae 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenFooter.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenFooter.java @@ -40,7 +40,7 @@ public class TestXSSFEvenFooter { } @Test - public void testSetGetText() { + void testSetGetText() { XSSFEvenFooter footer = (XSSFEvenFooter) sheet.getEvenFooter(); assertNotNull(footer); assertNull(footer.getText()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenHeader.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenHeader.java index e4070c3996..dc8d2ab584 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenHeader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFEvenHeader.java @@ -40,7 +40,7 @@ public class TestXSSFEvenHeader { } @Test - public void testSetGetText() { + void testSetGetText() { XSSFEvenHeader header = (XSSFEvenHeader) sheet.getEvenHeader(); assertNotNull(header); assertNull(header.getText()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstFooter.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstFooter.java index 8f0a050f8b..87ff0fde1e 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstFooter.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstFooter.java @@ -40,7 +40,7 @@ public class TestXSSFFirstFooter { } @Test - public void testSetGetText() { + void testSetGetText() { XSSFFirstFooter footer = (XSSFFirstFooter) sheet.getFirstFooter(); assertNotNull(footer); assertNull(footer.getText()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstHeader.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstHeader.java index 1734d0387e..7432e802ea 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstHeader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFirstHeader.java @@ -40,7 +40,7 @@ public class TestXSSFFirstHeader { } @Test - public void testSetGetText() { + void testSetGetText() { XSSFFirstHeader header = (XSSFFirstHeader) sheet.getFirstHeader(); assertNotNull(header); assertNull(header.getText()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java index f1b58eeed5..6ec3eb8aaa 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java @@ -63,13 +63,13 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testConstructor() { + void testConstructor() { XSSFFont xssfFont=new XSSFFont(); assertNotNull(xssfFont.getCTFont()); } @Test - public void testBold() { + void testBold() { CTFont ctFont=CTFont.Factory.newInstance(); CTBooleanProperty bool=ctFont.addNewB(); bool.setVal(false); @@ -85,7 +85,7 @@ public final class TestXSSFFont extends BaseTestFont{ @SuppressWarnings("deprecation") @Test - public void testCharSetWithDeprecatedFontCharset() throws IOException { + void testCharSetWithDeprecatedFontCharset() throws IOException { CTFont ctFont=CTFont.Factory.newInstance(); CTIntProperty prop=ctFont.addNewCharset(); prop.setVal(org.apache.poi.ss.usermodel.FontCharset.ANSI.getValue()); @@ -130,7 +130,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testCharSet() throws IOException { + void testCharSet() throws IOException { CTFont ctFont=CTFont.Factory.newInstance(); CTIntProperty prop=ctFont.addNewCharset(); prop.setVal(FontCharset.ANSI.getNativeId()); @@ -174,7 +174,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testFontName() { + void testFontName() { CTFont ctFont=CTFont.Factory.newInstance(); CTFontName fname=ctFont.addNewName(); fname.setVal("Arial"); @@ -188,7 +188,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testItalic() { + void testItalic() { CTFont ctFont=CTFont.Factory.newInstance(); CTBooleanProperty bool=ctFont.addNewI(); bool.setVal(false); @@ -204,7 +204,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testStrikeout() { + void testStrikeout() { CTFont ctFont=CTFont.Factory.newInstance(); CTBooleanProperty bool=ctFont.addNewStrike(); bool.setVal(false); @@ -220,7 +220,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testFontHeight() { + void testFontHeight() { CTFont ctFont=CTFont.Factory.newInstance(); CTFontSize size=ctFont.addNewSz(); size.setVal(11); @@ -234,7 +234,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testFontHeightInPoint() { + void testFontHeightInPoint() { CTFont ctFont=CTFont.Factory.newInstance(); CTFontSize size=ctFont.addNewSz(); size.setVal(14); @@ -248,7 +248,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testUnderline() { + void testUnderline() { CTFont ctFont=CTFont.Factory.newInstance(); CTUnderlineProperty underlinePropr=ctFont.addNewU(); underlinePropr.setVal(STUnderlineValues.SINGLE); @@ -267,7 +267,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testColor() { + void testColor() { CTFont ctFont=CTFont.Factory.newInstance(); CTColor color=ctFont.addNewColor(); color.setIndexed(XSSFFont.DEFAULT_FONT_COLOR); @@ -281,7 +281,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testRgbColor() { + void testRgbColor() { CTFont ctFont=CTFont.Factory.newInstance(); CTColor color=ctFont.addNewColor(); @@ -307,7 +307,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testThemeColor() { + void testThemeColor() { CTFont ctFont=CTFont.Factory.newInstance(); CTColor color=ctFont.addNewColor(); color.setTheme(1); @@ -321,7 +321,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testFamily() { + void testFamily() { CTFont ctFont=CTFont.Factory.newInstance(); CTFontFamily family=ctFont.addNewFamily(); family.setVal(FontFamily.MODERN.getValue()); @@ -332,7 +332,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testScheme() { + void testScheme() { CTFont ctFont=CTFont.Factory.newInstance(); CTFontScheme scheme=ctFont.addNewScheme(); scheme.setVal(STFontScheme.MAJOR); @@ -346,7 +346,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testTypeOffset() { + void testTypeOffset() { CTFont ctFont=CTFont.Factory.newInstance(); CTVerticalAlignFontProperty valign=ctFont.addNewVertAlign(); valign.setVal(STVerticalAlignRun.BASELINE); @@ -361,7 +361,7 @@ public final class TestXSSFFont extends BaseTestFont{ // store test from TestSheetUtil here as it uses XSSF @Test - public void testCanComputeWidthXSSF() throws IOException { + void testCanComputeWidthXSSF() throws IOException { try (Workbook wb = new XSSFWorkbook()) { // cannot check on result because on some machines we get back false here! @@ -372,7 +372,7 @@ public final class TestXSSFFont extends BaseTestFont{ // store test from TestSheetUtil here as it uses XSSF @Test - public void testCanComputeWidthInvalidFont() { + void testCanComputeWidthInvalidFont() { Font font = new XSSFFont(CTFont.Factory.newInstance()); font.setFontName("some non existing font name"); @@ -384,7 +384,7 @@ public final class TestXSSFFont extends BaseTestFont{ * Test that fonts get added properly */ @Test - public void testFindFont() throws IOException { + void testFindFont() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { assertEquals(1, wb.getNumberOfFonts()); @@ -483,7 +483,7 @@ public final class TestXSSFFont extends BaseTestFont{ } @Test - public void testEquals() { + void testEquals() { XSSFFont font = new XSSFFont(); XSSFFont equ = new XSSFFont(); XSSFFont notequ = new XSSFFont(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java index 883b53165a..64f459298f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java @@ -51,7 +51,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { } @Test - public void testSharedFormulas_evaluateInCell() throws IOException { + void testSharedFormulas_evaluateInCell() throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook("49872.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Sheet sheet = wb.getSheetAt(0); @@ -81,7 +81,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { * Evaluation of cell references with column indexes greater than 255. See bugzilla 50096 */ @Test - public void testEvaluateColumnGreaterThan255() throws IOException { + void testEvaluateColumnGreaterThan255() throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook("50096.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); @@ -115,7 +115,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { * workbooks, both HSSF and XSSF ones */ @Test - public void testReferencesToOtherWorkbooks() throws Exception { + void testReferencesToOtherWorkbooks() throws Exception { try (Workbook wb = _testDataProvider.openSampleWorkbook("ref2-56737.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Sheet s = wb.getSheetAt(0); @@ -232,7 +232,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { * See bug #56752 */ // @Disabled -// public void testCachedReferencesToOtherWorkbooks() { +// void testCachedReferencesToOtherWorkbooks() { // } /** @@ -244,7 +244,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { */ @ParameterizedTest @ValueSource(strings = {"55906-MultiSheetRefs.xls","55906-MultiSheetRefs.xlsx"}) - public void testMultiSheetReferencesHSSFandXSSF(String sampleFileName) throws Exception { + void testMultiSheetReferencesHSSFandXSSF(String sampleFileName) throws Exception { Function fun = sampleFileName.endsWith("x") ? XSSFTestDataSamples::openSampleWorkbook : HSSFTestDataSamples::openSampleWorkbook; @@ -309,7 +309,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { */ @ParameterizedTest @ValueSource(strings = {"55906-MultiSheetRefs.xls","55906-MultiSheetRefs.xlsx"}) - public void testMultiSheetAreasHSSFandXSSF(String sampleFileName) throws Exception { + void testMultiSheetAreasHSSFandXSSF(String sampleFileName) throws Exception { Function fun = sampleFileName.endsWith("x") ? XSSFTestDataSamples::openSampleWorkbook : HSSFTestDataSamples::openSampleWorkbook; @@ -364,7 +364,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { } @Test - public void test59736() throws IOException { + void test59736() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("59736.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Cell cell = wb.getSheetAt(0).getRow(0).getCell(0); @@ -392,7 +392,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { } @Test - public void testBug61468() throws IOException { + void testBug61468() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("simple-monthly-budget.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Cell cell = wb.getSheetAt(0).getRow(8).getCell(4); @@ -405,7 +405,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { @Test @Disabled("this is from an open bug/discussion over handling localization for number formats") - public void testBug61495() throws IOException { + void testBug61495() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("61495-test.xlsm")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); Cell cell = wb.getSheetAt(0).getRow(0).getCell(1); @@ -425,7 +425,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { * see bug 62834, handle when a shared formula range doesn't contain only formula cells */ @Test - public void testBug62834() throws IOException { + void testBug62834() throws IOException { try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("62834.xlsx")) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java index 49876ec205..8dbb509f33 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java @@ -407,7 +407,7 @@ public final class TestXSSFFormulaParser { } @Test - public void test58648Single() throws IOException { + void test58648Single() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb); Ptg[] ptgs; @@ -420,7 +420,7 @@ public final class TestXSSFFormulaParser { } @Test - public void test58648Basic() throws IOException { + void test58648Basic() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb); Ptg[] ptgs; @@ -463,7 +463,7 @@ public final class TestXSSFFormulaParser { } @Test - public void test58648FormulaParsing() throws IOException { + void test58648FormulaParsing() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58648.xlsx"); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); @@ -494,7 +494,7 @@ public final class TestXSSFFormulaParser { } @Test - public void testWhitespaceInFormula() throws IOException { + void testWhitespaceInFormula() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb); Ptg[] ptgs; @@ -536,7 +536,7 @@ public final class TestXSSFFormulaParser { } @Test - public void testWhitespaceInComplexFormula() throws IOException { + void testWhitespaceInComplexFormula() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb); Ptg[] ptgs; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHeaderFooterProperties.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHeaderFooterProperties.java index 7137cdb8fa..10c6b6b2c7 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHeaderFooterProperties.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHeaderFooterProperties.java @@ -43,14 +43,14 @@ public class TestXSSFHeaderFooterProperties { } @Test - public void testGetAlignWithMargins() { + void testGetAlignWithMargins() { assertFalse(hfProp.getAlignWithMargins()); hfProp.setAlignWithMargins(true); assertTrue(hfProp.getAlignWithMargins()); } @Test - public void testGetDifferentFirst() { + void testGetDifferentFirst() { assertFalse(hfProp.getDifferentFirst()); hfProp.setDifferentFirst(true); assertTrue(hfProp.getDifferentFirst()); @@ -59,7 +59,7 @@ public class TestXSSFHeaderFooterProperties { } @Test - public void testGetDifferentOddEven() { + void testGetDifferentOddEven() { assertFalse(hfProp.getDifferentOddEven()); hfProp.setDifferentOddEven(true); assertTrue(hfProp.getDifferentOddEven()); @@ -68,14 +68,14 @@ public class TestXSSFHeaderFooterProperties { } @Test - public void testGetScaleWithDoc() { + void testGetScaleWithDoc() { assertFalse(hfProp.getScaleWithDoc()); hfProp.setScaleWithDoc(true); assertTrue(hfProp.getScaleWithDoc()); } @Test - public void testRemoveAlignWithMargins() { + void testRemoveAlignWithMargins() { hfProp.setAlignWithMargins(true); assertTrue(hfProp.getHeaderFooter().isSetAlignWithMargins()); hfProp.removeAlignWithMargins(); @@ -83,7 +83,7 @@ public class TestXSSFHeaderFooterProperties { } @Test - public void testRemoveDifferentFirst() { + void testRemoveDifferentFirst() { hfProp.setDifferentFirst(true); assertTrue(hfProp.getHeaderFooter().isSetDifferentFirst()); hfProp.removeDifferentFirst(); @@ -91,7 +91,7 @@ public class TestXSSFHeaderFooterProperties { } @Test - public void testRemoveDifferentOddEven() { + void testRemoveDifferentOddEven() { hfProp.setDifferentOddEven(true); assertTrue(hfProp.getHeaderFooter().isSetDifferentOddEven()); hfProp.removeDifferentOddEven(); @@ -99,7 +99,7 @@ public class TestXSSFHeaderFooterProperties { } @Test - public void testRemoveScaleWithDoc() { + void testRemoveScaleWithDoc() { hfProp.setScaleWithDoc(true); assertTrue(hfProp.getHeaderFooter().isSetScaleWithDoc()); hfProp.removeScaleWithDoc(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java index d9090cf53f..203fbba80c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java @@ -39,7 +39,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void testLoadExisting() throws IOException { + void testLoadExisting() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithMoreVariousData.xlsx")) { assertEquals(3, workbook.getNumberOfSheets()); @@ -52,7 +52,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void testCreate() throws Exception { + void testCreate() throws Exception { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet(); XSSFRow row = sheet.createRow(0); @@ -97,7 +97,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void testInvalidURLs() throws IOException { + void testInvalidURLs() throws IOException { try (XSSFWorkbook workbook = new XSSFWorkbook()) { XSSFCreationHelper createHelper = workbook.getCreationHelper(); @@ -114,7 +114,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void testLoadSave() throws IOException { + void testLoadSave() throws IOException { try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithMoreVariousData.xlsx")) { CreationHelper createHelper = workbook.getCreationHelper(); assertEquals(3, workbook.getNumberOfSheets()); @@ -224,7 +224,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void test52716() throws IOException { + void test52716() throws IOException { try (XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("52716.xlsx")) { XSSFSheet sh1 = wb1.getSheetAt(0); @@ -245,7 +245,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void test53734() throws IOException { + void test53734() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53734.xlsx")) { Hyperlink link = wb.getSheetAt(0).getRow(0).getCell(0).getHyperlink(); assertEquals("javascript:///", link.getAddress()); @@ -258,7 +258,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void test53282() throws IOException { + void test53282() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53282.xlsx")) { Hyperlink link = wb.getSheetAt(0).getRow(0).getCell(14).getHyperlink(); assertEquals("mailto:nobody@nowhere.uk%C2%A0", link.getAddress()); @@ -276,7 +276,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void testCopyHSSFHyperlink() throws IOException { + void testCopyHSSFHyperlink() throws IOException { HSSFWorkbook hssfworkbook = new HSSFWorkbook(); HSSFHyperlink hlink = hssfworkbook.getCreationHelper().createHyperlink(HyperlinkType.URL); hlink.setAddress("http://poi.apache.org/"); @@ -299,7 +299,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { * URLs with a hash mark (#) are still URL hyperlinks, not document links */ @Test - public void testURLsWithHashMark() throws IOException { + void testURLsWithHashMark() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("59775.xlsx"); XSSFSheet sh = wb.getSheetAt(0); CellAddress A2 = new CellAddress("A2"); @@ -331,7 +331,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink { } @Test - public void test() throws IOException { + void test() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); CreationHelper createHelper = wb.getCreationHelper(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFName.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFName.java index 96d9dc4346..19d0bbb2b4 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFName.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFName.java @@ -39,7 +39,7 @@ public final class TestXSSFName extends BaseTestNamedRange { //TODO combine testRepeatingRowsAndColums() for HSSF and XSSF @Test - public void testRepeatingRowsAndColums() throws Exception { + void testRepeatingRowsAndColums() throws Exception { // First test that setting RR&C for same sheet more than once only creates a // single Print_Titles built-in record XSSFWorkbook wb = new XSSFWorkbook(); @@ -100,7 +100,7 @@ public final class TestXSSFName extends BaseTestNamedRange { } @Test - public void testSetNameName() throws Exception { + void testSetNameName() throws Exception { // Test that renaming named ranges doesn't break our new named range map XSSFWorkbook wb = new XSSFWorkbook(); wb.createSheet("First Sheet"); @@ -135,7 +135,7 @@ public final class TestXSSFName extends BaseTestNamedRange { //github-55 @Test - public void testSetNameNameCellAddress() throws IOException { + void testSetNameNameCellAddress() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); wb.createSheet("First Sheet"); XSSFName name = wb.createName(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddFooter.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddFooter.java index e9f51bc02e..ecfd22dfa1 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddFooter.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddFooter.java @@ -40,7 +40,7 @@ public class TestXSSFOddFooter { } @Test - public void testSetGetText() { + void testSetGetText() { XSSFOddFooter footer = (XSSFOddFooter) sheet.getOddFooter(); assertNotNull(footer); assertNull(footer.getText()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddHeader.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddHeader.java index fe49bdd175..94dc92ffd1 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddHeader.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFOddHeader.java @@ -40,7 +40,7 @@ public class TestXSSFOddHeader { } @Test - public void testSetGetText() { + void testSetGetText() { XSSFOddHeader header = (XSSFOddHeader) sheet.getOddHeader(); assertNotNull(header); assertNull(header.getText()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java index 27c7acd238..5f8514c87b 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; */ public final class TestXSSFPictureData { @Test - public void testRead() throws IOException { + void testRead() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithDrawing.xlsx"); List pictures = wb.getAllPictures(); //wb.getAllPictures() should return the same instance across multiple calls @@ -63,7 +63,7 @@ public final class TestXSSFPictureData { } @Test - public void testNew() throws IOException { + void testNew() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -119,7 +119,7 @@ public final class TestXSSFPictureData { * Bug 53568: XSSFPicture.getPictureData() can return null. */ @Test - public void test53568() throws IOException { + void test53568() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53568.xlsx"); List pictures = wb.getAllPictures(); assertNotNull(pictures); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java index 4f0f0b02c0..9fcc6a0bc3 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class TestXSSFPrintSetup { @Test - public void testSetGetPaperSize() { + void testSetGetPaperSize() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setPaperSize(9); @@ -52,7 +52,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetScale() { + void testSetGetScale() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setScale(9); @@ -64,7 +64,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetPageStart() { + void testSetGetPageStart() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setFirstPageNumber(9); @@ -76,7 +76,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetFitWidthHeight() { + void testSetGetFitWidthHeight() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setFitToWidth(50); @@ -93,7 +93,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetLeftToRight() { + void testSetGetLeftToRight() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setPageOrder(STPageOrder.DOWN_THEN_OVER); @@ -105,7 +105,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetOrientation() { + void testSetGetOrientation() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setOrientation(STOrientation.PORTRAIT); @@ -121,7 +121,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetValidSettings() { + void testSetGetValidSettings() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setUsePrinterDefaults(false); @@ -133,7 +133,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetNoColor() { + void testSetGetNoColor() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setBlackAndWhite(false); @@ -145,7 +145,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetDraft() { + void testSetGetDraft() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setDraft(false); @@ -157,7 +157,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetNotes() { + void testSetGetNotes() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setCellComments(STCellComments.NONE); @@ -169,7 +169,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetUsePage() { + void testSetGetUsePage() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setUseFirstPageNumber(false); @@ -181,7 +181,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetHVResolution() { + void testSetGetHVResolution() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setHorizontalDpi(120); @@ -197,7 +197,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetHeaderFooterMargin() { + void testSetGetHeaderFooterMargin() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageMargins pMargins = worksheet.addNewPageMargins(); pMargins.setHeader(1.5); @@ -213,7 +213,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetMargins() { + void testSetGetMargins() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageMargins pMargins = worksheet.addNewPageMargins(); pMargins.setTop(5.3); @@ -237,7 +237,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetGetCopies() { + void testSetGetCopies() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTPageSetup pSetup = worksheet.addNewPageSetup(); pSetup.setCopies(9); @@ -249,7 +249,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetSaveRead() throws Exception { + void testSetSaveRead() throws Exception { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet s1 = wb.createSheet(); assertFalse(s1.getCTWorksheet().isSetPageSetup()); @@ -291,12 +291,12 @@ public class TestXSSFPrintSetup { * Then, change, save, read, check */ @Test - public void testRoundTrip() { + void testRoundTrip() { // TODO } @Test - public void testSetLandscapeFalse() { + void testSetLandscapeFalse() { XSSFPrintSetup ps = new XSSFPrintSetup(CTWorksheet.Factory.newInstance()); assertFalse(ps.getLandscape()); @@ -309,7 +309,7 @@ public class TestXSSFPrintSetup { } @Test - public void testSetLeftToRight() { + void testSetLeftToRight() { XSSFPrintSetup ps = new XSSFPrintSetup(CTWorksheet.Factory.newInstance()); assertFalse(ps.getLeftToRight()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java index d4efdb6321..fdda400e79 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java @@ -46,7 +46,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst; public final class TestXSSFRichTextString { @Test - public void testCreate() { + void testCreate() { XSSFRichTextString rt = new XSSFRichTextString("Apache POI"); assertEquals("Apache POI", rt.getString()); assertFalse(rt.hasFormatting()); @@ -65,7 +65,7 @@ public final class TestXSSFRichTextString { } @Test - public void testEmpty() { + void testEmpty() { XSSFRichTextString rt = new XSSFRichTextString(); assertEquals(0, rt.getIndexOfFormattingRun(9999)); assertEquals(-1, rt.getLengthOfFormattingRun(9999)); @@ -73,7 +73,7 @@ public final class TestXSSFRichTextString { } @Test - public void testApplyFont() { + void testApplyFont() { XSSFRichTextString rt = new XSSFRichTextString(); rt.append("123"); rt.append("4567"); @@ -110,7 +110,7 @@ public final class TestXSSFRichTextString { } @Test - public void testApplyFontIndex() { + void testApplyFontIndex() { XSSFRichTextString rt = new XSSFRichTextString("Apache POI"); rt.applyFont(0, 10, (short)1); @@ -120,7 +120,7 @@ public final class TestXSSFRichTextString { } @Test - public void testApplyFontWithStyles() { + void testApplyFontWithStyles() { XSSFRichTextString rt = new XSSFRichTextString("Apache POI"); StylesTable tbl = new StylesTable(); @@ -133,7 +133,7 @@ public final class TestXSSFRichTextString { } @Test - public void testApplyFontException() { + void testApplyFontException() { XSSFRichTextString rt = new XSSFRichTextString("Apache POI"); rt.applyFont(0, 0, (short)1); @@ -149,7 +149,7 @@ public final class TestXSSFRichTextString { } @Test - public void testClearFormatting() { + void testClearFormatting() { XSSFRichTextString rt = new XSSFRichTextString("Apache POI"); assertEquals("Apache POI", rt.getString()); @@ -178,7 +178,7 @@ public final class TestXSSFRichTextString { } @Test - public void testGetFonts() { + void testGetFonts() { XSSFRichTextString rt = new XSSFRichTextString(); @@ -206,7 +206,7 @@ public final class TestXSSFRichTextString { * if a string has leading or trailing white spaces */ @Test - public void testPreserveSpaces() { + void testPreserveSpaces() { XSSFRichTextString rt = new XSSFRichTextString("Apache"); CTRst ct = rt.getCTRst(); STXstring xs = ct.xgetT(); @@ -226,7 +226,7 @@ public final class TestXSSFRichTextString { * test that unicode representation_ xHHHH_ is properly processed */ @Test - public void testUtfDecode() { + void testUtfDecode() { CTRst st = CTRst.Factory.newInstance(); st.setT("abc_x000D_2ef_x000D_"); XSSFRichTextString rt = new XSSFRichTextString(st); @@ -241,7 +241,7 @@ public final class TestXSSFRichTextString { } @Test - public void testApplyFont_lowlevel(){ + void testApplyFont_lowlevel(){ CTRst st = CTRst.Factory.newInstance(); String text = "Apache Software Foundation"; XSSFRichTextString str = new XSSFRichTextString(text); @@ -356,7 +356,7 @@ public final class TestXSSFRichTextString { } @Test - public void testApplyFont_usermodel(){ + void testApplyFont_usermodel(){ String text = "Apache Software Foundation"; XSSFRichTextString str = new XSSFRichTextString(text); XSSFFont font1 = new XSSFFont(); @@ -384,7 +384,7 @@ public final class TestXSSFRichTextString { } @Test - public void testLineBreaks_bug48877() { + void testLineBreaks_bug48877() { XSSFFont font = new XSSFFont(); font.setBold(true); @@ -444,7 +444,7 @@ public final class TestXSSFRichTextString { } @Test - public void testBug56511() throws IOException { + void testBug56511() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56511.xlsx")) { for (Sheet sheet : wb) { int lastRow = sheet.getLastRowNum(); @@ -475,7 +475,7 @@ public final class TestXSSFRichTextString { } @Test - public void testBug56511_values() throws IOException { + void testBug56511_values() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56511.xlsx")) { Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(0); @@ -515,7 +515,7 @@ public final class TestXSSFRichTextString { } @Test - public void testToString() { + void testToString() { XSSFRichTextString rt = new XSSFRichTextString("Apache POI"); assertNotNull(rt.toString()); @@ -524,7 +524,7 @@ public final class TestXSSFRichTextString { } @Test - public void test59008Font() { + void test59008Font() { XSSFFont font = new XSSFFont(CTFont.Factory.newInstance()); XSSFRichTextString rts = new XSSFRichTextString(); @@ -541,14 +541,14 @@ public final class TestXSSFRichTextString { } @Test - public void test60289UtfDecode() throws IOException { + void test60289UtfDecode() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60289.xlsx"); assertEquals("Rich Text\r\nTest", wb.getSheetAt(0).getRow(1).getCell(1).getRichStringCellValue().getString()); wb.close(); } @Test - public void testUtfDecode_withApplyFont() { + void testUtfDecode_withApplyFont() { XSSFFont font = new XSSFFont(); font.setBold(true); font.setFontHeightInPoints((short) 14); @@ -561,7 +561,7 @@ public final class TestXSSFRichTextString { } @Test - public void testUtfLength() { + void testUtfLength() { assertEquals(0, XSSFRichTextString.utfLength(null)); assertEquals(0, XSSFRichTextString.utfLength("")); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRow.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRow.java index fcfda3bb3b..4e6899dfc2 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRow.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRow.java @@ -44,7 +44,7 @@ public final class TestXSSFRow extends BaseTestXRow { } @Test - public void testCopyRowFrom() throws IOException { + void testCopyRowFrom() throws IOException { final XSSFWorkbook workbook = new XSSFWorkbook(); final XSSFSheet sheet = workbook.createSheet("test"); final XSSFRow srcRow = sheet.createRow(0); @@ -59,7 +59,7 @@ public final class TestXSSFRow extends BaseTestXRow { } @Test - public void testCopyRowFromExternalSheet() throws IOException { + void testCopyRowFromExternalSheet() throws IOException { final XSSFWorkbook workbook = new XSSFWorkbook(); final Sheet srcSheet = workbook.createSheet("src"); final XSSFSheet destSheet = workbook.createSheet("dest"); @@ -154,7 +154,7 @@ public final class TestXSSFRow extends BaseTestXRow { } @Test - public void testCopyRowOverwritesExistingRow() throws IOException { + void testCopyRowOverwritesExistingRow() throws IOException { final XSSFWorkbook workbook = new XSSFWorkbook(); final XSSFSheet sheet1 = workbook.createSheet("Sheet1"); final Sheet sheet2 = workbook.createSheet("Sheet2"); @@ -197,7 +197,7 @@ public final class TestXSSFRow extends BaseTestXRow { } @Test - public void testMultipleEditWriteCycles() { + void testMultipleEditWriteCycles() { final XSSFWorkbook wb1 = new XSSFWorkbook(); final XSSFSheet sheet1 = wb1.createSheet("Sheet1"); XSSFRow srcRow = sheet1.createRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFShape.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFShape.java index f262211718..67486d6f64 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFShape.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFShape.java @@ -32,14 +32,14 @@ import org.junit.jupiter.api.Test; public final class TestXSSFShape { @Test - public void test58325_one() throws IOException { + void test58325_one() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("58325_lt.xlsx")) { check58325(wb, 1); } } @Test - public void test58325_three() throws IOException { + void test58325_three() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("58325_db.xlsx")) { check58325(wb, 3); } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java index 9113c2296d..733372554d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java @@ -1308,7 +1308,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCreateTwoPivotTablesInOneSheet() throws IOException { + void testCreateTwoPivotTablesInOneSheet() throws IOException { XSSFWorkbook wb = setupSheet(); XSSFSheet sheet = wb.getSheetAt(0); @@ -1326,7 +1326,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCreateTwoPivotTablesInTwoSheets() throws IOException { + void testCreateTwoPivotTablesInTwoSheets() throws IOException { XSSFWorkbook wb = setupSheet(); XSSFSheet sheet = wb.getSheetAt(0); @@ -1345,7 +1345,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCreatePivotTable() throws IOException { + void testCreatePivotTable() throws IOException { XSSFWorkbook wb = setupSheet(); XSSFSheet sheet = wb.getSheetAt(0); @@ -1358,7 +1358,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCreatePivotTableInOtherSheetThanDataSheet() throws IOException { + void testCreatePivotTableInOtherSheetThanDataSheet() throws IOException { XSSFWorkbook wb = setupSheet(); XSSFSheet sheet1 = wb.getSheetAt(0); XSSFSheet sheet2 = wb.createSheet(); @@ -1374,7 +1374,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCreatePivotTableInOtherSheetThanDataSheetUsingAreaReference() throws IOException { + void testCreatePivotTableInOtherSheetThanDataSheetUsingAreaReference() throws IOException { XSSFWorkbook wb = setupSheet(); XSSFSheet sheet = wb.getSheetAt(0); XSSFSheet sheet2 = wb.createSheet("TEST"); @@ -1387,7 +1387,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCreatePivotTableWithConflictingDataSheets() throws IOException { + void testCreatePivotTableWithConflictingDataSheets() throws IOException { try (XSSFWorkbook wb = setupSheet()) { XSSFSheet sheet = wb.getSheetAt(0); XSSFSheet sheet2 = wb.createSheet("TEST"); @@ -1399,7 +1399,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testReadFails() throws IOException { + void testReadFails() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -1415,7 +1415,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { * Feel free to relocated or delete this unit test if it doesn't belong here. */ @Test - public void testCreateComment() throws IOException { + void testCreateComment() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); ClientAnchor anchor = wb.getCreationHelper().createClientAnchor(); XSSFSheet sheet = wb.createSheet(); @@ -1761,17 +1761,17 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testCopyOneRow() throws IOException { + void testCopyOneRow() throws IOException { testCopyOneRow("XSSFSheet.copyRows.xlsx"); } @Test - public void testCopyMultipleRows() throws IOException { + void testCopyMultipleRows() throws IOException { testCopyMultipleRows("XSSFSheet.copyRows.xlsx"); } @Test - public void testIgnoredErrors() throws IOException { + void testIgnoredErrors() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet(); CellRangeAddress region = CellRangeAddress.valueOf("B2:D4"); @@ -1790,7 +1790,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testIgnoredErrorsMultipleTypes() throws IOException { + void testIgnoredErrorsMultipleTypes() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet(); CellRangeAddress region = CellRangeAddress.valueOf("B2:D4"); @@ -1812,7 +1812,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testIgnoredErrorsMultipleCalls() throws IOException { + void testIgnoredErrorsMultipleCalls() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet(); CellRangeAddress region = CellRangeAddress.valueOf("B2:D4"); @@ -1888,7 +1888,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { * See bug #52425 */ @Test - public void testInsertCommentsToClonedSheet() throws IOException { + void testInsertCommentsToClonedSheet() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("52425.xlsx"); CreationHelper helper = wb.getCreationHelper(); Sheet sheet2 = wb.createSheet("Sheet 2"); @@ -1932,7 +1932,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { // bug 59687: XSSFSheet.RemoveRow doesn't handle row gaps properly when removing row comments @Test - public void testRemoveRowWithCommentAndGapAbove() throws IOException { + void testRemoveRowWithCommentAndGapAbove() throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook("59687.xlsx")) { final Sheet sheet = wb.getSheetAt(0); @@ -1949,7 +1949,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testGetHeaderFooterProperties() throws IOException { + void testGetHeaderFooterProperties() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); @@ -1959,7 +1959,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testSheetForceFormulaRecalculationDefaultValues() throws IOException { + void testSheetForceFormulaRecalculationDefaultValues() throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook("sample.xlsx")){ for (Sheet s : wb) { assertEquals(wb.getForceFormulaRecalculation(),s.getForceFormulaRecalculation()); @@ -1968,7 +1968,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testWorkbookSetForceFormulaRecalculation() throws IOException { + void testWorkbookSetForceFormulaRecalculation() throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook("sample.xlsx")){ wb.setForceFormulaRecalculation(true); assertTrue(wb.getForceFormulaRecalculation()); @@ -1976,7 +1976,7 @@ public final class TestXSSFSheet extends BaseTestXSheet { } @Test - public void testNotCascadeWorkbookSetForceFormulaRecalculation() throws IOException { + void testNotCascadeWorkbookSetForceFormulaRecalculation() throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook("sample.xlsx")) { // set all sheets to force recalculation for (Sheet s : wb) { diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java index bc1be64b1f..fbe9541a8e 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java @@ -32,7 +32,7 @@ public class TestXSSFSheetMergeRegions { private static final POILogger LOG = POILogFactory.getLogger(TestXSSFSheetMergeRegions.class); @Test - public void testMergeRegionsSpeed() throws IOException { + void testMergeRegionsSpeed() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57893-many-merges.xlsx")) { long millis = Long.MAX_VALUE; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetRowGrouping.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetRowGrouping.java index 7901432648..b6dddc2c6d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetRowGrouping.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetRowGrouping.java @@ -35,7 +35,7 @@ public final class TestXSSFSheetRowGrouping { private static final int GROUP_SIZE = 5; @Test - public void test55640() { + void test55640() { //long startTime = System.currentTimeMillis(); Workbook wb = new XSSFWorkbook(); fillData(wb); @@ -90,7 +90,7 @@ public final class TestXSSFSheetRowGrouping { } @Test - public void test55640reduce1() { + void test55640reduce1() { Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("sheet123"); sheet.setRowSumsBelow(false); @@ -119,7 +119,7 @@ public final class TestXSSFSheetRowGrouping { } @Test - public void test55640_VerifyCases() { + void test55640_VerifyCases() { // NOTE: This is currently based on current behavior of POI, somehow // what POI returns in the calls to collapsed/hidden is not fully matching // the examples in the spec or I did not fully understand how POI stores the data internally... @@ -232,7 +232,7 @@ public final class TestXSSFSheetRowGrouping { } @Test - public void test55640_VerifyCasesSpec() { + void test55640_VerifyCasesSpec() { // NOTE: This is currently based on current behavior of POI, somehow // what POI returns in the calls to collapsed/hidden is not fully matching // the examples in the spec or I did not fully understand how POI stores the data internally... @@ -330,7 +330,7 @@ public final class TestXSSFSheetRowGrouping { } @Test - public void test55640working() { + void test55640working() { Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("sheet123"); @@ -346,7 +346,7 @@ public final class TestXSSFSheetRowGrouping { } @Test - public void testGroupingTest() throws IOException { + void testGroupingTest() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("GroupTest.xlsx")) { assertEquals(31, wb.getSheetAt(0).getLastRowNum()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java index 8349607ab0..e548b9d5d8 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java @@ -43,7 +43,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** Error occurred at FormulaShifter#rowMoveAreaPtg while shift rows upward. */ @Test - public void testBug54524() throws IOException { + void testBug54524() throws IOException { XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("54524.xlsx"); XSSFSheet sheet = workbook.getSheetAt(0); sheet.shiftRows(3, 5, -1); @@ -59,7 +59,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** negative row shift causes corrupted data or throws exception */ @Test - public void testBug53798() throws IOException { + void testBug53798() throws IOException { // NOTE that for HSSF (.xls) negative shifts combined with positive ones do work as expected Workbook wb = XSSFTestDataSamples.openSampleWorkbook("53798.xlsx"); @@ -117,7 +117,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** negative row shift causes corrupted data or throws exception */ @Test - public void testBug53798a() throws IOException { + void testBug53798a() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("53798.xlsx"); Sheet testSheet = wb.getSheetAt(0); @@ -146,7 +146,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** Shifting rows with comment result - Unreadable content error and comment deletion */ @Test - public void testBug56017() throws IOException { + void testBug56017() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56017.xlsx"); Sheet sheet = wb.getSheetAt(0); @@ -188,7 +188,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** Moving the active sheet and deleting the others results in a corrupted file */ @Test - public void test57171() throws IOException { + void test57171() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx"); assertEquals(5, wb.getActiveSheetIndex()); removeAllSheetsBut(5, wb); // 5 is the active / selected sheet @@ -206,7 +206,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** Cannot delete an arbitrary sheet in an XLS workbook (only the last one) */ @Test - public void test57163() throws IOException { + void test57163() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx"); assertEquals(5, wb.getActiveSheetIndex()); wb.removeSheetAt(0); @@ -216,7 +216,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { } @Test - public void testSetSheetOrderAndAdjustActiveSheet() throws IOException { + void testSetSheetOrderAndAdjustActiveSheet() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx"); assertEquals(5, wb.getActiveSheetIndex()); @@ -266,7 +266,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { } @Test - public void testRemoveSheetAndAdjustActiveSheet() throws IOException { + void testRemoveSheetAndAdjustActiveSheet() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx"); assertEquals(5, wb.getActiveSheetIndex()); @@ -306,7 +306,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** Failed to clone a sheet from an Excel 2010 */ @Test - public void test57165() throws IOException { + void test57165() throws IOException { Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57171_57163_57165.xlsx"); assertEquals(5, wb.getActiveSheetIndex()); removeAllSheetsBut(3, wb); @@ -334,7 +334,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { /** Shifting rows with cell comments only shifts comments from first such cell. Other cell comments not shifted */ @Test - public void testBug57828_OnlyOneCommentShiftedInRow() throws IOException { + void testBug57828_OnlyOneCommentShiftedInRow() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57828.xlsx")) { XSSFSheet sheet = wb.getSheetAt(0); @@ -389,7 +389,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { // bug 59983: Wrong update of shared formulas after shiftRow @Test - public void testSharedFormulas() throws Exception { + void testSharedFormulas() throws Exception { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("TestShiftRowSharedFormula.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); assertEquals("SUM(C2:C4)", getCellFormula(sheet, "C5")); @@ -414,7 +414,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { // bug 59983: Wrong update of shared formulas after shiftRow @Test - public void testShiftSharedFormulas() throws Exception { + void testShiftSharedFormulas() throws Exception { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("TestShiftRowSharedFormula.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); assertEquals("SUM(C2:C4)", getCellFormula(sheet, "C5")); @@ -448,7 +448,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { } @Test - public void test60384() throws IOException { + void test60384() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60384.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); @@ -479,7 +479,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { } @Test - public void test60709() throws IOException { + void test60709() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60709.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java index dda5d61197..4f7f88073f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java @@ -114,7 +114,7 @@ public class TestXSSFSheetShiftRowsAndColumns { * Apply no shift. The purpose of this is to test {@code testCellAddresses} and {@code testMergeRegion}. */ @Test - public void testNoShift() { + void testNoShift() { final String procName = "testNoShift"; fileName = procName+".xlsx"; @@ -123,7 +123,7 @@ public class TestXSSFSheetShiftRowsAndColumns { } @Test - public void testShiftOneRowAndTestAddresses() { + void testShiftOneRowAndTestAddresses() { final String procName = "testShiftOneRowAndTestAddresses"; fileName = procName+".xlsx"; final int nRowsToShift = 1; @@ -133,7 +133,7 @@ public class TestXSSFSheetShiftRowsAndColumns { } @Test - public void testShiftOneRowAndTestMergeRegion() { + void testShiftOneRowAndTestMergeRegion() { final String procName = "testShiftOneRowAndTestMergeRegion"; fileName = procName+".xlsx"; final int nRowsToShift = 1; @@ -143,7 +143,7 @@ public class TestXSSFSheetShiftRowsAndColumns { } @Test - public void testShiftOneColumnAndTestAddresses() { + void testShiftOneColumnAndTestAddresses() { final String procName = "testShiftOneColumnAndTestAddresses"; fileName = procName+".xlsx"; final int nShift = 1; @@ -153,7 +153,7 @@ public class TestXSSFSheetShiftRowsAndColumns { } @Test - public void testShiftOneColumnAndTestMergeRegion() { + void testShiftOneColumnAndTestMergeRegion() { final String procName = "testShiftOneColumnAndTestMergeRegion"; fileName = procName+".xlsx"; final int nShift = 1; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetUpdateArrayFormulas.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetUpdateArrayFormulas.java index fbeae1ab37..9217a2f431 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetUpdateArrayFormulas.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetUpdateArrayFormulas.java @@ -46,7 +46,7 @@ public final class TestXSSFSheetUpdateArrayFormulas extends BaseTestSheetUpdateA // Test methods common with HSSF are in superclass // Local methods here test XSSF-specific details of updating array formulas @Test - public void testXSSFSetArrayFormula_singleCell() throws IOException { + void testXSSFSetArrayFormula_singleCell() throws IOException { CellRange cells; XSSFWorkbook workbook = new XSSFWorkbook(); @@ -69,7 +69,7 @@ public final class TestXSSFSheetUpdateArrayFormulas extends BaseTestSheetUpdateA } @Test - public void testXSSFSetArrayFormula_multiCell() throws IOException { + void testXSSFSetArrayFormula_multiCell() throws IOException { CellRange cells; String formula2 = "456"; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSimpleShape.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSimpleShape.java index 5347f584c7..f10879a2df 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSimpleShape.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSimpleShape.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public class TestXSSFSimpleShape { @Test - public void testXSSFTextParagraph() throws IOException { + void testXSSFTextParagraph() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java index 135250358e..a7cc18f02d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java @@ -85,7 +85,7 @@ public final class TestXSSFTable { } @Test - public void testCTTableStyleInfo() throws IOException { + void testCTTableStyleInfo() throws IOException { XSSFWorkbook outputWorkbook = new XSSFWorkbook(); XSSFSheet sheet = outputWorkbook.createSheet(); @@ -298,7 +298,7 @@ public final class TestXSSFTable { } @Test - public void testGetDataRowCount() throws IOException { + void testGetDataRowCount() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); AreaReference tableArea = new AreaReference("B2:B6", wb.getSpreadsheetVersion()); @@ -317,7 +317,7 @@ public final class TestXSSFTable { } @Test - public void testSetDataRowCount() throws IOException { + void testSetDataRowCount() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); @@ -346,7 +346,7 @@ public final class TestXSSFTable { } @Test - public void testCreateTableIds() throws IOException { + void testCreateTableIds() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -380,7 +380,7 @@ public final class TestXSSFTable { } @Test - public void testSetArea() throws IOException { + void testSetArea() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); @@ -414,7 +414,7 @@ public final class TestXSSFTable { } @Test - public void testCreateColumn() throws IOException { + void testCreateColumn() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); @@ -449,7 +449,7 @@ public final class TestXSSFTable { } @Test - public void testCreateColumnInvalidIndex() throws IOException { + void testCreateColumnInvalidIndex() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); AreaReference tableArea = new AreaReference("D2:D3", wb.getSpreadsheetVersion()); @@ -463,7 +463,7 @@ public final class TestXSSFTable { } @Test - public void testDifferentHeaderTypes() throws IOException { + void testDifferentHeaderTypes() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("TablesWithDifferentHeaders.xlsx")) { assertEquals(3, wb.getNumberOfSheets()); XSSFSheet s; @@ -498,7 +498,7 @@ public final class TestXSSFTable { * See https://stackoverflow.com/questions/44407111/apache-poi-cant-format-filled-cells-as-numeric */ @Test - public void testNumericCellsInTable() throws IOException { + void testNumericCellsInTable() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet s = wb.createSheet(); @@ -549,7 +549,7 @@ public final class TestXSSFTable { } @Test - public void testSetDisplayName() throws IOException { + void testSetDisplayName() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -564,7 +564,7 @@ public final class TestXSSFTable { } @Test - public void testSetDisplayNameNull() throws IOException { + void testSetDisplayNameNull() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -577,7 +577,7 @@ public final class TestXSSFTable { } @Test - public void testSetDisplayNameEmpty() throws IOException { + void testSetDisplayNameEmpty() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); @@ -593,7 +593,7 @@ public final class TestXSSFTable { * Delete table2, and create a named range in sheet0; it should automatically be assigned the name "Table4" */ @Test - public void testBug63401And62906() throws IOException { + void testBug63401And62906() throws IOException { try (XSSFWorkbook workbook = new XSSFWorkbook()) { XSSFSheet sheet0 = workbook.createSheet(); XSSFTable table = addTable(sheet0, 3, 0, 2, 2); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java index 8905897020..8d641ca4dc 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestXSSFTableColumn { @Test - public void testGetColumnName() throws IOException { + void testGetColumnName() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples .openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) { XSSFTable table = wb.getTable("Tabella2"); @@ -46,7 +46,7 @@ public final class TestXSSFTableColumn { } @Test - public void testGetColumnIndex() throws IOException { + void testGetColumnIndex() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples .openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) { XSSFTable table = wb.getTable("Tabella2"); @@ -62,7 +62,7 @@ public final class TestXSSFTableColumn { } @Test - public void testGetXmlColumnPrs() throws IOException { + void testGetXmlColumnPrs() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples .openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) { XSSFTable table = wb.getTable("Tabella2"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java index bfd4814419..503c0ce7e1 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; public class TestXSSFTextParagraph { @Test - public void testXSSFTextParagraph() throws IOException { + void testXSSFTextParagraph() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextRun.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextRun.java index 2fab40173a..77ab6a7a57 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextRun.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTextRun.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; public class TestXSSFTextRun { @Test - public void testXSSFTextParagraph() throws IOException { + void testXSSFTextParagraph() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java index ce0f0b9fb1..f5b27bfb40 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java @@ -43,7 +43,7 @@ public class TestXSSFUnicodeSurrogates { "\uD835\uDF77\uD835\uDF78\uD835\uDF79\uD835\uDF7A"; @Test - public void testWriteUnicodeSurrogates() throws IOException { + void testWriteUnicodeSurrogates() throws IOException { String sheetName = "Sheet1"; File tf = TempFile.createTempFile("poi-xmlbeans-test", ".xlsx"); try (XSSFWorkbook wb = new XSSFWorkbook()) { diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java index 35c4cfff79..83ef727b8a 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java @@ -56,7 +56,7 @@ import org.openxmlformats.schemas.officeDocument.x2006.sharedTypes.STTrueFalseBl public class TestXSSFVMLDrawing { @Test - public void testNew() throws IOException, XmlException { + void testNew() throws IOException, XmlException { XSSFVMLDrawing vml = new XSSFVMLDrawing(); List items = vml.getItems(); assertEquals(2, items.size()); @@ -116,7 +116,7 @@ public class TestXSSFVMLDrawing { } @Test - public void testFindCommentShape() throws IOException, XmlException { + void testFindCommentShape() throws IOException, XmlException { XSSFVMLDrawing vml = new XSSFVMLDrawing(); try (InputStream stream = POIDataSamples.getSpreadSheetInstance().openResourceAsStream("vmlDrawing1.vml")) { @@ -152,7 +152,7 @@ public class TestXSSFVMLDrawing { } @Test - public void testRemoveCommentShape() throws IOException, XmlException { + void testRemoveCommentShape() throws IOException, XmlException { XSSFVMLDrawing vml = new XSSFVMLDrawing(); try (InputStream stream = POIDataSamples.getSpreadSheetInstance().openResourceAsStream("vmlDrawing1.vml")) { vml.read(stream); @@ -167,7 +167,7 @@ public class TestXSSFVMLDrawing { } @Test - public void testEvilUnclosedBRFixing() throws IOException, XmlException { + void testEvilUnclosedBRFixing() throws IOException, XmlException { XSSFVMLDrawing vml = new XSSFVMLDrawing(); try (InputStream stream = POIDataSamples.getOpenXML4JInstance().openResourceAsStream("bug-60626.vml")) { vml.read(stream); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index 196395eb6d..51d7481fd1 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -744,7 +744,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testAddPivotCache() throws IOException { + void testAddPivotCache() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { CTWorkbook ctWb = wb.getCTWorkbook(); CTPivotCache pivotCache = wb.addPivotCache("0"); @@ -788,7 +788,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testLoadWorkbookWithPivotTable() throws Exception { + void testLoadWorkbookWithPivotTable() throws Exception { File file = TempFile.createTempFile("ooxml-pivottable", ".xlsx"); try (XSSFWorkbook wb = new XSSFWorkbook()) { @@ -807,7 +807,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testAddPivotTableToWorkbookWithLoadedPivotTable() throws Exception { + void testAddPivotTableToWorkbookWithLoadedPivotTable() throws Exception { File file = TempFile.createTempFile("ooxml-pivottable", ".xlsx"); try (XSSFWorkbook wb = new XSSFWorkbook()) { @@ -827,7 +827,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testSetFirstVisibleTab_57373() throws IOException { + void testSetFirstVisibleTab_57373() throws IOException { try (Workbook wb = new XSSFWorkbook()) { /*Sheet sheet1 =*/ @@ -866,7 +866,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { * Tests that we can save a workbook with macros and reload it. */ @Test - public void testSetVBAProject() throws Exception { + void testSetVBAProject() throws Exception { File file; final byte[] allBytes = new byte[256]; for (int i = 0; i < 256; i++) { @@ -907,7 +907,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testBug54399() throws IOException { + void testBug54399() throws IOException { XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("54399.xlsx"); for (int i = 0; i < workbook.getNumberOfSheets(); i++) { @@ -985,7 +985,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testBug56957CloseWorkbook() throws Exception { + void testBug56957CloseWorkbook() throws Exception { File file = TempFile.createTempFile("TestBug56957_", ".xlsx"); final Date dateExp = LocaleUtil.getLocaleCalendar(2014, 10, 9).getTime(); @@ -1051,7 +1051,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { } @Test - public void testCloseBeforeWrite() throws IOException { + void testCloseBeforeWrite() throws IOException { try (Workbook wb = new XSSFWorkbook()) { wb.createSheet("somesheet"); @@ -1102,7 +1102,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { @SuppressWarnings("deprecation") @Test - public void testRemoveSheet() throws IOException { + void testRemoveSheet() throws IOException { // Test removing a sheet maintains the named ranges correctly XSSFWorkbook wb = new XSSFWorkbook(); wb.createSheet("Sheet1"); @@ -1145,7 +1145,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { * See bug #61700 */ @Test - public void testWorkbookForceFormulaRecalculation() throws Exception { + void testWorkbookForceFormulaRecalculation() throws Exception { Workbook workbook = _testDataProvider.createWorkbook(); workbook.createSheet().createRow(0).createCell(0).setCellFormula("B1+C1"); workbook.getCreationHelper().createFormulaEvaluator().evaluateAll(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFChartLegend.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFChartLegend.java index 7bb9b61e12..bbd1ee0981 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFChartLegend.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFChartLegend.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; */ public final class TestXDDFChartLegend { @Test - public void testLegendPositionAccessMethods() throws IOException { + void testLegendPositionAccessMethods() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); @@ -52,7 +52,7 @@ public final class TestXDDFChartLegend { } @Test - public void test_setOverlay_defaultChartLegend_expectOverlayInitialValueSetToFalse() throws IOException { + void test_setOverlay_defaultChartLegend_expectOverlayInitialValueSetToFalse() throws IOException { // Arrange XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); @@ -70,7 +70,7 @@ public final class TestXDDFChartLegend { } @Test - public void test_setOverlay_chartLegendSetToTrue_expectOverlayInitialValueSetToTrue() throws IOException { + void test_setOverlay_chartLegendSetToTrue_expectOverlayInitialValueSetToTrue() throws IOException { // Arrange XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFManualLayout.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFManualLayout.java index c7298663b7..e69471d0fd 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFManualLayout.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXDDFManualLayout.java @@ -60,7 +60,7 @@ public final class TestXDDFManualLayout { * initialization so there can be some errors (NPE, for example). */ @Test - public void testAccessorMethods() { + void testAccessorMethods() { final double newRatio = 1.1; final double newCoordinate = 0.3; final LayoutMode nonDefaultMode = LayoutMode.FACTOR; @@ -100,7 +100,7 @@ public final class TestXDDFManualLayout { * any exceptions. */ @Test - public void testDefaultValues() { + void testDefaultValues() { assertNotNull(layout.getTarget()); assertNotNull(layout.getXMode()); assertNotNull(layout.getYMode()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSF3DChartData.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSF3DChartData.java index 5217a11988..1f2bd9a822 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSF3DChartData.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSF3DChartData.java @@ -55,7 +55,7 @@ public class TestXSSF3DChartData { }; @Test - public void testArea3D() throws IOException { + void testArea3D() throws IOException { // This test currently doesn't produce a valid area 3d chart and is only used to test accessors try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, plotData).build(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFCategoryAxis.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFCategoryAxis.java index f6d1709837..87d793958e 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFCategoryAxis.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFCategoryAxis.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; public final class TestXSSFCategoryAxis { @Test - public void testAccessMethods() throws Exception { + void testAccessMethods() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java index a50084b996..446aad8f23 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java @@ -62,7 +62,7 @@ public final class TestXSSFChartAxis { } @Test - public void testLogBaseIllegalArgument() { + void testLogBaseIllegalArgument() { IllegalArgumentException iae = null; try { axis.setLogBase(0.0); @@ -81,20 +81,20 @@ public final class TestXSSFChartAxis { } @Test - public void testLogBaseLegalArgument() { + void testLogBaseLegalArgument() { axis.setLogBase(Math.E); assertTrue(Math.abs(axis.getLogBase() - Math.E) < EPSILON); } @Test - public void testNumberFormat() { + void testNumberFormat() { final String numberFormat = "General"; axis.setNumberFormat(numberFormat); assertEquals(numberFormat, axis.getNumberFormat()); } @Test - public void testMaxAndMinAccessMethods() { + void testMaxAndMinAccessMethods() { final double newValue = 10.0; axis.setMinimum(newValue); @@ -105,7 +105,7 @@ public final class TestXSSFChartAxis { } @Test - public void testVisibleAccessMethods() { + void testVisibleAccessMethods() { axis.setVisible(true); assertTrue(axis.isVisible()); @@ -114,7 +114,7 @@ public final class TestXSSFChartAxis { } @Test - public void testMajorTickMarkAccessMethods() { + void testMajorTickMarkAccessMethods() { axis.setMajorTickMark(AxisTickMark.NONE); assertEquals(AxisTickMark.NONE, axis.getMajorTickMark()); @@ -129,7 +129,7 @@ public final class TestXSSFChartAxis { } @Test - public void testMinorTickMarkAccessMethods() { + void testMinorTickMarkAccessMethods() { axis.setMinorTickMark(AxisTickMark.NONE); assertEquals(AxisTickMark.NONE, axis.getMinorTickMark()); @@ -144,7 +144,7 @@ public final class TestXSSFChartAxis { } @Test - public void testGetChartAxisBug57362() throws IOException { + void testGetChartAxisBug57362() throws IOException { //Load existing excel with some chart on it having primary and secondary axis. try (final XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("57362.xlsx")) { final XSSFSheet sh = workbook.getSheetAt(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartTitle.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartTitle.java index 3d3d5c46b8..d646fddd8f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartTitle.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartTitle.java @@ -111,7 +111,7 @@ public class TestXSSFChartTitle { } @Test - public void testNewChart() throws IOException { + void testNewChart() throws IOException { XSSFWorkbook wb = createWorkbookWithChart(); XSSFChart chart = getChartFromWorkbook(wb, "linechart"); assertNotNull(chart); @@ -133,7 +133,7 @@ public class TestXSSFChartTitle { } @Test - public void testExistingChartWithTitle() throws IOException { + void testExistingChartWithTitle() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chartTitle_withTitle.xlsx"); XSSFChart chart = getChartFromWorkbook(wb, "Sheet1"); assertNotNull(chart); @@ -150,7 +150,7 @@ public class TestXSSFChartTitle { } @Test - public void testExistingChartNoTitle() throws IOException { + void testExistingChartNoTitle() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chartTitle_noTitle.xlsx"); XSSFChart chart = getChartFromWorkbook(wb, "Sheet1"); assertNotNull(chart); @@ -165,7 +165,7 @@ public class TestXSSFChartTitle { } @Test - public void testExistingChartWithFormulaTitle() throws IOException { + void testExistingChartWithFormulaTitle() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chartTitle_withTitleFormula.xlsx"); XSSFChart chart = getChartFromWorkbook(wb, "Sheet1"); assertNotNull(chart); @@ -179,7 +179,7 @@ public class TestXSSFChartTitle { } @Test - public void testRemovingFromExistingChartNoTitle() throws IOException { + void testRemovingFromExistingChartNoTitle() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chartTitle_noTitle.xlsx"); XSSFChart chart = getChartFromWorkbook(wb, "Sheet1"); assertNotNull(chart); @@ -192,7 +192,7 @@ public class TestXSSFChartTitle { } @Test - public void testRemovingFromExistingChartWithTitle() throws IOException { + void testRemovingFromExistingChartWithTitle() throws IOException { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chartTitle_withTitle.xlsx"); XSSFChart chart = getChartFromWorkbook(wb, "Sheet1"); assertNotNull(chart); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFDateAxis.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFDateAxis.java index f8865fd01a..34acba6286 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFDateAxis.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFDateAxis.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public final class TestXSSFDateAxis { @Test - public void testAccessMethods() throws Exception { + void testAccessMethods() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java index 8d83fe95c8..ea790a5fc6 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java @@ -50,7 +50,7 @@ public class TestXSSFLineChartData { }; @Test - public void testOneSeriePlot() throws IOException { + void testOneSeriePlot() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, plotData).build(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java index 2b2b22d9fd..5866c33754 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java @@ -52,7 +52,7 @@ public final class TestXSSFScatterChartData { }; @Test - public void testOneSeriePlot() throws IOException { + void testOneSeriePlot() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, plotData).build(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFValueAxis.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFValueAxis.java index 0df7fb4996..bc1d6f2c50 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFValueAxis.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFValueAxis.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public final class TestXSSFValueAxis { @Test - public void testAccessMethods() throws Exception { + void testAccessMethods() throws Exception { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sheet = wb.createSheet(); XSSFDrawing drawing = sheet.createDrawingPatriarch(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java index 7ffe6a99a9..52f90cca79 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java @@ -31,7 +31,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STBorderStyle; public class TestXSSFBorder { @Test - public void testGetBorderStyle() { + void testGetBorderStyle() { CTStylesheet stylesheet = CTStylesheet.Factory.newInstance(); CTBorder border = stylesheet.addNewBorders().addNewBorder(); CTBorderPr top = border.addNewTop(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java index 4562de62d5..9b2b91d0c0 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java @@ -40,7 +40,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType; public class TestXSSFCellFill { @Test - public void testGetFillBackgroundColor() { + void testGetFillBackgroundColor() { CTFill ctFill = CTFill.Factory.newInstance(); XSSFCellFill cellFill = new XSSFCellFill(ctFill, null); CTPatternFill ctPatternFill = ctFill.addNewPatternFill(); @@ -51,7 +51,7 @@ public class TestXSSFCellFill { } @Test - public void testGetFillForegroundColor() { + void testGetFillForegroundColor() { CTFill ctFill = CTFill.Factory.newInstance(); XSSFCellFill cellFill = new XSSFCellFill(ctFill, null); CTPatternFill ctPatternFill = ctFill.addNewPatternFill(); @@ -62,7 +62,7 @@ public class TestXSSFCellFill { } @Test - public void testGetSetPatternType() { + void testGetSetPatternType() { CTFill ctFill = CTFill.Factory.newInstance(); XSSFCellFill cellFill = new XSSFCellFill(ctFill, null); CTPatternFill ctPatternFill = ctFill.addNewPatternFill(); @@ -73,7 +73,7 @@ public class TestXSSFCellFill { } @Test - public void testGetNotModifies() { + void testGetNotModifies() { CTFill ctFill = CTFill.Factory.newInstance(); XSSFCellFill cellFill = new XSSFCellFill(ctFill, null); CTPatternFill ctPatternFill = ctFill.addNewPatternFill(); @@ -84,7 +84,7 @@ public class TestXSSFCellFill { } @Test - public void testColorFromTheme() throws IOException { + void testColorFromTheme() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("styles.xlsx")) { XSSFCell cellWithThemeColor = wb.getSheetAt(0).getRow(10).getCell(0); //color RGB will be extracted from theme @@ -106,7 +106,7 @@ public class TestXSSFCellFill { } @Test - public void testFillWithoutColors() throws IOException { + void testFillWithoutColors() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("FillWithoutColor.xlsx")) { XSSFCell cellWithFill = wb.getSheetAt(0).getRow(5).getCell(1); XSSFCellStyle style = cellWithFill.getCellStyle(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFHeaderFooter.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFHeaderFooter.java index 1df48b8f67..d08c80a023 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFHeaderFooter.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFHeaderFooter.java @@ -61,7 +61,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testGetHeaderFooter() { + void testGetHeaderFooter() { CTHeaderFooter ctHf; ctHf = hO.getHeaderFooter(); assertNotNull(ctHf); @@ -78,7 +78,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testGetValue() { + void testGetValue() { assertEquals("", hO.getValue()); assertEquals("", hE.getValue()); assertEquals("", hF.getValue()); @@ -112,15 +112,15 @@ public class TestXSSFHeaderFooter { } @Disabled("Test not yet created") - public void testAreFieldsStripped() { + void testAreFieldsStripped() { } @Disabled("Test not yet created") - public void testSetAreFieldsStripped() { + void testSetAreFieldsStripped() { } @Test - public void testStripFields() { + void testStripFields() { String simple = "I am a test header"; String withPage = "I am a&P test header"; String withLots = "I&A am&N a&P test&T header&U"; @@ -157,7 +157,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testGetCenter() { + void testGetCenter() { assertEquals("", hO.getCenter()); assertEquals("", hE.getCenter()); assertEquals("", hF.getCenter()); @@ -179,7 +179,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testGetLeft() { + void testGetLeft() { assertEquals("", hO.getLeft()); assertEquals("", hE.getLeft()); assertEquals("", hF.getLeft()); @@ -201,7 +201,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testGetRight() { + void testGetRight() { assertEquals("", hO.getValue()); assertEquals("", hE.getValue()); assertEquals("", hF.getValue()); @@ -223,7 +223,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testSetCenter() { + void testSetCenter() { assertEquals("", hO.getValue()); assertEquals("", hE.getValue()); assertEquals("", hF.getValue()); @@ -245,7 +245,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testSetLeft() { + void testSetLeft() { assertEquals("", hO.getValue()); assertEquals("", hE.getValue()); assertEquals("", hF.getValue()); @@ -267,7 +267,7 @@ public class TestXSSFHeaderFooter { } @Test - public void testSetRight() { + void testSetRight() { assertEquals("", hO.getValue()); assertEquals("", hE.getValue()); assertEquals("", hF.getValue()); @@ -291,7 +291,7 @@ public class TestXSSFHeaderFooter { @Test - public void testGetSetCenterLeftRight() { + void testGetSetCenterLeftRight() { assertEquals("", fO.getCenter()); fO.setCenter("My first center section"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorderTest.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorderTest.java index 075cbd21eb..423e8347a1 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorderTest.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorderTest.java @@ -46,7 +46,7 @@ public class XSSFCellBorderTest { } @Test - public void testEquals() { + void testEquals() { for (XSSFCellBorder.BorderSide side : XSSFCellBorder.BorderSide.values()) { XSSFCellBorder border = new XSSFCellBorder(); assertEquals(empty, border); @@ -78,7 +78,7 @@ public class XSSFCellBorderTest { } @Test - public void testConstruct() { + void testConstruct() { XSSFCellBorder border = new XSSFCellBorder((CTBorder) empty.getCTBorder().copy()); assertEquals(empty, border); border.getCTBorder().setOutline(true); @@ -97,7 +97,7 @@ public class XSSFCellBorderTest { } @Test - public void testGettersSetters() { + void testGettersSetters() { assertNotNull(empty.getCTBorder()); XSSFCellBorder border = new XSSFCellBorder((CTBorder) empty.getCTBorder().copy()); @@ -106,7 +106,7 @@ public class XSSFCellBorderTest { } @Test - public void testSetBorderStyle() { + void testSetBorderStyle() { XSSFCellBorder border = new XSSFCellBorder(); for (XSSFCellBorder.BorderSide side : XSSFCellBorder.BorderSide.values()) { assertEquals(BorderStyle.NONE, border.getBorderStyle(side)); @@ -117,7 +117,7 @@ public class XSSFCellBorderTest { } @Test - public void testSetBorderColor() { + void testSetBorderColor() { XSSFCellBorder border = new XSSFCellBorder(); XSSFColor color = new XSSFColor(stylesSource.getIndexedColors()); @@ -130,7 +130,7 @@ public class XSSFCellBorderTest { } @Test - public void testRegression() throws Exception { + void testRegression() throws Exception { XSSFCellStyle style = wb.createCellStyle(); style.setBorderTop(BorderStyle.THICK); style.setBorderBottom(BorderStyle.THICK); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java index 5570d91b21..e3c15ed123 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java @@ -45,7 +45,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf; public final class TestColumnHelper { @Test - public void testCleanColumns() { + void testCleanColumns() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTCols cols1 = worksheet.addNewCols(); @@ -79,7 +79,7 @@ public final class TestColumnHelper { } @Test - public void testSortColumns() { + void testSortColumns() { CTCols cols1 = CTCols.Factory.newInstance(); CTCol col1 = cols1.addNewCol(); col1.setMin(1); @@ -125,7 +125,7 @@ public final class TestColumnHelper { } @Test - public void testCloneCol() { + void testCloneCol() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); ColumnHelper helper = new ColumnHelper(worksheet); @@ -143,7 +143,7 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoCols() { + void testAddCleanColIntoCols() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); ColumnHelper helper = new ColumnHelper(worksheet); @@ -195,14 +195,14 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoColsExactOverlap() { + void testAddCleanColIntoColsExactOverlap() { CTCols cols = createHiddenAndBestFitColsWithHelper(1, 1, 1, 1); assertEquals(1, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 1, true, true); } @Test - public void testAddCleanColIntoColsOverlapsOverhangingBothSides() { + void testAddCleanColIntoColsOverlapsOverhangingBothSides() { CTCols cols = createHiddenAndBestFitColsWithHelper(2, 2, 1, 3); assertEquals(3, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 1, false, true); @@ -211,7 +211,7 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoColsOverlapsCompletelyNested() { + void testAddCleanColIntoColsOverlapsCompletelyNested() { CTCols cols = createHiddenAndBestFitColsWithHelper(1, 3, 2, 2); assertEquals(3, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 1, true, false); @@ -220,7 +220,7 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoColsNewOverlapsOverhangingLeftNotRightExactRight() { + void testAddCleanColIntoColsNewOverlapsOverhangingLeftNotRightExactRight() { CTCols cols = createHiddenAndBestFitColsWithHelper(2, 3, 1, 3); assertEquals(2, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 1, false, true); @@ -228,7 +228,7 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoColsNewOverlapsOverhangingRightNotLeftExactLeft() { + void testAddCleanColIntoColsNewOverlapsOverhangingRightNotLeftExactLeft() { CTCols cols = createHiddenAndBestFitColsWithHelper(1, 2, 1, 3); assertEquals(2, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 2, true, true); @@ -236,7 +236,7 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoColsNewOverlapsOverhangingLeftNotRight() { + void testAddCleanColIntoColsNewOverlapsOverhangingLeftNotRight() { CTCols cols = createHiddenAndBestFitColsWithHelper(2, 3, 1, 2); assertEquals(3, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 1, false, true); @@ -245,7 +245,7 @@ public final class TestColumnHelper { } @Test - public void testAddCleanColIntoColsNewOverlapsOverhangingRightNotLeft() { + void testAddCleanColIntoColsNewOverlapsOverhangingRightNotLeft() { CTCols cols = createHiddenAndBestFitColsWithHelper(1, 2, 2, 3); assertEquals(3, cols.sizeOfColArray()); assertMinMaxHiddenBestFit(cols, 0, 1, 1, true, false); @@ -288,7 +288,7 @@ public final class TestColumnHelper { } @Test - public void testGetColumn() { + void testGetColumn() { CTWorksheet worksheet = CTWorksheet.Factory.newInstance(); CTCols cols1 = worksheet.addNewCols(); @@ -318,7 +318,7 @@ public final class TestColumnHelper { } @Test - public void testSetColumnAttributes() { + void testSetColumnAttributes() { CTCol col = CTCol.Factory.newInstance(); col.setWidth(12); col.setHidden(true); @@ -333,7 +333,7 @@ public final class TestColumnHelper { } @Test - public void testGetOrCreateColumn() throws IOException { + void testGetOrCreateColumn() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet("Sheet 1"); ColumnHelper columnHelper = sheet.getColumnHelper(); @@ -357,7 +357,7 @@ public final class TestColumnHelper { } @Test - public void testGetSetColDefaultStyle() throws IOException { + void testGetSetColDefaultStyle() throws IOException { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet(); CTWorksheet ctWorksheet = sheet.getCTWorksheet(); @@ -408,7 +408,7 @@ public final class TestColumnHelper { @SuppressWarnings("deprecation") @Test - public void testColumnsCollapsed() { + void testColumnsCollapsed() { Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestHeaderFooterHelper.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestHeaderFooterHelper.java index ad2813d790..122f609032 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestHeaderFooterHelper.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestHeaderFooterHelper.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; public class TestHeaderFooterHelper { @Test - public void testGetCenterLeftRightSection() { + void testGetCenterLeftRightSection() { HeaderFooterHelper helper = new HeaderFooterHelper(); String headerFooter = "&CTest the center section"; @@ -42,7 +42,7 @@ public class TestHeaderFooterHelper { } @Test - public void testSetCenterLeftRightSection() { + void testSetCenterLeftRightSection() { HeaderFooterHelper helper = new HeaderFooterHelper(); String headerFooter = ""; headerFooter = helper.setCenterSection(headerFooter, "First added center section"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java b/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java index f808ad982a..d34957475d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java @@ -157,7 +157,7 @@ public class MemoryUsage { * @see #testXmlAttached() */ @Test - public void testXmlDetached() { + void testXmlDetached() { System.out.println(); System.out.println("Testing detached"); @@ -186,7 +186,7 @@ public class MemoryUsage { * @see #testXmlAttached() */ @Test - public void testXmlAttached() { + void testXmlAttached() { System.out.println(); System.out.println("Testing attached"); printMemoryUsage("before"); @@ -212,22 +212,22 @@ public class MemoryUsage { } @Test - public void testMixedHSSF() { + void testMixedHSSF() { mixedSpreadsheet(new HSSFWorkbook(), NUM_COLUMNS); } @Test - public void testMixedXSSF() { + void testMixedXSSF() { mixedSpreadsheet(new XSSFWorkbook(), NUM_COLUMNS); } @Test - public void testNumberHSSF() { + void testNumberHSSF() { numberSpreadsheet(new HSSFWorkbook(), NUM_COLUMNS); } @Test - public void testNumberXSSF() { + void testNumberXSSF() { numberSpreadsheet(new XSSFWorkbook(), NUM_COLUMNS); } } \ No newline at end of file diff --git a/src/ooxml/testcases/org/apache/poi/xssf/util/TestCTColComparator.java b/src/ooxml/testcases/org/apache/poi/xssf/util/TestCTColComparator.java index 4705141f4b..2d64973ad5 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/util/TestCTColComparator.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/util/TestCTColComparator.java @@ -28,7 +28,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCol; public final class TestCTColComparator { @Test - public void testCompare() { + void testCompare() { CTCol o1 = CTCol.Factory.newInstance(); o1.setMin(1); o1.setMax(10); @@ -46,7 +46,7 @@ public final class TestCTColComparator { } @Test - public void testArraysSort() { + void testArraysSort() { CTCol o1 = CTCol.Factory.newInstance(); o1.setMin(1); o1.setMax(10); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java b/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java index 74d323a5fb..77a7e8be08 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java @@ -37,7 +37,7 @@ public final class TestEvilUnclosedBRFixingInputStream { } @Test - public void testOK() throws IOException { + void testOK() throws IOException { byte[] ok = getBytes("

Hello There!
Tags!

"); EvilUnclosedBRFixingInputStream inp = new EvilUnclosedBRFixingInputStream(ok); @@ -47,7 +47,7 @@ public final class TestEvilUnclosedBRFixingInputStream { } @Test - public void testProblem() throws IOException { + void testProblem() throws IOException { byte[] orig = getBytes("

Hello
There!
Tags!

"); byte[] fixed = getBytes("

Hello
There!
Tags!

"); @@ -61,7 +61,7 @@ public final class TestEvilUnclosedBRFixingInputStream { * Checks that we can copy with br tags around the buffer boundaries */ @Test - public void testBufferSize() throws IOException { + void testBufferSize() throws IOException { byte[] orig = getBytes("

Hello

There!
Tags!

"); byte[] fixed = getBytes("

Hello

There!
Tags!

"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/util/TestNumericRanges.java b/src/ooxml/testcases/org/apache/poi/xssf/util/TestNumericRanges.java index cc4e62099a..d0d6469a83 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/util/TestNumericRanges.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/util/TestNumericRanges.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public class TestNumericRanges { @Test - public void testGetOverlappingType() { + void testGetOverlappingType() { long[] r1 = {3, 8}; long[] r2 = {6, 11}; long[] r3 = {1, 5}; @@ -40,7 +40,7 @@ public class TestNumericRanges { } @Test - public void testGetOverlappingRange() { + void testGetOverlappingRange() { long[] r1 = {3, 8}; long[] r2 = {6, 11}; long[] r3 = {1, 5}; diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/TestAllExtendedProperties.java b/src/ooxml/testcases/org/apache/poi/xwpf/TestAllExtendedProperties.java index f243092bf5..09355e810d 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/TestAllExtendedProperties.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/TestAllExtendedProperties.java @@ -48,7 +48,7 @@ import org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.CTVect */ public final class TestAllExtendedProperties { @Test - public void testGetAllExtendedProperties() throws IOException { + void testGetAllExtendedProperties() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestPoiXMLDocumentCorePropertiesGetKeywords.docx")) { CTProperties ctProps = doc.getProperties().getExtendedProperties().getUnderlyingProperties(); assertEquals("Microsoft Office Word", ctProps.getApplication()); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/TestDocumentProtection.java b/src/ooxml/testcases/org/apache/poi/xwpf/TestDocumentProtection.java index 082f398c71..24331d43b6 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/TestDocumentProtection.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/TestDocumentProtection.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; public class TestDocumentProtection { @Test - public void testShouldReadEnforcementProperties() throws IOException { + void testShouldReadEnforcementProperties() throws IOException { XWPFDocument documentWithoutDocumentProtectionTag = XWPFTestDataSamples.openSampleDocument("documentProtection_no_protection.docx"); assertFalse(documentWithoutDocumentProtectionTag.isEnforcedReadonlyProtection()); @@ -82,7 +82,7 @@ public class TestDocumentProtection { } @Test - public void testShouldEnforceForReadOnly() throws IOException { + void testShouldEnforceForReadOnly() throws IOException { // XWPFDocument document = createDocumentFromSampleFile("test-data/document/documentProtection_no_protection.docx"); XWPFDocument document = XWPFTestDataSamples.openSampleDocument("documentProtection_no_protection.docx"); assertFalse(document.isEnforcedReadonlyProtection()); @@ -94,7 +94,7 @@ public class TestDocumentProtection { } @Test - public void testShouldEnforceForFillingForms() throws IOException { + void testShouldEnforceForFillingForms() throws IOException { XWPFDocument document = XWPFTestDataSamples.openSampleDocument("documentProtection_no_protection.docx"); assertFalse(document.isEnforcedFillingFormsProtection()); @@ -105,7 +105,7 @@ public class TestDocumentProtection { } @Test - public void testShouldEnforceForComments() throws IOException { + void testShouldEnforceForComments() throws IOException { XWPFDocument document = XWPFTestDataSamples.openSampleDocument("documentProtection_no_protection.docx"); assertFalse(document.isEnforcedCommentsProtection()); @@ -116,7 +116,7 @@ public class TestDocumentProtection { } @Test - public void testShouldEnforceForTrackedChanges() throws IOException { + void testShouldEnforceForTrackedChanges() throws IOException { XWPFDocument document = XWPFTestDataSamples.openSampleDocument("documentProtection_no_protection.docx"); assertFalse(document.isEnforcedTrackedChangesProtection()); @@ -127,7 +127,7 @@ public class TestDocumentProtection { } @Test - public void testShouldUnsetEnforcement() throws IOException { + void testShouldUnsetEnforcement() throws IOException { XWPFDocument document = XWPFTestDataSamples.openSampleDocument("documentProtection_readonly_no_password.docx"); assertTrue(document.isEnforcedReadonlyProtection()); @@ -138,7 +138,7 @@ public class TestDocumentProtection { } @Test - public void testIntegration() throws IOException { + void testIntegration() throws IOException { XWPFDocument doc1 = new XWPFDocument(); XWPFParagraph p1 = doc1.createParagraph(); @@ -163,7 +163,7 @@ public class TestDocumentProtection { } @Test - public void testUpdateFields() throws IOException { + void testUpdateFields() throws IOException { XWPFDocument doc = new XWPFDocument(); assertFalse(doc.isEnforcedUpdateFields()); doc.enforceUpdateFields(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/TestNecessaryOOXMLClasses.java b/src/ooxml/testcases/org/apache/poi/xwpf/TestNecessaryOOXMLClasses.java index 93db6ce94f..ad40ddac01 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/TestNecessaryOOXMLClasses.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/TestNecessaryOOXMLClasses.java @@ -30,7 +30,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblLayoutType; public class TestNecessaryOOXMLClasses { @Test - public void testProblemClasses() { + void testProblemClasses() { CTTblLayoutType ctTblLayoutType = CTTblLayoutType.Factory.newInstance(); assertNotNull(ctTblLayoutType); STTblLayoutType stTblLayoutType = STTblLayoutType.Factory.newInstance(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/TestPackageCorePropertiesGetKeywords.java b/src/ooxml/testcases/org/apache/poi/xwpf/TestPackageCorePropertiesGetKeywords.java index bd669c39ec..033c466cc6 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/TestPackageCorePropertiesGetKeywords.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/TestPackageCorePropertiesGetKeywords.java @@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test; */ public final class TestPackageCorePropertiesGetKeywords { @Test - public void testGetSetKeywords() throws IOException { + void testGetSetKeywords() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestPoiXMLDocumentCorePropertiesGetKeywords.docx")) { String keywords = doc.getProperties().getCoreProperties().getKeywords(); assertEquals("extractor, test, rdf", keywords); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestExternalEntities.java b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestExternalEntities.java index b0748455c4..9df07592a8 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestExternalEntities.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestExternalEntities.java @@ -32,7 +32,7 @@ public class TestExternalEntities { * Get text out of the simple file */ @Test - public void testFile() throws IOException { + void testFile() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("ExternalEntityInText.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java index 7975271d9d..2cde13aea7 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java @@ -44,7 +44,7 @@ public class TestXWPFWordExtractor { * Get text out of the simple file */ @Test - public void testGetSimpleText() throws IOException { + void testGetSimpleText() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -69,7 +69,7 @@ public class TestXWPFWordExtractor { * Tests getting the text out of a complex file */ @Test - public void testGetComplexText() throws IOException { + void testGetComplexText() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("IllustrativeCases.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -96,7 +96,7 @@ public class TestXWPFWordExtractor { } @Test - public void testGetWithHyperlinks() throws IOException { + void testGetWithHyperlinks() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestDocument.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -123,7 +123,7 @@ public class TestXWPFWordExtractor { } @Test - public void testHeadersFooters() throws IOException { + void testHeadersFooters() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("ThreeColHeadFoot.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -172,7 +172,7 @@ public class TestXWPFWordExtractor { } @Test - public void testFootnotes() throws IOException { + void testFootnotes() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("footnotes.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { String text = extractor.getText(); @@ -183,7 +183,7 @@ public class TestXWPFWordExtractor { @Test - public void testTableFootnotes() throws IOException { + void testTableFootnotes() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("table_footnotes.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -192,7 +192,7 @@ public class TestXWPFWordExtractor { } @Test - public void testFormFootnotes() throws IOException { + void testFormFootnotes() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("form_footnotes.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -203,7 +203,7 @@ public class TestXWPFWordExtractor { } @Test - public void testEndnotes() throws IOException { + void testEndnotes() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("endnotes.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { String text = extractor.getText(); @@ -213,7 +213,7 @@ public class TestXWPFWordExtractor { } @Test - public void testInsertedDeletedText() throws IOException { + void testInsertedDeletedText() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("delins.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -223,7 +223,7 @@ public class TestXWPFWordExtractor { } @Test - public void testParagraphHeader() throws IOException { + void testParagraphHeader() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Headers.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -238,7 +238,7 @@ public class TestXWPFWordExtractor { * (macro enabled) docx files (bug #45690) */ @Test - public void testDOCMFiles() throws IOException { + void testDOCMFiles() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("45690.docm"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -254,7 +254,7 @@ public class TestXWPFWordExtractor { * we're extracting (bug #49189) */ @Test - public void testDocTabs() throws IOException { + void testDocTabs() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("WithTabs.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -273,7 +273,7 @@ public class TestXWPFWordExtractor { * w:instrText tag (spec sec. 17.16.23) */ @Test - public void testNoFieldCodes() throws IOException { + void testNoFieldCodes() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("FieldCodes.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { String text = extractor.getText(); @@ -288,7 +288,7 @@ public class TestXWPFWordExtractor { * with the fldSimple element (spec sec. 17.16.19) */ @Test - public void testFldSimpleContent() throws IOException { + void testFldSimpleContent() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("FldSimple.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { String text = extractor.getText(); @@ -302,7 +302,7 @@ public class TestXWPFWordExtractor { * NoClassDefFoundError for CTAnchor in XWPFRun */ @Test - public void testDrawings() throws IOException { + void testDrawings() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("drawing.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { String text = extractor.getText(); @@ -314,7 +314,7 @@ public class TestXWPFWordExtractor { * Test for basic extraction of SDT content */ @Test - public void testSimpleControlContent() throws IOException { + void testSimpleControlContent() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug54849.docx"); XWPFWordExtractor ex = new XWPFWordExtractor(doc)) { String[] targs = new String[]{ @@ -382,7 +382,7 @@ public class TestXWPFWordExtractor { * No Header or Footer in document */ @Test - public void testBug55733() throws Exception { + void testBug55733() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("55733.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -392,7 +392,7 @@ public class TestXWPFWordExtractor { } @Test - public void testCheckboxes() throws IOException { + void testCheckboxes() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("checkboxes.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -405,7 +405,7 @@ public class TestXWPFWordExtractor { } @Test - public void testMultipleBodyBug() throws IOException { + void testMultipleBodyBug() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("MultipleBodyBug.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { assertEquals("START BODY 1 The quick, brown fox jumps over a lazy dog. END BODY 1.\n" @@ -416,7 +416,7 @@ public class TestXWPFWordExtractor { } @Test - public void testPhonetic() throws IOException { + void testPhonetic() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("61470.docx")) { try (XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { //expect: baseText (phoneticText) @@ -430,7 +430,7 @@ public class TestXWPFWordExtractor { } @Test - public void testCTPictureBase() throws IOException { + void testCTPictureBase() throws IOException { //This forces ctpicturebase to be included in the poi-ooxml-lite jar try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("61991.docx"); XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { @@ -440,7 +440,7 @@ public class TestXWPFWordExtractor { } @Test - public void testGlossary() throws IOException { + void testGlossary() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("60316.dotx")) { XWPFWordExtractor extractor = new XWPFWordExtractor(doc); String txt = extractor.getText(); @@ -452,7 +452,7 @@ public class TestXWPFWordExtractor { } @Test - public void testPartsInTemplate() throws IOException { + void testPartsInTemplate() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("60316b.dotx")) { XWPFWordExtractor extractor = new XWPFWordExtractor(doc); String txt = extractor.getText(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFDecorators.java b/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFDecorators.java index 04271b14d7..9323b96b8a 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFDecorators.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFDecorators.java @@ -54,7 +54,7 @@ public class TestXWPFDecorators { } @Test - public void testHyperlink() { + void testHyperlink() { XWPFParagraph ps; XWPFParagraph ph; assertEquals(7, simple.getParagraphs().size()); @@ -81,7 +81,7 @@ public class TestXWPFDecorators { } @Test - public void testComments() { + void testComments() { int numComments = 0; for (XWPFParagraph p : comments.getParagraphs()) { XWPFCommentsDecorator d = new XWPFCommentsDecorator(p, null); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFHeaderFooterPolicy.java b/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFHeaderFooterPolicy.java index 21dc6751f0..1c98dbb41d 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFHeaderFooterPolicy.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFHeaderFooterPolicy.java @@ -63,7 +63,7 @@ public class TestXWPFHeaderFooterPolicy { } @Test - public void testPolicy() { + void testPolicy() { XWPFHeaderFooterPolicy policy; policy = noHeader.getHeaderFooterPolicy(); @@ -145,7 +145,7 @@ public class TestXWPFHeaderFooterPolicy { } @Test - public void testCreate() throws Exception { + void testCreate() throws Exception { try (XWPFDocument doc = new XWPFDocument()) { assertNull(doc.getHeaderFooterPolicy()); assertEquals(0, doc.getHeaderList().size()); @@ -176,7 +176,7 @@ public class TestXWPFHeaderFooterPolicy { } @Test - public void testContents() { + void testContents() { XWPFHeaderFooterPolicy policy; // Test a few simple bits off a simple header diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestColumn.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestColumn.java index 9354afd7d0..462f52e8a6 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestColumn.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestColumn.java @@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class TestColumn { @Test - public void testAddNewColWithCorrectAmountOfColumns() throws IOException { + void testAddNewColWithCorrectAmountOfColumns() throws IOException { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(2, 4); table.addNewCol(); @@ -37,7 +37,7 @@ public class TestColumn { } @Test - public void testAddNewColWithEmptyTable() throws IOException { + void testAddNewColWithEmptyTable() throws IOException { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(0, 0); table.removeRow(0); @@ -50,7 +50,7 @@ public class TestColumn { } @Test - public void testAddNewColWithDocx() throws Exception { + void testAddNewColWithDocx() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples .openSampleDocument("TestTableColumns.docx")) { XWPFTable table = doc.getTables().get(0); @@ -64,7 +64,7 @@ public class TestColumn { } @Test - public void testAddNewColWhenRowsHaveDifferentNumbersOfColumnsWithDocx() throws Exception { + void testAddNewColWhenRowsHaveDifferentNumbersOfColumnsWithDocx() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples .openSampleDocument("TestTableColumns.docx")) { XWPFTable table = doc.getTables().get(1); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java index 3976e61310..189a6d104b 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java @@ -126,7 +126,7 @@ public class TestXWPFBugs { } @Test - public void test56392() throws IOException { + void test56392() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("56392.docx")) { assertNotNull(doc); } @@ -136,7 +136,7 @@ public class TestXWPFBugs { * Removing a run needs to remove it from both Runs and IRuns */ @Test - public void test57829() throws IOException { + void test57829() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx")) { assertNotNull(doc); assertEquals(3, doc.getParagraphs().size()); @@ -152,7 +152,7 @@ public class TestXWPFBugs { * Removing a run needs to take into account position of run if paragraph contains hyperlink runs */ @Test - public void test58618() throws IOException { + void test58618() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("58618.docx")) { XWPFParagraph para = (XWPFParagraph) doc.getBodyElements().get(0); assertNotNull(para); @@ -166,7 +166,7 @@ public class TestXWPFBugs { } @Test - public void test59378() throws IOException { + void test59378() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("59378.docx")) { ByteArrayOutputStream out = new ByteArrayOutputStream(); doc.write(out); @@ -181,7 +181,7 @@ public class TestXWPFBugs { } @Test - public void test63788() throws IOException { + void test63788() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFNumbering numbering = doc.createNumbering(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java index be4c1af023..d0da4cbbcb 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java @@ -41,7 +41,7 @@ public class TestXWPFChart { * test method to check charts are not null */ @Test - public void testRead() throws IOException { + void testRead() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("61745.docx")) { List charts = sampleDoc.getCharts(); assertNotNull(charts); @@ -63,7 +63,7 @@ public class TestXWPFChart { * test method to add chart title and check whether it's set */ @Test - public void testChartTitle() throws IOException { + void testChartTitle() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("61745.docx")) { List charts = sampleDoc.getCharts(); XWPFChart chart = charts.get(0); @@ -85,7 +85,7 @@ public class TestXWPFChart { * test method to check relationship */ @Test - public void testChartRelation() throws IOException { + void testChartRelation() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("61745.docx")) { List charts = sampleDoc.getCharts(); XWPFChart chart = charts.get(0); @@ -99,7 +99,7 @@ public class TestXWPFChart { * test method to check adding chart in document */ @Test - public void testAddChartsToNewDocument() throws InvalidFormatException, IOException { + void testAddChartsToNewDocument() throws InvalidFormatException, IOException { try (XWPFDocument document = new XWPFDocument()) { XWPFChart chart = document.createChart(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFComment.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFComment.java index b720176a81..e6197bf894 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFComment.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFComment.java @@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class TestXWPFComment { @Test - public void testText() throws IOException { + void testText() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("comment.docx")) { assertEquals(1, doc.getComments().length); XWPFComment comment = doc.getComments()[0]; diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFDocument.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFDocument.java index 16663012b5..db1b969b58 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFDocument.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFDocument.java @@ -50,7 +50,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; public final class TestXWPFDocument { @Test - public void testContainsMainContentType() throws Exception { + void testContainsMainContentType() throws Exception { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx"); OPCPackage pack = doc.getPackage(); @@ -71,7 +71,7 @@ public final class TestXWPFDocument { } @Test - public void testOpen() throws Exception { + void testOpen() throws Exception { // Simple file try (XWPFDocument xml1 = XWPFTestDataSamples.openSampleDocument("sample.docx")) { // Check it has key parts @@ -89,7 +89,7 @@ public final class TestXWPFDocument { } @Test - public void testMetadataBasics() throws IOException { + void testMetadataBasics() throws IOException { try (XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("sample.docx")) { assertNotNull(xml.getProperties().getCoreProperties()); assertNotNull(xml.getProperties().getExtendedProperties()); @@ -104,7 +104,7 @@ public final class TestXWPFDocument { } @Test - public void testMetadataComplex() throws IOException { + void testMetadataComplex() throws IOException { XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("IllustrativeCases.docx"); assertNotNull(xml.getProperties().getCoreProperties()); assertNotNull(xml.getProperties().getExtendedProperties()); @@ -121,7 +121,7 @@ public final class TestXWPFDocument { } @Test - public void testWorkbookProperties() throws Exception { + void testWorkbookProperties() throws Exception { XWPFDocument doc = new XWPFDocument(); POIXMLProperties props = doc.getProperties(); assertNotNull(props); @@ -130,7 +130,7 @@ public final class TestXWPFDocument { } @Test - public void testAddParagraph() throws IOException { + void testAddParagraph() throws IOException { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx"); assertEquals(3, doc.getParagraphs().size()); @@ -152,7 +152,7 @@ public final class TestXWPFDocument { } @Test - public void testAddPicture() throws IOException, InvalidFormatException { + void testAddPicture() throws IOException, InvalidFormatException { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx"); byte[] jpeg = XWPFTestDataSamples.getImage("nature1.jpg"); String relationId = doc.addPictureData(jpeg, Document.PICTURE_TYPE_JPEG); @@ -168,7 +168,7 @@ public final class TestXWPFDocument { } @Test - public void testAllPictureFormats() throws IOException, InvalidFormatException { + void testAllPictureFormats() throws IOException, InvalidFormatException { XWPFDocument doc = new XWPFDocument(); doc.addPictureData(new byte[10], Document.PICTURE_TYPE_EMF); @@ -192,7 +192,7 @@ public final class TestXWPFDocument { } @Test - public void testAddHyperlink() throws IOException { + void testAddHyperlink() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { XWPFParagraph p = doc.createParagraph(); XWPFHyperlinkRun h = p.createHyperlinkRun("https://poi.apache.org/"); @@ -212,7 +212,7 @@ public final class TestXWPFDocument { } @Test - public void testRemoveBodyElement() throws IOException { + void testRemoveBodyElement() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx")) { assertEquals(3, doc.getParagraphs().size()); assertEquals(3, doc.getBodyElements().size()); @@ -275,7 +275,7 @@ public final class TestXWPFDocument { } @Test - public void testRegisterPackagePictureData() throws IOException, InvalidFormatException { + void testRegisterPackagePictureData() throws IOException, InvalidFormatException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_1.docx")) { /* manually assemble a new image package part*/ OPCPackage opcPkg = doc.getPackage(); @@ -306,7 +306,7 @@ public final class TestXWPFDocument { } @Test - public void testFindPackagePictureData() throws IOException { + void testFindPackagePictureData() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_1.docx")) { byte[] nature1 = XWPFTestDataSamples.getImage("nature1.gif"); XWPFPictureData part = doc.findPackagePictureData(nature1, Document.PICTURE_TYPE_GIF); @@ -318,7 +318,7 @@ public final class TestXWPFDocument { } @Test - public void testGetAllPictures() throws IOException { + void testGetAllPictures() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_3.docx")) { List allPictures = doc.getAllPictures(); List allPackagePictures = doc.getAllPackagePictures(); @@ -336,7 +336,7 @@ public final class TestXWPFDocument { } @Test - public void testGetAllPackagePictures() throws IOException { + void testGetAllPackagePictures() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_3.docx")) { List allPackagePictures = doc.getAllPackagePictures(); @@ -350,7 +350,7 @@ public final class TestXWPFDocument { } @Test - public void testPictureHandlingSimpleFile() throws IOException, InvalidFormatException { + void testPictureHandlingSimpleFile() throws IOException, InvalidFormatException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_1.docx")) { assertEquals(1, doc.getAllPackagePictures().size()); byte[] newPic = XWPFTestDataSamples.getImage("abstract4.jpg"); @@ -365,7 +365,7 @@ public final class TestXWPFDocument { } @Test - public void testPictureHandlingHeaderDocumentImages() throws IOException { + void testPictureHandlingHeaderDocumentImages() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_2.docx")) { assertEquals(1, doc.getAllPictures().size()); assertEquals(1, doc.getAllPackagePictures().size()); @@ -375,7 +375,7 @@ public final class TestXWPFDocument { } @Test - public void testPictureHandlingComplex() throws IOException, InvalidFormatException { + void testPictureHandlingComplex() throws IOException, InvalidFormatException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("issue_51265_3.docx")) { XWPFHeader xwpfHeader = doc.getHeaderArray(0); @@ -394,7 +394,7 @@ public final class TestXWPFDocument { } @Test - public void testZeroLengthLibreOfficeDocumentWithWaterMarkHeader() throws IOException { + void testZeroLengthLibreOfficeDocumentWithWaterMarkHeader() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("zero-length.docx")) { POIXMLProperties properties = doc.getProperties(); @@ -412,7 +412,7 @@ public final class TestXWPFDocument { } @Test - public void testSettings() throws IOException { + void testSettings() throws IOException { XWPFSettings settings = new XWPFSettings(); assertEquals(100, settings.getZoomPercent()); settings.setZoomPercent(50); @@ -455,7 +455,7 @@ public final class TestXWPFDocument { } @Test - public void testEnforcedWith() throws IOException { + void testEnforcedWith() throws IOException { try (XWPFDocument docx = XWPFTestDataSamples.openSampleDocument("EnforcedWith.docx")) { assertTrue(docx.isEnforcedProtection()); } @@ -463,7 +463,7 @@ public final class TestXWPFDocument { @Test @Disabled("XWPF should be able to write to a new Stream when opened Read-Only") - public void testWriteFromReadOnlyOPC() throws Exception { + void testWriteFromReadOnlyOPC() throws Exception { OPCPackage opc = OPCPackage.open( POIDataSamples.getDocumentInstance().getFile("SampleDoc.docx"), PackageAccess.READ diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnote.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnote.java index e7f11fa3a1..703d0eb1f5 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnote.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnote.java @@ -55,7 +55,7 @@ public class TestXWPFEndnote { } @Test - public void testAddParagraphsToFootnote() throws IOException { + void testAddParagraphsToFootnote() throws IOException { // Add a run to the first paragraph: @@ -99,7 +99,7 @@ public class TestXWPFEndnote { } @Test - public void testAddTableToFootnote() throws IOException { + void testAddTableToFootnote() throws IOException { XWPFTable table = endnote.createTable(); assertNotNull(table); @@ -128,7 +128,7 @@ public class TestXWPFEndnote { } @Test - public void testRemoveEndnote() { + void testRemoveEndnote() { // NOTE: XWPFDocument.removeEndnote() delegates directly to // XWPFEndnotes. docOut.createEndnote(); @@ -140,7 +140,7 @@ public class TestXWPFEndnote { } @Test - public void testAddFootnoteRefToParagraph() { + void testAddFootnoteRefToParagraph() { XWPFParagraph p = docOut.createParagraph(); List runs = p.getRuns(); assertEquals(0, runs.size(), "Expected no runs in new paragraph"); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnotes.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnotes.java index e0a17b0c6a..770f24d88b 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnotes.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFEndnotes.java @@ -31,7 +31,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STFtnEdn; public class TestXWPFEndnotes { @Test - public void testCreateEndnotes() throws IOException{ + void testCreateEndnotes() throws IOException{ try (XWPFDocument docOut = new XWPFDocument()) { XWPFEndnotes footnotes = docOut.createEndnotes(); assertNotNull(footnotes); @@ -42,7 +42,7 @@ public class TestXWPFEndnotes { } @Test - public void testAddEndnotesToDocument() throws IOException { + void testAddEndnotesToDocument() throws IOException { try (XWPFDocument docOut = new XWPFDocument()) { // NOTE: XWPFDocument.createEndnote() delegates directly // to XWPFFootnotes.createEndnote() so this tests diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnote.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnote.java index 23a6b22e82..9ed9e4e630 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnote.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnote.java @@ -55,7 +55,7 @@ public class TestXWPFFootnote { } @Test - public void testAddParagraphsToFootnote() throws IOException { + void testAddParagraphsToFootnote() throws IOException { // Add a run to the first paragraph: @@ -99,7 +99,7 @@ public class TestXWPFFootnote { } @Test - public void testAddTableToFootnote() throws IOException { + void testAddTableToFootnote() throws IOException { XWPFTable table = footnote.createTable(); assertNotNull(table); @@ -127,7 +127,7 @@ public class TestXWPFFootnote { } @Test - public void testRemoveFootnote() { + void testRemoveFootnote() { // NOTE: XWPFDocument.removeFootnote() delegates directly to // XWPFFootnotes. docOut.createFootnote(); @@ -139,7 +139,7 @@ public class TestXWPFFootnote { } @Test - public void testAddFootnoteRefToParagraph() { + void testAddFootnoteRefToParagraph() { XWPFParagraph p = docOut.createParagraph(); List runs = p.getRuns(); assertEquals(0, runs.size(), "Expected no runs in new paragraph"); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnotes.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnotes.java index 8a71e84d2b..0f61d7c76c 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnotes.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnotes.java @@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertSame; public class TestXWPFFootnotes { @Test - public void testCreateFootnotes() throws IOException{ + void testCreateFootnotes() throws IOException{ try (XWPFDocument docOut = new XWPFDocument()) { XWPFAbstractFootnotesEndnotes footnotes = docOut.createFootnotes(); @@ -45,7 +45,7 @@ public class TestXWPFFootnotes { } @Test - public void testAddFootnotesToDocument() throws IOException { + void testAddFootnotesToDocument() throws IOException { try (XWPFDocument docOut = new XWPFDocument()) { // NOTE: XWPFDocument.createFootnote() delegates directly @@ -67,7 +67,7 @@ public class TestXWPFFootnotes { * Bug 55066 - avoid double loading the footnotes */ @Test - public void testLoadFootnotesOnce() throws IOException { + void testLoadFootnotesOnce() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug54849.docx")) { List footnotes = doc.getFootnotes(); int hits = 0; diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java index 6ec254f3ca..6fc0fe9092 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java @@ -34,7 +34,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText; public final class TestXWPFHeader { @Test - public void testSimpleHeader() throws IOException { + void testSimpleHeader() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("headerFooter.docx")) { XWPFHeaderFooterPolicy policy = sampleDoc.getHeaderFooterPolicy(); @@ -47,7 +47,7 @@ public final class TestXWPFHeader { } @Test - public void testImageInHeader() throws IOException { + void testImageInHeader() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("headerPic.docx")) { XWPFHeaderFooterPolicy policy = sampleDoc.getHeaderFooterPolicy(); @@ -60,7 +60,7 @@ public final class TestXWPFHeader { } @Test - public void testSetHeader() throws IOException { + void testSetHeader() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { // no header is set (yet) XWPFHeaderFooterPolicy policy = sampleDoc.getHeaderFooterPolicy(); @@ -181,7 +181,7 @@ public final class TestXWPFHeader { } @Test - public void testSetWatermark() throws IOException { + void testSetWatermark() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { // No header is set (yet) @@ -206,7 +206,7 @@ public final class TestXWPFHeader { } } - public void testSetWatermarkOnEmptyDoc() throws IOException { + void testSetWatermarkOnEmptyDoc() throws IOException { try (XWPFDocument sampleDoc = new XWPFDocument()) { // No header is set (yet) @@ -233,25 +233,25 @@ public final class TestXWPFHeader { @Disabled @Test - public void testAddPictureData() { + void testAddPictureData() { // TODO } @Disabled @Test - public void testGetAllPictures() { + void testGetAllPictures() { // TODO } @Disabled @Test - public void testGetAllPackagePictures() { + void testGetAllPackagePictures() { // TODO } @Disabled @Test - public void testGetPictureDataById() { + void testGetPictureDataById() { // TODO } diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java index 17e41b66cf..5e34741aed 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java @@ -33,7 +33,7 @@ public final class TestXWPFHeadings { private static final String HEADING1 = "Heading1"; @Test - public void testSetParagraphStyle() throws IOException { + void testSetParagraphStyle() throws IOException { //new clean instance of paragraph try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("heading123.docx")) { XWPFParagraph p = doc.createParagraph(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFNumbering.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFNumbering.java index 771c8fd80c..18ea0e1c64 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFNumbering.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFNumbering.java @@ -33,7 +33,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumLvl; public class TestXWPFNumbering { @Test - public void testCompareAbstractNum() throws IOException { + void testCompareAbstractNum() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Numbering.docx")) { XWPFNumbering numbering = doc.getNumbering(); BigInteger numId = BigInteger.valueOf(1); @@ -47,7 +47,7 @@ public class TestXWPFNumbering { } @Test - public void testAddNumberingToDoc() throws IOException { + void testAddNumberingToDoc() throws IOException { BigInteger abstractNumId = BigInteger.valueOf(1); BigInteger numId = BigInteger.valueOf(1); @@ -66,7 +66,7 @@ public class TestXWPFNumbering { } @Test - public void testAddAbstractNumIfAbstractNumNotEqualNull() throws IOException { + void testAddAbstractNumIfAbstractNumNotEqualNull() throws IOException { BigInteger abstractNumId = BigInteger.valueOf(1); XWPFDocument docOut = new XWPFDocument(); XWPFNumbering numbering = docOut.createNumbering(); @@ -87,7 +87,7 @@ public class TestXWPFNumbering { } @Test - public void testAddAbstractNumIfAbstractNumEqualNull() throws IOException { + void testAddAbstractNumIfAbstractNumEqualNull() throws IOException { XWPFDocument docOut = new XWPFDocument(); XWPFNumbering numbering = docOut.createNumbering(); @@ -105,7 +105,7 @@ public class TestXWPFNumbering { } @Test - public void testGetNumIlvl() throws IOException { + void testGetNumIlvl() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Numbering.docx")) { BigInteger numIlvl = BigInteger.valueOf(0); assertEquals(numIlvl, doc.getParagraphs().get(0).getNumIlvl()); @@ -115,7 +115,7 @@ public class TestXWPFNumbering { } @Test - public void testGetNumFmt() throws IOException { + void testGetNumFmt() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Numbering.docx")) { assertEquals("bullet", doc.getParagraphs().get(0).getNumFmt()); assertEquals("bullet", doc.getParagraphs().get(1).getNumFmt()); @@ -128,7 +128,7 @@ public class TestXWPFNumbering { } @Test - public void testLvlText() throws IOException { + void testLvlText() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Numbering.docx")) { assertEquals("%1.%2.%3.", doc.getParagraphs().get(12).getNumLevelText()); @@ -143,7 +143,7 @@ public class TestXWPFNumbering { } @Test - public void testOverrideList() throws IOException { + void testOverrideList() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("NumberingWOverrides.docx")) { XWPFParagraph p = doc.getParagraphs().get(4); XWPFNumbering numbering = doc.getNumbering(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java index a9f1c0a764..73eb333e65 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java @@ -58,7 +58,7 @@ public final class TestXWPFParagraph { * Check that we get the right paragraph from the header */ @Test - public void testHeaderParagraph() throws IOException { + void testHeaderParagraph() throws IOException { try (XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("ThreeColHead.docx")) { XWPFHeader hdr = xml.getHeaderFooterPolicy().getDefaultHeader(); @@ -77,7 +77,7 @@ public final class TestXWPFParagraph { * Check that we get the right paragraphs from the document */ @Test - public void testDocumentParagraph() throws IOException { + void testDocumentParagraph() throws IOException { try (XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("ThreeColHead.docx")) { List ps = xml.getParagraphs(); assertEquals(10, ps.size()); @@ -102,7 +102,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetBorderTop() throws IOException { + void testSetGetBorderTop() throws IOException { //new clean instance of paragraph try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -124,7 +124,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetAlignment() throws IOException { + void testSetGetAlignment() throws IOException { //new clean instance of paragraph try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -144,7 +144,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetSpacing() throws IOException { + void testSetGetSpacing() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -183,7 +183,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetSpacingLineRule() throws IOException { + void testSetGetSpacingLineRule() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -202,7 +202,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetIndentationChars() throws IOException { + void testSetGetIndentationChars() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -218,7 +218,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetIndentation() throws IOException { + void testSetGetIndentation() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -238,7 +238,7 @@ public final class TestXWPFParagraph { } } @Test - public void testSetGetVerticalAlignment() throws IOException { + void testSetGetVerticalAlignment() throws IOException { //new clean instance of paragraph try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -256,7 +256,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetWordWrap() throws IOException { + void testSetGetWordWrap() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -273,7 +273,7 @@ public final class TestXWPFParagraph { } @Test - public void testSetGetPageBreak() throws IOException { + void testSetGetPageBreak() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -290,7 +290,7 @@ public final class TestXWPFParagraph { } @Test - public void testBookmarks() throws IOException { + void testBookmarks() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("bookmarks.docx")) { XWPFParagraph paragraph = doc.getParagraphs().get(0); assertEquals("Sample Word Document", paragraph.getText()); @@ -305,7 +305,7 @@ public final class TestXWPFParagraph { } @Test - public void testGetSetNumID() throws IOException { + void testGetSetNumID() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -315,7 +315,7 @@ public final class TestXWPFParagraph { } @Test - public void testGetSetILvl() throws IOException { + void testGetSetILvl() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -325,7 +325,7 @@ public final class TestXWPFParagraph { } @Test - public void testAddingRuns() throws IOException { + void testAddingRuns() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx")) { XWPFParagraph p = doc.getParagraphs().get(0); @@ -343,7 +343,7 @@ public final class TestXWPFParagraph { } @Test - public void testCreateNewRuns() throws IOException { + void testCreateNewRuns() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -364,7 +364,7 @@ public final class TestXWPFParagraph { } @Test - public void testInsertNewRuns() throws IOException { + void testInsertNewRuns() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -384,7 +384,7 @@ public final class TestXWPFParagraph { } @Test - public void testRemoveRuns() throws IOException { + void testRemoveRuns() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -415,7 +415,7 @@ public final class TestXWPFParagraph { } @Test - public void testRemoveAndInsertRunsWithOtherIRunElement() + void testRemoveAndInsertRunsWithOtherIRunElement() throws IOException { XWPFDocument doc = new XWPFDocument(); @@ -475,7 +475,7 @@ public final class TestXWPFParagraph { } @Test - public void testPictures() throws IOException { + void testPictures() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("VariousPictures.docx")) { assertEquals(7, doc.getParagraphs().size()); @@ -550,7 +550,7 @@ public final class TestXWPFParagraph { } @Test - public void testTika792() throws Exception { + void testTika792() throws Exception { //This test forces the loading of CTMoveBookmark and //CTMoveBookmarkImpl into ooxml-lite. try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Tika-792.docx")) { @@ -562,7 +562,7 @@ public final class TestXWPFParagraph { } @Test - public void testSettersGetters() throws IOException { + void testSettersGetters() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -687,7 +687,7 @@ public final class TestXWPFParagraph { } @Test - public void testSearchTextNotFound() throws IOException { + void testSearchTextNotFound() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -697,7 +697,7 @@ public final class TestXWPFParagraph { } @Test - public void testSearchTextFound() throws IOException { + void testSearchTextFound() throws IOException { try (XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("ThreeColHead.docx")) { List ps = xml.getParagraphs(); @@ -715,7 +715,7 @@ public final class TestXWPFParagraph { } @Test - public void testFieldRuns() throws IOException { + void testFieldRuns() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("FldSimple.docx")) { List ps = doc.getParagraphs(); assertEquals(1, ps.size()); @@ -736,7 +736,7 @@ public final class TestXWPFParagraph { @SuppressWarnings("deprecation") @Test - public void testRuns() throws IOException { + void testRuns() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFParagraph p = doc.createParagraph(); @@ -751,7 +751,7 @@ public final class TestXWPFParagraph { } @Test - public void test58067() throws IOException { + void test58067() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("58067.docx")) { StringBuilder str = new StringBuilder(); @@ -763,7 +763,7 @@ public final class TestXWPFParagraph { } @Test - public void test61787() throws IOException { + void test61787() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("61787.docx")) { StringBuilder str = new StringBuilder(); @@ -782,7 +782,7 @@ public final class TestXWPFParagraph { * for someone else trying a similar thing */ @Test - public void testNumberedLists() throws Exception { + void testNumberedLists() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("ComplexNumberedLists.docx")) { XWPFParagraph p; diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java index 02149a7e32..b12e4e90a4 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; public class TestXWPFPictureData { @Test - public void testRead() throws InvalidFormatException, IOException { + void testRead() throws InvalidFormatException, IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("VariousPictures.docx")) { List pictures = sampleDoc.getAllPictures(); @@ -64,7 +64,7 @@ public class TestXWPFPictureData { } @Test - public void testPictureInHeader() throws IOException { + void testPictureInHeader() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("headerPic.docx")) { verifyOneHeaderPicture(sampleDoc); @@ -74,7 +74,7 @@ public class TestXWPFPictureData { } @Test - public void testCreateHeaderPicture() throws Exception { + void testCreateHeaderPicture() throws Exception { try (XWPFDocument doc = new XWPFDocument()) { // Starts with no header @@ -113,7 +113,7 @@ public class TestXWPFPictureData { } @Test - public void testNew() throws InvalidFormatException, IOException { + void testNew() throws InvalidFormatException, IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("EmptyDocumentWithHeaderFooter.docx")) { byte[] jpegData = XWPFTestDataSamples.getImage("nature1.jpg"); assertNotNull(jpegData); @@ -172,7 +172,7 @@ public class TestXWPFPictureData { } @Test - public void testBug51770() throws IOException { + void testBug51770() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug51170.docx")) { XWPFHeaderFooterPolicy policy = doc.getHeaderFooterPolicy(); XWPFHeader header = policy.getDefaultHeader(); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java index 7ccc739613..dcbc3ebd16 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java @@ -79,7 +79,7 @@ public class TestXWPFRun { } @Test - public void testSetGetText() { + void testSetGetText() { ctRun.addNewT().setStringValue("TEST STRING"); ctRun.addNewT().setStringValue("TEST2 STRING"); ctRun.addNewT().setStringValue("TEST3 STRING"); @@ -102,7 +102,7 @@ public class TestXWPFRun { * exercise isCTOnOff(CTOnOff) through all valid permutations */ @Test - public void testCTOnOff() { + void testCTOnOff() { CTRPr rpr = ctRun.addNewRPr(); CTOnOff bold = rpr.addNewB(); XWPFRun run = new XWPFRun(ctRun, irb); @@ -129,7 +129,7 @@ public class TestXWPFRun { } @Test - public void testSetGetBold() { + void testSetGetBold() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewB().setVal(STOnOff1.ON); @@ -143,7 +143,7 @@ public class TestXWPFRun { } @Test - public void testSetGetItalic() { + void testSetGetItalic() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewI().setVal(STOnOff1.ON); @@ -155,7 +155,7 @@ public class TestXWPFRun { } @Test - public void testSetGetStrike() { + void testSetGetStrike() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewStrike().setVal(STOnOff1.ON); @@ -167,7 +167,7 @@ public class TestXWPFRun { } @Test - public void testSetGetUnderline() { + void testSetGetUnderline() { CTRPr rpr = ctRun.addNewRPr(); XWPFRun run = new XWPFRun(ctRun, irb); rpr.addNewU().setVal(STUnderline.DASH); @@ -181,7 +181,7 @@ public class TestXWPFRun { } @Test - public void testSetGetFontFamily() { + void testSetGetFontFamily() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewRFonts().setAscii("Times New Roman"); @@ -193,7 +193,7 @@ public class TestXWPFRun { } @Test - public void testSetGetFontSize() { + void testSetGetFontSize() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewSz().setVal(BigInteger.valueOf(14)); @@ -211,7 +211,7 @@ public class TestXWPFRun { } @Test - public void testSetGetTextForegroundBackground() { + void testSetGetTextForegroundBackground() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewPosition().setVal(new BigInteger("4000")); @@ -223,7 +223,7 @@ public class TestXWPFRun { } @Test - public void testSetGetColor() { + void testSetGetColor() { XWPFRun run = new XWPFRun(ctRun, irb); run.setColor("0F0F0F"); String clr = run.getColor(); @@ -231,7 +231,7 @@ public class TestXWPFRun { } @Test - public void testAddCarriageReturn() { + void testAddCarriageReturn() { ctRun.addNewT().setStringValue("TEST STRING"); ctRun.addNewCr(); ctRun.addNewT().setStringValue("TEST2 STRING"); @@ -251,7 +251,7 @@ public class TestXWPFRun { } @Test - public void testAddTabsAndLineBreaks() { + void testAddTabsAndLineBreaks() { ctRun.addNewT().setStringValue("TEST STRING"); ctRun.addNewCr(); ctRun.addNewT().setStringValue("TEST2 STRING"); @@ -273,7 +273,7 @@ public class TestXWPFRun { } @Test - public void testAddPageBreak() { + void testAddPageBreak() { ctRun.addNewT().setStringValue("TEST STRING"); ctRun.addNewBr(); ctRun.addNewT().setStringValue("TEST2 STRING"); @@ -295,7 +295,7 @@ public class TestXWPFRun { * right thing with it */ @Test - public void testExisting() throws IOException { + void testExisting() throws IOException { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestDocument.docx"); XWPFParagraph p; XWPFRun run; @@ -429,7 +429,7 @@ public class TestXWPFRun { } @Test - public void testPictureInHeader() throws IOException { + void testPictureInHeader() throws IOException { XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("headerPic.docx"); XWPFHeaderFooterPolicy policy = sampleDoc.getHeaderFooterPolicy(); @@ -455,7 +455,7 @@ public class TestXWPFRun { } @Test - public void testSetGetLang() { + void testSetGetLang() { XWPFRun run = p.createRun(); assertNull(run.getLang()); @@ -470,7 +470,7 @@ public class TestXWPFRun { } @Test - public void testSetGetLang2() { + void testSetGetLang2() { XWPFRun run = p.createRun(); assertNull(run.getLang()); @@ -485,7 +485,7 @@ public class TestXWPFRun { } @Test - public void testAddPicture() throws Exception { + void testAddPicture() throws Exception { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestDocument.docx"); XWPFParagraph p = doc.getParagraphArray(2); XWPFRun r = p.getRuns().get(0); @@ -512,7 +512,7 @@ public class TestXWPFRun { * Bugzilla #58237 - Unable to add image to word document header */ @Test - public void testAddPictureInHeader() throws IOException, InvalidFormatException { + void testAddPictureInHeader() throws IOException, InvalidFormatException { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestDocument.docx"); XWPFHeader hdr = doc.createHeader(HeaderFooterType.DEFAULT); XWPFParagraph p = hdr.createParagraph(); @@ -553,7 +553,7 @@ public class TestXWPFRun { * run mustn't NPE */ @Test - public void testSetFontFamily_52288() throws IOException { + void testSetFontFamily_52288() throws IOException { XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("52288.docx"); final Iterator paragraphs = doc.getParagraphsIterator(); while (paragraphs.hasNext()) { @@ -571,7 +571,7 @@ public class TestXWPFRun { } @Test - public void testBug55476() throws IOException, InvalidFormatException { + void testBug55476() throws IOException, InvalidFormatException { byte[] image = XWPFTestDataSamples.getImage("abstract1.jpg"); XWPFDocument document = new XWPFDocument(); @@ -594,7 +594,7 @@ public class TestXWPFRun { } @Test - public void testBug58922() throws IOException { + void testBug58922() throws IOException { XWPFDocument document = new XWPFDocument(); final XWPFRun run = document.createParagraph().createRun(); @@ -654,7 +654,7 @@ public class TestXWPFRun { } @Test - public void testSetters() { + void testSetters() { XWPFDocument document = new XWPFDocument(); final XWPFRun run = document.createParagraph().createRun(); @@ -676,7 +676,7 @@ public class TestXWPFRun { } @Test - public void testSetGetTextScale() throws IOException { + void testSetGetTextScale() throws IOException { XWPFDocument document = new XWPFDocument(); final XWPFRun run = document.createParagraph().createRun(); assertEquals(100, run.getTextScale()); @@ -686,7 +686,7 @@ public class TestXWPFRun { } @Test - public void testSetGetTextHighlightColor() throws IOException { + void testSetGetTextHighlightColor() throws IOException { XWPFDocument document = new XWPFDocument(); final XWPFRun run = document.createParagraph().createRun(); assertEquals(STHighlightColor.NONE, run.getTextHightlightColor()); @@ -701,7 +701,7 @@ public class TestXWPFRun { } @Test - public void testSetGetVanish() throws IOException { + void testSetGetVanish() throws IOException { XWPFDocument document = new XWPFDocument(); final XWPFRun run = document.createParagraph().createRun(); assertFalse(run.isVanish()); @@ -713,7 +713,7 @@ public class TestXWPFRun { } @Test - public void testSetGetVerticalAlignment() throws IOException { + void testSetGetVerticalAlignment() throws IOException { XWPFDocument document = new XWPFDocument(); XWPFRun run = document.createParagraph().createRun(); assertEquals(STVerticalAlignRun.BASELINE, run.getVerticalAlignment()); @@ -727,7 +727,7 @@ public class TestXWPFRun { } @Test - public void testSetGetVAlign() { + void testSetGetVAlign() { CTRPr rpr = ctRun.addNewRPr(); rpr.addNewVertAlign().setVal(STVerticalAlignRun.SUBSCRIPT); @@ -738,7 +738,7 @@ public class TestXWPFRun { } @Test - public void testSetGetEmphasisMark() throws IOException { + void testSetGetEmphasisMark() throws IOException { XWPFDocument document = new XWPFDocument(); XWPFRun run = document.createParagraph().createRun(); assertEquals(STEm.NONE, run.getEmphasisMark()); @@ -750,7 +750,7 @@ public class TestXWPFRun { } @Test - public void testSetGetUnderlineColor() throws IOException { + void testSetGetUnderlineColor() throws IOException { XWPFDocument document = new XWPFDocument(); XWPFRun run = document.createParagraph().createRun(); assertEquals("auto", run.getUnderlineColor()); @@ -765,7 +765,7 @@ public class TestXWPFRun { } @Test - public void testSetGetUnderlineThemeColor() throws IOException { + void testSetGetUnderlineThemeColor() throws IOException { XWPFDocument document = new XWPFDocument(); XWPFRun run = document.createParagraph().createRun(); assertEquals(STThemeColor.NONE, run.getUnderlineThemeColor()); @@ -781,7 +781,7 @@ public class TestXWPFRun { @Test - public void testSetStyleId() throws IOException { + void testSetStyleId() throws IOException { XWPFDocument document = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx"); final XWPFRun run = document.createParagraph().createRun(); @@ -797,7 +797,7 @@ public class TestXWPFRun { } @Test - public void testGetDepthWidth() throws IOException, InvalidFormatException { + void testGetDepthWidth() throws IOException, InvalidFormatException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("TestDocument.docx")) { XWPFHeader hdr = doc.createHeader(HeaderFooterType.DEFAULT); XWPFParagraph p = hdr.createParagraph(); @@ -819,7 +819,7 @@ public class TestXWPFRun { } @Test - public void testWhitespace() throws IOException { + void testWhitespace() throws IOException { String[] text = new String[] { " The quick brown fox", "\t\tjumped over the lazy dog" diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java index ed20affd16..235c17d3ab 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java @@ -34,7 +34,7 @@ public final class TestXWPFSDT { * Test text extraction from nested SDTs */ @Test - public void testNestedSDTs() throws Exception { + void testNestedSDTs() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug64561.docx")) { XWPFAbstractSDT sdt = extractAllSDTs(doc).get(0); assertEquals("Subject", sdt.getContent().getText(), "extracted text"); @@ -45,7 +45,7 @@ public final class TestXWPFSDT { * Test simple tag and title extraction from SDT */ @Test - public void testTagTitle() throws Exception { + void testTagTitle() throws Exception { try (XWPFDocument doc =XWPFTestDataSamples.openSampleDocument("Bug54849.docx")) { String tag = null; String title = null; @@ -66,7 +66,7 @@ public final class TestXWPFSDT { } @Test - public void testGetSDTs() throws Exception { + void testGetSDTs() throws Exception { String[] contents = new String[]{ "header_rich_text", "Rich_text", @@ -99,7 +99,7 @@ public final class TestXWPFSDT { * POI-54771 and TIKA-1317 */ @Test - public void testSDTAsCell() throws Exception { + void testSDTAsCell() throws Exception { //Bug54771a.docx and Bug54771b.docx test slightly //different recursion patterns. Keep both! try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug54771a.docx")) { @@ -128,7 +128,7 @@ public final class TestXWPFSDT { * POI-55142 and Tika 1130 */ @Test - public void testNewLinesBetweenRuns() throws Exception { + void testNewLinesBetweenRuns() throws Exception { try (XWPFDocument doc =XWPFTestDataSamples.openSampleDocument("Bug55142.docx")) { List sdts = extractAllSDTs(doc); List targs = new ArrayList<>(); @@ -152,7 +152,7 @@ public final class TestXWPFSDT { } @Test - public void test60341() throws IOException { + void test60341() throws IOException { //handle sdtbody without an sdtpr try (XWPFDocument doc =XWPFTestDataSamples.openSampleDocument("Bug60341.docx")) { List sdts = extractAllSDTs(doc); @@ -163,7 +163,7 @@ public final class TestXWPFSDT { } @Test - public void test62859() throws IOException { + void test62859() throws IOException { //this doesn't test the exact code path for this issue, but //it does test for a related issue, and the fix fixes both. //We should try to add the actual triggering document diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSmartTag.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSmartTag.java index 466cadae65..ffd9a5e02d 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSmartTag.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSmartTag.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; */ public final class TestXWPFSmartTag { @Test - public void testSmartTags() throws IOException { + void testSmartTags() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("smarttag-snippet.docx")) { XWPFParagraph p = doc.getParagraphArray(0); assertContains(p.getText(), "Carnegie Mellon University School of Computer Science"); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java index 49fb85ea2d..550e16ff74 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java @@ -39,7 +39,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STStyleType; public final class TestXWPFStyles { @Test - public void testGetUsedStyles() throws IOException { + void testGetUsedStyles() throws IOException { try (XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("Styles.docx")) { List testUsedStyleList = new ArrayList<>(); XWPFStyles styles = sampleDoc.getStyles(); @@ -56,7 +56,7 @@ public final class TestXWPFStyles { } @Test - public void testAddStylesToDocument() throws IOException { + void testAddStylesToDocument() throws IOException { XWPFDocument docOut = new XWPFDocument(); XWPFStyles styles = docOut.createStyles(); @@ -80,7 +80,7 @@ public final class TestXWPFStyles { * both regular and glossary styles without error */ @Test - public void test52449() throws Exception { + void test52449() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("52449.docx")) { XWPFStyles styles = doc.getStyles(); assertNotNull(styles); @@ -98,7 +98,7 @@ public final class TestXWPFStyles { */ @SuppressWarnings("resource") @Test - public void testLanguages() { + void testLanguages() { XWPFDocument docOut = new XWPFDocument(); XWPFStyles styles = docOut.createStyles(); styles.setEastAsia("Chinese"); @@ -110,7 +110,7 @@ public final class TestXWPFStyles { } @Test - public void testType() { + void testType() { CTStyle ctStyle = CTStyle.Factory.newInstance(); XWPFStyle style = new XWPFStyle(ctStyle); @@ -119,7 +119,7 @@ public final class TestXWPFStyles { } @Test - public void testLatentStyles() { + void testLatentStyles() { CTLatentStyles latentStyles = CTLatentStyles.Factory.newInstance(); CTLsdException ex = latentStyles.addNewLsdException(); ex.setName("ex1"); @@ -129,7 +129,7 @@ public final class TestXWPFStyles { } @Test - public void testSetStyles_Bug57254() throws IOException { + void testSetStyles_Bug57254() throws IOException { XWPFDocument docOut = new XWPFDocument(); XWPFStyles styles = docOut.createStyles(); @@ -149,7 +149,7 @@ public final class TestXWPFStyles { } @Test - public void testEasyAccessToStyles() throws IOException { + void testEasyAccessToStyles() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { XWPFStyles styles = doc.getStyles(); assertNotNull(styles); @@ -209,7 +209,7 @@ public final class TestXWPFStyles { // Bug 60329: style with missing StyleID throws NPE @Test - public void testMissingStyleId() throws IOException { + void testMissingStyleId() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("60329.docx")) { XWPFStyles styles = doc.getStyles(); // Styles exist in the test document in this order, EmptyCellLayoutStyle @@ -226,7 +226,7 @@ public final class TestXWPFStyles { } @Test - public void testGetStyleByName() throws IOException { + void testGetStyleByName() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { XWPFStyles styles = doc.getStyles(); assertNotNull(styles); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java index 158eb2495d..e7cf38426f 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java @@ -46,7 +46,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder; public class TestXWPFTable { @Test - public void testConstructor() throws IOException { + void testConstructor() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); XWPFTable xtab = new XWPFTable(ctTable, doc); @@ -65,7 +65,7 @@ public class TestXWPFTable { } @Test - public void testTblGrid() throws IOException { + void testTblGrid() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); CTTblGrid cttblgrid = ctTable.addNewTblGrid(); @@ -80,7 +80,7 @@ public class TestXWPFTable { } @Test - public void testGetText() throws IOException { + void testGetText() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl table = CTTbl.Factory.newInstance(); CTRow row = table.addNewTr(); @@ -96,7 +96,7 @@ public class TestXWPFTable { } @Test - public void testCreateRow() throws IOException { + void testCreateRow() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl table = CTTbl.Factory.newInstance(); @@ -128,7 +128,7 @@ public class TestXWPFTable { } @Test - public void testSetGetWidth() throws IOException { + void testSetGetWidth() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFTable xtab = doc.createTable(); @@ -191,7 +191,7 @@ public class TestXWPFTable { } @Test - public void testSetGetHeight() throws IOException { + void testSetGetHeight() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl table = CTTbl.Factory.newInstance(); @@ -204,7 +204,7 @@ public class TestXWPFTable { } @Test - public void testSetGetMargins() throws IOException { + void testSetGetMargins() throws IOException { // instantiate the following class so it'll get picked up by // the XmlBean process and added to the jar file. it's required // for the following XWPFTable methods. @@ -229,7 +229,7 @@ public class TestXWPFTable { } @Test - public void testSetGetHBorders() throws IOException { + void testSetGetHBorders() throws IOException { // instantiate the following classes so they'll get picked up by // the XmlBean process and added to the jar file. they are required // for the following XWPFTable methods. @@ -298,7 +298,7 @@ public class TestXWPFTable { } @Test - public void testSetGetVBorders() throws IOException { + void testSetGetVBorders() throws IOException { // create a table try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); @@ -364,7 +364,7 @@ public class TestXWPFTable { } @Test - public void testSetGetTopBorders() throws IOException { + void testSetGetTopBorders() throws IOException { // create a table try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); @@ -403,7 +403,7 @@ public class TestXWPFTable { } @Test - public void testSetGetBottomBorders() throws IOException { + void testSetGetBottomBorders() throws IOException { // create a table try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); @@ -442,7 +442,7 @@ public class TestXWPFTable { } @Test - public void testSetGetLeftBorders() throws IOException { + void testSetGetLeftBorders() throws IOException { // create a table try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); @@ -481,7 +481,7 @@ public class TestXWPFTable { } @Test - public void testSetGetRightBorders() throws IOException { + void testSetGetRightBorders() throws IOException { // create a table try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); @@ -520,7 +520,7 @@ public class TestXWPFTable { } @Test - public void testSetGetRowBandSize() throws IOException { + void testSetGetRowBandSize() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); XWPFTable table = new XWPFTable(ctTable, doc); @@ -531,7 +531,7 @@ public class TestXWPFTable { } @Test - public void testSetGetColBandSize() throws IOException { + void testSetGetColBandSize() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { CTTbl ctTable = CTTbl.Factory.newInstance(); XWPFTable table = new XWPFTable(ctTable, doc); @@ -542,7 +542,7 @@ public class TestXWPFTable { } @Test - public void testCreateTable() throws Exception { + void testCreateTable() throws Exception { // open an empty document try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx")) { @@ -577,7 +577,7 @@ public class TestXWPFTable { } @Test - public void testSetGetTableAlignment() throws IOException { + void testSetGetTableAlignment() throws IOException { try (XWPFDocument doc = new XWPFDocument()) { XWPFTable tbl = doc.createTable(1, 1); tbl.setTableAlignment(TableRowAlign.LEFT); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java index 1ac72e26f8..cdc92bb6a7 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java @@ -48,7 +48,7 @@ import java.util.List; public class TestXWPFTableCell { @Test - public void testSetGetVertAlignment() { + void testSetGetVertAlignment() { // instantiate the following classes so they'll get picked up by // the XmlBean process and added to the jar file. they are required // for the following XWPFTableCell methods. @@ -77,7 +77,7 @@ public class TestXWPFTableCell { } @Test - public void testSetGetColor() { + void testSetGetColor() { // create a table XWPFDocument doc = new XWPFDocument(); CTTbl ctTable = CTTbl.Factory.newInstance(); @@ -97,7 +97,7 @@ public class TestXWPFTableCell { * ensure that CTHMerge and CTTcBorders go in poi-ooxml.jar */ @Test - public void test54099() { + void test54099() { XWPFDocument doc = new XWPFDocument(); CTTbl ctTable = CTTbl.Factory.newInstance(); XWPFTable table = new XWPFTable(ctTable, doc); @@ -116,7 +116,7 @@ public class TestXWPFTableCell { } @Test - public void testCellVerticalAlign() throws Exception{ + void testCellVerticalAlign() throws Exception{ try (XWPFDocument docx = XWPFTestDataSamples.openSampleDocument("59030.docx")) { List tables = docx.getTables(); assertEquals(1, tables.size()); @@ -136,7 +136,7 @@ public class TestXWPFTableCell { // This is not a very useful test as written. It is not worth the execution time for a unit test @Disabled @Test - public void testCellVerticalAlignShouldNotThrowNPE() throws Exception { + void testCellVerticalAlignShouldNotThrowNPE() throws Exception { XWPFDocument docx = XWPFTestDataSamples.openSampleDocument("TestTableCellAlign.docx"); List tables = docx.getTables(); for (XWPFTable table : tables) { @@ -152,7 +152,7 @@ public class TestXWPFTableCell { } @Test - public void testCellGetSetWidth() throws Exception { + void testCellGetSetWidth() throws Exception { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(); XWPFTableRow tr = table.createRow(); @@ -166,7 +166,7 @@ public class TestXWPFTableCell { } @Test - public void testAddParagraph() throws Exception { + void testAddParagraph() throws Exception { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(); XWPFTableRow tr = table.createRow(); @@ -186,7 +186,7 @@ public class TestXWPFTableCell { } @Test - public void testRemoveParagraph() throws Exception { + void testRemoveParagraph() throws Exception { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(); XWPFTableRow tr = table.createRow(); @@ -219,7 +219,7 @@ public class TestXWPFTableCell { } @Test - public void testRemoveTable() throws Exception { + void testRemoveTable() throws Exception { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(); XWPFTableRow tr = table.createRow(); @@ -249,7 +249,7 @@ public class TestXWPFTableCell { } @Test - public void testBug63624() throws Exception { + void testBug63624() throws Exception { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(1, 1); XWPFTableRow row = table.getRow(0); @@ -263,7 +263,7 @@ public class TestXWPFTableCell { } @Test - public void test63624() { + void test63624() { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(1, 1); XWPFTableRow row = table.getRow(0); diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableRow.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableRow.java index ee532e2631..4c95be51f6 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableRow.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableRow.java @@ -31,7 +31,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STHeightRule; public class TestXWPFTableRow { @Test - public void testCreateRow() throws IOException { + void testCreateRow() throws IOException { XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(1, 1); XWPFTableRow tr = table.createRow(); @@ -40,7 +40,7 @@ public class TestXWPFTableRow { } @Test - public void testSetGetCantSplitRow() throws IOException { + void testSetGetCantSplitRow() throws IOException { // create a table XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(1, 1); @@ -66,7 +66,7 @@ public class TestXWPFTableRow { } @Test - public void testSetGetRepeatHeader() throws IOException { + void testSetGetRepeatHeader() throws IOException { // create a table XWPFDocument doc = new XWPFDocument(); XWPFTable table = doc.createTable(3, 1); @@ -102,7 +102,7 @@ public class TestXWPFTableRow { // Test that validates the table header value can be parsed from a document // generated in Word @Test - public void testIsRepeatHeader() throws Exception { + void testIsRepeatHeader() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples .openSampleDocument("Bug60337.docx")) { XWPFTable table = doc.getTables().get(0); @@ -124,7 +124,7 @@ public class TestXWPFTableRow { // Test that validates the table header value can be parsed from a document // generated in Word @Test - public void testIsCantSplit() throws Exception { + void testIsCantSplit() throws Exception { try (XWPFDocument doc = XWPFTestDataSamples .openSampleDocument("Bug60337.docx")) { XWPFTable table = doc.getTables().get(0); @@ -143,7 +143,7 @@ public class TestXWPFTableRow { } @Test - public void testRemoveCell() throws IOException { + void testRemoveCell() throws IOException { XWPFDocument doc = new XWPFDocument(); XWPFTableRow tr = doc.createTable(1, 1).createRow(); @@ -157,7 +157,7 @@ public class TestXWPFTableRow { } @Test - public void testGetSetHeightRule() throws IOException { + void testGetSetHeightRule() throws IOException { XWPFDocument doc = new XWPFDocument(); XWPFTableRow tr = doc.createTable(1, 1).createRow(); assertEquals(TableRowHeightRule.AUTO, tr.getHeightRule()); @@ -171,7 +171,7 @@ public class TestXWPFTableRow { } @Test - public void testBug62174() throws IOException { + void testBug62174() throws IOException { try (XWPFDocument doc = XWPFTestDataSamples .openSampleDocument("Bug60337.docx")) { XWPFTable table = doc.getTables().get(0);