diff options
Diffstat (limited to 'src/testcases/org/apache/poi/hssf')
181 files changed, 843 insertions, 843 deletions
diff --git a/src/testcases/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java b/src/testcases/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java index 9eb7ffac66..91481c80ec 100644 --- a/src/testcases/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java +++ b/src/testcases/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java @@ -63,7 +63,7 @@ public abstract class BaseTestIteratingXLS { @ParameterizedTest @MethodSource("files") - public void testMain(File file) throws Exception { + void testMain(File file) throws Exception { String fileName = file.getName(); Class<? extends Throwable> t = EXCLUDED.get(fileName); diff --git a/src/testcases/org/apache/poi/hssf/dev/TestBiffViewer.java b/src/testcases/org/apache/poi/hssf/dev/TestBiffViewer.java index 3e84c6db6d..a6fcb169f8 100644 --- a/src/testcases/org/apache/poi/hssf/dev/TestBiffViewer.java +++ b/src/testcases/org/apache/poi/hssf/dev/TestBiffViewer.java @@ -66,7 +66,7 @@ public class TestBiffViewer extends BaseTestIteratingXLS { // @Test // @Disabled("only used for manual tests") // @SuppressWarnings("java:S2699") -// public void testOneFile() throws Exception { +// void testOneFile() throws Exception { // POIDataSamples samples = POIDataSamples.getSpreadSheetInstance(); // runOneFile(samples.getFile("43493.xls")); // } diff --git a/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java b/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java index f05167dcf7..061b8ed0af 100644 --- a/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java +++ b/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java @@ -64,7 +64,7 @@ public class TestEFBiffViewer extends BaseTestIteratingXLS { } //@Test - public void testFile() throws IOException { + void testFile() throws IOException { EFBiffViewer viewer = new EFBiffViewer(); viewer.setFile(new File("test-data/spreadsheet/59074.xls").getAbsolutePath()); viewer.run(); diff --git a/src/testcases/org/apache/poi/hssf/dev/TestReSave.java b/src/testcases/org/apache/poi/hssf/dev/TestReSave.java index b03de96459..972490db83 100644 --- a/src/testcases/org/apache/poi/hssf/dev/TestReSave.java +++ b/src/testcases/org/apache/poi/hssf/dev/TestReSave.java @@ -86,7 +86,7 @@ public class TestReSave extends BaseTestIteratingXLS { @Disabled("Only used for local testing") @Test - public void testOneFile() throws Exception { + void testOneFile() throws Exception { String dataDirName = System.getProperty(POIDataSamples.TEST_PROPERTY); if(dataDirName == null) { dataDirName = "test-data"; diff --git a/src/testcases/org/apache/poi/hssf/dev/TestRecordLister.java b/src/testcases/org/apache/poi/hssf/dev/TestRecordLister.java index 0950553125..fc2f304c42 100644 --- a/src/testcases/org/apache/poi/hssf/dev/TestRecordLister.java +++ b/src/testcases/org/apache/poi/hssf/dev/TestRecordLister.java @@ -57,7 +57,7 @@ public class TestRecordLister extends BaseTestIteratingXLS { } //@Test - public void testFile() throws IOException { + void testFile() throws IOException { RecordLister viewer = new RecordLister(); viewer.setFile(new File("test-data/spreadsheet/testEXCEL_95.xls").getAbsolutePath()); viewer.run(); diff --git a/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java b/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java index 973da0839f..c3f43af19e 100644 --- a/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java +++ b/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java @@ -45,7 +45,7 @@ public final class TestAbortableListener { } @Test - public void testAbortingBasics() throws Exception { + void testAbortingBasics() throws Exception { AbortableCountingListener l = new AbortableCountingListener(1000); HSSFRequest req = new HSSFRequest(); @@ -65,7 +65,7 @@ public final class TestAbortableListener { } @Test - public void testAbortStops() throws Exception { + void testAbortStops() throws Exception { AbortableCountingListener l = new AbortableCountingListener(1); HSSFRequest req = new HSSFRequest(); diff --git a/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java b/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java index 9598783543..7434a29dc4 100644 --- a/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java +++ b/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java @@ -60,7 +60,7 @@ public final class TestEventRecordFactory { * tests that the records can be processed and properly return values. */ @Test - public void testProcessRecords() { + void testProcessRecords() { final boolean[] wascalled = { false }; // hack to pass boolean by ref into inner class ERFListener listener = rec -> { @@ -94,7 +94,7 @@ public final class TestEventRecordFactory { * constructed record in the simple case. */ @Test - public void testCreateRecord() { + void testCreateRecord() { BOFRecord bof = new BOFRecord(); bof.setBuild((short)0); bof.setBuildYear((short)1999); @@ -122,7 +122,7 @@ public final class TestEventRecordFactory { // @NotImplemented // @Test // @Disabled - // public void testCreateContinuedRecord() { + // void testCreateContinuedRecord() { // } @@ -135,7 +135,7 @@ public final class TestEventRecordFactory { * */ @Test - public void testContinuedUnknownRecord() throws IOException { + void testContinuedUnknownRecord() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (byte[] b : CONTINUE_DATA) { bos.write(b); diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java index df64164d0c..7a7279024a 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java @@ -67,20 +67,20 @@ public final class TestEventWorkbookBuilder { } @Test - public void testBasics() { + void testBasics() { assertNotNull(listener.getSSTRecord()); assertNotNull(listener.getBoundSheetRecords()); assertNotNull(listener.getExternSheetRecords()); } @Test - public void testGetStubWorkbooks() { + void testGetStubWorkbooks() { assertNotNull(listener.getStubWorkbook()); assertNotNull(listener.getStubHSSFWorkbook()); } @Test - public void testContents() { + void testContents() { assertEquals(2, listener.getSSTRecord().getNumStrings()); assertEquals(3, listener.getBoundSheetRecords().length); assertEquals(1, listener.getExternSheetRecords().length); @@ -94,7 +94,7 @@ public final class TestEventWorkbookBuilder { } @Test - public void testFormulas() { + void testFormulas() { // Check our formula records assertEquals(6, fRecs.size()); diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java index e3ca90ca92..4b2672cfff 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java @@ -52,7 +52,7 @@ public final class TestFormatTrackingHSSFListener { } @Test - public void testFormats() throws Exception { + void testFormats() throws Exception { processFile("MissingBits.xls"); assertEquals("_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)", listener.getFormatString(41)); @@ -69,7 +69,7 @@ public final class TestFormatTrackingHSSFListener { * want to check the exact strings! */ @Test - public void testTurnToString() throws Exception { + void testTurnToString() throws Exception { String[] files = new String[] { "45365.xls", "45365-2.xls", "MissingBits.xls" }; diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java index 4cf5f77ae2..37bc38eb37 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java @@ -61,7 +61,7 @@ public final class TestHSSFEventFactory { } @Test - public void testWithMissingRecords() throws Exception { + void testWithMissingRecords() throws Exception { openSample("SimpleWithSkip.xls"); @@ -78,7 +78,7 @@ public final class TestHSSFEventFactory { } @Test - public void testWithCrazyContinueRecords() throws Exception { + void testWithCrazyContinueRecords() throws Exception { // Some files have crazy ordering of their continue records // Check that we don't break on them (bug #42844) @@ -105,26 +105,26 @@ public final class TestHSSFEventFactory { */ @Test @SuppressWarnings("java:S2699") - public void testUnknownContinueRecords() throws Exception { + void testUnknownContinueRecords() throws Exception { openSample("42844.xls"); } @Test @SuppressWarnings("java:S2699") - public void testWithDifferentWorkbookName() throws Exception { + void testWithDifferentWorkbookName() throws Exception { openSample("BOOK_in_capitals.xls"); openSample("WORKBOOK_in_capitals.xls"); } @Test @SuppressWarnings("java:S2699") - public void testWithPasswordProtectedWorkbooksNoPass() { + void testWithPasswordProtectedWorkbooksNoPass() { // Without a password, can't be read assertThrows(EncryptedDocumentException.class, () -> openSample("xor-encryption-abc.xls")); } @Test - public void testWithPasswordProtectedWorkbooks() throws Exception { + void testWithPasswordProtectedWorkbooks() throws Exception { // With the password, is properly processed Biff8EncryptionKey.setCurrentUserPassword("abc"); try { diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java index d89584cbf3..98e7c1c4d9 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java @@ -64,7 +64,7 @@ public final class TestMissingRecordAwareHSSFListener { } @Test - public void testMissingRowRecords() throws IOException { + void testMissingRowRecords() throws IOException { readRecords("MissingBits.xls"); // We have rows 0, 1, 2, 20 and 21 @@ -96,7 +96,7 @@ public final class TestMissingRecordAwareHSSFListener { // Make sure we don't put in any extra new lines that aren't already there @Test - public void testNoExtraNewLines() throws IOException { + void testNoExtraNewLines() throws IOException { // Load a different file // This file has has something in lines 1-33 readRecords("MRExtraLines.xls"); @@ -117,7 +117,7 @@ public final class TestMissingRecordAwareHSSFListener { * Make sure that the presence of shared formulas does not cause extra end-of-row records. */ @Test - public void testEndOfRow_bug45672() throws IOException { + void testEndOfRow_bug45672() throws IOException { readRecords("ex45672.xls"); assertEquals(1, matches(r -> r instanceof SharedFormulaRecord)); assertEquals(1, matches(r -> r instanceof LastCellOfRowDummyRecord)); @@ -128,7 +128,7 @@ public final class TestMissingRecordAwareHSSFListener { * Check that we don't have any MulBlankRecords, but do have lots of BlankRecords */ @Test - public void testMulBlankHandling() throws IOException { + void testMulBlankHandling() throws IOException { readRecords("45672.xls"); assertEquals(20, matches(r -> r instanceof BlankRecord)); assertEquals(2, matches(r -> r instanceof LastCellOfRowDummyRecord)); @@ -136,14 +136,14 @@ public final class TestMissingRecordAwareHSSFListener { } @Test - public void testStringRecordHandling() throws IOException { + void testStringRecordHandling() throws IOException { readRecords("53588.xls"); assertEquals(1, matches(r -> r instanceof MissingCellDummyRecord)); assertEquals(1, matches(r -> r instanceof LastCellOfRowDummyRecord)); } @Test - public void testFormulasWithStringResultsHandling() throws IOException { + void testFormulasWithStringResultsHandling() throws IOException { readRecords("53433.xls"); String exp = diff --git a/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java b/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java index 6d32039836..20ca15d581 100644 --- a/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java +++ b/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java @@ -47,7 +47,7 @@ public final class TestExcelExtractor { } @Test - public void testSimple() throws IOException { + void testSimple() throws IOException { try (ExcelExtractor extractor = createExtractor("Simple.xls")) { assertEquals("Sheet1\nreplaceMe\nSheet2\nSheet3\n", extractor.getText()); @@ -58,7 +58,7 @@ public final class TestExcelExtractor { } @Test - public void testNumericFormula() throws IOException { + void testNumericFormula() throws IOException { try (ExcelExtractor extractor = createExtractor("sumifformula.xls")) { assertEquals( "Sheet1\n" + @@ -87,7 +87,7 @@ public final class TestExcelExtractor { } @Test - public void testWithContinueRecords() throws IOException { + void testWithContinueRecords() throws IOException { try (ExcelExtractor extractor = createExtractor("StringContinueRecords.xls")) { // Has masses of text // Until we fixed bug #41064, this would've @@ -97,7 +97,7 @@ public final class TestExcelExtractor { } @Test - public void testStringConcat() throws IOException { + void testStringConcat() throws IOException { try (ExcelExtractor extractor = createExtractor("SimpleWithFormula.xls")) { // Comes out as NaN if treated as a number // And as XYZ if treated as a string @@ -110,7 +110,7 @@ public final class TestExcelExtractor { } @Test - public void testStringFormula() throws IOException { + void testStringFormula() throws IOException { try (ExcelExtractor extractor = createExtractor("StringFormulas.xls")) { // Comes out as NaN if treated as a number // And as XYZ if treated as a string @@ -124,7 +124,7 @@ public final class TestExcelExtractor { @Test - public void testEventExtractor() throws Exception { + void testEventExtractor() throws Exception { // First up, a simple file with string // based formulas in it try (EventBasedExcelExtractor extractor1 = new EventBasedExcelExtractor( @@ -167,7 +167,7 @@ public final class TestExcelExtractor { } @Test - public void testWithComments() throws IOException { + void testWithComments() throws IOException { try (ExcelExtractor extractor = createExtractor("SimpleWithComments.xls")) { extractor.setIncludeSheetNames(false); @@ -191,7 +191,7 @@ public final class TestExcelExtractor { } @Test - public void testWithBlank() throws IOException { + void testWithBlank() throws IOException { try (ExcelExtractor extractor = createExtractor("MissingBits.xls")) { String def = extractor.getText(); extractor.setIncludeBlankCells(true); @@ -214,7 +214,7 @@ public final class TestExcelExtractor { } @Test - public void testFormatting() throws Exception { + void testFormatting() throws Exception { Locale userLocale = LocaleUtil.getUserLocale(); LocaleUtil.setUserLocale(Locale.ROOT); try (ExcelExtractor extractor = createExtractor("Formatting.xls")) { @@ -243,7 +243,7 @@ public final class TestExcelExtractor { * Embeded in a non-excel file */ @Test - public void testWithEmbeded() throws Exception { + void testWithEmbeded() throws Exception { POIFSFileSystem fs = null; HSSFWorkbook wbA = null, wbB = null; @@ -278,7 +278,7 @@ public final class TestExcelExtractor { * Excel embeded in excel */ @Test - public void testWithEmbededInOwn() throws Exception { + void testWithEmbededInOwn() throws Exception { POIDataSamples ssSamples = POIDataSamples.getSpreadSheetInstance(); POIFSFileSystem fs = null; HSSFWorkbook wbA = null, wbB = null; @@ -319,7 +319,7 @@ public final class TestExcelExtractor { * Test that we get text from headers and footers */ @Test - public void test45538() throws IOException { + void test45538() throws IOException { String[] files = { "45538_classic_Footer.xls", "45538_form_Footer.xls", "45538_classic_Header.xls", "45538_form_Header.xls" @@ -334,7 +334,7 @@ public final class TestExcelExtractor { } @Test - public void testPassword() throws IOException { + void testPassword() throws IOException { Biff8EncryptionKey.setCurrentUserPassword("password"); try (ExcelExtractor extractor = createExtractor("password.xls")) { String text = extractor.getText(); @@ -346,7 +346,7 @@ public final class TestExcelExtractor { } @Test - public void testNullPointerException() throws IOException { + void testNullPointerException() throws IOException { try (ExcelExtractor extractor = createExtractor("ar.org.apsme.www_Form%20Inscripcion%20Curso%20NO%20Socios.xls")) { assertNotNull(extractor); assertNotNull(extractor.getText()); @@ -354,7 +354,7 @@ public final class TestExcelExtractor { } @Test - public void test61045() throws IOException { + void test61045() throws IOException { //bug 61045. File is govdocs1 626534 try (ExcelExtractor extractor = createExtractor("61045_govdocs1_626534.xls")) { String txt = extractor.getText(); @@ -363,7 +363,7 @@ public final class TestExcelExtractor { } @Test - public void test60405a() throws IOException { + void test60405a() throws IOException { //bug 61045. File is govdocs1 626534 try (ExcelExtractor extractor = createExtractor("60405.xls")) { String txt = extractor.getText(); @@ -373,7 +373,7 @@ public final class TestExcelExtractor { } @Test - public void test60405b() throws IOException { + void test60405b() throws IOException { //bug 61045. File is govdocs1 626534 try (ExcelExtractor extractor = createExtractor("60405.xls")) { extractor.setFormulasNotResults(true); diff --git a/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java b/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java index 708cf2e94d..c2085841d7 100644 --- a/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java +++ b/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java @@ -53,7 +53,7 @@ public final class TestOldExcelExtractor { } @Test - public void testSimpleExcel3() throws IOException { + void testSimpleExcel3() throws IOException { try (OldExcelExtractor extractor = createExtractor("testEXCEL_3.xls")) { // Check we can call getText without error @@ -79,14 +79,14 @@ public final class TestOldExcelExtractor { @Test - public void testSimpleExcel3NoReading() throws IOException { + void testSimpleExcel3NoReading() throws IOException { try (OldExcelExtractor extractor = createExtractor("testEXCEL_3.xls")) { assertNotNull(extractor); } } @Test - public void testSimpleExcel4() throws IOException { + void testSimpleExcel4() throws IOException { try (OldExcelExtractor extractor = createExtractor("testEXCEL_4.xls")) { // Check we can call getText without error @@ -108,7 +108,7 @@ public final class TestOldExcelExtractor { } @Test - public void testSimpleExcel5() throws IOException { + void testSimpleExcel5() throws IOException { for (String ver : new String[] {"5", "95"}) { try (OldExcelExtractor extractor = createExtractor("testEXCEL_"+ver+".xls")) { @@ -135,7 +135,7 @@ public final class TestOldExcelExtractor { } @Test - public void testStrings() throws IOException { + void testStrings() throws IOException { try (OldExcelExtractor extractor = createExtractor("testEXCEL_4.xls")) { String text = extractor.getText(); @@ -155,7 +155,7 @@ public final class TestOldExcelExtractor { } @Test - public void testFormattedNumbersExcel4() throws IOException { + void testFormattedNumbersExcel4() throws IOException { try (OldExcelExtractor extractor = createExtractor("testEXCEL_4.xls")) { String text = extractor.getText(); @@ -175,7 +175,7 @@ public final class TestOldExcelExtractor { } @Test - public void testFormattedNumbersExcel5() throws IOException { + void testFormattedNumbersExcel5() throws IOException { for (String ver : new String[] {"5", "95"}) { try (OldExcelExtractor extractor = createExtractor("testEXCEL_"+ver+".xls")) { String text = extractor.getText(); @@ -201,7 +201,7 @@ public final class TestOldExcelExtractor { } @Test - public void testFromFile() throws IOException { + void testFromFile() throws IOException { for (String ver : new String[] {"4", "5", "95"}) { String filename = "testEXCEL_"+ver+".xls"; File f = HSSFTestDataSamples.getSampleFile(filename); @@ -215,7 +215,7 @@ public final class TestOldExcelExtractor { } @Test - public void testFromInputStream() throws IOException { + void testFromInputStream() throws IOException { for (String ver : new String[] {"4", "5", "95"}) { String filename = "testEXCEL_"+ver+".xls"; File f = HSSFTestDataSamples.getSampleFile(filename); @@ -230,7 +230,7 @@ public final class TestOldExcelExtractor { } @Test - public void testOpenInvalidFile1() throws IOException { + void testOpenInvalidFile1() throws IOException { // a file that exists, but is a different format assertThrows(OfficeXmlFileException.class, () -> createExtractor("WithVariousData.xlsx").close()); @@ -244,13 +244,13 @@ public final class TestOldExcelExtractor { } @Test - public void testOpenNonExistingFile() { + void testOpenNonExistingFile() { // a file that exists, but is a different format assertThrows(EmptyFileException.class, () -> new OldExcelExtractor(new File("notexistingfile.xls")).close()); } @Test - public void testInputStream() throws IOException { + void testInputStream() throws IOException { File file = HSSFTestDataSamples.getSampleFile("testEXCEL_3.xls"); try (InputStream stream = new FileInputStream(file); OldExcelExtractor extractor = new OldExcelExtractor(stream)) { @@ -260,7 +260,7 @@ public final class TestOldExcelExtractor { } @Test - public void testInputStreamNPOIHeader() throws IOException { + void testInputStreamNPOIHeader() throws IOException { //TODO: the worksheet names are currently mangled. They're treated //as if UTF-16, but they're just ascii. Need to fix this. //Is it possible that the leading 0 byte in the worksheet name is a signal @@ -274,7 +274,7 @@ public final class TestOldExcelExtractor { } @Test - public void testPOIFSFileSystem() throws IOException { + void testPOIFSFileSystem() throws IOException { File file = HSSFTestDataSamples.getSampleFile("FormulaRefs.xls"); try (POIFSFileSystem fs = new POIFSFileSystem(file); OldExcelExtractor extractor = new OldExcelExtractor(fs)){ @@ -284,7 +284,7 @@ public final class TestOldExcelExtractor { } @Test - public void testDirectoryNode() throws IOException { + void testDirectoryNode() throws IOException { File file = HSSFTestDataSamples.getSampleFile("FormulaRefs.xls"); try (POIFSFileSystem fs = new POIFSFileSystem(file); OldExcelExtractor extractor = new OldExcelExtractor(fs.getRoot())) { @@ -294,7 +294,7 @@ public final class TestOldExcelExtractor { } @Test - public void testDirectoryNodeInvalidFile() throws IOException { + void testDirectoryNodeInvalidFile() throws IOException { File file = POIDataSamples.getDocumentInstance().getFile("test.doc"); try (POIFSFileSystem fs = new POIFSFileSystem(file)) { assertThrows(FileNotFoundException.class, () -> new OldExcelExtractor(fs.getRoot())); @@ -302,7 +302,7 @@ public final class TestOldExcelExtractor { } @Test - public void testMainUsage() { + void testMainUsage() { PrintStream save = System.err; SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); @@ -317,7 +317,7 @@ public final class TestOldExcelExtractor { } @Test - public void testMain() throws IOException { + void testMain() throws IOException { File file = HSSFTestDataSamples.getSampleFile("testEXCEL_3.xls"); PrintStream save = System.out; try { @@ -333,7 +333,7 @@ public final class TestOldExcelExtractor { } @Test - public void testEncryptionException() throws IOException { + void testEncryptionException() throws IOException { //test file derives from Common Crawl File file = HSSFTestDataSamples.getSampleFile("60284.xls"); @@ -345,7 +345,7 @@ public final class TestOldExcelExtractor { } @Test - public void testSheetWithNoName() throws IOException { + void testSheetWithNoName() throws IOException { File file = HSSFTestDataSamples.getSampleFile("64130.xls"); try (OldExcelExtractor ex = new OldExcelExtractor(file)) { diff --git a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java index cac09fd549..154209e4f4 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java +++ b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java @@ -143,7 +143,7 @@ public class TestDrawingAggregate { */ @ParameterizedTest @MethodSource("samples") - public void testAllTestSamples(File file) throws IOException { + void testAllTestSamples(File file) throws IOException { boolean ignoreParse = true; try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook(file.getName())) { ignoreParse = false; @@ -196,7 +196,7 @@ public class TestDrawingAggregate { * when reading incomplete data ensure that the serialized bytes match the source */ @Test - public void testIncompleteData() throws IOException { + void testIncompleteData() throws IOException { //EscherDgContainer and EscherSpgrContainer length exceeds the actual length of the data String data = "H4sIAAAAAAAAAGWOOw7CQAxE32YTsSRIWSgQJSUloqSm5g4ICURBg+iBK3APGi6wBWeh9xGYbEps2WON"+ @@ -227,7 +227,7 @@ public class TestDrawingAggregate { * TODO: figure out why it fails with "RecordFormatException: 0 bytes written but getRecordSize() reports 80" */ @Test - public void testFailing() throws IOException { + void testFailing() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("15573.xls")) { HSSFSheet sh = wb.getSheetAt(0); HSSFPatriarch dp = sh.getDrawingPatriarch(); @@ -255,7 +255,7 @@ public class TestDrawingAggregate { } @Test - public void testSolverContainerMustBeSavedDuringSerialization() throws IOException{ + void testSolverContainerMustBeSavedDuringSerialization() throws IOException{ try (HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("SolverContainerAfterSPGR.xls")) { HSSFSheet sh = wb1.getSheetAt(0); InternalSheet ish = HSSFTestHelper.getSheetForTest(sh); @@ -289,7 +289,7 @@ public class TestDrawingAggregate { } @Test - public void testFileWithTextbox() throws IOException{ + void testFileWithTextbox() throws IOException{ try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("text.xls")) { HSSFSheet sh = wb.getSheetAt(0); InternalSheet ish = HSSFTestHelper.getSheetForTest(sh); @@ -309,7 +309,7 @@ public class TestDrawingAggregate { } @Test - public void testFileWithCharts() throws IOException { + void testFileWithCharts() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("49581.xls")) { HSSFSheet sh = wb.getSheetAt(0); InternalSheet ish = HSSFTestHelper.getSheetForTest(sh); @@ -337,7 +337,7 @@ public class TestDrawingAggregate { * test reading drawing aggregate from a test file from Bugzilla 45129 */ @Test - public void test45129() throws IOException { + void test45129() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("45129.xls")) { HSSFSheet sh = wb.getSheetAt(0); @@ -401,7 +401,7 @@ public class TestDrawingAggregate { * ... */ @Test - public void testSerializeDrawingBigger8k() throws IOException { + void testSerializeDrawingBigger8k() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("DrawingContinue.xls")) { InternalWorkbook iworkbook = HSSFTestHelper.getWorkbookForTest(wb); HSSFSheet sh = wb.getSheetAt(0); @@ -458,7 +458,7 @@ public class TestDrawingAggregate { @Test - public void testSerializeDrawingBigger8k_noAggregation() throws IOException { + void testSerializeDrawingBigger8k_noAggregation() throws IOException { try (HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("DrawingContinue.xls")) { InternalSheet isheet = HSSFTestHelper.getSheetForTest(wb1.getSheetAt(0)); List<RecordBase> records = isheet.getRecords(); @@ -483,7 +483,7 @@ public class TestDrawingAggregate { } @Test - public void testSerializeDrawingWithComments() throws IOException { + void testSerializeDrawingWithComments() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("DrawingAndComments.xls")) { HSSFSheet sh = wb.getSheetAt(0); InternalWorkbook iworkbook = HSSFTestHelper.getWorkbookForTest(wb); @@ -539,7 +539,7 @@ public class TestDrawingAggregate { @Test - public void testFileWithPictures() throws IOException { + void testFileWithPictures() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ContinueRecordProblem.xls")) { HSSFSheet sh = wb.getSheetAt(0); @@ -594,7 +594,7 @@ public class TestDrawingAggregate { } @Test - public void testUnhandledContinue() throws IOException { + void testUnhandledContinue() throws IOException { String data = "H4sIAAAAAAAAAO3adVRU2/4A8EPHAEOnlEooNaSUdCNIg4CUDCEtQ6gwlITSjYiSkoKA0ikg0i1IyCjS"+ "QwpSEr8B73v3PS6+9+67vz/eH+615pyz9tn71PqevT/rfGcJOIcLBtDXrNgAgBjAXcMFAAAb9SPDBAAw"+ @@ -737,7 +737,7 @@ public class TestDrawingAggregate { } @Test - public void testUnhandledContinue2() throws IOException { + void testUnhandledContinue2() throws IOException { String data = "H4sIAAAAAAAAAO3bdVRUW9sA8AGGrqFHSlpAhSEcQAkJ6UYQyaFBmiEFpCVEOiREGikJSekGlRJQuiQl"+ "FQFB4ptBvxvIvd+97/fete4f7rWYc9aZc4aZw7P3/s3zbFYB/FiEANTNeD4AAATA2sQCAADIH0wgAEAI"+ diff --git a/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java b/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java index 13ca011eb1..d6feb0f544 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java +++ b/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java @@ -36,7 +36,7 @@ public final class TestDrawingManager2 { } @Test - public void testCreateDgRecord() { + void testCreateDgRecord() { EscherDgRecord dgRecord1 = drawingManager2.createDgRecord(); assertEquals( 1, dgRecord1.getDrawingGroupId() ); assertEquals( -1, dgRecord1.getLastMSOSPID() ); @@ -52,7 +52,7 @@ public final class TestDrawingManager2 { } @Test - public void testCreateDgRecordOld() { + void testCreateDgRecordOld() { // converted from TestDrawingManager(1) EscherDggRecord dgg = new EscherDggRecord(); dgg.setDrawingsSaved( 0 ); @@ -69,7 +69,7 @@ public final class TestDrawingManager2 { } @Test - public void testAllocateShapeId() { + void testAllocateShapeId() { EscherDgRecord dgRecord1 = drawingManager2.createDgRecord(); assertEquals( 1, dgg.getDrawingsSaved() ); EscherDgRecord dgRecord2 = drawingManager2.createDgRecord(); @@ -105,7 +105,7 @@ public final class TestDrawingManager2 { } @Test - public void testFindNewDrawingGroupId() { + void testFindNewDrawingGroupId() { // converted from TestDrawingManager(1) EscherDggRecord dgg = new EscherDggRecord(); dgg.setDrawingsSaved( 1 ); diff --git a/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java b/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java index 16cfe133e1..6a12fb17ba 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java +++ b/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java @@ -84,7 +84,7 @@ public class TestDrawingShapes { * ----shape */ @Test - public void testDrawingGroups() throws IOException { + void testDrawingGroups() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls"); HSSFSheet sheet = wb.getSheet("groups"); HSSFPatriarch patriarch = sheet.getDrawingPatriarch(); @@ -99,7 +99,7 @@ public class TestDrawingShapes { } @Test - public void testHSSFShapeCompatibility() { + void testHSSFShapeCompatibility() { HSSFSimpleShape shape = new HSSFSimpleShape(null, new HSSFClientAnchor()); shape.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE); assertEquals(0x08000040, shape.getLineStyleColor()); @@ -118,7 +118,7 @@ public class TestDrawingShapes { } @Test - public void testDefaultPictureSettings() { + void testDefaultPictureSettings() { HSSFPicture picture = new HSSFPicture(null, new HSSFClientAnchor()); assertEquals(picture.getLineWidth(), HSSFShape.LINEWIDTH_DEFAULT); assertEquals(picture.getFillColor(), HSSFShape.FILL__FILLCOLOR_DEFAULT); @@ -132,7 +132,7 @@ public class TestDrawingShapes { * No NullPointerException should appear */ @Test - public void testDefaultSettingsWithEmptyContainer() { + void testDefaultSettingsWithEmptyContainer() { EscherContainerRecord container = new EscherContainerRecord(); EscherOptRecord opt = new EscherOptRecord(); opt.setRecordId(EscherOptRecord.RECORD_ID); @@ -155,7 +155,7 @@ public class TestDrawingShapes { * create a rectangle, save the workbook, read back and verify that all shape properties are there */ @Test - public void testReadWriteRectangle() throws IOException { + void testReadWriteRectangle() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); @@ -252,7 +252,7 @@ public class TestDrawingShapes { } @Test - public void testReadExistingImage() throws IOException { + void testReadExistingImage() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls"); HSSFSheet sheet = wb.getSheet("pictures"); HSSFPatriarch drawing = sheet.getDrawingPatriarch(); @@ -274,7 +274,7 @@ public class TestDrawingShapes { /* assert shape properties when reading shapes from a existing workbook */ @Test - public void testReadExistingRectangle() throws IOException { + void testReadExistingRectangle() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls"); HSSFSheet sheet = wb.getSheet("rectangles"); HSSFPatriarch drawing = sheet.getDrawingPatriarch(); @@ -292,7 +292,7 @@ public class TestDrawingShapes { } @Test - public void testShapeIds() throws IOException { + void testShapeIds() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet1 = wb1.createSheet(); HSSFPatriarch patriarch1 = sheet1.createDrawingPatriarch(); @@ -339,7 +339,7 @@ public class TestDrawingShapes { * File already have for 1 shape on each sheet, because document must contain EscherDgRecord for each sheet */ @Test - public void testAllocateNewIds() throws IOException { + void testAllocateNewIds() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("empty.xls"); HSSFSheet sheet = wb.getSheetAt(0); HSSFPatriarch patriarch = sheet.getDrawingPatriarch(); @@ -370,7 +370,7 @@ public class TestDrawingShapes { } @Test - public void testOpt() throws IOException { + void testOpt() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); // create a sheet with a text box @@ -385,7 +385,7 @@ public class TestDrawingShapes { } @Test - public void testCorrectOrderInOptRecord() throws IOException{ + void testCorrectOrderInOptRecord() throws IOException{ HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); @@ -411,7 +411,7 @@ public class TestDrawingShapes { } @Test - public void testDgRecordNumShapes() throws IOException { + void testDgRecordNumShapes() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -423,7 +423,7 @@ public class TestDrawingShapes { } @Test - public void testTextForSimpleShape() throws IOException { + void testTextForSimpleShape() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -468,7 +468,7 @@ public class TestDrawingShapes { } @Test - public void testRemoveShapes() throws IOException { + void testRemoveShapes() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -618,7 +618,7 @@ public class TestDrawingShapes { } @Test - public void testShapeFlip() throws IOException { + void testShapeFlip() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -662,7 +662,7 @@ public class TestDrawingShapes { } @Test - public void testRotation() throws IOException { + void testRotation() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -691,7 +691,7 @@ public class TestDrawingShapes { @SuppressWarnings("unused") @Test - public void testShapeContainerImplementsIterable() throws IOException { + void testShapeContainerImplementsIterable() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); @@ -710,7 +710,7 @@ public class TestDrawingShapes { } @Test - public void testClearShapesForPatriarch() throws IOException { + void testClearShapesForPatriarch() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -743,7 +743,7 @@ public class TestDrawingShapes { } @Test - public void testBug45312() throws Exception { + void testBug45312() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java b/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java index 72e9e55941..1d3c3924c6 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java +++ b/src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java @@ -56,7 +56,7 @@ public class TestEscherRecordFactory { } @Test - public void testDetectContainer() { + void testDetectContainer() { Random rnd = new Random(); assertTrue(isContainer((short) 0x0, EscherContainerRecord.DG_CONTAINER)); assertTrue(isContainer((short) 0x0, EscherContainerRecord.SOLVER_CONTAINER)); @@ -81,7 +81,7 @@ public class TestEscherRecordFactory { } @Test - public void testDgContainerMustBeRootOfHSSFSheetEscherRecords() { + void testDgContainerMustBeRootOfHSSFSheetEscherRecords() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("47251.xls"); HSSFSheet sh = wb.getSheetAt(0); InternalSheet ish = HSSFTestHelper.getSheetForTest(sh); diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java index db7f6f1862..024960310f 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java @@ -72,35 +72,35 @@ public final class TestFormulaParser { } @Test - public void testSimpleFormula() { + void testSimpleFormula() { confirmTokenClasses("2+2",IntPtg.class, IntPtg.class, AddPtg.class); } @Test - public void testFormulaWithSpace1() { + void testFormulaWithSpace1() { confirmTokenClasses(" 2 + 2 ",IntPtg.class, IntPtg.class, AddPtg.class); } @Test - public void testFormulaWithSpace2() { + void testFormulaWithSpace2() { Ptg[] ptgs = parseFormula("2+ sum( 3 , 4) "); assertEquals(5, ptgs.length); } @Test - public void testFormulaWithSpaceNRef() { + void testFormulaWithSpaceNRef() { Ptg[] ptgs = parseFormula("sum( A2:A3 )"); assertEquals(2, ptgs.length); } @Test - public void testFormulaWithString() { + void testFormulaWithString() { Ptg[] ptgs = parseFormula("\"hello\" & \"world\" "); assertEquals(3, ptgs.length); } @Test - public void testTRUE() { + void testTRUE() { Ptg[] ptgs = parseFormula("TRUE"); assertEquals(1, ptgs.length); BoolPtg flag = (BoolPtg) ptgs[0]; @@ -108,7 +108,7 @@ public final class TestFormulaParser { } @Test - public void testSumIf() { + void testSumIf() { Ptg[] ptgs = parseFormula("SUMIF(A1:A5,\">4000\",B1:B5)"); assertEquals(4, ptgs.length); } @@ -119,14 +119,14 @@ public final class TestFormulaParser { * */ @Test - public void testNonAlphaFormula() { + void testNonAlphaFormula() { Ptg[] ptgs = parseFormula("\"TOTAL[\"&F3&\"]\""); confirmTokenClasses(ptgs, StringPtg.class, RefPtg.class, ConcatPtg.class, StringPtg.class, ConcatPtg.class); assertEquals("TOTAL[", ((StringPtg)ptgs[0]).getValue()); } @Test - public void testMacroFunction() throws IOException { + void testMacroFunction() throws IOException { // testNames.xls contains a VB function called 'myFunc' final String testFile = "testNames.xls"; try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook(testFile)) { @@ -191,19 +191,19 @@ public final class TestFormulaParser { } @Test - public void testEmbeddedSlash() { + void testEmbeddedSlash() { confirmTokenClasses("HYPERLINK(\"http://www.jakarta.org\",\"Jakarta\")", StringPtg.class, StringPtg.class, FuncVarPtg.class); } @Test - public void testConcatenate() { + void testConcatenate() { confirmTokenClasses("CONCATENATE(\"first\",\"second\")", StringPtg.class, StringPtg.class, FuncVarPtg.class); } @Test - public void testWorksheetReferences() throws IOException { + void testWorksheetReferences() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet1 = wb.createSheet("NoQuotesNeeded"); @@ -231,12 +231,12 @@ public final class TestFormulaParser { } @Test - public void testUnaryMinus() { + void testUnaryMinus() { confirmTokenClasses("-A1", RefPtg.class, UnaryMinusPtg.class); } @Test - public void testUnaryPlus() { + void testUnaryPlus() { confirmTokenClasses("+A1", RefPtg.class, UnaryPlusPtg.class); } @@ -248,7 +248,7 @@ public final class TestFormulaParser { * check that POI follows the same encoding rules as Excel. */ @Test - public void testExactEncodingOfUnaryPlusAndMinus() { + void testExactEncodingOfUnaryPlusAndMinus() { // as tested in Excel: confirmUnary("-3", -3, NumberPtg.class); confirmUnary("--4", -4, NumberPtg.class, UnaryMinusPtg.class); @@ -278,7 +278,7 @@ public final class TestFormulaParser { } @Test - public void testLeadingSpaceInString() { + void testLeadingSpaceInString() { String value = " hi "; Ptg[] ptgs = parseFormula("\"" + value + "\""); confirmTokenClasses(ptgs, StringPtg.class); @@ -286,7 +286,7 @@ public final class TestFormulaParser { } @Test - public void testLookupAndMatchFunctionArgs() { + void testLookupAndMatchFunctionArgs() { Ptg[] ptgs = parseFormula("lookup(A1, A3:A52, B3:B52)"); confirmTokenClasses(ptgs, RefPtg.class, AreaPtg.class, AreaPtg.class, FuncVarPtg.class); assertEquals(ptgs[0].getPtgClass(), Ptg.CLASS_VALUE, "ptg0 has Value class"); @@ -298,20 +298,20 @@ public final class TestFormulaParser { /** bug 33160*/ @Test - public void testLargeInt() { + void testLargeInt() { confirmTokenClasses("40", IntPtg.class); confirmTokenClasses("40000", IntPtg.class); } /** bug 33160 */ @Test - public void testSimpleLongFormula() { + void testSimpleLongFormula() { confirmTokenClasses("40000/2", IntPtg.class, IntPtg.class, DividePtg.class); } /** bug 35027, underscore in sheet name */ @Test - public void testUnderscore() throws IOException { + void testUnderscore() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet1 = wb.createSheet("Cash_Flow"); sheet1.createRow(0).createCell(0).setCellValue("Cash_Flow"); @@ -331,7 +331,7 @@ public final class TestFormulaParser { /** bug 49725, defined names with underscore */ @Test - public void testNamesWithUnderscore() throws IOException { + void testNamesWithUnderscore() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); //or new XSSFWorkbook(); HSSFSheet sheet = wb.createSheet("NamesWithUnderscore"); @@ -378,14 +378,14 @@ public final class TestFormulaParser { // bug 38396 : Formula with exponential numbers not parsed correctly. @Test - public void testExponentialParsing() { + void testExponentialParsing() { confirmTokenClasses("1.3E21/2", NumberPtg.class, IntPtg.class, DividePtg.class); confirmTokenClasses("1322E21/2", NumberPtg.class, IntPtg.class, DividePtg.class); confirmTokenClasses("1.3E1/2", NumberPtg.class, IntPtg.class, DividePtg.class); } @Test - public void testExponentialInSheet() throws IOException { + void testExponentialInSheet() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Cash_Flow"); @@ -459,7 +459,7 @@ public final class TestFormulaParser { } @Test - public void testNumbers() throws IOException { + void testNumbers() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Cash_Flow"); @@ -501,7 +501,7 @@ public final class TestFormulaParser { } @Test - public void testRanges() throws IOException { + void testRanges() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Cash_Flow"); @@ -527,7 +527,7 @@ public final class TestFormulaParser { } @Test - public void testMultiSheetReference() throws IOException { + void testMultiSheetReference() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Cash_Flow"); @@ -582,7 +582,7 @@ public final class TestFormulaParser { * a formula consisting of a single no-arg function got rendered without the function braces */ @Test - public void testToFormulaStringZeroArgFunction() throws IOException { + void testToFormulaStringZeroArgFunction() throws IOException { HSSFWorkbook book = new HSSFWorkbook(); Ptg[] ptgs = { @@ -594,7 +594,7 @@ public final class TestFormulaParser { } @Test - public void testPercent() { + void testPercent() { confirmTokenClasses("5%", IntPtg.class, PercentPtg.class); // spaces OK @@ -621,7 +621,7 @@ public final class TestFormulaParser { * Tests combinations of various operators in the absence of brackets */ @Test - public void testPrecedenceAndAssociativity() { + void testPrecedenceAndAssociativity() { // TRUE=TRUE=2=2 evaluates to FALSE confirmTokenClasses("TRUE=TRUE=2=2", BoolPtg.class, BoolPtg.class, EqualPtg.class, @@ -664,7 +664,7 @@ public final class TestFormulaParser { } @Test - public void testPower() { + void testPower() { confirmTokenClasses("2^5", IntPtg.class, IntPtg.class, PowerPtg.class); } @@ -677,7 +677,7 @@ public final class TestFormulaParser { } @Test - public void testParseNumber() { + void testParseNumber() { IntPtg ip; // bug 33160 @@ -697,7 +697,7 @@ public final class TestFormulaParser { } @Test - public void testMissingArgs() { + void testMissingArgs() { confirmTokenClasses("if(A1, ,C1)", RefPtg.class, AttrPtg.class, // tAttrIf @@ -713,7 +713,7 @@ public final class TestFormulaParser { } @Test - public void testParseErrorLiterals() { + void testParseErrorLiterals() { confirmParseErrorLiteral(ErrPtg.NULL_INTERSECTION, "#NULL!"); confirmParseErrorLiteral(ErrPtg.DIV_ZERO, "#DIV/0!"); @@ -744,7 +744,7 @@ public final class TestFormulaParser { } @Test - public void testParseStringLiterals_bug28754() throws IOException { + void testParseStringLiterals_bug28754() throws IOException { StringPtg sp; try { @@ -771,7 +771,7 @@ public final class TestFormulaParser { } @Test - public void testParseStringLiterals() { + void testParseStringLiterals() { confirmStringParse("goto considered harmful"); confirmStringParse("goto 'considered' harmful"); @@ -784,7 +784,7 @@ public final class TestFormulaParser { } @Test - public void testParseSumIfSum() { + void testParseSumIfSum() { String formulaString; Ptg[] ptgs; ptgs = parseFormula("sum(5, 2, if(3>2, sum(A1:A2), 6))"); @@ -797,7 +797,7 @@ public final class TestFormulaParser { } @Test - public void testParserErrors() { + void testParserErrors() { parseExpectedException(" 12 . 345 "); parseExpectedException("1 .23 "); @@ -824,7 +824,7 @@ public final class TestFormulaParser { } @Test - public void testSetFormulaWithRowBeyond32768_Bug44539() throws IOException { + void testSetFormulaWithRowBeyond32768_Bug44539() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); @@ -840,7 +840,7 @@ public final class TestFormulaParser { } @Test - public void testSpaceAtStartOfFormula() { + void testSpaceAtStartOfFormula() { // Simulating cell formula of "= 4" (note space) // The same Ptg array can be observed if an excel file is saved with that exact formula @@ -868,7 +868,7 @@ public final class TestFormulaParser { * Checks some internal error detecting logic ('stack underflow error' in toFormulaString) */ @Test - public void testTooFewOperandArgs() { + void testTooFewOperandArgs() { // Simulating badly encoded cell formula of "=/1" // Not sure if Excel could ever produce this Ptg[] ptgs = { @@ -889,7 +889,7 @@ public final class TestFormulaParser { * (e.g. COUNTIF) Excel fails to evaluate the formula, giving '#VALUE!' instead. */ @Test - public void testFuncPtgSelection() { + void testFuncPtgSelection() { Ptg[] ptgs = parseFormula("countif(A1:A2, 1)"); assertEquals(3, ptgs.length); @@ -900,7 +900,7 @@ public final class TestFormulaParser { } @Test - public void testWrongNumberOfFunctionArgs() throws IOException { + void testWrongNumberOfFunctionArgs() throws IOException { confirmArgCountMsg("sin()", "Too few arguments to function 'SIN'. Expected 1 but got 0."); confirmArgCountMsg("countif(1, 2, 3, 4)", "Too many arguments to function 'COUNTIF'. Expected 2 but got 4."); confirmArgCountMsg("index(1, 2, 3, 4, 5, 6)", "Too many arguments to function 'INDEX'. At most 4 were expected but got 6."); @@ -915,7 +915,7 @@ public final class TestFormulaParser { } @Test - public void testParseErrorExpectedMsg() { + void testParseErrorExpectedMsg() { FormulaParseException e; e = assertThrows(FormulaParseException.class, () -> parseFormula("round(3.14;2)")); confirmParseException(e, "Parse error near char 10 ';' in specified formula 'round(3.14;2)'. Expected ',' or ')'"); @@ -928,7 +928,7 @@ public final class TestFormulaParser { * this function name has a dot in it. */ @Test - public void testParseErrorTypeFunction() { + void testParseErrorTypeFunction() { Ptg[] ptgs; try { @@ -944,7 +944,7 @@ public final class TestFormulaParser { } @Test - public void testNamedRangeThatLooksLikeCell() throws IOException { + void testNamedRangeThatLooksLikeCell() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFName name = wb.createName(); @@ -972,7 +972,7 @@ public final class TestFormulaParser { } @Test - public void testParseAreaRefHighRow_bug45358() throws IOException { + void testParseAreaRefHighRow_bug45358() throws IOException { Ptg[] ptgs; AreaI aptg; @@ -997,7 +997,7 @@ public final class TestFormulaParser { } @Test - public void testParseArray() { + void testParseArray() { Ptg[] ptgs; ptgs = parseFormula("mode({1,2,2,#REF!;FALSE,3,3,2})"); confirmTokenClasses(ptgs, ArrayPtg.class, FuncVarPtg.class); @@ -1010,7 +1010,7 @@ public final class TestFormulaParser { } @Test - public void testParseStringElementInArray() { + void testParseStringElementInArray() { Ptg[] ptgs; ptgs = parseFormula("MAX({\"5\"},3)"); confirmTokenClasses(ptgs, ArrayPtg.class, IntPtg.class, FuncVarPtg.class); @@ -1037,7 +1037,7 @@ public final class TestFormulaParser { } @Test - public void testParseArrayNegativeElement() { + void testParseArrayNegativeElement() { Ptg[] ptgs; try { ptgs = parseFormula("{-42}"); @@ -1060,7 +1060,7 @@ public final class TestFormulaParser { } @Test - public void testRangeOperator() throws IOException { + void testRangeOperator() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); @@ -1085,7 +1085,7 @@ public final class TestFormulaParser { } @Test - public void testBooleanNamedSheet() throws IOException { + void testBooleanNamedSheet() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("true"); HSSFCell cell = sheet.createRow(0).createCell(0); @@ -1097,7 +1097,7 @@ public final class TestFormulaParser { } @Test - public void testParseExternalWorkbookReference() throws IOException { + void testParseExternalWorkbookReference() throws IOException { HSSFWorkbook wbA = HSSFTestDataSamples.openSampleWorkbook("multibookFormulaA.xls"); HSSFCell cell = wbA.getSheetAt(0).getRow(0).getCell(0); @@ -1129,7 +1129,7 @@ public final class TestFormulaParser { } @Test - public void testUnion() throws IOException { + void testUnion() throws IOException { String formula = "Sheet1!$B$2:$C$3,OFFSET(Sheet1!$E$2:$E$4,1,Sheet1!$A$1),Sheet1!$D$6"; HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Sheet1"); @@ -1157,7 +1157,7 @@ public final class TestFormulaParser { } @Test - public void testIntersection() throws IOException { + void testIntersection() throws IOException { String formula = "Sheet1!$B$2:$C$3 OFFSET(Sheet1!$E$2:$E$4, 1,Sheet1!$A$1) Sheet1!$D$6"; HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Sheet1"); @@ -1185,7 +1185,7 @@ public final class TestFormulaParser { } @Test - public void testComparisonInParen() { + void testComparisonInParen() { confirmTokenClasses("(A1 > B2)", RefPtg.class, RefPtg.class, @@ -1195,7 +1195,7 @@ public final class TestFormulaParser { } @Test - public void testUnionInParen() { + void testUnionInParen() { confirmTokenClasses("(A1:B2,B2:C3)", MemAreaPtg.class, AreaPtg.class, @@ -1206,7 +1206,7 @@ public final class TestFormulaParser { } @Test - public void testIntersectionInParen() { + void testIntersectionInParen() { confirmTokenClasses("(A1:B2 B2:C3)", MemAreaPtg.class, AreaPtg.class, @@ -1218,7 +1218,7 @@ public final class TestFormulaParser { // https://bz.apache.org/bugzilla/show_bug.cgi?id=60980 @Test - public void testIntersectionInFunctionArgs() { + void testIntersectionInFunctionArgs() { confirmTokenClasses("SUM(A1:B2 B2:C3)", MemAreaPtg.class, AreaPtg.class, @@ -1229,7 +1229,7 @@ public final class TestFormulaParser { } @Test - public void testIntersectionNamesInFunctionArgs() { + void testIntersectionNamesInFunctionArgs() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFName name1 = wb.createName(); @@ -1252,7 +1252,7 @@ public final class TestFormulaParser { } @Test - public void testRange_bug46643() throws IOException { + void testRange_bug46643() throws IOException { String formula = "Sheet1!A1:Sheet1!B3"; HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Sheet1"); @@ -1276,7 +1276,7 @@ public final class TestFormulaParser { /** Named ranges with backslashes, e.g. 'POI\\2009' */ @Test - public void testBackSlashInNames() throws IOException { + void testBackSlashInNames() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFName name = wb.createName(); @@ -1301,7 +1301,7 @@ public final class TestFormulaParser { * See the related/similar test: {@link BaseTestBugzillaIssues#bug42448()} */ @Test - public void testParseAbnormalSheetNamesAndRanges_bug42448() throws IOException { + void testParseAbnormalSheetNamesAndRanges_bug42448() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("A"); try { @@ -1316,7 +1316,7 @@ public final class TestFormulaParser { } @Test - public void testRangeFuncOperand_bug46951() throws IOException { + void testRangeFuncOperand_bug46951() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { Ptg[] ptgs; try { @@ -1341,7 +1341,7 @@ public final class TestFormulaParser { } @Test - public void testUnionOfFullCollFullRowRef() throws IOException { + void testUnionOfFullCollFullRowRef() throws IOException { parseFormula("3:4"); Ptg[] ptgs = parseFormula("$Z:$AC"); confirmTokenClasses(ptgs, AreaPtg.class); @@ -1378,7 +1378,7 @@ public final class TestFormulaParser { } @Test - public void testExplicitRangeWithTwoSheetNames() throws IOException { + void testExplicitRangeWithTwoSheetNames() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Sheet1"); Ptg[] ptgs = HSSFFormulaParser.parse("Sheet1!F1:Sheet1!G2", wb); @@ -1399,7 +1399,7 @@ public final class TestFormulaParser { * and that the {@link MemFuncPtg} / {@link MemAreaPtg} is added correctly */ @Test - public void testComplexExplicitRangeEncodings() { + void testComplexExplicitRangeEncodings() { Ptg[] ptgs; ptgs = parseFormula("SUM(OFFSET(A1,0,0):B2:C3:D4:E5:OFFSET(F6,1,1):G7)"); @@ -1448,7 +1448,7 @@ public final class TestFormulaParser { * */ @Test - public void testEdgeCaseParserErrors() throws IOException { + void testEdgeCaseParserErrors() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("Sheet1"); @@ -1478,7 +1478,7 @@ public final class TestFormulaParser { * POI should also be able to parse such defined names. */ @Test - public void testParseComplexName() throws IOException { + void testParseComplexName() throws IOException { // Mock up a spreadsheet to match the critical details of the sample try (HSSFWorkbook wb = new HSSFWorkbook()) { @@ -1512,7 +1512,7 @@ public final class TestFormulaParser { * references during parsing. */ @Test - public void testZeroRowRefs() throws IOException { + void testZeroRowRefs() throws IOException { String badCellRef = "B0"; // bad because zero is not a valid row number String leadingZeroCellRef = "B000001"; // this should get parsed as "B1" HSSFWorkbook wb = new HSSFWorkbook(); @@ -1546,7 +1546,7 @@ public final class TestFormulaParser { } @Test - public void test57196_Formula() throws IOException { + void test57196_Formula() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); Ptg[] ptgs = HSSFFormulaParser.parse("DEC2HEX(HEX2DEC(O8)-O2+D2)", wb, FormulaType.CELL, -1); assertNotNull(ptgs, "Ptg array should not be null"); diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParserEval.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParserEval.java index d948695620..6447fa21bf 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParserEval.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParserEval.java @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; public final class TestFormulaParserEval { @Test - public void testWithNamedRange() { + void testWithNamedRange() { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet s = workbook.createSheet("Foo"); @@ -76,7 +76,7 @@ public final class TestFormulaParserEval { } @Test - public void testEvaluateFormulaWithRowBeyond32768_Bug44539() { + void testEvaluateFormulaWithRowBeyond32768_Bug44539() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java index 42f650a549..066408104a 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java @@ -55,7 +55,7 @@ public final class TestFormulaParserIf { } @Test - public void testSimpleIf() { + void testSimpleIf() { Class<?>[] expClss = { RefPtg.class, @@ -75,7 +75,7 @@ public final class TestFormulaParserIf { } @Test - public void testSimpleIfNoFalseParam() { + void testSimpleIfNoFalseParam() { Class<?>[] expClss = { RefPtg.class, @@ -92,7 +92,7 @@ public final class TestFormulaParserIf { } @Test - public void testIfWithLargeParams() { + void testIfWithLargeParams() { Class<?>[] expClss = { RefPtg.class, @@ -123,7 +123,7 @@ public final class TestFormulaParserIf { } @Test - public void testNestedIf() { + void testNestedIf() { Class<?>[] expClss = { RefPtg.class, @@ -160,7 +160,7 @@ public final class TestFormulaParserIf { } @Test - public void testEmbeddedIf() { + void testEmbeddedIf() { Ptg[] ptgs = parseFormula("IF(3>=1,\"*\",IF(4<>1,\"first\",\"second\"))"); assertEquals(17, ptgs.length); @@ -170,14 +170,14 @@ public final class TestFormulaParserIf { } @Test - public void testSimpleLogical() { + void testSimpleLogical() { Ptg[] ptgs = parseFormula("IF(A1<A2,B1,B2)"); assertEquals(9, ptgs.length); assertEquals(LessThanPtg.class, ptgs[2].getClass(), "3rd Ptg is less than"); } @Test - public void testParenIf() { + void testParenIf() { Ptg[] ptgs = parseFormula("IF((A1+A2)<=3,\"yes\",\"no\")"); assertEquals(12, ptgs.length); assertEquals(LessEqualPtg.class, ptgs[5].getClass(), "6th Ptg is less than equal"); @@ -185,7 +185,7 @@ public final class TestFormulaParserIf { } @Test - public void testYN() { + void testYN() { Ptg[] ptgs = parseFormula("IF(TRUE,\"Y\",\"N\")"); assertEquals(7, ptgs.length); @@ -207,7 +207,7 @@ public final class TestFormulaParserIf { * Make sure the ptgs are generated properly with two functions embedded */ @Test - public void testNestedFunctionIf() { + void testNestedFunctionIf() { Ptg[] ptgs = parseFormula("IF(A1=B1,AVERAGE(A1:B1),AVERAGE(A2:B2))"); assertEquals(11, ptgs.length); @@ -219,7 +219,7 @@ public final class TestFormulaParserIf { } @Test - public void testIfSingleCondition(){ + void testIfSingleCondition(){ Ptg[] ptgs = parseFormula("IF(1=1,10)"); assertEquals(7, ptgs.length); diff --git a/src/testcases/org/apache/poi/hssf/model/TestHSSFAnchor.java b/src/testcases/org/apache/poi/hssf/model/TestHSSFAnchor.java index c0bcf375ed..d04bfe4c93 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestHSSFAnchor.java +++ b/src/testcases/org/apache/poi/hssf/model/TestHSSFAnchor.java @@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test; public class TestHSSFAnchor { @Test - public void testDefaultValues(){ + void testDefaultValues(){ HSSFClientAnchor clientAnchor = new HSSFClientAnchor(); assertEquals(clientAnchor.getAnchorType(), AnchorType.MOVE_AND_RESIZE); assertEquals(clientAnchor.getCol1(), 0); @@ -81,7 +81,7 @@ public class TestHSSFAnchor { } @Test - public void testCorrectOrderInSpContainer(){ + void testCorrectOrderInSpContainer(){ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls"); HSSFSheet sheet = wb.getSheet("pictures"); HSSFPatriarch drawing = sheet.getDrawingPatriarch(); @@ -102,7 +102,7 @@ public class TestHSSFAnchor { } @Test - public void testCreateClientAnchorFromContainer(){ + void testCreateClientAnchorFromContainer(){ EscherContainerRecord container = new EscherContainerRecord(); EscherClientAnchorRecord escher = new EscherClientAnchorRecord(); escher.setFlag((short) 3); @@ -137,7 +137,7 @@ public class TestHSSFAnchor { } @Test - public void testCreateChildAnchorFromContainer(){ + void testCreateChildAnchorFromContainer(){ EscherContainerRecord container = new EscherContainerRecord(); EscherChildAnchorRecord escher = new EscherChildAnchorRecord(); escher.setDx1((short) 15); @@ -159,7 +159,7 @@ public class TestHSSFAnchor { } @Test - public void testShapeEscherMustHaveAnchorRecord(){ + void testShapeEscherMustHaveAnchorRecord(){ HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); @@ -178,7 +178,7 @@ public class TestHSSFAnchor { } @Test - public void testClientAnchorFromEscher(){ + void testClientAnchorFromEscher(){ EscherClientAnchorRecord escher = new EscherClientAnchorRecord(); escher.setCol1((short)11); escher.setCol2((short)12); @@ -209,7 +209,7 @@ public class TestHSSFAnchor { } @Test - public void testClientAnchorFromScratch(){ + void testClientAnchorFromScratch(){ HSSFClientAnchor anchor = new HSSFClientAnchor(); EscherClientAnchorRecord escher = (EscherClientAnchorRecord) HSSFTestHelper.getEscherAnchor(anchor); anchor.setAnchor((short)11, 12, 13, 14, (short)15, 16, 17, 18); @@ -258,7 +258,7 @@ public class TestHSSFAnchor { } @Test - public void testChildAnchorFromEscher(){ + void testChildAnchorFromEscher(){ EscherChildAnchorRecord escher = new EscherChildAnchorRecord(); escher.setDx1((short) 15); escher.setDx2((short) 16); @@ -277,7 +277,7 @@ public class TestHSSFAnchor { } @Test - public void testChildAnchorFromScratch(){ + void testChildAnchorFromScratch(){ HSSFChildAnchor anchor = new HSSFChildAnchor(); EscherChildAnchorRecord escher = (EscherChildAnchorRecord) HSSFTestHelper.getEscherAnchor(anchor); anchor.setAnchor(11, 12, 13, 14); @@ -306,7 +306,7 @@ public class TestHSSFAnchor { } @Test - public void testEqualsToSelf(){ + void testEqualsToSelf(){ HSSFClientAnchor clientAnchor = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); assertEquals(clientAnchor, clientAnchor); @@ -315,7 +315,7 @@ public class TestHSSFAnchor { } @Test - public void testPassIncompatibleTypeIsFalse(){ + void testPassIncompatibleTypeIsFalse(){ HSSFClientAnchor clientAnchor = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); assertNotSame(clientAnchor, "wrongType"); @@ -324,7 +324,7 @@ public class TestHSSFAnchor { } @Test - public void testNullReferenceIsFalse() { + void testNullReferenceIsFalse() { HSSFClientAnchor clientAnchor = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); assertNotNull(clientAnchor, "Passing null to equals should return false"); @@ -333,7 +333,7 @@ public class TestHSSFAnchor { } @Test - public void testEqualsIsReflexiveIsSymmetric() { + void testEqualsIsReflexiveIsSymmetric() { HSSFClientAnchor clientAnchor1 = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); HSSFClientAnchor clientAnchor2 = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); @@ -348,7 +348,7 @@ public class TestHSSFAnchor { } @Test - public void testEqualsValues(){ + void testEqualsValues(){ HSSFClientAnchor clientAnchor1 = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); HSSFClientAnchor clientAnchor2 = new HSSFClientAnchor(0, 1, 2, 3, (short)4, 5, (short)6, 7); assertEquals(clientAnchor1, clientAnchor2); @@ -423,7 +423,7 @@ public class TestHSSFAnchor { } @Test - public void testFlipped(){ + void testFlipped(){ HSSFChildAnchor child = new HSSFChildAnchor(2,2,1,1); assertTrue(child.isHorizontallyFlipped()); assertTrue(child.isVerticallyFlipped()); diff --git a/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java b/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java index 7c7f7ad05b..d9ce8b98fb 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java +++ b/src/testcases/org/apache/poi/hssf/model/TestLinkTable.java @@ -59,7 +59,7 @@ public final class TestLinkTable { * It's not clear what exact steps need to be taken in Excel to create such a workbook */ @Test - public void testLinkTableWithoutExternalBookRecord_bug45046() { + void testLinkTableWithoutExternalBookRecord_bug45046() { // Bug 45046 b: DEFINEDNAME is part of LinkTable HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex45046-21984.xls"); // some other sanity checks @@ -74,7 +74,7 @@ public final class TestLinkTable { } @Test - public void testMultipleExternSheetRecords_bug45698() { + void testMultipleExternSheetRecords_bug45698() { // Bug: Extern sheet is part of LinkTable HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex45698-22488.xls"); // some other sanity checks @@ -82,7 +82,7 @@ public final class TestLinkTable { } @Test - public void testExtraSheetRefs_bug45978() { + void testExtraSheetRefs_bug45978() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex45978-extraLinkTableSheets.xls"); /* ex45978-extraLinkTableSheets.xls is a cut-down version of attachment 22561. @@ -121,7 +121,7 @@ public final class TestLinkTable { * when reading the workbook of attachment 23468 from bugzilla 47001 */ @Test - public void testMissingExternSheetRecord_bug47001b() { + void testMissingExternSheetRecord_bug47001b() { Record[] recs = { SupBookRecord.createAddInFunctions(), @@ -136,7 +136,7 @@ public final class TestLinkTable { } @Test - public void testNameCommentRecordBetweenNameRecords() { + void testNameCommentRecordBetweenNameRecords() { final Record[] recs = { new NameRecord(), @@ -160,7 +160,7 @@ public final class TestLinkTable { } @Test - public void testAddNameX(){ + void testAddNameX(){ WorkbookRecordList wrl = new WorkbookRecordList(); wrl.add(0, new BOFRecord()); wrl.add(1, new CountryRecord()); diff --git a/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java b/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java index 8210d140df..6d752d1f40 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java +++ b/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java @@ -46,7 +46,7 @@ public final class TestOperandClassTransformer { } @Test - public void testMdeterm() { + void testMdeterm() { String formula = "MDETERM(ABS(A1))"; Ptg[] ptgs = parseFormula(formula); @@ -56,7 +56,7 @@ public final class TestOperandClassTransformer { } @Test - public void testMdetermReturnsValueInvalidOnABlankCell() { + void testMdetermReturnsValueInvalidOnABlankCell() { ValueEval matrixRef = EvalFactory.createAreaEval("A1:B2", new ValueEval[]{ BlankEval.instance, @@ -80,7 +80,7 @@ public final class TestOperandClassTransformer { */ @Test @Disabled - public void testIndexPi1() { + void testIndexPi1() { String formula = "INDEX(PI(),1)"; Ptg[] ptgs = parseFormula(formula); @@ -93,7 +93,7 @@ public final class TestOperandClassTransformer { * value operator it must get type V */ @Test - public void testDirectOperandOfValueOperator() { + void testDirectOperandOfValueOperator() { String formula = "COUNT(A1*1)"; Ptg[] ptgs = parseFormula(formula); assertNotEquals(Ptg.CLASS_REF, ptgs[0].getPtgClass()); @@ -105,7 +105,7 @@ public final class TestOperandClassTransformer { * A cell ref passed to a function expecting type V should be converted to type V */ @Test - public void testRtoV() { + void testRtoV() { String formula = "lookup(A1, A3:A52, B3:B52)"; Ptg[] ptgs = parseFormula(formula); @@ -113,7 +113,7 @@ public final class TestOperandClassTransformer { } @Test - public void testComplexIRR_bug45041() { + void testComplexIRR_bug45041() { String formula = "(1+IRR(SUMIF(A:A,ROW(INDIRECT(MIN(A:A)&\":\"&MAX(A:A))),B:B),0))^365-1"; Ptg[] ptgs = parseFormula(formula); diff --git a/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java b/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java index aa9b4c4c6a..5affa8bae9 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java +++ b/src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java @@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test; */ public final class TestRowBlocksReader { @Test - public void testAbnormalPivotTableRecords_bug46280() { + void testAbnormalPivotTableRecords_bug46280() { int SXVIEW_SID = ViewDefinitionRecord.sid; Record[] inRecs = { new RowRecord(0), diff --git a/src/testcases/org/apache/poi/hssf/model/TestSheet.java b/src/testcases/org/apache/poi/hssf/model/TestSheet.java index bdc27459c6..5818285a67 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestSheet.java +++ b/src/testcases/org/apache/poi/hssf/model/TestSheet.java @@ -56,7 +56,7 @@ public final class TestSheet { } @Test - public void testCreateSheet() { + void testCreateSheet() { // Check we're adding row and cell aggregates List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); records.add(BOFRecord.createSheetBOF()); @@ -105,7 +105,7 @@ public final class TestSheet { } @Test - public void testAddMergedRegion() { + void testAddMergedRegion() { InternalSheet sheet = InternalSheet.createSheet(); final int regionsToAdd = 4096; @@ -141,7 +141,7 @@ public final class TestSheet { } @Test - public void testRemoveMergedRegion() { + void testRemoveMergedRegion() { InternalSheet sheet = InternalSheet.createSheet(); int regionsToAdd = 4096; @@ -172,7 +172,7 @@ public final class TestSheet { * */ @Test - public void testMovingMergedRegion() { + void testMovingMergedRegion() { List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); CellRangeAddress[] cras = { @@ -197,12 +197,12 @@ public final class TestSheet { } // @Test - // public void testGetMergedRegionAt() { + // void testGetMergedRegionAt() { // TODO // } // @Test - // public void testGetNumMergedRegions() { + // void testGetNumMergedRegions() { // TODO // } @@ -211,7 +211,7 @@ public final class TestSheet { * */ @Test - public void testRowAggregation() { + void testRowAggregation() { List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); records.add(InternalSheet.createBOF()); @@ -235,7 +235,7 @@ public final class TestSheet { * */ @Test - public void testRowPageBreaks() { + void testRowPageBreaks() { short colFrom = 0; short colTo = 255; @@ -291,7 +291,7 @@ public final class TestSheet { * */ @Test - public void testColPageBreaks() { + void testColPageBreaks() { short rowFrom = 0; short rowTo = (short)65535; @@ -352,7 +352,7 @@ public final class TestSheet { * works as designed. */ @Test - public void testXFIndexForColumn() { + void testXFIndexForColumn() { final short TEST_IDX = 10; final short DEFAULT_IDX = 0xF; // 15 InternalSheet sheet = InternalSheet.createSheet(); @@ -422,7 +422,7 @@ public final class TestSheet { * when an <tt>UncalcedRecord</tt> was present.<p> */ @Test - public void testUncalcSize_bug45066() { + void testUncalcSize_bug45066() { List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); records.add(BOFRecord.createSheetBOF()); @@ -455,7 +455,7 @@ public final class TestSheet { * The code here represents a normal POI use case where a spreadsheet is created from scratch. */ @Test - public void testRowValueAggregatesOrder_bug45145() { + void testRowValueAggregatesOrder_bug45145() { InternalSheet sheet = InternalSheet.createSheet(); @@ -519,7 +519,7 @@ public final class TestSheet { * which in turn got the dimensions record out of alignment */ @Test - public void testGutsRecord_bug45640() { + void testGutsRecord_bug45640() { InternalSheet sheet = InternalSheet.createSheet(); sheet.addRow(new RowRecord(0)); @@ -533,7 +533,7 @@ public final class TestSheet { } @Test - public void testMisplacedMergedCellsRecords_bug45699() throws Exception { + void testMisplacedMergedCellsRecords_bug45699() throws Exception { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex45698-22488.xls")) { HSSFSheet sheet = wb.getSheetAt(0); HSSFRow row = sheet.getRow(3); @@ -546,7 +546,7 @@ public final class TestSheet { * In 3.1, setting margins between creating first row and first cell caused an exception. */ @Test - public void testSetMargins_bug45717() throws Exception { + void testSetMargins_bug45717() throws Exception { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("Vorschauliste"); HSSFRow row = sheet.createRow(0); @@ -569,7 +569,7 @@ public final class TestSheet { * Excel(2007) tolerates this, so POI should too. */ @Test - public void testMissingDims() { + void testMissingDims() { int rowIx = 5; int colIx = 6; @@ -604,7 +604,7 @@ public final class TestSheet { * and since there is a slight performance hit the fix was made to avoid it. */ @Test - public void testShiftFormulasAddCondFormat_bug46547() { + void testShiftFormulasAddCondFormat_bug46547() { // Create a sheet with data validity (similar to bugzilla attachment id=23131). InternalSheet sheet = InternalSheet.createSheet(); @@ -621,7 +621,7 @@ public final class TestSheet { * which already had data validity constraints. */ @Test - public void testAddCondFormatAfterDataValidation_bug46547() { + void testAddCondFormatAfterDataValidation_bug46547() { // Create a sheet with data validity (similar to bugzilla attachment id=23131). InternalSheet sheet = InternalSheet.createSheet(); sheet.getOrCreateDataValidityTable(); @@ -632,7 +632,7 @@ public final class TestSheet { } @Test - public void testCloneMulBlank_bug46776() { + void testCloneMulBlank_bug46776() { org.apache.poi.hssf.record.Record[] recs = { InternalSheet.createBOF(), new DimensionsRecord(), @@ -654,7 +654,7 @@ public final class TestSheet { } @Test - public void testCreateAggregate() { + void testCreateAggregate() { String msoDrawingRecord1 = "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 \n" + "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 \n" + @@ -742,7 +742,7 @@ public final class TestSheet { } @Test - public void testSheetDimensions() { + void testSheetDimensions() { InternalSheet sheet = InternalSheet.createSheet(); DimensionsRecord dimensions = (DimensionsRecord)sheet.findFirstRecordBySid(DimensionsRecord.sid); assertNotNull(dimensions); diff --git a/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java b/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java index 974a336553..de076476d3 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java +++ b/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public final class TestSheetAdditional { @Test - public void testGetCellWidth() { + void testGetCellWidth() { InternalSheet sheet = InternalSheet.createSheet(); ColumnInfoRecord nci = new ColumnInfoRecord(); @@ -55,7 +55,7 @@ public final class TestSheetAdditional { } @Test - public void testMaxColumnWidth() { + void testMaxColumnWidth() { InternalSheet sheet = InternalSheet.createSheet(); // the limit sheet.setColumnWidth(0, 255*256); diff --git a/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java b/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java index ee9b06d0fd..687225b9fe 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java @@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test; */ public final class TestWorkbook { @Test - public void testFontStuff() throws IOException { + void testFontStuff() throws IOException { HSSFWorkbook hwb = new HSSFWorkbook(); InternalWorkbook wb = TestHSSFWorkbook.getInternalWorkbook(hwb); @@ -102,7 +102,7 @@ public final class TestWorkbook { } @Test - public void testAddNameX() throws IOException { + void testAddNameX() throws IOException { HSSFWorkbook hwb = new HSSFWorkbook(); InternalWorkbook wb = TestHSSFWorkbook.getInternalWorkbook(hwb); assertNotNull(wb.getNameXPtg("ISODD", AggregatingUDFFinder.DEFAULT)); @@ -128,7 +128,7 @@ public final class TestWorkbook { } @Test - public void testRecalcId() throws IOException { + void testRecalcId() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); assertFalse(wb.getForceFormulaRecalculation()); @@ -156,7 +156,7 @@ public final class TestWorkbook { } @Test - public void testWriteAccess() { + void testWriteAccess() { HSSFWorkbook wb = new HSSFWorkbook(); InternalWorkbook iwb = TestHSSFWorkbook.getInternalWorkbook(wb); diff --git a/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java b/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java index a7da3501f7..7018ff54ae 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; public final class TestArrayRecord { @Test - public void testRead() { + void testRead() { String hex = "21 02 25 00 01 00 01 00 01 01 00 00 00 00 00 00 " + "17 00 65 00 00 01 00 02 C0 02 C0 65 00 00 01 00 " + @@ -62,7 +62,7 @@ public final class TestArrayRecord { } @Test - public void testBug57231() { + void testBug57231() { HSSFWorkbook wb = HSSFTestDataSamples .openSampleWorkbook("57231_MixedGasReport.xls"); HSSFSheet sheet = wb.getSheet("master"); diff --git a/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java b/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java index daa41fc8d2..3288b75131 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java @@ -31,7 +31,7 @@ public final class TestAutoFilterInfoRecord { }; @Test - public void testRead() { + void testRead() { AutoFilterInfoRecord record = new AutoFilterInfoRecord(TestcaseRecordInputStream.create(AutoFilterInfoRecord.sid, data)); @@ -43,7 +43,7 @@ public final class TestAutoFilterInfoRecord { } @Test - public void testWrite() { + void testWrite() { AutoFilterInfoRecord record = new AutoFilterInfoRecord(); record.setNumEntries((short)3); @@ -54,7 +54,7 @@ public final class TestAutoFilterInfoRecord { } @Test - public void testClone() + void testClone() { AutoFilterInfoRecord record = new AutoFilterInfoRecord(); record.setNumEntries((short)3); diff --git a/src/testcases/org/apache/poi/hssf/record/TestBOFRecord.java b/src/testcases/org/apache/poi/hssf/record/TestBOFRecord.java index a73e0aacf6..45af19a12e 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestBOFRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestBOFRecord.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public final class TestBOFRecord { @Test - public void testBOFRecord() throws IOException { + void testBOFRecord() throws IOException { // This used to throw an error before - #42794 try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("bug_42794.xls")) { Sheet sh = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/hssf/record/TestBoolErrRecord.java b/src/testcases/org/apache/poi/hssf/record/TestBoolErrRecord.java index a281b5f009..04ab3d3bb2 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestBoolErrRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestBoolErrRecord.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; public final class TestBoolErrRecord { @Test - public void testError() { + void testError() { byte[] data = HexRead.readFromString( "00 00 00 00 0F 00 " + // row, col, xfIndex "07 01 " // #DIV/0!, isError @@ -54,7 +54,7 @@ public final class TestBoolErrRecord { * work by the same coincidence). */ @Test - public void testOooBadFormat_bug47479() { + void testOooBadFormat_bug47479() { byte[] data = HexRead.readFromString( "05 02 09 00 " + // sid, size "00 00 00 00 0F 00 " + // row, col, xfIndex diff --git a/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java b/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java index 48b2796d2c..79ea46e9d7 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java @@ -35,25 +35,25 @@ import org.junit.jupiter.api.Test; public final class TestBoundSheetRecord { @Test - public void testRecordLength() { + void testRecordLength() { BoundSheetRecord record = new BoundSheetRecord("Sheet1"); assertEquals(18, record.getRecordSize()); } @Test - public void testWideRecordLength() { + void testWideRecordLength() { BoundSheetRecord record = new BoundSheetRecord("Sheet\u20ac"); assertEquals(24, record.getRecordSize()); } @Test - public void testName() { + void testName() { BoundSheetRecord record = new BoundSheetRecord("1234567890223456789032345678904"); assertThrows(IllegalArgumentException.class, () -> record.setSheetname("s//*s")); } @Test - public void testDeserializeUnicode() { + void testDeserializeUnicode() { byte[] data = HexRead.readFromString("" + "85 00 1A 00" // sid, length @@ -76,7 +76,7 @@ public final class TestBoundSheetRecord { } @Test - public void testOrdering() { + void testOrdering() { BoundSheetRecord bs1 = new BoundSheetRecord("SheetB"); BoundSheetRecord bs2 = new BoundSheetRecord("SheetC"); BoundSheetRecord bs3 = new BoundSheetRecord("SheetA"); @@ -97,7 +97,7 @@ public final class TestBoundSheetRecord { } @Test - public void testValidNames() { + void testValidNames() { assertTrue(isValid("Sheet1")); assertTrue(isValid("O'Brien's sales")); assertTrue(isValid(" data # ")); diff --git a/src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java b/src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java index 68b5bad564..6551b42d50 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; */ public final class TestCFHeaderRecord { @Test - public void testCreateCFHeaderRecord () { + void testCreateCFHeaderRecord () { CFHeaderRecord record = new CFHeaderRecord(); CellRangeAddress[] ranges = { new CellRangeAddress(0,0xFFFF,5,5), @@ -64,7 +64,7 @@ public final class TestCFHeaderRecord { } @Test - public void testCreateCFHeader12Record () { + void testCreateCFHeader12Record () { CFHeader12Record record = new CFHeader12Record(); CellRangeAddress[] ranges = { new CellRangeAddress(0,0xFFFF,5,5), @@ -97,7 +97,7 @@ public final class TestCFHeaderRecord { } @Test - public void testSerialization() { + void testSerialization() { byte[] recordData = { (byte)0x03, (byte)0x00, @@ -149,7 +149,7 @@ public final class TestCFHeaderRecord { } @Test - public void testExtremeRows() { + void testExtremeRows() { byte[] recordData = { (byte)0x13, (byte)0x00, // nFormats (byte)0x00, (byte)0x00, diff --git a/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java b/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java index ea5462dd33..ac8346d053 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java @@ -50,7 +50,7 @@ import org.junit.jupiter.api.Test; */ public final class TestCFRuleRecord { @Test - public void testConstructors () throws IOException { + void testConstructors () throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet(); @@ -76,7 +76,7 @@ public final class TestCFRuleRecord { @SuppressWarnings("squid:S2699") @Test - public void testCreateCFRuleRecord() throws IOException { + void testCreateCFRuleRecord() throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet(); CFRuleRecord record = CFRuleRecord.create(sheet, "7"); @@ -99,7 +99,7 @@ public final class TestCFRuleRecord { @SuppressWarnings("squid:S2699") @Test - public void testCreateCFRule12Record() throws IOException { + void testCreateCFRule12Record() throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet(); CFRule12Record record = CFRule12Record.create(sheet, "7"); @@ -121,7 +121,7 @@ public final class TestCFRuleRecord { } @Test - public void testCreateIconCFRule12Record() throws IOException { + void testCreateIconCFRule12Record() throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet(); CFRule12Record record = CFRule12Record.create(sheet, IconSet.GREY_5_ARROWS); @@ -372,7 +372,7 @@ public final class TestCFRuleRecord { } @Test - public void testWrite() throws IOException { + void testWrite() throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet(); CFRuleRecord rr = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "5", "10"); @@ -410,7 +410,7 @@ public final class TestCFRuleRecord { * tRefN and tAreaN tokens must be preserved when re-serializing conditional format formulas */ @Test - public void testReserializeRefNTokens() { + void testReserializeRefNTokens() { RecordInputStream is = TestcaseRecordInputStream.create(CFRuleRecord.sid, DATA_REFN); CFRuleRecord rr = new CFRuleRecord(is); @@ -427,7 +427,7 @@ public final class TestCFRuleRecord { } @Test - public void testBug53691() throws IOException { + void testBug53691() throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet(); @@ -442,7 +442,7 @@ public final class TestCFRuleRecord { } @Test - public void testBug57231_rewrite() throws IOException { + void testBug57231_rewrite() throws IOException { try (HSSFWorkbook wb1 = HSSFITestDataProvider.instance.openSampleWorkbook("57231_MixedGasReport.xls")) { assertEquals(7, wb1.getNumberOfSheets()); try (HSSFWorkbook wb2 = HSSFITestDataProvider.instance.writeOutAndReadBack(wb1)) { diff --git a/src/testcases/org/apache/poi/hssf/record/TestColumnInfoRecord.java b/src/testcases/org/apache/poi/hssf/record/TestColumnInfoRecord.java index 1910a96f7b..dff4b02a04 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestColumnInfoRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestColumnInfoRecord.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestColumnInfoRecord { @Test - public void testBasic() { + void testBasic() { byte[] data = HexRead.readFromString("7D 00 0C 00 14 00 9B 00 C7 19 0F 00 01 13 00 00"); RecordInputStream in = TestcaseRecordInputStream.create(data); @@ -53,7 +53,7 @@ public final class TestColumnInfoRecord { * Excel reads that file OK and assumes zero for the value of the reserved field. */ @Test - public void testZeroResevedBytes_bug48332() { + void testZeroResevedBytes_bug48332() { // Taken from bugzilla attachment 24661 (offset 0x1E73) byte[] inpData = HexRead.readFromString("7D 00 0A 00 00 00 00 00 D5 19 0F 00 02 00"); byte[] outData = HexRead.readFromString("7D 00 0C 00 00 00 00 00 D5 19 0F 00 02 00 00 00"); @@ -71,7 +71,7 @@ public final class TestColumnInfoRecord { * but this seems to cause no problem to Excel */ @Test - public void testOneReservedByte() { + void testOneReservedByte() { byte[] inpData = HexRead.readFromString("7D 00 0B 00 00 00 00 00 24 02 0F 00 00 00 01"); byte[] outData = HexRead.readFromString("7D 00 0C 00 00 00 00 00 24 02 0F 00 00 00 01 00"); RecordInputStream in = TestcaseRecordInputStream.create(inpData); diff --git a/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java index c79165fec2..49ae12cb3b 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java @@ -40,7 +40,7 @@ public final class TestCommonObjectDataSubRecord { }; @Test - public void testLoad() { + void testLoad() { CommonObjectDataSubRecord record = new CommonObjectDataSubRecord(TestcaseRecordInputStream.createLittleEndian(data), data.length); assertEquals( CommonObjectDataSubRecord.OBJECT_TYPE_LIST_BOX, record.getObjectType()); @@ -58,7 +58,7 @@ public final class TestCommonObjectDataSubRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { CommonObjectDataSubRecord record = new CommonObjectDataSubRecord(); record.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_LIST_BOX); diff --git a/src/testcases/org/apache/poi/hssf/record/TestDConRefRecord.java b/src/testcases/org/apache/poi/hssf/record/TestDConRefRecord.java index c9797cc6f0..35bcf1633e 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestDConRefRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestDConRefRecord.java @@ -177,7 +177,7 @@ public class TestDConRefRecord { * various flavours. This uses the RecordInputStream constructor. */ @Test - public void testReadWriteSBExtRef() throws IOException { + void testReadWriteSBExtRef() throws IOException { testReadWrite(data1, "read-write single-byte external reference, volume type path"); testReadWrite(volumeString, "read-write properly formed single-byte external reference, volume type path"); @@ -202,7 +202,7 @@ public class TestDConRefRecord { * string */ @Test - public void testReadWriteDBExtRefUncVol() throws IOException { + void testReadWriteDBExtRefUncVol() throws IOException { testReadWrite(data4, "read-write double-byte external reference, UNC volume type path"); } @@ -221,7 +221,7 @@ public class TestDConRefRecord { * test read-constructor-then-serialize for a double-byte self-reference style string */ @Test - public void testReadWriteDBSelfRef() throws IOException { + void testReadWriteDBSelfRef() throws IOException { testReadWrite(data2, "read-write double-byte self reference"); } @@ -229,7 +229,7 @@ public class TestDConRefRecord { * test read-constructor-then-serialize for a single-byte self-reference style string */ @Test - public void testReadWriteSBSelfRef() throws IOException { + void testReadWriteSBSelfRef() throws IOException { testReadWrite(data3, "read-write single byte self reference"); } @@ -237,7 +237,7 @@ public class TestDConRefRecord { * Test of getDataSize method, of class DConRefRecord. */ @Test - public void testGetDataSize() { + void testGetDataSize() { DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.create(81, data1)); int expResult = data1.length; int result = instance.getDataSize(); @@ -255,7 +255,7 @@ public class TestDConRefRecord { * Test of getSid method, of class DConRefRecord. */ @Test - public void testGetSid() { + void testGetSid() { DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.create(81, data1)); short expResult = 81; short result = instance.getSid(); @@ -266,7 +266,7 @@ public class TestDConRefRecord { * Test of getPath method, of class DConRefRecord. */ @Test - public void testGetPath() { + void testGetPath() { // TODO: different types of paths. DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.create(81, data1)); byte[] expResult = Arrays.copyOfRange(data1, 9, data1.length); @@ -278,7 +278,7 @@ public class TestDConRefRecord { * Test of isExternalRef method, of class DConRefRecord. */ @Test - public void testIsExternalRef() { + void testIsExternalRef() { DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.create(81, data1)); assertTrue(instance.isExternalRef(), "external reference"); instance = new DConRefRecord(TestcaseRecordInputStream.create(81, data2)); diff --git a/src/testcases/org/apache/poi/hssf/record/TestDVALRecord.java b/src/testcases/org/apache/poi/hssf/record/TestDVALRecord.java index 83fff74ae8..e95f4d31ab 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestDVALRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestDVALRecord.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; public final class TestDVALRecord { @Test - public void testRead() { + void testRead() { byte[] data = new byte[22]; LittleEndian.putShort(data, 0, DVALRecord.sid); LittleEndian.putShort(data, 2, (short)18); diff --git a/src/testcases/org/apache/poi/hssf/record/TestDrawingGroupRecord.java b/src/testcases/org/apache/poi/hssf/record/TestDrawingGroupRecord.java index 042c3ec348..0526812a0d 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestDrawingGroupRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestDrawingGroupRecord.java @@ -30,7 +30,7 @@ public final class TestDrawingGroupRecord { private static final int MAX_DATA_SIZE = MAX_RECORD_SIZE - 4; @Test - public void testGetRecordSize() { + void testGetRecordSize() { DrawingGroupRecord r = new DrawingGroupRecord(); assertEquals(4, r.getRecordSize()); @@ -67,7 +67,7 @@ public final class TestDrawingGroupRecord { } @Test - public void testSerialize() { + void testSerialize() { // Check under max record size DrawingGroupRecord r = new DrawingGroupRecord(); byte[] rawData = new byte[100]; @@ -118,7 +118,7 @@ public final class TestDrawingGroupRecord { } @Test - public void testGrossSizeFromDataSize() { + void testGrossSizeFromDataSize() { assertEquals( 4, DrawingGroupRecord.grossSizeFromDataSize( 0 ) ); assertEquals( 5, DrawingGroupRecord.grossSizeFromDataSize( 1 ) ); assertEquals( MAX_RECORD_SIZE, DrawingGroupRecord.grossSizeFromDataSize( MAX_DATA_SIZE ) ); diff --git a/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java b/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java index 1aa1cefa88..764f25fe29 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java @@ -36,7 +36,7 @@ public final class TestDrawingRecord { * See Bugzilla #47548 */ @Test - public void testReadContinued() throws IOException { + void testReadContinued() throws IOException { //simulate a continues drawing record ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/src/testcases/org/apache/poi/hssf/record/TestEmbeddedObjectRefSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestEmbeddedObjectRefSubRecord.java index ac3f6b56e7..b33166ebbb 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestEmbeddedObjectRefSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestEmbeddedObjectRefSubRecord.java @@ -33,7 +33,7 @@ public final class TestEmbeddedObjectRefSubRecord { private static final short EORSR_SID = EmbeddedObjectRefSubRecord.sid; @Test - public void testStore() { + void testStore() { String data1 = "20 00 05 00 FC 10 76 01 02 24 14 DF 00 03 10 00 " + "00 46 6F 72 6D 73 2E 43 68 65 63 6B 42 6F 78 2E " @@ -58,7 +58,7 @@ public final class TestEmbeddedObjectRefSubRecord { } @Test - public void testCreate() { + void testCreate() { EmbeddedObjectRefSubRecord record1 = new EmbeddedObjectRefSubRecord(); byte[] ser = record1.serialize(); @@ -74,7 +74,7 @@ public final class TestEmbeddedObjectRefSubRecord { @SuppressWarnings("squid:S2699") @Test - public void testCameraTool_bug45912() { + void testCameraTool_bug45912() { /* * taken from ftPictFmla sub-record in attachment 22645 (offset 0x40AB). */ @@ -98,7 +98,7 @@ public final class TestEmbeddedObjectRefSubRecord { */ @SuppressWarnings("squid:S2699") @Test - public void testVarious() { + void testVarious() { String[] rawData = { "12 00 0B 00 70 95 0B 05 3B 01 00 36 00 40 00 18 00 19 00 18", "12 00 0B 00 B0 4D 3E 03 3B 00 00 00 00 01 00 00 80 01 C0 00", @@ -132,7 +132,7 @@ public final class TestEmbeddedObjectRefSubRecord { @SuppressWarnings("squid:S2699") @Test - public void testVisioDrawing_bug46199() { + void testVisioDrawing_bug46199() { /* * taken from ftPictFmla sub-record in attachment 22860 (stream offset 0x768F).<br> * Note that the since the string length is zero, there is no unicode flag byte diff --git a/src/testcases/org/apache/poi/hssf/record/TestEndSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestEndSubRecord.java index 306c60d451..3a13816982 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestEndSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestEndSubRecord.java @@ -30,13 +30,13 @@ public final class TestEndSubRecord { private static final byte[] data = { }; @Test - public void testLoad() { + void testLoad() { EndSubRecord record = new EndSubRecord(TestcaseRecordInputStream.create(0x00, data), 0); assertEquals(0, record.getDataSize()); } @Test - public void testStore() { + void testStore() { EndSubRecord record = new EndSubRecord(); byte [] recordBytes = record.serialize(); assertEquals(0, recordBytes.length - 4); diff --git a/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java b/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java index 761256479b..a8f1c1f170 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java @@ -37,7 +37,7 @@ public final class TestEscherAggregate { * Tests that the create aggregate method correctly rejoins escher records together. */ @Test - public void testCreateAggregate() { + void testCreateAggregate() { String msoDrawingRecord1 = "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 \n" + "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 \n" + @@ -85,7 +85,7 @@ public final class TestEscherAggregate { } @Test - public void testSerialize() { + void testSerialize() { EscherContainerRecord container1 = new EscherContainerRecord(); EscherContainerRecord spContainer1 = new EscherContainerRecord(); diff --git a/src/testcases/org/apache/poi/hssf/record/TestExtSSTRecord.java b/src/testcases/org/apache/poi/hssf/record/TestExtSSTRecord.java index 5ad4a65830..d1fd7dd97e 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestExtSSTRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestExtSSTRecord.java @@ -32,7 +32,7 @@ public final class TestExtSSTRecord { * ExtSSTRecord can be continued. Ensure we properly read the continue remainder. */ @Test - public void test50967() throws IOException { + void test50967() throws IOException { // hex dump from ISBN_UPD_PL_20100104_1525.xls attached to Bugzilla 50867 byte[] bytes = RawDataUtil.decompress("H4sIAAAAAAAAACWaBbAVxxZF9/jgrkFDcAvu7hrc3d3dLbhrgBDcXR8OwV2CEz" + "RIIFhw+4G/Zqiiqrn3zkyvvc/p7tM976sSp/CVOJIUVVJH2sa022lX0e6OLK0zpE9RpKemdCQav9lSlhhSCldqEEuq7EsbYkuLuGdJHG" + diff --git a/src/testcases/org/apache/poi/hssf/record/TestExtendedFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/TestExtendedFormatRecord.java index 632a6f1cf2..322ce95bdf 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestExtendedFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestExtendedFormatRecord.java @@ -41,7 +41,7 @@ public final class TestExtendedFormatRecord { } @Test - public void testLoad() { + void testLoad() { ExtendedFormatRecord record = createEFR(); assertEquals(0, record.getFontIndex()); assertEquals(0, record.getFormatIndex()); @@ -59,7 +59,7 @@ public final class TestExtendedFormatRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { // .fontindex = 0 // .formatindex = 0 // .celloptions = fffffff5 @@ -125,7 +125,7 @@ public final class TestExtendedFormatRecord { @SuppressWarnings("squid:S2699") @Test - public void testCloneOnto() { + void testCloneOnto() { ExtendedFormatRecord base = createEFR(); ExtendedFormatRecord other = new ExtendedFormatRecord(); @@ -136,7 +136,7 @@ public final class TestExtendedFormatRecord { } @Test - public void testRotation() { + void testRotation() { ExtendedFormatRecord record = createEFR(); assertEquals(0, record.getRotation()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestExternalNameRecord.java b/src/testcases/org/apache/poi/hssf/record/TestExternalNameRecord.java index bca4bbe6fe..9fb1602b20 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestExternalNameRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestExternalNameRecord.java @@ -52,7 +52,7 @@ public final class TestExternalNameRecord { } @Test - public void testBasicDeserializeReserialize() { + void testBasicDeserializeReserialize() { ExternalNameRecord enr = createSimpleENR(dataFDS); assertEquals("FDS", enr.getText()); @@ -62,7 +62,7 @@ public final class TestExternalNameRecord { } @Test - public void testBasicSize() { + void testBasicSize() { ExternalNameRecord enr = createSimpleENR(dataFDS); assertNotEquals(13, enr.getRecordSize(), "Identified bug 44695"); assertEquals(17, enr.getRecordSize()); @@ -71,7 +71,7 @@ public final class TestExternalNameRecord { } @Test - public void testAutoStdDocName() { + void testAutoStdDocName() { ExternalNameRecord enr = createSimpleENR(dataAutoDocName); assertEquals("'191219AW4 Corp,[WORKOUT_PX]'", enr.getText()); @@ -86,7 +86,7 @@ public final class TestExternalNameRecord { } @Test - public void testPlainName() { + void testPlainName() { ExternalNameRecord enr = createSimpleENR(dataPlainName); assertEquals("Rate_Date", enr.getText()); @@ -101,7 +101,7 @@ public final class TestExternalNameRecord { } @Test - public void testDDELink_bug47229() { + void testDDELink_bug47229() { /* * Hex dump read directly from text of bugzilla 47229 */ @@ -126,7 +126,7 @@ public final class TestExternalNameRecord { } @Test - public void testUnicodeName_bug47384() { + void testUnicodeName_bug47384() { // data taken from bugzilla 47384 att 23830 at offset 0x13A0 byte[] dataUN = HexRead.readFromString( "23 00 22 00" + @@ -143,7 +143,7 @@ public final class TestExternalNameRecord { } @Test - public void test48339() { + void test48339() { // data taken from bugzilla 48339 byte[] data = HexRead.readFromString( "23 00 09 00" + @@ -156,7 +156,7 @@ public final class TestExternalNameRecord { } @Test - public void testNPEWithFileFrom49219() { + void testNPEWithFileFrom49219() { // the file at test-data/spreadsheet/49219.xls has ExternalNameRecords without actual data, // we did handle this during reading, but failed during serializing this out, ensure it works now byte[] data = new byte[] { diff --git a/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java index 74b06b172e..a7a34a58e2 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; */ public final class TestFeatRecord { @Test - public void testWithoutFeatRecord() throws Exception { + void testWithoutFeatRecord() throws Exception { HSSFWorkbook hssf = HSSFTestDataSamples.openSampleWorkbook("46136-WithWarnings.xls"); InternalWorkbook wb = HSSFTestHelper.getWorkbookForTest(hssf); @@ -91,7 +91,7 @@ public final class TestFeatRecord { } @Test - public void testReadFeatRecord() { + void testReadFeatRecord() { HSSFWorkbook hssf = HSSFTestDataSamples.openSampleWorkbook("46136-NoWarnings.xls"); InternalWorkbook wb = HSSFTestHelper.getWorkbookForTest(hssf); @@ -183,7 +183,7 @@ public final class TestFeatRecord { * cloning sheets with feat records */ @Test - public void testCloneSheetWithFeatRecord() throws IOException { + void testCloneSheetWithFeatRecord() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("46136-WithWarnings.xls")) { HSSFSheet src = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java index 2a24c80143..a9fb1aea28 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFontRecord.java @@ -48,7 +48,7 @@ public final class TestFontRecord { }; @Test - public void testLoad() { + void testLoad() { FontRecord record = new FontRecord(TestcaseRecordInputStream.create(0x31, data)); assertEquals(0xc8, record.getFontHeight()); @@ -70,7 +70,7 @@ public final class TestFontRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { // .fontheight = c8 // .attributes = 0 // .italic = false @@ -102,7 +102,7 @@ public final class TestFontRecord { } @Test - public void testCloneOnto() { + void testCloneOnto() { FontRecord base = new FontRecord(TestcaseRecordInputStream.create(0x31, data)); FontRecord other = new FontRecord(); @@ -115,7 +115,7 @@ public final class TestFontRecord { } @Test - public void testSameProperties() { + void testSameProperties() { FontRecord f1 = new FontRecord(TestcaseRecordInputStream.create(0x31, data)); FontRecord f2 = new FontRecord(TestcaseRecordInputStream.create(0x31, data)); @@ -138,7 +138,7 @@ public final class TestFontRecord { * samples to say otherwise. */ @Test - public void testEmptyName_bug47250() { + void testEmptyName_bug47250() { byte[] emptyNameData = HexRead.readFromString( "C8 00 00 00 FF 7F 90 01 00 00 00 00 00 00 " + "00" // zero length diff --git a/src/testcases/org/apache/poi/hssf/record/TestFormulaRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFormulaRecord.java index 180a8d0521..af4bb2c927 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFormulaRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFormulaRecord.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; public final class TestFormulaRecord { @Test - public void testCreateFormulaRecord () { + void testCreateFormulaRecord () { FormulaRecord record = new FormulaRecord(); record.setColumn((short)0); record.setRow(1); @@ -52,7 +52,7 @@ public final class TestFormulaRecord { * This formula record is a representation of =1/0 at row 0, column 0 */ @Test - public void testCheckNanPreserve() { + void testCheckNanPreserve() { byte[] formulaByte = { 0, 0, 0, 0, 0x0F, 0x00, @@ -102,7 +102,7 @@ public final class TestFormulaRecord { * Tests to see if the shared formula cells properly reserialize the expPtg */ @Test - public void testExpFormula() { + void testExpFormula() { byte[] formulaByte = new byte[27]; formulaByte[4] =(byte)0x0F; @@ -121,7 +121,7 @@ public final class TestFormulaRecord { } @Test - public void testWithConcat() { + void testWithConcat() { // =CHOOSE(2,A2,A3,A4) byte[] data = { 1, 0, 1, 0, 15, 0, 0, 0, 0, 0, 0, 0, 57, @@ -159,7 +159,7 @@ public final class TestFormulaRecord { } @Test - public void testReserialize() { + void testReserialize() { FormulaRecord formulaRecord = new FormulaRecord(); formulaRecord.setRow(1); formulaRecord.setColumn((short) 1); @@ -182,7 +182,7 @@ public final class TestFormulaRecord { * inside {@link FormulaRecord} */ @Test - public void testCachedValue_bug46479() { + void testCachedValue_bug46479() { FormulaRecord fr0 = new FormulaRecord(); FormulaRecord fr1 = new FormulaRecord(); // test some other cached value types diff --git a/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java index 985fe64eaa..fa0aa8882f 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java @@ -34,7 +34,7 @@ public final class TestFtCblsSubRecord { }; @Test - public void testRead() { + void testRead() { FtCblsSubRecord record = new FtCblsSubRecord(TestcaseRecordInputStream.create(FtCblsSubRecord.sid, data), data.length); assertEquals(FtCblsSubRecord.sid, record.getSid()); @@ -42,7 +42,7 @@ public final class TestFtCblsSubRecord { } @Test - public void testWrite() { + void testWrite() { FtCblsSubRecord record = new FtCblsSubRecord(); assertEquals(FtCblsSubRecord.sid, record.getSid()); assertEquals(data.length, record.getDataSize()); @@ -52,7 +52,7 @@ public final class TestFtCblsSubRecord { } @Test - public void testClone() { + void testClone() { FtCblsSubRecord record = new FtCblsSubRecord(); byte[] src = record.serialize(); diff --git a/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java b/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java index cbcb0a493f..2ac1126ba8 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java @@ -283,7 +283,7 @@ public final class TestHyperlinkRecord { } @Test - public void testReadURLLink(){ + void testReadURLLink(){ RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, data1); HyperlinkRecord link = new HyperlinkRecord(is); assertEquals(2, link.getFirstRow()); @@ -303,7 +303,7 @@ public final class TestHyperlinkRecord { } @Test - public void testReadFileLink(){ + void testReadFileLink(){ RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, data2); HyperlinkRecord link = new HyperlinkRecord(is); assertEquals(0, link.getFirstRow()); @@ -323,7 +323,7 @@ public final class TestHyperlinkRecord { } @Test - public void testReadEmailLink(){ + void testReadEmailLink(){ RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, data3); HyperlinkRecord link = new HyperlinkRecord(is); assertEquals(1, link.getFirstRow()); @@ -342,7 +342,7 @@ public final class TestHyperlinkRecord { } @Test - public void testReadDocumentLink(){ + void testReadDocumentLink(){ RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, data4); HyperlinkRecord link = new HyperlinkRecord(is); assertEquals(3, link.getFirstRow()); @@ -372,7 +372,7 @@ public final class TestHyperlinkRecord { } @Test - public void testSerialize(){ + void testSerialize(){ serialize(data1); serialize(data2); serialize(data3); @@ -380,7 +380,7 @@ public final class TestHyperlinkRecord { } @Test - public void testCreateURLRecord() { + void testCreateURLRecord() { HyperlinkRecord link = new HyperlinkRecord(); link.newUrlLink(); link.setFirstRow((short)2); @@ -395,7 +395,7 @@ public final class TestHyperlinkRecord { } @Test - public void testCreateFileRecord() { + void testCreateFileRecord() { HyperlinkRecord link = new HyperlinkRecord(); link.newFileLink(); link.setFirstRow((short)0); @@ -410,7 +410,7 @@ public final class TestHyperlinkRecord { } @Test - public void testCreateDocumentRecord() { + void testCreateDocumentRecord() { HyperlinkRecord link = new HyperlinkRecord(); link.newDocumentLink(); link.setFirstRow((short)3); @@ -425,7 +425,7 @@ public final class TestHyperlinkRecord { } @Test - public void testCreateEmailtRecord() { + void testCreateEmailtRecord() { HyperlinkRecord link = new HyperlinkRecord(); link.newUrlLink(); link.setFirstRow((short)1); @@ -440,7 +440,7 @@ public final class TestHyperlinkRecord { } @Test - public void testClone() { + void testClone() { byte[][] data = {data1, data2, data3, data4}; for (final byte[] d : data) { RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, d); @@ -453,7 +453,7 @@ public final class TestHyperlinkRecord { @SuppressWarnings("squid:S2699") @Test - public void testReserializeTargetFrame() { + void testReserializeTargetFrame() { RecordInputStream in = TestcaseRecordInputStream.create(HyperlinkRecord.sid, dataTargetFrame); HyperlinkRecord hr = new HyperlinkRecord(in); byte[] ser = hr.serialize(); @@ -461,7 +461,7 @@ public final class TestHyperlinkRecord { } @Test - public void testReserializeLinkToWorkbook() { + void testReserializeLinkToWorkbook() { RecordInputStream in = TestcaseRecordInputStream.create(HyperlinkRecord.sid, dataLinkToWorkbook); HyperlinkRecord hr = new HyperlinkRecord(in); @@ -472,7 +472,7 @@ public final class TestHyperlinkRecord { } @Test - public void testReserializeUNC() { + void testReserializeUNC() { RecordInputStream in = TestcaseRecordInputStream.create(HyperlinkRecord.sid, dataUNC); HyperlinkRecord hr = new HyperlinkRecord(in); @@ -482,7 +482,7 @@ public final class TestHyperlinkRecord { } @Test - public void testGUID() throws IOException { + void testGUID() throws IOException { ClassID g; g = new ClassID("3F2504E0-4F89-11D3-9A0C-0305E82C3301"); confirmGUID(g, 0x3F2504E0, 0x4F89, 0x11D3, 0x9A0C0305E82C3301L); @@ -522,7 +522,7 @@ public final class TestHyperlinkRecord { } @Test - public void test47498(){ + void test47498(){ RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, data_47498); HyperlinkRecord link = new HyperlinkRecord(is); assertEquals(2, link.getFirstRow()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java b/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java index 96e844486c..47e92fbed6 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public final class TestInterfaceEndRecord { @Test - public void testCreate() { + void testCreate() { InterfaceEndRecord record = InterfaceEndRecord.instance; assertEquals(0, record.getDataSize()); } @@ -46,7 +46,7 @@ public final class TestInterfaceEndRecord { * data to an {@link InterfaceHdrRecord}. */ @Test - public void testUnexpectedBytes_bug47251(){ + void testUnexpectedBytes_bug47251(){ String hex = "" + "09 08 10 00 00 06 05 00 EC 15 CD 07 C1 C0 00 00 06 03 00 00 " + //BOF "E2 00 02 00 B0 04 " + //INTERFACEEND with extra two bytes diff --git a/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java b/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java index f1f93ffe95..dd005ed4f8 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public final class TestLabelRecord { @Test - public void testEmptyString() throws IOException { + void testEmptyString() throws IOException { try (HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("ex42570-20305.xls"); HSSFWorkbook wb2 = HSSFTestDataSamples.writeOutAndReadBack(wb1)) { HSSFSheet s1 = wb1.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/hssf/record/TestLbsDataSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestLbsDataSubRecord.java index 71e2504761..759181a605 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestLbsDataSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestLbsDataSubRecord.java @@ -45,7 +45,7 @@ public final class TestLbsDataSubRecord { * test data was taken from 47701.xls */ @Test - public void test_47701(){ + void test_47701(){ byte[] data = HexRead.readFromString( "15, 00, 12, 00, 12, 00, 02, 00, 11, 20, " + "00, 00, 00, 00, 80, 3D, 03, 05, 00, 00, " + @@ -79,7 +79,7 @@ public final class TestLbsDataSubRecord { * test data was taken from the file attached to Bugzilla 45778 */ @Test - public void test_45778(){ + void test_45778(){ byte[] data = HexRead.readFromString( "15, 00, 12, 00, 14, 00, 01, 00, 01, 00, " + "01, 21, 00, 00, 3C, 13, F4, 03, 00, 00, " + @@ -119,7 +119,7 @@ public final class TestLbsDataSubRecord { * There are 5 padding bytes that are removed by POI */ @Test - public void test_remove_padding(){ + void test_remove_padding(){ byte[] data = HexRead.readFromString( "5D, 00, 4C, 00, " + "15, 00, 12, 00, 12, 00, 01, 00, 11, 00, " + @@ -153,7 +153,7 @@ public final class TestLbsDataSubRecord { } @Test - public void test_LbsDropData() throws IOException{ + void test_LbsDropData() throws IOException{ byte[] data = HexRead.readFromString( //LbsDropData "0A, 00, " + //flags diff --git a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java index b9c98bdeed..6ab7a1dec5 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java @@ -41,7 +41,7 @@ public final class TestMergeCellsRecord { * Make sure when a clone is called, we actually clone it. */ @Test - public void testCloneReferences() { + void testCloneReferences() { CellRangeAddress[] cras = { new CellRangeAddress(0, 1, 0, 2), }; MergeCellsRecord merge = new MergeCellsRecord(cras, 0, cras.length); MergeCellsRecord clone = merge.copy(); @@ -60,7 +60,7 @@ public final class TestMergeCellsRecord { } @Test - public void testMCTable_bug46009() { + void testMCTable_bug46009() { MergedCellsTable mct = new MergedCellsTable(); CellRangeAddress[] cras = { new CellRangeAddress(0, 0, 0, 3) }; MergeCellsRecord mcr1 = new MergeCellsRecord(cras, 0, 1); diff --git a/src/testcases/org/apache/poi/hssf/record/TestNameCommentRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNameCommentRecord.java index 20fa58db33..555153e409 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNameCommentRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNameCommentRecord.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; */ public final class TestNameCommentRecord { @Test - public void testReserialize() { + void testReserialize() { final byte[] data = HexRead .readFromString("" + "94 08 00 00 00 00 00 00 00 00 00 00 04 00 07 00 00 6E 61 6D 65 00 63 6F 6D 6D 65 6E 74]"); diff --git a/src/testcases/org/apache/poi/hssf/record/TestNameRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNameRecord.java index 3c0f267bd7..34475b59aa 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNameRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNameRecord.java @@ -45,7 +45,7 @@ public final class TestNameRecord { * Makes sure that additional name information is parsed properly such as menu/description */ @Test - public void testFillExtras() { + void testFillExtras() { byte[] examples = HexRead.readFromString("" + "88 03 67 06 07 00 00 00 00 00 00 23 00 00 00 4D " @@ -60,7 +60,7 @@ public final class TestNameRecord { } @Test - public void testReserialize() { + void testReserialize() { byte[] data = HexRead .readFromString("" + "20 00 00 01 0B 00 00 00 01 00 00 00 00 00 00 06 3B 00 00 00 00 02 00 00 00 09 00]"); @@ -72,7 +72,7 @@ public final class TestNameRecord { } @Test - public void testFormulaRelAbs_bug46174() throws IOException { + void testFormulaRelAbs_bug46174() throws IOException { // perhaps this testcase belongs on TestHSSFName try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFName name = wb.createName(); @@ -85,7 +85,7 @@ public final class TestNameRecord { } @Test - public void testFormulaGeneral() throws IOException { + void testFormulaGeneral() throws IOException { // perhaps this testcase belongs on TestHSSFName HSSFWorkbook wb = new HSSFWorkbook(); HSSFName name = wb.createName(); @@ -103,7 +103,7 @@ public final class TestNameRecord { * A NameRecord followed by a ContinueRecord. See Bugzilla 50244 */ @Test - public void test50244() throws IOException { + void test50244() throws IOException { byte[] data1 = RawDataUtil.decompress( "H4sIAAAAAAAAAI3Zu2qWQRAA0I8EQcHGzkrwBcLO7B0sBR9AwdYIKdKFoPhovp7xLyQWyX+m2OWw7TIX5u3x/t1xHG9ePhyXxyl+" + "fbz+cf3p/ufd3c3nm/vbm6tvx++L18fXy4fr4tVxxNWXLFelhCENlRCIZuiERAzDJFTEMmxCM/RiCMJApKESJqIZOmEhhmESNmIZ" + @@ -139,7 +139,7 @@ public final class TestNameRecord { } @Test - public void testBug57923() { + void testBug57923() { NameRecord record = new NameRecord(); assertEquals(0, record.getExternSheetNumber()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java index cbec6a7573..eec2c29929 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java @@ -41,7 +41,7 @@ public final class TestNoteRecord { ); @Test - public void testRead() { + void testRead() { NoteRecord record = new NoteRecord(TestcaseRecordInputStream.create(NoteRecord.sid, testData)); @@ -54,7 +54,7 @@ public final class TestNoteRecord { } @Test - public void testWrite() { + void testWrite() { NoteRecord record = new NoteRecord(); assertEquals(NoteRecord.sid, record.getSid()); @@ -69,7 +69,7 @@ public final class TestNoteRecord { } @Test - public void testClone() { + void testClone() { NoteRecord record = new NoteRecord(); record.setRow((short)1); @@ -92,7 +92,7 @@ public final class TestNoteRecord { } @Test - public void testUnicodeAuthor() { + void testUnicodeAuthor() { // This sample data was created by setting the 'user name' field in the 'Personalize' // section of Excel's options to \u30A2\u30D1\u30C3\u30C1\u65CF, and then // creating a cell comment. diff --git a/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java index b1692389d7..5f55d50c33 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java @@ -36,7 +36,7 @@ public final class TestNoteStructureSubRecord { }; @Test - public void testRead() { + void testRead() { NoteStructureSubRecord record = new NoteStructureSubRecord(TestcaseRecordInputStream.create(NoteStructureSubRecord.sid, data), data.length); assertEquals(NoteStructureSubRecord.sid, record.getSid()); @@ -44,7 +44,7 @@ public final class TestNoteStructureSubRecord { } @Test - public void testWrite() { + void testWrite() { NoteStructureSubRecord record = new NoteStructureSubRecord(); assertEquals(NoteStructureSubRecord.sid, record.getSid()); assertEquals(data.length, record.getDataSize()); @@ -54,7 +54,7 @@ public final class TestNoteStructureSubRecord { } @Test - public void testClone() { + void testClone() { NoteStructureSubRecord record = new NoteStructureSubRecord(); byte[] src = record.serialize(); diff --git a/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java b/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java index 54b9cd3cac..325bfbac01 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestObjRecord.java @@ -60,7 +60,7 @@ public final class TestObjRecord { ); @Test - public void testLoad() { + void testLoad() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.create(ObjRecord.sid, recdata)); assertEquals(26, record.getRecordSize() - 4); @@ -73,7 +73,7 @@ public final class TestObjRecord { } @Test - public void testStore() { + void testStore() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.create(ObjRecord.sid, recdata)); byte [] recordBytes = record.serialize(); @@ -83,7 +83,7 @@ public final class TestObjRecord { } @Test - public void testConstruct() { + void testConstruct() { ObjRecord record = new ObjRecord(); CommonObjectDataSubRecord ftCmo = new CommonObjectDataSubRecord(); ftCmo.setObjectType( CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT); @@ -109,7 +109,7 @@ public final class TestObjRecord { } @Test - public void testReadWriteWithPadding_bug45133() { + void testReadWriteWithPadding_bug45133() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.create(recdataNeedingPadding)); assertNotEquals(34, record.getRecordSize(), "Identified bug 45133"); assertEquals(36, record.getRecordSize()); @@ -127,7 +127,7 @@ public final class TestObjRecord { */ @SuppressWarnings("squid:S2699") @Test - public void test4BytePadding() { + void test4BytePadding() { // actual data from file saved by Excel 2007 byte[] data = HexRead.readFromString("" + "15 00 12 00 1E 00 01 00 11 60 B4 6D 3C 01 C4 06 " diff --git a/src/testcases/org/apache/poi/hssf/record/TestPLVRecord.java b/src/testcases/org/apache/poi/hssf/record/TestPLVRecord.java index 30b0f4294b..bae54fad14 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestPLVRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestPLVRecord.java @@ -42,7 +42,7 @@ public final class TestPLVRecord { private final static String SHEET_NAME = "S2"; @Test - public void testPLVRecord() throws Exception { + void testPLVRecord() throws Exception { try (InputStream is = HSSFTestDataSamples.openSampleFileStream(XLS_FILENAME); HSSFWorkbook workbook = new HSSFWorkbook(is)) { diff --git a/src/testcases/org/apache/poi/hssf/record/TestPaletteRecord.java b/src/testcases/org/apache/poi/hssf/record/TestPaletteRecord.java index d1805300b1..e0816996e7 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestPaletteRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestPaletteRecord.java @@ -35,7 +35,7 @@ public final class TestPaletteRecord { * Tests that the default palette matches the constants of HSSFColor */ @Test - public void testDefaultPalette() { + void testDefaultPalette() { PaletteRecord palette = new PaletteRecord(); //make sure all the HSSFColor constants match diff --git a/src/testcases/org/apache/poi/hssf/record/TestPaneRecord.java b/src/testcases/org/apache/poi/hssf/record/TestPaneRecord.java index 906a73f6fd..3ffcc521cd 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestPaneRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestPaneRecord.java @@ -38,7 +38,7 @@ public final class TestPaneRecord { }; @Test - public void testLoad() { + void testLoad() { PaneRecord record = new PaneRecord(TestcaseRecordInputStream.create(0x41, data)); assertEquals( (short)1, record.getX()); @@ -52,7 +52,7 @@ public final class TestPaneRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { PaneRecord record = new PaneRecord(); record.setX( (short) 1); diff --git a/src/testcases/org/apache/poi/hssf/record/TestRecalcIdRecord.java b/src/testcases/org/apache/poi/hssf/record/TestRecalcIdRecord.java index 7662a95d5b..707f2a0538 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestRecalcIdRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestRecalcIdRecord.java @@ -35,7 +35,7 @@ public final class TestRecalcIdRecord { @SuppressWarnings("squid:S2699") @Test - public void testBasicDeserializeReserialize() { + void testBasicDeserializeReserialize() { byte[] data = HexRead.readFromString( "C1 01" + // rt @@ -47,7 +47,7 @@ public final class TestRecalcIdRecord { } @Test - public void testBadFirstField_bug48096() { + void testBadFirstField_bug48096() { /* * Data taken from the sample file referenced in Bugzilla 48096, file offset 0x0D45. * The apparent problem is that the first data short field has been written with the diff --git a/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java b/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java index 103eeace7d..0518d40ca4 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java +++ b/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java @@ -44,7 +44,7 @@ public final class TestRecordFactory { * */ @Test - public void testBasicRecordConstruction() { + void testBasicRecordConstruction() { short recType = BOFRecord.sid; byte[] data = { 0, 6, 5, 0, -2, 28, -51, 7, -55, 64, 0, 0, 6, 1, 0, 0 @@ -87,7 +87,7 @@ public final class TestRecordFactory { * */ @Test - public void testSpecial() { + void testSpecial() { short recType = RKRecord.sid; byte[] data = { 0, 0, 0, 0, 21, 0, 0, 0, 0, 0 @@ -114,7 +114,7 @@ public final class TestRecordFactory { * FAILURE: The wrong records are created or contain the wrong values <P> */ @Test - public void testContinuedUnknownRecord() { + void testContinuedUnknownRecord() { byte[] data = { 0, -1, 0, 0, // an unknown record with 0 length 0x3C , 0, 3, 0, 1, 2, 3, // a continuation record with 3 bytes of data @@ -144,7 +144,7 @@ public final class TestRecordFactory { * Record factory must preserve this structure when reading records. */ @Test - public void testMixedContinue() throws IOException { + void testMixedContinue() throws IOException { // Adapted from a real test sample file 39512.xls (Offset 0x4854). // See Bug 39512 for details. String dump = @@ -194,7 +194,7 @@ public final class TestRecordFactory { } @Test - public void testNonZeroPadding_bug46987() throws IOException { + void testNonZeroPadding_bug46987() throws IOException { Record[] recs = { new BOFRecord(), new WriteAccessRecord(), // need *something* between BOF and EOF diff --git a/src/testcases/org/apache/poi/hssf/record/TestRecordInputStream.java b/src/testcases/org/apache/poi/hssf/record/TestRecordInputStream.java index c3d8644689..aebd43e05f 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestRecordInputStream.java +++ b/src/testcases/org/apache/poi/hssf/record/TestRecordInputStream.java @@ -55,7 +55,7 @@ public final class TestRecordInputStream { @Test - public void testChangeOfCompressionFlag_bug25866() { + void testChangeOfCompressionFlag_bug25866() { byte[] changingFlagSimpleData = HexRead.readFromString("" + "AA AA " // fake SID + "06 00 " // first rec len 6 @@ -69,7 +69,7 @@ public final class TestRecordInputStream { } @Test - public void testChangeFromUnCompressedToCompressed() { + void testChangeFromUnCompressedToCompressed() { byte[] changingFlagSimpleData = HexRead.readFromString("" + "AA AA " // fake SID + "0F 00 " // first rec len 15 @@ -81,7 +81,7 @@ public final class TestRecordInputStream { } @Test - public void testReadString() { + void testReadString() { byte[] changingFlagFullData = HexRead.readFromString("" + "AA AA " // fake SID + "12 00 " // first rec len 18 (15 + next 3 bytes) @@ -96,7 +96,7 @@ public final class TestRecordInputStream { @ParameterizedTest @CsvSource({"1, 200", "0, 200", "999999999, 200", HeaderRecord.sid+", 200"}) - public void testLeftoverDataException(int sid, int remainingByteCount) { + void testLeftoverDataException(int sid, int remainingByteCount) { // just ensure that the exception is created correctly, even with unknown sids assertDoesNotThrow(() -> new RecordInputStream.LeftoverDataException(sid, remainingByteCount)); } diff --git a/src/testcases/org/apache/poi/hssf/record/TestSCLRecord.java b/src/testcases/org/apache/poi/hssf/record/TestSCLRecord.java index cfe9f1ebea..f9e7ca4e39 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSCLRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSCLRecord.java @@ -34,7 +34,7 @@ public final class TestSCLRecord { }; @Test - public void testLoad() { + void testLoad() { SCLRecord record = new SCLRecord(TestcaseRecordInputStream.create(0xa0, data)); assertEquals( 3, record.getNumerator()); assertEquals( 4, record.getDenominator()); @@ -44,7 +44,7 @@ public final class TestSCLRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SCLRecord record = new SCLRecord(); record.setNumerator( (short)3 ); record.setDenominator( (short)4 ); diff --git a/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java b/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java index 5c0c88c3b8..5b920e5b87 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java @@ -53,7 +53,7 @@ public final class TestSSTDeserializer { } @Test - public void testSpanRichTextToPlainText() throws IOException { + void testSpanRichTextToPlainText() throws IOException { byte[] header = readSampleHexData("richtextdata.txt", "header", FAKE_SID); byte[] continueBytes = readSampleHexData("richtextdata.txt", "continue1", ContinueRecord.sid); RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes)); @@ -67,7 +67,7 @@ public final class TestSSTDeserializer { } @Test - public void testContinuationWithNoOverlap() throws IOException { + void testContinuationWithNoOverlap() throws IOException { byte[] header = readSampleHexData("evencontinuation.txt", "header", FAKE_SID); byte[] continueBytes = readSampleHexData("evencontinuation.txt", "continue1", ContinueRecord.sid); RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes)); @@ -84,7 +84,7 @@ public final class TestSSTDeserializer { * Strings can actually span across more than one continuation. */ @Test - public void testStringAcross2Continuations() throws IOException { + void testStringAcross2Continuations() throws IOException { byte[] header = readSampleHexData("stringacross2continuations.txt", "header", FAKE_SID); byte[] continue1 = readSampleHexData("stringacross2continuations.txt", "continue1", ContinueRecord.sid); byte[] continue2 = readSampleHexData("stringacross2continuations.txt", "continue2", ContinueRecord.sid); @@ -100,7 +100,7 @@ public final class TestSSTDeserializer { } @Test - public void testExtendedStrings() throws IOException { + void testExtendedStrings() throws IOException { byte[] header = readSampleHexData("extendedtextstrings.txt", "rich-header", FAKE_SID); byte[] continueBytes = readSampleHexData("extendedtextstrings.txt", "rich-continue1", ContinueRecord.sid); RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes)); diff --git a/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java b/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java index 9b030894a8..d4bbb5e2bd 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java @@ -83,7 +83,7 @@ public final class TestSSTRecord { * SST is often split over several {@link ContinueRecord}s */ @Test - public void testContinuedRecord() throws IOException { + void testContinuedRecord() throws IOException { byte[] origData; SSTRecord record; byte[] ser_output; @@ -125,7 +125,7 @@ public final class TestSSTRecord { * Test capability of handling mondo big strings */ @Test - public void testHugeStrings() { + void testHugeStrings() { SSTRecord record = new SSTRecord(); byte[][] bstrings = { @@ -208,7 +208,7 @@ public final class TestSSTRecord { * test SSTRecord boundary conditions */ @Test - public void testSSTRecordBug() { + void testSSTRecordBug() { // create an SSTRecord and write a certain pattern of strings // to it ... then serialize it and verify the content SSTRecord record = new SSTRecord(); @@ -244,7 +244,7 @@ public final class TestSSTRecord { * test simple addString */ @Test - public void testSimpleAddString() { + void testSimpleAddString() { SSTRecord record = new SSTRecord(); UnicodeString s1 = new UnicodeString("Hello world"); @@ -290,7 +290,7 @@ public final class TestSSTRecord { * test simple constructor */ @Test - public void testSimpleConstructor() { + void testSimpleConstructor() { SSTRecord record = new SSTRecord(); assertEquals( 0, record.getNumStrings() ); @@ -310,7 +310,7 @@ public final class TestSSTRecord { * Tests that workbooks with rich text that duplicates a non rich text cell can be read and written. */ @Test - public void testReadWriteDuplicatedRichText1() throws Exception { + void testReadWriteDuplicatedRichText1() throws Exception { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("duprich1.xls")) { HSSFSheet sheet = wb.getSheetAt(1); assertEquals("01/05 (Wed)", sheet.getRow(0).getCell(8).getStringCellValue()); @@ -351,7 +351,7 @@ public final class TestSSTRecord { } @Test - public void test50779_1() throws IOException { + void test50779_1() throws IOException { byte[] bytes = RawDataUtil.decompress("H4sIAAAAAAAAAL3aO2gVQRQG4HO5XkEZ8AESi4DBKoXFP+8IVioSvahcLxKC" + "iRIRc9FEUZExCL4IYnyQqIi9SEATFUHRTkSQaBFsrEQLG8EiFgGrCM6uIGiff5c5e3ZY9l8W9mt2FqSjoyEixTBSW5kPm7EV29CNHa" + "hjJ3ajgSb2oge92Id+HMAADuEwWjiCoxjCMI7hOE7iNM7gLM7hPC7gIi5hFJdxBWO4imu4jhsYxy3cBqTYtVRESU28/NnqMFJZ/Fgj" + @@ -378,7 +378,7 @@ public final class TestSSTRecord { } @Test - public void test50779_2() throws IOException { + void test50779_2() throws IOException { byte[] bytes = RawDataUtil.decompress("H4sIAAAAAAAAAL3Uu2sVQRjG4e9wOKKw4gUkKSyCVQqLd2d2ZhOwiiLqQSUe" + "JIgRUcQc1ERUZBXBG0GMFxIiaC8S8I6FWIoIop2NlWBhI1hoIVhFcM6Cgn+Avx3m2+HbXd5hYJ9FGxgYNbPedNYY0SZt1hZtU1vbtV" + "Oj6mi3xrRHe7VP+3VAh3RYXR3RUR3TpKZ0XCd1Wmd0Tud1QRd1SZc1rSu6qhld03Xd0E3Nal63JOuNnIlxTIxnYgomJjAxkYkpmZgh" + @@ -404,7 +404,7 @@ public final class TestSSTRecord { } @Test - public void test57456() { + void test57456() { byte[] bytes = HexRead.readFromString("FC, 00, 08, 00, 00, 00, 00, 00, E1, 06, 00, 00"); RecordInputStream in = TestcaseRecordInputStream.create(bytes); assertEquals(SSTRecord.sid, in.getSid()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java b/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java index 2c26a91f54..2fd22d799e 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSSTRecordSizeCalculator.java @@ -54,7 +54,7 @@ public final class TestSSTRecordSizeCalculator { } @Test - public void testBasic() { + void testBasic() { strings.add(makeUnicodeString(SMALL_STRING)); confirmSize(SST_RECORD_OVERHEAD + COMPRESSED_PLAIN_STRING_OVERHEAD @@ -62,7 +62,7 @@ public final class TestSSTRecordSizeCalculator { } @Test - public void testBigStringAcrossUnicode() { + void testBigStringAcrossUnicode() { int bigString = MAX_DATA_SPACE + 100; strings.add(makeUnicodeString(bigString)); confirmSize(SST_RECORD_OVERHEAD @@ -74,7 +74,7 @@ public final class TestSSTRecordSizeCalculator { } @Test - public void testPerfectFit() { + void testPerfectFit() { int perfectFit = MAX_DATA_SPACE - COMPRESSED_PLAIN_STRING_OVERHEAD; strings.add(makeUnicodeString(perfectFit)); confirmSize(SST_RECORD_OVERHEAD @@ -83,7 +83,7 @@ public final class TestSSTRecordSizeCalculator { } @Test - public void testJustOversized() { + void testJustOversized() { int tooBig = MAX_DATA_SPACE - COMPRESSED_PLAIN_STRING_OVERHEAD + 1; strings.add(makeUnicodeString(tooBig)); confirmSize(SST_RECORD_OVERHEAD @@ -96,7 +96,7 @@ public final class TestSSTRecordSizeCalculator { } @Test - public void testSecondStringStartsOnNewContinuation() { + void testSecondStringStartsOnNewContinuation() { int perfectFit = MAX_DATA_SPACE - COMPRESSED_PLAIN_STRING_OVERHEAD; strings.add(makeUnicodeString(perfectFit)); strings.add(makeUnicodeString(SMALL_STRING)); @@ -109,7 +109,7 @@ public final class TestSSTRecordSizeCalculator { } @Test - public void testHeaderCrossesNormalContinuePoint() { + void testHeaderCrossesNormalContinuePoint() { int almostPerfectFit = MAX_DATA_SPACE - COMPRESSED_PLAIN_STRING_OVERHEAD - 2; strings.add(makeUnicodeString(almostPerfectFit)); String oneCharString = new String(new char[1]); diff --git a/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java b/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java index b24f02af78..899668642f 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java @@ -76,7 +76,7 @@ public final class TestSharedFormulaRecord { * incorrect encoding. The formula here is one such example (Excel displays #VALUE!). */ @Test - public void testConvertSharedFormulasOperandClasses_bug45123() { + void testConvertSharedFormulasOperandClasses_bug45123() { LittleEndianInput in = TestcaseRecordInputStream.createLittleEndian(SHARED_FORMULA_WITH_REF_ARRAYS_DATA); int encodedLen = in.readUShort(); @@ -98,7 +98,7 @@ public final class TestSharedFormulaRecord { } @Test - public void testConvertSharedFormulas() { + void testConvertSharedFormulas() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFEvaluationWorkbook fpb = HSSFEvaluationWorkbook.create(wb); Ptg[] sharedFormula, convertedFormula; @@ -139,7 +139,7 @@ public final class TestSharedFormulaRecord { * Make sure that POI preserves {@link SharedFormulaRecord}s */ @Test - public void testPreserveOnReserialize() { + void testPreserveOnReserialize() { HSSFWorkbook wb; HSSFSheet sheet; HSSFCell cellB32769; @@ -172,7 +172,7 @@ public final class TestSharedFormulaRecord { } @Test - public void testUnshareFormulaDueToChangeFormula() { + void testUnshareFormulaDueToChangeFormula() { HSSFWorkbook wb; HSSFSheet sheet; HSSFCell cellB32769; @@ -194,7 +194,7 @@ public final class TestSharedFormulaRecord { } @Test - public void testUnshareFormulaDueToDelete() { + void testUnshareFormulaDueToDelete() { HSSFWorkbook wb; HSSFSheet sheet; HSSFCell cell; diff --git a/src/testcases/org/apache/poi/hssf/record/TestStringRecord.java b/src/testcases/org/apache/poi/hssf/record/TestStringRecord.java index ed1282152d..1261b8a2ad 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestStringRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestStringRecord.java @@ -43,7 +43,7 @@ public final class TestStringRecord { ); @Test - public void testLoad() { + void testLoad() { StringRecord record = new StringRecord(TestcaseRecordInputStream.create(0x207, data)); assertEquals( "Fahrzeugtyp", record.getString()); @@ -52,7 +52,7 @@ public final class TestStringRecord { } @Test - public void testStore() { + void testStore() { StringRecord record = new StringRecord(); record.setString("Fahrzeugtyp"); @@ -64,7 +64,7 @@ public final class TestStringRecord { } @Test - public void testContinue() throws IOException { + void testContinue() throws IOException { int MAX_BIFF_DATA = RecordInputStream.MAX_RECORD_DATA_SIZE; int TEXT_LEN = MAX_BIFF_DATA + 1000; // deliberately over-size String textChunk = "ABCDEGGHIJKLMNOP"; // 16 chars diff --git a/src/testcases/org/apache/poi/hssf/record/TestStyleRecord.java b/src/testcases/org/apache/poi/hssf/record/TestStyleRecord.java index 068ea327b2..b77916504d 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestStyleRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestStyleRecord.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; */ public final class TestStyleRecord { @Test - public void testUnicodeReadName() { + void testUnicodeReadName() { byte[] data = HexRead.readFromString( "11 00 09 00 01 38 5E C4 89 5F 00 53 00 68 00 65 00 65 00 74 00 31 00"); RecordInputStream in = TestcaseRecordInputStream.create(StyleRecord.sid, data); diff --git a/src/testcases/org/apache/poi/hssf/record/TestSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestSubRecord.java index 608e5a9050..dc8accf556 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSubRecord.java @@ -75,7 +75,7 @@ public final class TestSubRecord { * read overruns, so the bug was mostly silent. */ @Test - public void testReadAll_bug45778() { + void testReadAll_bug45778() { RecordInputStream in = TestcaseRecordInputStream.create(dataAutoFilter); ObjRecord or = new ObjRecord(in); byte[] data2 = or.serialize(); @@ -85,7 +85,7 @@ public final class TestSubRecord { } @Test - public void testReadManualComboWithFormula() { + void testReadManualComboWithFormula() { byte[] data = HexRead.readFromString("" + "5D 00 66 00 " + "15 00 12 00 14 00 02 00 11 20 00 00 00 00 " @@ -119,7 +119,7 @@ public final class TestSubRecord { * ObjRecord back to the proper size. POI should do the same. */ @Test - public void testWayTooMuchPadding_bug46545() { + void testWayTooMuchPadding_bug46545() { byte[] data = HexRead.readFromString("" + "15 00 12 00 14 00 13 00 01 21 00 00 00" + "00 98 0B 5B 09 00 00 00 00 0C 00 14 00 00 00 00 00 00 00 00" diff --git a/src/testcases/org/apache/poi/hssf/record/TestSupBookRecord.java b/src/testcases/org/apache/poi/hssf/record/TestSupBookRecord.java index 4ad7a39d35..8a412703c2 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestSupBookRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestSupBookRecord.java @@ -60,7 +60,7 @@ public final class TestSupBookRecord { * tests that we can load the record */ @Test - public void testLoadIR() { + void testLoadIR() { SupBookRecord record = new SupBookRecord(TestcaseRecordInputStream.create(0x01AE, dataIR)); assertTrue( record.isInternalReferences() ); //expected flag assertEquals( 0x4, record.getNumberOfSheets() ); //expected # of sheets @@ -72,7 +72,7 @@ public final class TestSupBookRecord { * tests that we can load the record */ @Test - public void testLoadER() { + void testLoadER() { SupBookRecord record = new SupBookRecord(TestcaseRecordInputStream.create(0x01AE, dataER)); assertTrue( record.isExternalReferences() ); //expected flag assertEquals( 0x2, record.getNumberOfSheets() ); //expected # of sheets @@ -90,7 +90,7 @@ public final class TestSupBookRecord { * tests that we can load the record */ @Test - public void testLoadAIF() { + void testLoadAIF() { SupBookRecord record = new SupBookRecord(TestcaseRecordInputStream.create(0x01AE, dataAIF)); assertTrue( record.isAddInFunctions() ); //expected flag assertEquals( 0x1, record.getNumberOfSheets() ); //expected # of sheets @@ -102,7 +102,7 @@ public final class TestSupBookRecord { */ @SuppressWarnings("squid:S2699") @Test - public void testStoreIR() { + void testStoreIR() { SupBookRecord record = SupBookRecord.createInternalReferences((short)4); confirmRecordEncoding(0x01AE, dataIR, record.serialize()); @@ -110,7 +110,7 @@ public final class TestSupBookRecord { @SuppressWarnings("squid:S2699") @Test - public void testStoreER() { + void testStoreER() { String url = "testURL"; String[] sheetNames = { "Sheet1", "Sheet2", }; SupBookRecord record = SupBookRecord.createExternalReferences(url, sheetNames); @@ -119,7 +119,7 @@ public final class TestSupBookRecord { } @Test - public void testStoreAIF() { + void testStoreAIF() { SupBookRecord record = SupBookRecord.createAddInFunctions(); assertEquals(1, record.getNumberOfSheets()); assertTrue(record.isAddInFunctions()); @@ -127,7 +127,7 @@ public final class TestSupBookRecord { } @Test - public void testExternalReferenceUrl() { + void testExternalReferenceUrl() { String[] sheetNames = new String[]{"SampleSheet"}; final char startMarker = (char)1; diff --git a/src/testcases/org/apache/poi/hssf/record/TestTableRecord.java b/src/testcases/org/apache/poi/hssf/record/TestTableRecord.java index 0ce1f53b92..22c8ab41fc 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestTableRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestTableRecord.java @@ -45,7 +45,7 @@ public final class TestTableRecord { }; @Test - public void testLoad() { + void testLoad() { TableRecord record = new TableRecord(TestcaseRecordInputStream.create(0x236, data)); @@ -65,7 +65,7 @@ public final class TestTableRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() + void testStore() { // Offset 0x3bd9 (15321) // recordid = 0x236, size = 16 diff --git a/src/testcases/org/apache/poi/hssf/record/TestTextObjectBaseRecord.java b/src/testcases/org/apache/poi/hssf/record/TestTextObjectBaseRecord.java index 7823705ea9..02acfc7877 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestTextObjectBaseRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestTextObjectBaseRecord.java @@ -53,7 +53,7 @@ public final class TestTextObjectBaseRecord { ); @Test - public void testLoad() { + void testLoad() { RecordInputStream in = TestcaseRecordInputStream.create(data); TextObjectRecord record = new TextObjectRecord(in); @@ -66,7 +66,7 @@ public final class TestTextObjectBaseRecord { } @Test - public void testStore() { + void testStore() { TextObjectRecord record = new TextObjectRecord(); HSSFRichTextString str = new HSSFRichTextString("AB"); diff --git a/src/testcases/org/apache/poi/hssf/record/TestTextObjectRecord.java b/src/testcases/org/apache/poi/hssf/record/TestTextObjectRecord.java index 9456aa985a..a9d4f3ff82 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestTextObjectRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestTextObjectRecord.java @@ -50,7 +50,7 @@ public final class TestTextObjectRecord { ); @Test - public void testRead() { + void testRead() { RecordInputStream is =TestcaseRecordInputStream.create(simpleData); TextObjectRecord record = new TextObjectRecord(is); @@ -63,7 +63,7 @@ public final class TestTextObjectRecord { } @Test - public void testWrite() { + void testWrite() { HSSFRichTextString str = new HSSFRichTextString("Hello, World!"); TextObjectRecord record = new TextObjectRecord(); @@ -88,7 +88,7 @@ public final class TestTextObjectRecord { * Zero {@link ContinueRecord}s follow a {@link TextObjectRecord} if the text is empty */ @Test - public void testWriteEmpty() { + void testWriteEmpty() { HSSFRichTextString str = new HSSFRichTextString(""); TextObjectRecord record = new TextObjectRecord(); @@ -111,7 +111,7 @@ public final class TestTextObjectRecord { * Test that TextObjectRecord serializes logs records properly. */ @Test - public void testLongRecords() { + void testLongRecords() { int[] lengths = {1024, 2048, 4096, 8192, 16384}; //test against strings of different length for (int length : lengths) { StringBuilder buff = new StringBuilder(length); @@ -138,7 +138,7 @@ public final class TestTextObjectRecord { * Test cloning */ @Test - public void testClone() { + void testClone() { String text = "Hello, World"; HSSFRichTextString str = new HSSFRichTextString(text); @@ -183,7 +183,7 @@ public final class TestTextObjectRecord { ); @Test - public void testLinkFormula() { + void testLinkFormula() { RecordInputStream is = new RecordInputStream(new ByteArrayInputStream(linkData)); is.nextRecord(); TextObjectRecord rec = new TextObjectRecord(is); diff --git a/src/testcases/org/apache/poi/hssf/record/TestUnicodeNameRecord.java b/src/testcases/org/apache/poi/hssf/record/TestUnicodeNameRecord.java index 55f80ed678..355321fab6 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestUnicodeNameRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestUnicodeNameRecord.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestUnicodeNameRecord { @Test - public void testReadBook() throws IOException { + void testReadBook() throws IOException { // This bit used to crash try (HSSFWorkbook book = HSSFTestDataSamples.openSampleWorkbook("unicodeNameRecord.xls")) { HSSFSheet sheet = book.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/hssf/record/TestWriteAccessRecord.java b/src/testcases/org/apache/poi/hssf/record/TestWriteAccessRecord.java index 2187479fc9..04d49eca32 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestWriteAccessRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestWriteAccessRecord.java @@ -35,7 +35,7 @@ public final class TestWriteAccessRecord { + "20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20"; @Test - public void testMissingStringHeader_bug47001a() { + void testMissingStringHeader_bug47001a() { /* * Data taken from offset 0x0224 in * attachment 23468 from bugzilla 47001 @@ -66,7 +66,7 @@ public final class TestWriteAccessRecord { } @Test - public void testShortRecordWrittenByMSAccess() { + void testShortRecordWrittenByMSAccess() { /* * Data taken from two example files * ex42564-21435.xls diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java index f930fadf1d..d471a4983e 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java @@ -50,7 +50,7 @@ import org.junit.jupiter.api.Test; @SuppressWarnings("resource") public final class TestCFRecordsAggregate { @Test - public void testCFRecordsAggregate() { + void testCFRecordsAggregate() { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); @@ -121,7 +121,7 @@ public final class TestCFRecordsAggregate { * Make sure that the CF Header record is properly updated with the number of rules */ @Test - public void testNRules() { + void testNRules() { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); CellRangeAddress[] cellRanges = { @@ -142,7 +142,7 @@ public final class TestCFRecordsAggregate { } @Test - public void testCantMixTypes() { + void testCantMixTypes() { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); CellRangeAddress[] cellRanges = { diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java index 238f74e3b4..bcade8e406 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestColumnInfoRecordsAggregate { @Test - public void testGetRecordSize() { + void testGetRecordSize() { ColumnInfoRecordsAggregate agg = new ColumnInfoRecordsAggregate(); agg.insertColumn(createColInfo(1, 3)); agg.insertColumn(createColInfo(4, 7)); @@ -60,7 +60,7 @@ public final class TestColumnInfoRecordsAggregate { } @Test - public void testGroupColumns_bug45639() { + void testGroupColumns_bug45639() { ColumnInfoRecordsAggregate agg = new ColumnInfoRecordsAggregate(); agg.groupColumnRange( 7, 9, true); agg.groupColumnRange( 4, 12, true); @@ -83,7 +83,7 @@ public final class TestColumnInfoRecordsAggregate { * Check that an inner group remains hidden */ @Test - public void testHiddenAfterExpanding() { + void testHiddenAfterExpanding() { ColumnInfoRecordsAggregate agg = new ColumnInfoRecordsAggregate(); agg.groupColumnRange(1, 15, true); agg.groupColumnRange(4, 12, true); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java index d31f3d837f..d9eb109964 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestFormulaRecordAggregate.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public final class TestFormulaRecordAggregate { @Test - public void testBasic() { + void testBasic() { FormulaRecord f = new FormulaRecord(); f.setCachedResultTypeString(); StringRecord s = new StringRecord(); @@ -56,7 +56,7 @@ public final class TestFormulaRecordAggregate { * the extra record. POI should do the same. */ @Test - public void testExtraStringRecord_bug46213() { + void testExtraStringRecord_bug46213() { FormulaRecord fr = new FormulaRecord(); fr.setValue(2.0); StringRecord sr = new StringRecord(); @@ -71,7 +71,7 @@ public final class TestFormulaRecordAggregate { } @Test - public void testArrayFormulas() { + void testArrayFormulas() { int rownum = 4; int colnum = 4; diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java index c7822c28f0..aa33e44488 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestPageSettingsBlock.java @@ -62,7 +62,7 @@ import org.junit.jupiter.api.Test; */ public final class TestPageSettingsBlock { @Test - public void testPrintSetup_bug46548() { + void testPrintSetup_bug46548() { // PageSettingBlock in this file contains PLS (sid=x004D) record // followed by ContinueRecord (sid=x003C) HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex46548-23133.xls"); @@ -78,7 +78,7 @@ public final class TestPageSettingsBlock { * {@link PageSettingsBlock}. */ @Test - public void testHeaderFooter_bug46840() { + void testHeaderFooter_bug46840() { int rowIx = 5; int colIx = 6; @@ -115,7 +115,7 @@ public final class TestPageSettingsBlock { * Bug 46953 occurred because POI didn't handle late PSB records properly. */ @Test - public void testLateHeaderFooter_bug46953() { + void testLateHeaderFooter_bug46953() { int rowIx = 5; int colIx = 6; @@ -160,7 +160,7 @@ public final class TestPageSettingsBlock { * </ul> */ @Test - public void testLateMargins_bug47199() { + void testLateMargins_bug47199() { BottomMarginRecord bottomMargin = new BottomMarginRecord(); bottomMargin.setMargin(0.787F); @@ -194,7 +194,7 @@ public final class TestPageSettingsBlock { * was added while fixing bug 47199. All existing POI test samples comply with this requirement. */ @Test - public void testDuplicatePSBRecord_bug47199() { + void testDuplicatePSBRecord_bug47199() { // Hypothetical setup of PSB records which should cause POI to crash org.apache.poi.hssf.record.Record[] recs = { new HeaderRecord("&LSales Figures"), @@ -215,7 +215,7 @@ public final class TestPageSettingsBlock { * Excel in this regard. */ @Test - public void testMissingHeaderFooter() { + void testMissingHeaderFooter() { // initialise PSB with some records, but not the header / footer org.apache.poi.hssf.record.Record[] recs = { new HCenterRecord(), @@ -251,7 +251,7 @@ public final class TestPageSettingsBlock { * As of June 2009, PLS is still uninterpreted by POI */ @Test - public void testDuplicatePLS_bug47415() { + void testDuplicatePLS_bug47415() { Record plsA = new UnknownRecord(UnknownRecord.PLS_004D, HexRead.readFromString("BA AD F0 0D")); Record plsB = new UnknownRecord(UnknownRecord.PLS_004D, HexRead.readFromString("DE AD BE EF")); Record contB1 = new ContinueRecord(HexRead.readFromString("FE ED")); @@ -277,7 +277,7 @@ public final class TestPageSettingsBlock { } @Test - public void testDuplicateHeaderFooter_bug48026() { + void testDuplicateHeaderFooter_bug48026() { org.apache.poi.hssf.record.Record[] recs = { BOFRecord.createSheetBOF(), @@ -349,7 +349,7 @@ public final class TestPageSettingsBlock { } @Test - public void testDuplicateHeaderFooterInside_bug48026() { + void testDuplicateHeaderFooterInside_bug48026() { Record[] recs = { BOFRecord.createSheetBOF(), diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java index f0b2b671f6..8926ab0822 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestRowRecordsAggregate.java @@ -50,7 +50,7 @@ import org.junit.jupiter.api.Test; public final class TestRowRecordsAggregate { @Test - public void testRowGet() { + void testRowGet() { RowRecordsAggregate rra = new RowRecordsAggregate(); RowRecord rr = new RowRecord(4); rra.insertRow(rr); @@ -70,7 +70,7 @@ public final class TestRowRecordsAggregate { * {@link FormulaRecord}s that they apply to (and only once).<br> */ @Test - public void testArraysAndTables() throws Exception { + void testArraysAndTables() throws Exception { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("testArraysAndTables.xls")) { final List<org.apache.poi.hssf.record.Record> sheetRecs = new ArrayList<>(); wb.getSheetAt(0).getSheet().visitContainedRecords(sheetRecs::add, 0); @@ -134,7 +134,7 @@ public final class TestRowRecordsAggregate { * UnknownRecord} has the potential of being 'continued'. */ @Test - public void testUnknownContinue_bug46280() { + void testUnknownContinue_bug46280() { org.apache.poi.hssf.record.Record[] inRecs = { new RowRecord(0), new NumberRecord(), diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestSharedValueManager.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestSharedValueManager.java index 2790da2cc9..4c89b919cd 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestSharedValueManager.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestSharedValueManager.java @@ -63,7 +63,7 @@ public final class TestSharedValueManager { * would sometimes associate formulas in the overlapping region with the wrong shared formula */ @Test - public void testPartiallyOverlappingRanges() { + void testPartiallyOverlappingRanges() { for (int attempt=1; attempt < MAX_ATTEMPTS; attempt++) { @@ -87,7 +87,7 @@ public final class TestSharedValueManager { * but the symptoms are much uglier - serialization fails with {@link NullPointerException}.<br> */ @Test - public void testCompletelyOverlappedRanges() { + void testCompletelyOverlappedRanges() { for (int attempt=1; attempt < MAX_ATTEMPTS; attempt++) { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook(SAMPLE_FILE_NAME); @@ -112,7 +112,7 @@ public final class TestSharedValueManager { * These were not explored fully, but seem to be fixed now. */ @Test - public void testRecalculateFormulas47747() { + void testRecalculateFormulas47747() { /* * ex47747-sharedFormula.xls is a heavily cut-down version of the spreadsheet from @@ -141,7 +141,7 @@ public final class TestSharedValueManager { } @Test - public void testBug52527() { + void testBug52527() { HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("52527.xls"); HSSFWorkbook wb2 = HSSFTestDataSamples.writeOutAndReadBack(wb1); diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java index dbacbe4d6b..82d9765299 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java @@ -69,7 +69,7 @@ public final class TestValueRecordsAggregate { * as part of the value records */ @Test - public void testSharedFormula() { + void testSharedFormula() { List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); records.add(new FormulaRecord()); records.add(new SharedFormulaRecord()); @@ -110,7 +110,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testInsertCell() { + void testInsertCell() { assertEquals(0, getValueRecords().size()); BlankRecord blankRecord = newBlankRecord(); @@ -119,7 +119,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testRemoveCell() { + void testRemoveCell() { BlankRecord blankRecord1 = newBlankRecord(); valueRecord.insertCell( blankRecord1 ); BlankRecord blankRecord2 = newBlankRecord(); @@ -131,7 +131,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testGetPhysicalNumberOfCells() { + void testGetPhysicalNumberOfCells() { assertEquals(0, valueRecord.getPhysicalNumberOfCells()); BlankRecord blankRecord1 = newBlankRecord(); valueRecord.insertCell( blankRecord1 ); @@ -141,7 +141,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testGetFirstCellNum() { + void testGetFirstCellNum() { assertEquals( -1, valueRecord.getFirstCellNum() ); valueRecord.insertCell( newBlankRecord( 2, 2 ) ); assertEquals( 2, valueRecord.getFirstCellNum() ); @@ -154,7 +154,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testGetLastCellNum() { + void testGetLastCellNum() { assertEquals( -1, valueRecord.getLastCellNum() ); valueRecord.insertCell( newBlankRecord( 2, 2 ) ); assertEquals( 2, valueRecord.getLastCellNum() ); @@ -187,7 +187,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testSerialize() { + void testSerialize() { byte[] expectedArray = HexRead.readFromString("" + "06 00 16 00 " // Formula + "01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " @@ -246,7 +246,7 @@ public final class TestValueRecordsAggregate { * */ @Test - public void testSpuriousSharedFormulaFlag() throws Exception { + void testSpuriousSharedFormulaFlag() throws Exception { long actualCRC = getFileCRC(HSSFTestDataSamples.openSampleFileStream(ABNORMAL_SHARED_FORMULA_FLAG_TEST_FILE)); long expectedCRC = 2277445406L; @@ -317,7 +317,7 @@ public final class TestValueRecordsAggregate { } @Test - public void testRemoveNewRow_bug46312() throws IOException { + void testRemoveNewRow_bug46312() throws IOException { // To make bug occur, rowIndex needs to be >= ValueRecordsAggregate.records.length int rowIndex = 30; @@ -341,7 +341,7 @@ public final class TestValueRecordsAggregate { * are use appropriately */ @Test - public void testMultipleBlanks() { + void testMultipleBlanks() { BlankRecord brA2 = newBlankRecord(0, 1); BlankRecord brB2 = newBlankRecord(1, 1); BlankRecord brC2 = newBlankRecord(2, 1); diff --git a/src/testcases/org/apache/poi/hssf/record/cf/TestCellRange.java b/src/testcases/org/apache/poi/hssf/record/cf/TestCellRange.java index aa59f19b88..61921d6d2e 100644 --- a/src/testcases/org/apache/poi/hssf/record/cf/TestCellRange.java +++ b/src/testcases/org/apache/poi/hssf/record/cf/TestCellRange.java @@ -70,7 +70,7 @@ public final class TestCellRange { } @Test - public void testContainsMethod() + void testContainsMethod() { CellRangeAddress [] ranges = sampleRanges; for(int i=0; i!=ranges.length;i++) @@ -96,7 +96,7 @@ public final class TestCellRange { private static final CellRangeAddress box5 = createCR( 1, 3, 1,3); @Test - public void testHasSharedBorderMethod() { + void testHasSharedBorderMethod() { assertFalse(CellRangeUtil.hasExactSharedBorder(col1, col1)); assertFalse(CellRangeUtil.hasExactSharedBorder(col2, col2)); assertTrue(CellRangeUtil.hasExactSharedBorder(col1, col2)); @@ -139,7 +139,7 @@ public final class TestCellRange { } @Test - public void testIntersectMethod() { + void testIntersectMethod() { assertEquals(CellRangeUtil.OVERLAP, CellRangeUtil.intersect(box0, box5)); assertEquals(CellRangeUtil.OVERLAP, CellRangeUtil.intersect(box5, box0)); assertEquals(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.intersect(box1, box4)); @@ -166,7 +166,7 @@ public final class TestCellRange { * =$C:$IV,$B$1:$B$8,$B$10:$B$65536,$A:$A */ @Test - public void testCreate() { + void testCreate() { CellRangeAddress cr = createCR(0, -1, 2, 255); // $C:$IV assertFalse(cr.isFullRowRange(), "isFullRowRange"); @@ -181,7 +181,7 @@ public final class TestCellRange { } @Test - public void testNumberOfCells() { + void testNumberOfCells() { assertEquals(1, oneCell.getNumberOfCells()); assertEquals(100, box9x9.getNumberOfCells()); assertEquals(121, box10to20c.getNumberOfCells()); @@ -189,7 +189,7 @@ public final class TestCellRange { @SuppressWarnings("RedundantArrayCreation") @Test - public void testMergeCellRanges() { + void testMergeCellRanges() { // no result on empty cellRangeTest(new String[]{ }); @@ -222,13 +222,13 @@ public final class TestCellRange { @SuppressWarnings("RedundantArrayCreation") @Test - public void testMergeCellRanges55380() { + void testMergeCellRanges55380() { cellRangeTest(new String[]{"C1:D2", "C2:C3"}, new String[] {"C1:D2", "C2:C3"}); cellRangeTest(new String[]{"A1:C3", "B2:D2"}, new String[] {"A1:C3", "B2:D2"}); cellRangeTest(new String[]{"C9:D30", "C7:C31"}, new String[] {"C9:D30", "C7:C31"}); } -// public void testResolveRangeOverlap() { +// void testResolveRangeOverlap() { // resolveRangeOverlapTest("C1:D2", "C2:C3"); // } @@ -258,7 +258,7 @@ public final class TestCellRange { } @Test - public void testValueOf() { + void testValueOf() { CellRangeAddress cr1 = CellRangeAddress.valueOf("A1:B1"); assertEquals(0, cr1.getFirstColumn()); assertEquals(0, cr1.getFirstRow()); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAreaFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAreaFormatRecord.java index c8684fd20d..fe81173573 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAreaFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAreaFormatRecord.java @@ -43,7 +43,7 @@ public final class TestAreaFormatRecord { }; @Test - public void testLoad() { + void testLoad() { AreaFormatRecord record = new AreaFormatRecord(TestcaseRecordInputStream.create(0x100a, data)); assertEquals( 0xFFFFFF, record.getForegroundColor()); assertEquals( 0x000000, record.getBackgroundColor()); @@ -60,7 +60,7 @@ public final class TestAreaFormatRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AreaFormatRecord record = new AreaFormatRecord(); record.setForegroundColor( 0xFFFFFF ); record.setBackgroundColor( 0x000000 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAreaRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAreaRecord.java index 0143a3fe0b..971030de6c 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAreaRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAreaRecord.java @@ -37,7 +37,7 @@ public final class TestAreaRecord { }; @Test - public void testLoad() { + void testLoad() { AreaRecord record = new AreaRecord(TestcaseRecordInputStream.create(0x101A, data)); assertEquals( 2, record.getFormatFlags()); @@ -50,7 +50,7 @@ public final class TestAreaRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AreaRecord record = new AreaRecord(); record.setStacked( false ); record.setDisplayAsPercentage( true ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisLineFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisLineFormatRecord.java index d7cd652e46..d59ff0f9c8 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisLineFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisLineFormatRecord.java @@ -35,7 +35,7 @@ public final class TestAxisLineFormatRecord { }; @Test - public void testLoad() { + void testLoad() { AxisLineFormatRecord record = new AxisLineFormatRecord(TestcaseRecordInputStream.create(0x1021, data)); assertEquals( AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE, record.getAxisType()); @@ -44,7 +44,7 @@ public final class TestAxisLineFormatRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AxisLineFormatRecord record = new AxisLineFormatRecord(); record.setAxisType( AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisOptionsRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisOptionsRecord.java index 906544cf0a..f4da9d33d3 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisOptionsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisOptionsRecord.java @@ -40,7 +40,7 @@ public final class TestAxisOptionsRecord { }; @Test - public void testLoad() { + void testLoad() { AxisOptionsRecord record = new AxisOptionsRecord(TestcaseRecordInputStream.create(0x1062, data)); assertEquals( 0, record.getMinimumCategory()); assertEquals( 0, record.getMaximumCategory()); @@ -65,7 +65,7 @@ public final class TestAxisOptionsRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AxisOptionsRecord record = new AxisOptionsRecord(); record.setMinimumCategory( (short)0 ); record.setMaximumCategory( (short)0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisParentRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisParentRecord.java index 581611161f..8aecd9fb6a 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisParentRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisParentRecord.java @@ -39,7 +39,7 @@ public final class TestAxisParentRecord { }; @Test - public void testLoad() { + void testLoad() { AxisParentRecord record = new AxisParentRecord(TestcaseRecordInputStream.create(0x1041, data)); assertEquals( AxisParentRecord.AXIS_TYPE_MAIN, record.getAxisType()); assertEquals( 0x021d, record.getX()); @@ -52,7 +52,7 @@ public final class TestAxisParentRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AxisParentRecord record = new AxisParentRecord(); record.setAxisType( AxisParentRecord.AXIS_TYPE_MAIN ); record.setX( 0x021d ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisRecord.java index 7065c50f89..3471aad2ff 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisRecord.java @@ -39,7 +39,7 @@ public final class TestAxisRecord { }; @Test - public void testLoad() { + void testLoad() { AxisRecord record = new AxisRecord(TestcaseRecordInputStream.create(0x101d, data)); assertEquals( AxisRecord.AXIS_TYPE_CATEGORY_OR_X_AXIS, record.getAxisType()); assertEquals( 0, record.getReserved1()); @@ -52,7 +52,7 @@ public final class TestAxisRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AxisRecord record = new AxisRecord(); record.setAxisType( AxisRecord.AXIS_TYPE_CATEGORY_OR_X_AXIS ); record.setReserved1( 0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisUsedRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisUsedRecord.java index 13bc7826e7..3c4cfeb1f4 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestAxisUsedRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestAxisUsedRecord.java @@ -35,7 +35,7 @@ public final class TestAxisUsedRecord { }; @Test - public void testLoad() { + void testLoad() { AxisUsedRecord record = new AxisUsedRecord(TestcaseRecordInputStream.create(0x1046, data)); assertEquals( 1, record.getNumAxis()); @@ -44,7 +44,7 @@ public final class TestAxisUsedRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { AxisUsedRecord record = new AxisUsedRecord(); record.setNumAxis( (short)1 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestBarRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestBarRecord.java index 911e72828b..6133b146e8 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestBarRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestBarRecord.java @@ -38,7 +38,7 @@ public final class TestBarRecord { }; @Test - public void testLoad() { + void testLoad() { BarRecord record = new BarRecord(TestcaseRecordInputStream.create(0x1017, data)); assertEquals( 0, record.getBarSpace()); assertEquals( 0x96, record.getCategorySpace()); @@ -53,7 +53,7 @@ public final class TestBarRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { BarRecord record = new BarRecord(); record.setBarSpace( (short)0 ); record.setCategorySpace( (short)0x96 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestCategorySeriesAxisRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestCategorySeriesAxisRecord.java index 52ea943d21..6a2ea9c6b4 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestCategorySeriesAxisRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestCategorySeriesAxisRecord.java @@ -40,7 +40,7 @@ public final class TestCategorySeriesAxisRecord { }; @Test - public void testLoad() { + void testLoad() { CategorySeriesAxisRecord record = new CategorySeriesAxisRecord(TestcaseRecordInputStream.create(0x1020, data)); assertEquals( 1, record.getCrossingPoint()); assertEquals( 1, record.getLabelFrequency()); @@ -55,7 +55,7 @@ public final class TestCategorySeriesAxisRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { CategorySeriesAxisRecord record = new CategorySeriesAxisRecord(); record.setCrossingPoint( (short)1 ); record.setLabelFrequency( (short)1 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestChartFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestChartFormatRecord.java index ce6ede8437..51652848c9 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestChartFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestChartFormatRecord.java @@ -45,7 +45,7 @@ public final class TestChartFormatRecord { * The correct size of a {@link ChartFormatRecord} is 20 bytes (not including header). */ @Test - public void testLoad() { + void testLoad() { RecordInputStream in = TestcaseRecordInputStream.create(data); ChartFormatRecord record = new ChartFormatRecord(in); assertNotEquals(2, in.remaining(), "Identified bug 44693d"); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestChartRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestChartRecord.java index 621fa7676d..bfe73a5056 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestChartRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestChartRecord.java @@ -38,7 +38,7 @@ public final class TestChartRecord { }; @Test - public void testLoad() { + void testLoad() { ChartRecord record = new ChartRecord(TestcaseRecordInputStream.create(0x1002, data)); assertEquals( 0, record.getX()); assertEquals( 0, record.getY()); @@ -50,7 +50,7 @@ public final class TestChartRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { ChartRecord record = new ChartRecord(); record.setX( 0 ); record.setY( 0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java index eb3894ba4a..29c4ed46b8 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestChartTitleFormatRecord.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; public final class TestChartTitleFormatRecord { @Test - public void testRecord() throws Exception { + void testRecord() throws Exception { POIFSFileSystem fs = new POIFSFileSystem( HSSFTestDataSamples.getSampleFile("WithFormattedGraphTitle.xls")); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestDatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestDatRecord.java index 71b0c6901c..13af42e0c8 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestDatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestDatRecord.java @@ -37,7 +37,7 @@ public final class TestDatRecord { }; @Test - public void testLoad() { + void testLoad() { DatRecord record = new DatRecord(TestcaseRecordInputStream.create(0x1063, data)); assertEquals( 0xD, record.getOptions()); assertTrue(record.isHorizontalBorder()); @@ -50,7 +50,7 @@ public final class TestDatRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { DatRecord record = new DatRecord(); record.setHorizontalBorder( true ); record.setVerticalBorder( false ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestDataFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestDataFormatRecord.java index b304166a5d..0a0bc16ee0 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestDataFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestDataFormatRecord.java @@ -39,7 +39,7 @@ public final class TestDataFormatRecord { }; @Test - public void testLoad() { + void testLoad() { DataFormatRecord record = new DataFormatRecord(TestcaseRecordInputStream.create(0x1006, data)); assertEquals( (short)0xFFFF, record.getPointNumber()); assertEquals( 0, record.getSeriesIndex()); @@ -52,7 +52,7 @@ public final class TestDataFormatRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { DataFormatRecord record = new DataFormatRecord(); record.setPointNumber( (short)0xFFFF ); record.setSeriesIndex( (short)0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestDefaultDataLabelTextPropertiesRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestDefaultDataLabelTextPropertiesRecord.java index fe54c3d6c2..0eccb1ef4c 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestDefaultDataLabelTextPropertiesRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestDefaultDataLabelTextPropertiesRecord.java @@ -35,7 +35,7 @@ public final class TestDefaultDataLabelTextPropertiesRecord { }; @Test - public void testLoad() { + void testLoad() { DefaultDataLabelTextPropertiesRecord record = new DefaultDataLabelTextPropertiesRecord(TestcaseRecordInputStream.create(0x1024, data)); assertEquals( 2, record.getCategoryDataType()); @@ -45,7 +45,7 @@ public final class TestDefaultDataLabelTextPropertiesRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { DefaultDataLabelTextPropertiesRecord record = new DefaultDataLabelTextPropertiesRecord(); record.setCategoryDataType( (short)2 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestFontBasisRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestFontBasisRecord.java index ce95d58328..e0e0916f43 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestFontBasisRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestFontBasisRecord.java @@ -39,7 +39,7 @@ public final class TestFontBasisRecord { }; @Test - public void testLoad() { + void testLoad() { FontBasisRecord record = new FontBasisRecord(TestcaseRecordInputStream.create(0x1060, data)); assertEquals( 0x1a28, record.getXBasis()); assertEquals( 0x0f9c, record.getYBasis()); @@ -52,7 +52,7 @@ public final class TestFontBasisRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { FontBasisRecord record = new FontBasisRecord(); record.setXBasis( (short)0x1a28 ); record.setYBasis( (short)0x0f9c ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestFontIndexRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestFontIndexRecord.java index 0bb9d954e7..e7ec924ca3 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestFontIndexRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestFontIndexRecord.java @@ -35,7 +35,7 @@ public final class TestFontIndexRecord { }; @Test - public void testLoad() { + void testLoad() { FontIndexRecord record = new FontIndexRecord(TestcaseRecordInputStream.create(0x1026, data)); assertEquals( 5, record.getFontIndex()); @@ -45,7 +45,7 @@ public final class TestFontIndexRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { FontIndexRecord record = new FontIndexRecord(); record.setFontIndex( (short)5 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestFrameRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestFrameRecord.java index 86ab6691fc..57c8174e33 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestFrameRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestFrameRecord.java @@ -38,7 +38,7 @@ public final class TestFrameRecord { }; @Test - public void testLoad() { + void testLoad() { FrameRecord record = new FrameRecord(TestcaseRecordInputStream.create(0x1032, data)); assertEquals( FrameRecord.BORDER_TYPE_REGULAR, record.getBorderType()); assertEquals( 2, record.getOptions()); @@ -50,7 +50,7 @@ public final class TestFrameRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { FrameRecord record = new FrameRecord(); record.setBorderType( FrameRecord.BORDER_TYPE_REGULAR ); record.setOptions( (short)2 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestLegendRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestLegendRecord.java index 1965bcf776..fba93251aa 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestLegendRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestLegendRecord.java @@ -36,7 +36,7 @@ public final class TestLegendRecord { (byte) 0x01, (byte) 0x1F, (byte) 0x00 }; @Test - public void testLoad() { + void testLoad() { LegendRecord record = new LegendRecord(TestcaseRecordInputStream.create(0x1015, data)); assertEquals(0xe76, record.getXAxisUpperLeft()); @@ -64,7 +64,7 @@ public final class TestLegendRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { LegendRecord record = new LegendRecord(); record.setXAxisUpperLeft(0xe76); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestLineFormatRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestLineFormatRecord.java index dd2e5a60c5..a03b7be146 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestLineFormatRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestLineFormatRecord.java @@ -41,7 +41,7 @@ public final class TestLineFormatRecord { }; @Test - public void testLoad() { + void testLoad() { LineFormatRecord record = new LineFormatRecord(TestcaseRecordInputStream.create(0x1007, data)); assertEquals( 0, record.getLineColor()); assertEquals( 0, record.getLinePattern()); @@ -56,7 +56,7 @@ public final class TestLineFormatRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { LineFormatRecord record = new LineFormatRecord(); record.setLineColor( 0 ); record.setLinePattern( (short)0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestLinkedDataRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestLinkedDataRecord.java index 91bb43f998..977a446c02 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestLinkedDataRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestLinkedDataRecord.java @@ -158,7 +158,7 @@ recordid = 0x1051, size =8 }; @Test - public void testLoad() { + void testLoad() { LinkedDataRecord record = new LinkedDataRecord(TestcaseRecordInputStream.create(0x1051, data)); assertEquals( LinkedDataRecord.LINK_TYPE_VALUES, record.getLinkType()); assertEquals( LinkedDataRecord.REFERENCE_TYPE_WORKSHEET, record.getReferenceType()); @@ -177,7 +177,7 @@ recordid = 0x1051, size =8 @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { LinkedDataRecord record = new LinkedDataRecord(); record.setLinkType( LinkedDataRecord.LINK_TYPE_VALUES ); record.setReferenceType( LinkedDataRecord.REFERENCE_TYPE_WORKSHEET ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestNumberFormatIndexRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestNumberFormatIndexRecord.java index b2fe6db59c..3c0ad353f2 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestNumberFormatIndexRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestNumberFormatIndexRecord.java @@ -35,7 +35,7 @@ public final class TestNumberFormatIndexRecord { }; @Test - public void testLoad() { + void testLoad() { NumberFormatIndexRecord record = new NumberFormatIndexRecord(TestcaseRecordInputStream.create(0x104e, data)); assertEquals( 5, record.getFormatIndex()); @@ -44,7 +44,7 @@ public final class TestNumberFormatIndexRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { NumberFormatIndexRecord record = new NumberFormatIndexRecord(); record.setFormatIndex( (short)5 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestObjectLinkRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestObjectLinkRecord.java index 1641270e37..8d10c0c2cf 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestObjectLinkRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestObjectLinkRecord.java @@ -35,7 +35,7 @@ public final class TestObjectLinkRecord { }; @Test - public void testLoad() { + void testLoad() { ObjectLinkRecord record = new ObjectLinkRecord(TestcaseRecordInputStream.create(0x1027, data)); assertEquals( (short)3, record.getAnchorId()); @@ -47,7 +47,7 @@ public final class TestObjectLinkRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { ObjectLinkRecord record = new ObjectLinkRecord(); record.setAnchorId( (short)3 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestPlotAreaRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestPlotAreaRecord.java index 119cf47117..badc114313 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestPlotAreaRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestPlotAreaRecord.java @@ -34,14 +34,14 @@ public final class TestPlotAreaRecord { }; @Test - public void testLoad() { + void testLoad() { PlotAreaRecord record = new PlotAreaRecord(TestcaseRecordInputStream.create(0x1035, data)); assertEquals( 4, record.getRecordSize() ); } @Test - public void testStore() { + void testStore() { PlotAreaRecord record = new PlotAreaRecord(); byte [] recordBytes = record.serialize(); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestPlotGrowthRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestPlotGrowthRecord.java index 235d144bbc..444dbf659a 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestPlotGrowthRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestPlotGrowthRecord.java @@ -36,7 +36,7 @@ public final class TestPlotGrowthRecord { }; @Test - public void testLoad() { + void testLoad() { PlotGrowthRecord record = new PlotGrowthRecord(TestcaseRecordInputStream.create(0x1064, data)); assertEquals( 65536, record.getHorizontalScale()); @@ -47,7 +47,7 @@ public final class TestPlotGrowthRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { PlotGrowthRecord record = new PlotGrowthRecord(); record.setHorizontalScale( 65536 ); record.setVerticalScale( 65536 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesChartGroupIndexRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesChartGroupIndexRecord.java index 27aec2c93b..162ac4b396 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesChartGroupIndexRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesChartGroupIndexRecord.java @@ -35,7 +35,7 @@ public final class TestSeriesChartGroupIndexRecord { }; @Test - public void testLoad() { + void testLoad() { SeriesChartGroupIndexRecord record = new SeriesChartGroupIndexRecord(TestcaseRecordInputStream.create(0x1045, data)); assertEquals( 0, record.getChartGroupIndex()); @@ -44,7 +44,7 @@ public final class TestSeriesChartGroupIndexRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SeriesChartGroupIndexRecord record = new SeriesChartGroupIndexRecord(); record.setChartGroupIndex( (short)0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesIndexRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesIndexRecord.java index 92c54e4a47..ddd1a01fad 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesIndexRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesIndexRecord.java @@ -35,7 +35,7 @@ public final class TestSeriesIndexRecord { }; @Test - public void testLoad() { + void testLoad() { SeriesIndexRecord record = new SeriesIndexRecord(TestcaseRecordInputStream.create(0x1065, data)); assertEquals( (short)3, record.getIndex()); @@ -44,7 +44,7 @@ public final class TestSeriesIndexRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SeriesIndexRecord record = new SeriesIndexRecord(); record.setIndex( (short)3 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesLabelsRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesLabelsRecord.java index 1454da7474..b0e51325a5 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesLabelsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesLabelsRecord.java @@ -37,7 +37,7 @@ public final class TestSeriesLabelsRecord { }; @Test - public void testLoad() { + void testLoad() { SeriesLabelsRecord record = new SeriesLabelsRecord(TestcaseRecordInputStream.create(0x100c, data)); assertEquals( 3, record.getFormatFlags()); assertTrue(record.isShowActual()); @@ -52,7 +52,7 @@ public final class TestSeriesLabelsRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SeriesLabelsRecord record = new SeriesLabelsRecord(); record.setShowActual( true ); record.setShowPercent( true ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesListRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesListRecord.java index 49cf366d84..ad8a3f2617 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesListRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesListRecord.java @@ -35,7 +35,7 @@ public final class TestSeriesListRecord { }; @Test - public void testLoad() { + void testLoad() { SeriesListRecord record = new SeriesListRecord(TestcaseRecordInputStream.create(0x1016, data)); assertEquals( (short)0x2001, record.getSeriesNumbers()[0]); @@ -47,7 +47,7 @@ public final class TestSeriesListRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SeriesListRecord record = new SeriesListRecord(new short[] { (short)0x2001, (short)0xf0ff } ); byte [] recordBytes = record.serialize(); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesRecord.java index 2fd3d4384c..5f76b07a39 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesRecord.java @@ -40,7 +40,7 @@ public final class TestSeriesRecord { }; @Test - public void testLoad() { + void testLoad() { SeriesRecord record = new SeriesRecord(TestcaseRecordInputStream.create(0x1003, data)); assertEquals( SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC, record.getCategoryDataType()); assertEquals( SeriesRecord.VALUES_DATA_TYPE_NUMERIC, record.getValuesDataType()); @@ -55,7 +55,7 @@ public final class TestSeriesRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SeriesRecord record = new SeriesRecord(); record.setCategoryDataType( SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC ); record.setValuesDataType( SeriesRecord.VALUES_DATA_TYPE_NUMERIC ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesTextRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesTextRecord.java index 59dcb4b2ac..4e698a5c9e 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesTextRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSeriesTextRecord.java @@ -35,7 +35,7 @@ public final class TestSeriesTextRecord { .readFromString("00 00 0C 00 56 61 6C 75 65 20 4E 75 6D 62 65 72"); @Test - public void testLoad() { + void testLoad() { SeriesTextRecord record = new SeriesTextRecord(TestcaseRecordInputStream.create(0x100d, SIMPLE_DATA)); assertEquals((short) 0, record.getId()); @@ -46,7 +46,7 @@ public final class TestSeriesTextRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SeriesTextRecord record = new SeriesTextRecord(); record.setId(0); @@ -57,7 +57,7 @@ public final class TestSeriesTextRecord { } @Test - public void testReserializeLongTitle() { + void testReserializeLongTitle() { // Hex dump from bug 45784 attachment 22560 streamOffset=0x0CD1 byte[] data = HexRead.readFromString( "00 00, " diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestSheetPropertiesRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestSheetPropertiesRecord.java index 2fc545854e..b918c7d2a2 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestSheetPropertiesRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestSheetPropertiesRecord.java @@ -40,7 +40,7 @@ public final class TestSheetPropertiesRecord { }; @Test - public void testLoad() { + void testLoad() { RecordInputStream in = TestcaseRecordInputStream.create(0x1044, data); SheetPropertiesRecord record = new SheetPropertiesRecord(in); assertNotEquals(1, in.remaining(), "Identified bug 44693c"); @@ -58,7 +58,7 @@ public final class TestSheetPropertiesRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { SheetPropertiesRecord record = new SheetPropertiesRecord(); record.setChartTypeManuallyFormatted( false ); record.setPlotVisibleOnly( true ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestTextRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestTextRecord.java index 99de874822..bcedd6e648 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestTextRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestTextRecord.java @@ -48,7 +48,7 @@ public final class TestTextRecord { }; @Test - public void testLoad() { + void testLoad() { TextRecord record = new TextRecord(TestcaseRecordInputStream.create(0x1025, data)); assertEquals( TextRecord.HORIZONTAL_ALIGNMENT_CENTER, record.getHorizontalAlignment()); assertEquals( TextRecord.VERTICAL_ALIGNMENT_CENTER, record.getVerticalAlignment()); @@ -83,7 +83,7 @@ public final class TestTextRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { TextRecord record = new TextRecord(); record.setHorizontalAlignment( TextRecord.HORIZONTAL_ALIGNMENT_CENTER ); record.setVerticalAlignment( TextRecord.VERTICAL_ALIGNMENT_CENTER ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestTickRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestTickRecord.java index 7e5395f583..c6ab270fbd 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestTickRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestTickRecord.java @@ -42,7 +42,7 @@ public final class TestTickRecord { }; @Test - public void testLoad() { + void testLoad() { TickRecord record = new TickRecord(TestcaseRecordInputStream.create(0x101e, data)); assertEquals( (byte)2, record.getMajorTickType()); assertEquals( (byte)0, record.getMinorTickType()); @@ -65,7 +65,7 @@ public final class TestTickRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { TickRecord record = new TickRecord(); record.setMajorTickType( (byte)2 ); record.setMinorTickType( (byte)0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestUnitsRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestUnitsRecord.java index 5996f909c5..33973f3ab2 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestUnitsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestUnitsRecord.java @@ -35,7 +35,7 @@ public final class TestUnitsRecord { }; @Test - public void testLoad() { + void testLoad() { UnitsRecord record = new UnitsRecord(TestcaseRecordInputStream.create(0x1001, data)); assertEquals( 0, record.getUnits()); @@ -45,7 +45,7 @@ public final class TestUnitsRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { UnitsRecord record = new UnitsRecord(); record.setUnits( (short)0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/chart/TestValueRangeRecord.java b/src/testcases/org/apache/poi/hssf/record/chart/TestValueRangeRecord.java index d0314e1ae5..f0bfff2300 100644 --- a/src/testcases/org/apache/poi/hssf/record/chart/TestValueRangeRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/chart/TestValueRangeRecord.java @@ -42,7 +42,7 @@ public final class TestValueRangeRecord { }; @Test - public void testLoad() { + void testLoad() { ValueRangeRecord record = new ValueRangeRecord(TestcaseRecordInputStream.create(0x101f, data)); assertEquals( 0.0, record.getMinimumAxisValue(), 0.001); @@ -66,7 +66,7 @@ public final class TestValueRangeRecord { @SuppressWarnings("squid:S2699") @Test - public void testStore() { + void testStore() { ValueRangeRecord record = new ValueRangeRecord(); record.setMinimumAxisValue( 0 ); record.setMaximumAxisValue( 0 ); diff --git a/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java b/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java index 314fbdd686..e810bb94b2 100644 --- a/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public final class TestExtendedPivotTableViewFieldsRecord { @Test - public void testSubNameNotPresent_bug46693() { + void testSubNameNotPresent_bug46693() { // This data came from attachment 23347 of bug 46693 at offset 0xAA43 byte[] data = HexRead.readFromString( "00 01 14 00" + // BIFF header @@ -46,7 +46,7 @@ public final class TestExtendedPivotTableViewFieldsRecord { @SuppressWarnings("squid:S2699") @Test - public void testOlderFormat_bug46918() { + void testOlderFormat_bug46918() { // There are 10 SXVDEX records in the file (not uploaded) that originated bugzilla 46918 // They all had the following hex encoding: byte[] data = HexRead.readFromString("00 01 0A 00 1E 14 00 0A FF FF FF FF 00 00"); diff --git a/src/testcases/org/apache/poi/hssf/record/pivot/TestPageItemRecord.java b/src/testcases/org/apache/poi/hssf/record/pivot/TestPageItemRecord.java index e9f7ff1f36..afebcc4ec5 100644 --- a/src/testcases/org/apache/poi/hssf/record/pivot/TestPageItemRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/pivot/TestPageItemRecord.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; */ public final class TestPageItemRecord { @Test - public void testMoreThanOneInfoItem_bug46917() { + void testMoreThanOneInfoItem_bug46917() { byte[] data = HexRead.readFromString("01 02 03 04 05 06 07 08 09 0A 0B 0C"); RecordInputStream in = TestcaseRecordInputStream.create(PageItemRecord.sid, data); PageItemRecord rec = new PageItemRecord(in); @@ -43,7 +43,7 @@ public final class TestPageItemRecord { } @Test - public void testSerialize() { + void testSerialize() { confirmSerialize("01 02 03 04 05 06"); confirmSerialize("01 02 03 04 05 06 07 08 09 0A 0B 0C"); confirmSerialize("01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12"); diff --git a/src/testcases/org/apache/poi/hssf/record/pivot/TestViewFieldsRecord.java b/src/testcases/org/apache/poi/hssf/record/pivot/TestViewFieldsRecord.java index c51da99e2e..a0898efa64 100644 --- a/src/testcases/org/apache/poi/hssf/record/pivot/TestViewFieldsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/pivot/TestViewFieldsRecord.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public final class TestViewFieldsRecord { @Test - public void testUnicodeFlag_bug46693() { + void testUnicodeFlag_bug46693() { byte[] data = HexRead.readFromString("01 00 01 00 01 00 04 00 05 00 00 6D 61 72 63 6F"); RecordInputStream in = TestcaseRecordInputStream.create(ViewFieldsRecord.sid, data); ViewFieldsRecord rec = new ViewFieldsRecord(in); @@ -43,7 +43,7 @@ public final class TestViewFieldsRecord { } @Test - public void testSerialize() { + void testSerialize() { // This hex data was produced by changing the 'Custom Name' property, // available under 'Field Settings' from the 'PivotTable Field List' (Excel 2007) confirmSerialize("00 00 01 00 01 00 00 00 FF FF"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java index 6f51abef42..f8f0b52e1c 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java @@ -37,14 +37,14 @@ import org.junit.jupiter.api.Test; public final class TestBug42464 { @Test - public void testOKFile() throws Exception { + void testOKFile() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("42464-ExpPtg-ok.xls"); process(wb); wb.close(); } @Test - public void testExpSharedBadFile() throws Exception { + void testExpSharedBadFile() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("42464-ExpPtg-bad.xls"); process(wb); wb.close(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 77195a5115..1e48d3c2d9 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -798,7 +798,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { */ @Disabled("For now, blows up with an exception from ExtPtg") @Test - public void test43623() throws Exception { + void test43623() throws Exception { try (HSSFWorkbook wb1 = openSampleWorkbook("43623.xls")) { assertEquals(1, wb1.getNumberOfSheets()); @@ -1855,7 +1855,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { * eg =SUM($Sheet2.A1:$Sheet3.A1) */ @Test - public void test48703() throws Exception { + void test48703() throws Exception { try (HSSFWorkbook wb = openSampleWorkbook("48703.xls")) { assertEquals(3, wb.getNumberOfSheets()); @@ -2266,7 +2266,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test57163() throws IOException { + void test57163() throws IOException { simpleTest("57163.xls", wb -> { while (wb.getNumberOfSheets() > 1) { wb.removeSheetAt(1); @@ -2275,7 +2275,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test48043() throws IOException { + void test48043() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("56325a.xls")) { wb.removeSheetAt(2); @@ -2301,7 +2301,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test57925() throws IOException { + void test57925() throws IOException { try (Workbook wb = openSampleWorkbook("57925.xls")) { wb.getCreationHelper().createFormulaEvaluator().evaluateAll(); DataFormatter df = new DataFormatter(); @@ -2316,7 +2316,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test46515() throws IOException { + void test46515() throws IOException { try (Workbook wb = openSampleWorkbook("46515.xls")) { // Get structure from webservice @@ -2349,7 +2349,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test55668() throws IOException { + void test55668() throws IOException { try (Workbook wb = openSampleWorkbook("55668.xls")) { Sheet sheet = wb.getSheetAt(0); @@ -2369,7 +2369,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test55982() throws IOException { + void test55982() throws IOException { simpleTest("55982.xls", wb -> assertNotNull(wb.cloneSheet(1))); } @@ -2377,7 +2377,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { * Test generator of ids for the CommonObjectDataSubRecord record. */ @Test - public void test51332() { + void test51332() { HSSFClientAnchor anchor = new HSSFClientAnchor(); HSSFSimpleShape shape; CommonObjectDataSubRecord cmo; @@ -2401,7 +2401,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { // As of POI 3.15 beta 2, LibreOffice does not display the diagonal border while it does display the bottom border // I have not checked Excel to know if this is a LibreOffice or a POI problem. @Test - public void test53564() throws IOException { + void test53564() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("Page 1"); final short BLUE = 30; @@ -2438,7 +2438,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test61287() throws IOException { + void test61287() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("61287.xls"); ExcelExtractor ex = new ExcelExtractor(wb)) { String text = ex.getText(); @@ -2447,7 +2447,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test61300() throws Exception { + void test61300() throws Exception { try (POIFSFileSystem poifs = new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream("61300.xls"))) { DocumentEntry entry = @@ -2462,7 +2462,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test51262() throws IOException { + void test51262() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("51262.xls")) { Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(2); @@ -2490,7 +2490,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test60460() throws IOException { + void test60460() throws IOException { try (final Workbook wb = openSampleWorkbook("60460.xls")) { assertEquals(2, wb.getAllNames().size()); @@ -2507,7 +2507,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { } @Test - public void test63819() throws IOException { + void test63819() throws IOException { LocaleUtil.setUserLocale(Locale.UK); try { simpleTest("63819.xls", null); @@ -2520,7 +2520,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { * Test that VALUE behaves properly as array function and its result is handled by aggregate function */ @Test - public void testValueAsArrayFunction() throws IOException { + void testValueAsArrayFunction() throws IOException { try (final Workbook wb = openSampleWorkbook("TestValueAsArrayFunction.xls")) { wb.getCreationHelper().createFormulaEvaluator().evaluateAll(); Sheet sheet = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java index 7e2ba9f8c4..d873775683 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java @@ -72,7 +72,7 @@ public final class TestCellStyle { * */ @Test - public void testWriteSheetFont() throws IOException{ + void testWriteSheetFont() throws IOException{ File file = TempFile.createTempFile("testWriteSheetFont", ".xls"); try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); @@ -112,7 +112,7 @@ public final class TestCellStyle { * Tests that is creating a file with a date or an calendar works correctly. */ @Test - public void testDataStyle() throws IOException { + void testDataStyle() throws IOException { File file = TempFile.createTempFile("testWriteSheetStyleDate", ".xls"); try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); @@ -144,7 +144,7 @@ public final class TestCellStyle { } @Test - public void testHashEquals() throws IOException { + void testHashEquals() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); HSSFCellStyle cs1 = wb.createCellStyle(); @@ -185,7 +185,7 @@ public final class TestCellStyle { * */ @Test - public void testWriteSheetStyle() throws IOException { + void testWriteSheetStyle() throws IOException { File file = TempFile.createTempFile("testWriteSheetStyle", ".xls"); try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); @@ -233,7 +233,7 @@ public final class TestCellStyle { * HSSFWorkbook */ @Test - public void testCloneStyleSameWB() throws IOException { + void testCloneStyleSameWB() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFFont fnt = wb.createFont(); fnt.setFontName("TestingFont"); @@ -266,7 +266,7 @@ public final class TestCellStyle { * two different HSSFWorkbooks */ @Test - public void testCloneStyleDiffWB() throws IOException { + void testCloneStyleDiffWB() throws IOException { try (HSSFWorkbook wbOrig = new HSSFWorkbook()) { HSSFFont fnt = wbOrig.createFont(); @@ -308,7 +308,7 @@ public final class TestCellStyle { } @Test - public void testStyleNames() throws IOException { + void testStyleNames() throws IOException { try (HSSFWorkbook wb = openSample("WithExtendedStyles.xls")) { HSSFSheet s = wb.getSheetAt(0); HSSFCell c1 = s.getRow(0).getCell(0); @@ -362,7 +362,7 @@ public final class TestCellStyle { } @Test - public void testGetSetBorderHair() throws IOException { + void testGetSetBorderHair() throws IOException { BorderStyle[] bs = { HAIR, DOTTED, DASH_DOT_DOT, DASHED, THIN, MEDIUM_DASH_DOT_DOT, SLANTED_DASH_DOT, MEDIUM_DASH_DOT, MEDIUM_DASHED, MEDIUM, THICK, DOUBLE @@ -378,7 +378,7 @@ public final class TestCellStyle { } @Test - public void testShrinkToFit() throws IOException { + void testShrinkToFit() throws IOException { // Existing file try (HSSFWorkbook wb1 = openSample("ShrinkToFit.xls")) { HSSFSheet s = wb1.getSheetAt(0); @@ -412,7 +412,7 @@ public final class TestCellStyle { } @Test - public void test56563() { + void test56563() { Stream.of("56563a.xls", "56563b.xls").parallel().forEach(fileName -> assertDoesNotThrow(() -> { Random rand = new Random(); for(int i=0; i<10; i++) { @@ -434,7 +434,7 @@ public final class TestCellStyle { } @Test - public void test56959() throws IOException { + void test56959() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("somesheet"); @@ -469,7 +469,7 @@ public final class TestCellStyle { @Test - public void test58043() throws IOException { + void test58043() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFCellStyle cellStyle = wb.createCellStyle(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCloneSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCloneSheet.java index d8e6ea92e8..421b6e0061 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestCloneSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCloneSheet.java @@ -45,7 +45,7 @@ public final class TestCloneSheet extends BaseTestCloneSheet { } @Test - public void testCloneSheetWithoutDrawings(){ + void testCloneSheetWithoutDrawings(){ HSSFWorkbook b = new HSSFWorkbook(); HSSFSheet s = b.createSheet("Test"); HSSFSheet s2 = s.cloneSheet(b); @@ -56,7 +56,7 @@ public final class TestCloneSheet extends BaseTestCloneSheet { } @Test - public void testCloneSheetWithEmptyDrawingAggregate(){ + void testCloneSheetWithEmptyDrawingAggregate(){ HSSFWorkbook b = new HSSFWorkbook(); HSSFSheet s = b.createSheet("Test"); HSSFPatriarch patriarch = s.createDrawingPatriarch(); @@ -92,7 +92,7 @@ public final class TestCloneSheet extends BaseTestCloneSheet { } @Test - public void testCloneComment() throws IOException { + void testCloneComment() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sh = wb.createSheet(); HSSFPatriarch p = sh.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java b/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java index 51bca0f4af..8126682fc8 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java @@ -114,7 +114,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testAddToExistingSheet() throws Exception { + void testAddToExistingSheet() throws Exception { // dvEmpty.xls is a simple one sheet workbook. With a DataValidations header record but no // DataValidations. It's important that the example has one SHEETPROTECTION record. @@ -191,7 +191,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsAny() throws Exception { + void testGetDataValidationsAny() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -236,7 +236,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsIntegerFormula() throws Exception { + void testGetDataValidationsIntegerFormula() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -263,7 +263,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsIntegerValue() throws Exception { + void testGetDataValidationsIntegerValue() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -290,7 +290,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsDecimal() throws Exception { + void testGetDataValidationsDecimal() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -317,7 +317,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsDate() throws Exception { + void testGetDataValidationsDate() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -344,7 +344,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsListExplicit() throws Exception { + void testGetDataValidationsListExplicit() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -378,7 +378,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsListFormula() throws Exception { + void testGetDataValidationsListFormula() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); @@ -407,7 +407,7 @@ public final class TestDataValidation extends BaseTestDataValidation { } @Test - public void testGetDataValidationsFormula() throws Exception { + void testGetDataValidationsFormula() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); List<HSSFDataValidation> list = sheet.getDataValidations(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestEmbeddedObjects.java b/src/testcases/org/apache/poi/hssf/usermodel/TestEmbeddedObjects.java index af2c703582..891207e4c2 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestEmbeddedObjects.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestEmbeddedObjects.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; */ public class TestEmbeddedObjects { @Test - public void testReadExistingObject() throws IOException { + void testReadExistingObject() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls")) { List<HSSFObjectData> list = wb.getAllEmbeddedObjects(); assertEquals(list.size(), 1); @@ -47,7 +47,7 @@ public class TestEmbeddedObjects { * See https://github.com/apache/poi/pull/2 */ @Test - public void testReadNestedObject() throws IOException { + void testReadNestedObject() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("WithCheckBoxes.xls")) { List<HSSFObjectData> list = wb.getAllEmbeddedObjects(); assertEquals(list.size(), 1); @@ -62,7 +62,7 @@ public class TestEmbeddedObjects { * See https://github.com/apache/poi/pull/2 */ @Test - public void testReadManyNestedObjects() throws IOException { + void testReadManyNestedObjects() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("45538_form_Header.xls")) { List<HSSFObjectData> list = wb.getAllEmbeddedObjects(); assertEquals(list.size(), 40); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics.java b/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics.java index 4f4cce473e..64c8a36d1a 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics.java @@ -62,7 +62,7 @@ public final class TestEscherGraphics { } @Test - public void testGetFont() { + void testGetFont() { Font f = graphics.getFont(); if (! f.toString().contains("dialog") && ! f.toString().contains("Dialog")) { assertEquals("java.awt.Font[family=Arial,name=Arial,style=plain,size=10]", f.toString()); @@ -70,7 +70,7 @@ public final class TestEscherGraphics { } @Test - public void testGetFontMetrics() { + void testGetFontMetrics() { Font f = graphics.getFont(); if (f.toString().contains("dialog") || f.toString().contains("Dialog")) { return; @@ -81,20 +81,20 @@ public final class TestEscherGraphics { } @Test - public void testSetFont() { + void testSetFont() { Font f = new Font("Helvetica", 0, 12); graphics.setFont(f); assertEquals(f, graphics.getFont()); } @Test - public void testSetColor() { + void testSetColor() { graphics.setColor(Color.red); assertEquals(Color.red, graphics.getColor()); } @Test - public void testFillRect() { + void testFillRect() { graphics.fillRect( 10, 10, 20, 20 ); HSSFSimpleShape s = (HSSFSimpleShape) escherGroupA.getChildren().get(0); assertEquals(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE, s.getShapeType()); @@ -105,14 +105,14 @@ public final class TestEscherGraphics { } @Test - public void testDrawString() { + void testDrawString() { graphics.drawString("This is a test", 10, 10); HSSFTextbox t = (HSSFTextbox) escherGroupA.getChildren().get(0); assertEquals("This is a test", t.getString().getString()); } @Test - public void testGetDataBackAgain() throws Exception { + void testGetDataBackAgain() throws Exception { HSSFSheet s; HSSFShapeGroup s1; HSSFShapeGroup s2; diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics2d.java b/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics2d.java index f207b9a117..0e0e52f1eb 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics2d.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestEscherGraphics2d.java @@ -54,7 +54,7 @@ public final class TestEscherGraphics2d { } @Test - public void testDrawString() { + void testDrawString() { graphics.drawString("This is a test", 10, 10); HSSFTextbox t = (HSSFTextbox) escherGroup.getChildren().get(0); assertEquals("This is a test", t.getString().getString()); @@ -80,7 +80,7 @@ public final class TestEscherGraphics2d { } @Test - public void testFillRect() { + void testFillRect() { graphics.fillRect( 10, 10, 20, 20 ); HSSFSimpleShape s = (HSSFSimpleShape) escherGroup.getChildren().get(0); assertEquals(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE, s.getShapeType()); @@ -91,7 +91,7 @@ public final class TestEscherGraphics2d { } @Test - public void testGetFontMetrics() { + void testGetFontMetrics() { FontMetrics fontMetrics = graphics.getFontMetrics(graphics.getFont()); if (isDialogPresent()) { // if dialog is returned we can't run the test properly. @@ -102,20 +102,20 @@ public final class TestEscherGraphics2d { } @Test - public void testSetFont() { + void testSetFont() { Font f = new Font("Helvetica", Font.PLAIN, 12); graphics.setFont(f); assertEquals(f, graphics.getFont()); } @Test - public void testSetColor() { + void testSetColor() { graphics.setColor(Color.red); assertEquals(Color.red, graphics.getColor()); } @Test - public void testGetFont() { + void testGetFont() { Font f = graphics.getFont(); if (isDialogPresent()) { // if dialog is returned we can't run the test properly. @@ -131,7 +131,7 @@ public final class TestEscherGraphics2d { } @Test - public void testDraw() { + void testDraw() { graphics.draw(new Line2D.Double(10,10,20,20)); HSSFSimpleShape s = (HSSFSimpleShape) escherGroup.getChildren().get(0); assertEquals(s.getShapeType(), HSSFSimpleShape.OBJECT_TYPE_LINE); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestExternalReferenceChange.java b/src/testcases/org/apache/poi/hssf/usermodel/TestExternalReferenceChange.java index b60b5c10c1..50a0fee7f3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestExternalReferenceChange.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestExternalReferenceChange.java @@ -34,7 +34,7 @@ public class TestExternalReferenceChange { private static final String SOURCE_WORKBOOK_FILENAME = "52575_source.xls"; @Test - public void testDummyToSource() throws IOException { + void testDummyToSource() throws IOException { try (HSSFWorkbook mainWorkbook = HSSFTestDataSamples.openSampleWorkbook(MAIN_WORKBOOK_FILENAME); HSSFWorkbook sourceWorkbook = HSSFTestDataSamples.openSampleWorkbook(SOURCE_WORKBOOK_FILENAME)) { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFontDetails.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFontDetails.java index 0b469d64a8..ae21d99a2a 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestFontDetails.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFontDetails.java @@ -40,19 +40,19 @@ public final class TestFontDetails { } @Test - public void testCreate() { + void testCreate() { assertEquals(13, fontDetails.getHeight()); assertEquals(6, fontDetails.getCharWidth('a')); assertEquals(3, fontDetails.getCharWidth('f')); } @Test - public void testGetStringWidth() { + void testGetStringWidth() { assertEquals(9, fontDetails.getStringWidth("af")); } @Test - public void testGetCharWidth() { + void testGetCharWidth() { assertEquals(6, fontDetails.getCharWidth('a')); assertEquals(9, fontDetails.getCharWidth('=')); } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java index d51fa32d4c..1bb3585e89 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java @@ -75,7 +75,7 @@ public final class TestFormulaEvaluatorBugs { * open up excel */ @Test - public void test44636() throws Exception { + void test44636() throws Exception { // Open the existing file, tweak one value and // re-calculate @@ -130,7 +130,7 @@ public final class TestFormulaEvaluatorBugs { * if a formula has values in the interval [Short.MAX_VALUE, (Short.MAX_VALUE+1)*2] */ @Test - public void test44297() throws Exception { + void test44297() throws Exception { HSSFWorkbook wb = openSampleWorkbook("44297.xls"); @@ -194,7 +194,7 @@ public final class TestFormulaEvaluatorBugs { * of all the rows in Column C */ @Test - public void test44410() throws Exception { + void test44410() throws Exception { HSSFWorkbook wb = openSampleWorkbook("SingleLetterRanges.xls"); HSSFSheet sheet = wb.getSheetAt(0); @@ -254,7 +254,7 @@ public final class TestFormulaEvaluatorBugs { * Tests that we can evaluate boolean cells properly */ @Test - public void testEvaluateBooleanInCell_bug44508() throws Exception { + void testEvaluateBooleanInCell_bug44508() throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); wb.setSheetName(0, "Sheet1"); @@ -275,7 +275,7 @@ public final class TestFormulaEvaluatorBugs { } @Test - public void testClassCast_bug44861() throws Exception { + void testClassCast_bug44861() throws Exception { try (HSSFWorkbook wb = openSampleWorkbook("44861.xls")) { // Check direct HSSFFormulaEvaluator.evaluateAllFormulaCells(wb); @@ -296,7 +296,7 @@ public final class TestFormulaEvaluatorBugs { } @Test - public void testEvaluateInCellWithErrorCode_bug44950() throws Exception { + void testEvaluateInCellWithErrorCode_bug44950() throws Exception { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(1); @@ -313,7 +313,7 @@ public final class TestFormulaEvaluatorBugs { } @Test - public void testDateWithNegativeParts_bug48528() throws Exception { + void testDateWithNegativeParts_bug48528() throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(1); @@ -386,7 +386,7 @@ public final class TestFormulaEvaluatorBugs { * The HSSFFormula evaluator performance benefits greatly from caching of intermediate cell values */ @Test - public void testSlowEvaluate45376() throws Exception { + void testSlowEvaluate45376() throws Exception { /* * Note - to observe behaviour without caching, disable the call to * updateValue() from FormulaCellCacheEntry.updateFormulaResult(). @@ -440,7 +440,7 @@ public final class TestFormulaEvaluatorBugs { @SuppressWarnings("resource") @Test - public void test55747_55324() throws Exception { + void test55747_55324() throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); HSSFFormulaEvaluator ev = wb.getCreationHelper().createFormulaEvaluator(); HSSFSheet ws = wb.createSheet(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorDocs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorDocs.java index c718fece8d..046a08ff86 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorDocs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorDocs.java @@ -38,7 +38,7 @@ public final class TestFormulaEvaluatorDocs { * https://poi.apache.org/hssf/eval.html#EvaluateAll */ @Test - public void testEvaluateAll() throws IOException { + void testEvaluateAll() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s1 = wb.createSheet(); HSSFSheet s2 = wb.createSheet(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulas.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulas.java index ee15db7700..6cbe1b512a 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulas.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulas.java @@ -53,7 +53,7 @@ public final class TestFormulas { * Add 1+1 -- WHoohoo! */ @Test - public void testBasicAddIntegers() throws IOException { + void testBasicAddIntegers() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s = wb1.createSheet(); @@ -76,7 +76,7 @@ public final class TestFormulas { * Add various integers */ @Test - public void testAddIntegers() throws IOException { + void testAddIntegers() throws IOException { binomialOperator("+"); } @@ -84,7 +84,7 @@ public final class TestFormulas { * Multiply various integers */ @Test - public void testMultplyIntegers() throws IOException { + void testMultplyIntegers() throws IOException { binomialOperator("*"); } @@ -92,7 +92,7 @@ public final class TestFormulas { * Subtract various integers */ @Test - public void testSubtractIntegers() throws IOException { + void testSubtractIntegers() throws IOException { binomialOperator("-"); } @@ -100,7 +100,7 @@ public final class TestFormulas { * Subtract various integers */ @Test - public void testDivideIntegers() throws IOException { + void testDivideIntegers() throws IOException { binomialOperator("/"); } @@ -108,7 +108,7 @@ public final class TestFormulas { * Exponentialize various integers; */ @Test - public void testPowerIntegers() throws IOException { + void testPowerIntegers() throws IOException { binomialOperator("^"); } @@ -116,7 +116,7 @@ public final class TestFormulas { * Concatenate two numbers 1&2 = 12 */ @Test - public void testConcatIntegers() throws IOException { + void testConcatIntegers() throws IOException { binomialOperator("&"); } @@ -124,7 +124,7 @@ public final class TestFormulas { * tests 1*2+3*4 */ @Test - public void testOrderOfOperationsMultiply() throws IOException { + void testOrderOfOperationsMultiply() throws IOException { orderTest("1*2+3*4"); } @@ -132,7 +132,7 @@ public final class TestFormulas { * tests 1*2+3^4 */ @Test - public void testOrderOfOperationsPower() throws IOException { + void testOrderOfOperationsPower() throws IOException { orderTest("1*2+3^4"); } @@ -140,12 +140,12 @@ public final class TestFormulas { * Tests that parenthesis are obeyed */ @Test - public void testParenthesis() throws IOException { + void testParenthesis() throws IOException { orderTest("(1*3)+2+(1+2)*(3^4)^5"); } @Test - public void testReferencesOpr() throws IOException { + void testReferencesOpr() throws IOException { String[] operation = new String[] { "+", "-", "*", "/", "^", "&" }; @@ -159,7 +159,7 @@ public final class TestFormulas { * */ @Test - public void testFloat() throws IOException { + void testFloat() throws IOException { floatTest("*"); floatTest("/"); } @@ -211,22 +211,22 @@ public final class TestFormulas { } @Test - public void testAreaSum() throws IOException { + void testAreaSum() throws IOException { areaFunctionTest("SUM"); } @Test - public void testAreaAverage() throws IOException { + void testAreaAverage() throws IOException { areaFunctionTest("AVERAGE"); } @Test - public void testRefArraySum() throws IOException { + void testRefArraySum() throws IOException { refArrayFunctionTest("SUM"); } @Test - public void testAreaArraySum() throws IOException { + void testAreaArraySum() throws IOException { refAreaArrayFunctionTest("SUM"); } @@ -479,7 +479,7 @@ public final class TestFormulas { @Test - public void testAbsRefs() throws IOException { + void testAbsRefs() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s = wb1.createSheet(); HSSFRow r = s.createRow(0); @@ -512,7 +512,7 @@ public final class TestFormulas { } @Test - public void testSheetFunctions() throws IOException { + void testSheetFunctions() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s = wb1.createSheet("A"); HSSFRow r = s.createRow(0); @@ -544,7 +544,7 @@ public final class TestFormulas { } @Test - public void testRVAoperands() throws IOException { + void testRVAoperands() throws IOException { File file = TempFile.createTempFile("testFormulaRVA",".xls"); try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); @@ -583,7 +583,7 @@ public final class TestFormulas { } @Test - public void testStringFormulas() throws IOException { + void testStringFormulas() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet("A"); HSSFRow r = s.createRow(0); @@ -606,7 +606,7 @@ public final class TestFormulas { } @Test - public void testLogicalFormulas() throws IOException { + void testLogicalFormulas() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s = wb1.createSheet("A"); HSSFRow r = s.createRow(0); @@ -623,7 +623,7 @@ public final class TestFormulas { } @Test - public void testDateFormulas() throws IOException { + void testDateFormulas() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet("testSheet1"); HSSFRow r = s.createRow(0); @@ -653,7 +653,7 @@ public final class TestFormulas { } @Test - public void testIfFormulas() throws IOException { + void testIfFormulas() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s = wb1.createSheet("testSheet1"); HSSFRow r = s.createRow(0); @@ -722,7 +722,7 @@ public final class TestFormulas { } @Test - public void testSumIf() throws IOException { + void testSumIf() throws IOException { String function ="SUMIF(A1:A5,\">4000\",B1:B5)"; try (HSSFWorkbook wb = openSample("sumifformula.xls")) { @@ -774,7 +774,7 @@ public final class TestFormulas { } @Test - public void testSquareMacro() throws IOException { + void testSquareMacro() throws IOException { try (HSSFWorkbook w = openSample("SquareMacro.xls")) { HSSFSheet s0 = w.getSheetAt(0); HSSFRow[] r = {s0.getRow(0), s0.getRow(1)}; @@ -814,7 +814,7 @@ public final class TestFormulas { } @Test - public void testStringFormulaRead() throws IOException { + void testStringFormulaRead() throws IOException { try (HSSFWorkbook w = openSample("StringFormulas.xls")) { HSSFCell c = w.getSheetAt(0).getRow(0).getCell(0); assertEquals("XYZ", c.getRichStringCellValue().getString(), "String Cell value"); @@ -823,7 +823,7 @@ public final class TestFormulas { /** test for bug 34021*/ @Test - public void testComplexSheetRefs() throws IOException { + void testComplexSheetRefs() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s1 = wb1.createSheet("Sheet a.1"); HSSFSheet s2 = wb1.createSheet("Sheet.A"); @@ -843,7 +843,7 @@ public final class TestFormulas { /** Unknown Ptg 3C*/ @Test - public void test27272_1() throws IOException { + void test27272_1() throws IOException { try (HSSFWorkbook wb = openSample("27272_1.xls")) { wb.getSheetAt(0); assertEquals("Compliance!#REF!", wb.getNameAt(0).getRefersToFormula(), "Reference for named range"); @@ -853,7 +853,7 @@ public final class TestFormulas { /** Unknown Ptg 3D*/ @Test - public void test27272_2() throws IOException { + void test27272_2() throws IOException { try (HSSFWorkbook wb = openSample("27272_2.xls")) { assertEquals("LOAD.POD_HISTORIES!#REF!", wb.getNameAt(0).getRefersToFormula(), "Reference for named range"); writeOutAndReadBack(wb).close(); @@ -862,7 +862,7 @@ public final class TestFormulas { /** MissingArgPtg */ @Test - public void testMissingArgPtg() throws IOException { + void testMissingArgPtg() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFCell cell = wb.createSheet("Sheet1").createRow(4).createCell(0); assertDoesNotThrow(() -> cell.setCellFormula("IF(A1=\"A\",1,)")); @@ -870,7 +870,7 @@ public final class TestFormulas { } @Test - public void testSharedFormula() throws IOException { + void testSharedFormula() throws IOException { try (HSSFWorkbook wb = openSample("SharedFormulaTest.xls")) { assertEquals("A$1*2", wb.getSheetAt(0).getRow(1).getCell(1).toString()); assertEquals("$A11*2", wb.getSheetAt(0).getRow(11).getCell(1).toString()); @@ -883,7 +883,7 @@ public final class TestFormulas { * Test creation / evaluation of formulas with sheet-level names */ @Test - public void testSheetLevelFormulas() throws IOException { + void testSheetLevelFormulas() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sh1 = wb.createSheet("Sheet1"); HSSFName nm1 = wb.createName(); @@ -931,7 +931,7 @@ public final class TestFormulas { * see Bug #49640 */ @Test - public void testFormulasWithUnderscore() throws IOException{ + void testFormulasWithUnderscore() throws IOException{ try (HSSFWorkbook wb = new HSSFWorkbook()) { Name nm1 = wb.createName(); nm1.setNameName("_score1"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java index 1873641e18..fb21fb8303 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java @@ -63,7 +63,7 @@ public final class TestHSSFCell extends BaseTestCell { * but there's a separate unit test for that. */ @Test - public void testDateWindowingRead() throws IOException { + void testDateWindowingRead() throws IOException { Calendar cal = LocaleUtil.getLocaleCalendar(2000, 0, 1, 0, 0, 0);// Jan. 1, 2000 Date date = cal.getTime(); @@ -95,7 +95,7 @@ public final class TestHSSFCell extends BaseTestCell { * results of this test are meaningless. */ @Test - public void testDateWindowingWrite() throws IOException { + void testDateWindowingWrite() throws IOException { Calendar cal = LocaleUtil.getLocaleCalendar(2000,0,1,0,0,0); // Jan. 1, 2000 Date date = cal.getTime(); @@ -144,7 +144,7 @@ public final class TestHSSFCell extends BaseTestCell { * Tests that the active cell can be correctly read and set */ @Test - public void testActiveCell() throws IOException { + void testActiveCell() throws IOException { //read in sample try (HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("Simple.xls")) { @@ -173,7 +173,7 @@ public final class TestHSSFCell extends BaseTestCell { @Test - public void testActiveCellBug56114() throws IOException { + void testActiveCellBug56114() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sh = wb.createSheet(); @@ -215,7 +215,7 @@ public final class TestHSSFCell extends BaseTestCell { * Test reading hyperlinks */ @Test - public void testWithHyperlink() throws IOException { + void testWithHyperlink() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("WithHyperlink.xls")) { HSSFSheet sheet = wb.getSheetAt(0); @@ -234,7 +234,7 @@ public final class TestHSSFCell extends BaseTestCell { * Test reading hyperlinks */ @Test - public void testWithTwoHyperlinks() throws IOException { + void testWithTwoHyperlinks() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("WithTwoHyperLinks.xls")) { HSSFSheet sheet = wb.getSheetAt(0); @@ -262,7 +262,7 @@ public final class TestHSSFCell extends BaseTestCell { * to our workbook, and not those from other workbooks. */ @Test - public void testCellStyleWorkbookMatch() throws IOException { + void testCellStyleWorkbookMatch() throws IOException { try (HSSFWorkbook wbA = new HSSFWorkbook(); HSSFWorkbook wbB = new HSSFWorkbook()) { @@ -291,7 +291,7 @@ public final class TestHSSFCell extends BaseTestCell { * versions (prior to bug 46213 / r717883) crash instead. */ @Test - public void testCachedTypeChange() throws IOException { + void testCachedTypeChange() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("Sheet1"); Cell cell = sheet.createRow(0).createCell(0); @@ -336,14 +336,14 @@ public final class TestHSSFCell extends BaseTestCell { * HSSF prior to version 3.7 had a bug: it could write a NaN but could not read such a file back. */ @Test - public void testReadNaN() throws IOException { + void testReadNaN() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("49761.xls")) { assertNotNull(wb); } } @Test - public void testHSSFCell() throws IOException { + void testHSSFCell() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); HSSFRow row = sheet.createRow(0); @@ -354,7 +354,7 @@ public final class TestHSSFCell extends BaseTestCell { } @Test - public void testDeprecatedMethods() throws IOException { + void testDeprecatedMethods() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); HSSFRow row = sheet.createRow(0); @@ -371,7 +371,7 @@ public final class TestHSSFCell extends BaseTestCell { } @Test - public void testCellType() throws IOException { + void testCellType() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java index 07900573d7..64d029fca8 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFChart.java @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; public final class TestHSSFChart { @Test - public void testSingleChart() { + void testSingleChart() { HSSFWorkbook wb = openSampleWorkbook("WithChart.xls"); HSSFSheet s1 = wb.getSheetAt(0); @@ -69,7 +69,7 @@ public final class TestHSSFChart { } @Test - public void testTwoCharts() { + void testTwoCharts() { HSSFWorkbook wb = openSampleWorkbook("WithTwoCharts.xls"); HSSFSheet s1 = wb.getSheetAt(0); @@ -102,7 +102,7 @@ public final class TestHSSFChart { } @Test - public void testThreeCharts() { + void testThreeCharts() { HSSFWorkbook wb = openSampleWorkbook("WithThreeCharts.xls"); HSSFSheet s1 = wb.getSheetAt(0); @@ -143,7 +143,7 @@ public final class TestHSSFChart { } @Test - public void testExistingSheet3() throws Exception { + void testExistingSheet3() throws Exception { HSSFWorkbook wb = openSampleWorkbook("49581.xls"); HSSFSheet sheet = wb.getSheetAt( 2 ) ; @@ -166,7 +166,7 @@ public final class TestHSSFChart { } @Test - public void testExistingSheet2() throws Exception { + void testExistingSheet2() throws Exception { HSSFWorkbook wb = openSampleWorkbook("49581.xls"); HSSFSheet sheet = wb.getSheetAt( 1 ) ; HSSFChart[] charts = HSSFChart.getSheetCharts( sheet ) ; @@ -198,7 +198,7 @@ public final class TestHSSFChart { } @Test - public void testExistingSheet1() throws Exception { + void testExistingSheet1() throws Exception { try (HSSFWorkbook wb = openSampleWorkbook("49581.xls")) { HSSFSheet sheet = wb.getSheetAt(0); HSSFChart[] charts = HSSFChart.getSheetCharts(sheet); @@ -237,7 +237,7 @@ public final class TestHSSFChart { * Bug 26862: HSSFWorkbook.cloneSheet copies charts */ @Test - public void test26862() throws IOException, Exception { + void test26862() throws IOException, Exception { HSSFWorkbook wb = openSampleWorkbook("SimpleChart.xls"); HSSFSheet srcSheet = wb.getSheetAt(0); HSSFChart[] srcCharts = HSSFChart.getSheetCharts(srcSheet); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFClientAnchor.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFClientAnchor.java index 2d19ce1aaf..8c9dbe6cc9 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFClientAnchor.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFClientAnchor.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; */ public final class TestHSSFClientAnchor { @Test - public void testGetAnchorHeightInPoints() throws IOException { + void testGetAnchorHeightInPoints() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("test"); HSSFClientAnchor a = new HSSFClientAnchor(0, 0, 1023, 255, (short) 0, 0, (short) 0, 0); @@ -68,7 +68,7 @@ public final class TestHSSFClientAnchor { * (Bug 42999 reported that dx1 and dx2 are swapped if dx1>dx2. It doesn't make sense for client anchors.) */ @Test - public void testConvertAnchor() { + void testConvertAnchor() { HSSFClientAnchor[] anchors = { new HSSFClientAnchor( 0 , 0 , 0 , 0 ,(short)0, 1,(short)1,3), new HSSFClientAnchor( 100 , 0 , 900 , 255 ,(short)0, 1,(short)1,3), @@ -88,7 +88,7 @@ public final class TestHSSFClientAnchor { } @Test - public void testAnchorHeightInPoints() throws IOException { + void testAnchorHeightInPoints() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); @@ -110,7 +110,7 @@ public final class TestHSSFClientAnchor { * Check {@link HSSFClientAnchor} constructor does not treat 32768 as -32768. */ @Test - public void testCanHaveRowGreaterThan32767() { + void testCanHaveRowGreaterThan32767() { // Maximum permitted row number should be 65535. HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) 0, 32768, (short) 0, 32768); @@ -122,7 +122,7 @@ public final class TestHSSFClientAnchor { * Check the maximum is not set at 255*256 instead of 256*256 - 1. */ @Test - public void testCanHaveRowUpTo65535() { + void testCanHaveRowUpTo65535() { HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) 0, 65535, (short) 0, 65535); assertEquals(65535, anchor.getRow1()); @@ -130,7 +130,7 @@ public final class TestHSSFClientAnchor { } @Test - public void testCannotHaveRowGreaterThan65535() { + void testCannotHaveRowGreaterThan65535() { assertThrows(IllegalArgumentException.class, () -> new HSSFClientAnchor(0, 0, 0, 0, (short) 0, 65536, (short) 0, 65536)); } @@ -139,7 +139,7 @@ public final class TestHSSFClientAnchor { * Check the same maximum value enforced when using {@link HSSFClientAnchor#setRow1}. */ @Test - public void testCanSetRowUpTo65535() { + void testCanSetRowUpTo65535() { HSSFClientAnchor anchor = new HSSFClientAnchor(); anchor.setRow1(65535); anchor.setRow2(65535); @@ -149,13 +149,13 @@ public final class TestHSSFClientAnchor { } @Test - public void testCannotSetRow1GreaterThan65535() { + void testCannotSetRow1GreaterThan65535() { assertThrows(IllegalArgumentException.class, () -> new HSSFClientAnchor().setRow1(65536)); } @Test - public void testCannotSetRow2GreaterThan65535() { + void testCannotSetRow2GreaterThan65535() { assertThrows(IllegalArgumentException.class, () -> new HSSFClientAnchor().setRow2(65536)); } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java index ef4a2bc538..2677567fad 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java @@ -102,7 +102,7 @@ public final class TestHSSFComment extends BaseTestCellComment { } @Test - public void testBug56380InsertComments() throws Exception { + void testBug56380InsertComments() throws Exception { HSSFWorkbook workbook = new HSSFWorkbook(); Sheet sheet = workbook.createSheet(); Drawing<?> drawing = sheet.createDrawingPatriarch(); @@ -138,7 +138,7 @@ public final class TestHSSFComment extends BaseTestCellComment { } @Test - public void testBug56380InsertTooManyComments() throws Exception { + void testBug56380InsertTooManyComments() throws Exception { try (HSSFWorkbook workbook = new HSSFWorkbook()) { Sheet sheet = workbook.createSheet(); Drawing<?> drawing = sheet.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java index 0512d5a080..9bb01384b1 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java @@ -56,17 +56,17 @@ public final class TestHSSFConditionalFormatting extends BaseTestConditionalForm } @Test - public void testRead() throws IOException { + void testRead() throws IOException { testRead("WithConditionalFormatting.xls"); } @Test - public void testReadOffice2007() throws IOException { + void testReadOffice2007() throws IOException { testReadOffice2007("NewStyleConditionalFormattings.xls"); } @Test - public void test53691() throws IOException { + void test53691() throws IOException { SheetConditionalFormatting cf; final Workbook wb = HSSFITestDataProvider.instance.openSampleWorkbook("53691.xls"); /* diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java index 8a8b1063e6..0f1b6a46a1 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java @@ -49,7 +49,7 @@ public final class TestHSSFDataFormat extends BaseTestDataFormat { * Bug 51378: getDataFormatString method call crashes when reading the test file */ @Test - public void test51378() throws IOException { + void test51378() throws IOException { List<String> expNull = Arrays.asList( "0-3-0","0-43-11" ); try (HSSFWorkbook wb = openSampleWorkbook("12561-1.xls")) { for (Sheet sheet : wb) { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java index 035eeaa78a..4e2843ad22 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java @@ -229,7 +229,7 @@ public final class TestHSSFDataFormatter { * Test getting formatted values from numeric and date cells. */ @Test - public void testGetFormattedCellValueHSSFCell() { + void testGetFormattedCellValueHSSFCell() { // Valid date formats -- cell values should be date formatted & not "555.555" HSSFRow row = wb.getSheetAt(0).getRow(0); Iterator<Cell> it = row.cellIterator(); @@ -332,7 +332,7 @@ public final class TestHSSFDataFormatter { } @Test - public void testGetFormattedCellValueHSSFCellHSSFFormulaEvaluator() { + void testGetFormattedCellValueHSSFCellHSSFFormulaEvaluator() { // test formula format HSSFRow row = wb.getSheetAt(0).getRow(7); HSSFCell cell = row.getCell(0); @@ -355,7 +355,7 @@ public final class TestHSSFDataFormatter { * format pattern cannot be parsed by DecimalFormat. */ @Test - public void testSetDefaultNumberFormat() { + void testSetDefaultNumberFormat() { HSSFRow row = wb.getSheetAt(0).getRow(3); Iterator<Cell> it = row.cellIterator(); DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(LocaleUtil.getUserLocale()); @@ -378,7 +378,7 @@ public final class TestHSSFDataFormatter { * A format of "@" means use the general format */ @Test - public void testGeneralAtFormat() { + void testGeneralAtFormat() { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("47154.xls"); HSSFSheet sheet = workbook.getSheetAt(0); HSSFRow row = sheet.getRow(0); @@ -397,7 +397,7 @@ public final class TestHSSFDataFormatter { * Tests various formattings of dates and numbers */ @Test - public void testFromFile() { + void testFromFile() { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("Formatting.xls"); HSSFSheet sheet = workbook.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFEvaluationSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFEvaluationSheet.java index 09bad315a6..bac90f1577 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFEvaluationSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFEvaluationSheet.java @@ -37,7 +37,7 @@ public class TestHSSFEvaluationSheet extends BaseTestXEvaluationSheet { } @Test - public void testMissingExternalName() throws IOException { + void testMissingExternalName() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("external_name.xls")) { // this sometimes causes exceptions wb.getAllNames().stream().filter(n -> !n.isFunctionName()).forEach( diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java index f7dedf8c21..9ddc17a9f3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java @@ -50,7 +50,7 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator { * (single cells and rectangular areas) */ @Test - public void testEvaluateSimple() throws IOException { + void testEvaluateSimple() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("testNames.xls"); HSSFSheet sheet = wb.getSheetAt(0); HSSFCell cell = sheet.getRow(8).getCell(0); @@ -69,7 +69,7 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator { * for but POI should look elsewhere to decide whether it can evaluate the name. */ @Test - public void testDefinedNameWithComplexFlag_bug47048() throws IOException { + void testDefinedNameWithComplexFlag_bug47048() throws IOException { // Mock up a spreadsheet to match the critical details of the sample HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Input"); @@ -130,7 +130,7 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator { * The HSSFFormula evaluator performance benefits greatly from caching of intermediate cell values */ @Test - public void testShortCircuitIfEvaluation() throws IOException { + void testShortCircuitIfEvaluation() throws IOException { // Set up a simple IF() formula that has measurable evaluation cost for its operands. try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("Sheet1"); @@ -160,7 +160,7 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator { * we parse. */ @Test - public void testXRefs() throws IOException { + void testXRefs() throws IOException { try (HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("XRefCalc.xls"); HSSFWorkbook wb2 = HSSFTestDataSamples.openSampleWorkbook("XRefCalcData.xls")) { Cell cell; diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHeaderFooter.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHeaderFooter.java index 6d2263dd9b..cb4178ab7a 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHeaderFooter.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHeaderFooter.java @@ -34,7 +34,7 @@ public final class TestHSSFHeaderFooter { * Tests that get header retrieves the proper values. */ @Test - public void testRetrieveCorrectHeader() throws IOException { + void testRetrieveCorrectHeader() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("EmbeddedChartHeaderTest.xls")) { HSSFSheet s = wb.getSheetAt(0); @@ -47,7 +47,7 @@ public final class TestHSSFHeaderFooter { } @Test - public void testSpecialChars() { + void testSpecialChars() { assertEquals("&U", HSSFHeader.startUnderline()); assertEquals("&U", HSSFHeader.endUnderline()); assertEquals("&P", HSSFHeader.page()); @@ -57,7 +57,7 @@ public final class TestHSSFHeaderFooter { } @Test - public void testStripFields() throws IOException { + void testStripFields() throws IOException { 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"; @@ -96,7 +96,7 @@ public final class TestHSSFHeaderFooter { * Tests that get header retrieves the proper values. */ @Test - public void testRetrieveCorrectFooter() throws IOException { + void testRetrieveCorrectFooter() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("EmbeddedChartHeaderTest.xls")) { HSSFSheet s = wb.getSheetAt(0); HSSFFooter foot = s.getFooter(); @@ -111,7 +111,7 @@ public final class TestHSSFHeaderFooter { * Testcase for Bug 17039 HSSFHeader does not support DBCS */ @Test - public void testHeaderHas16bitCharacter() throws IOException { + void testHeaderHas16bitCharacter() throws IOException { try (HSSFWorkbook b = new HSSFWorkbook()) { HSSFSheet s = b.createSheet("Test"); HSSFHeader h = s.getHeader(); @@ -133,7 +133,7 @@ public final class TestHSSFHeaderFooter { * Testcase for Bug 17039 HSSFFooter does not support DBCS */ @Test - public void testFooterHas16bitCharacter() throws IOException { + void testFooterHas16bitCharacter() throws IOException { try (HSSFWorkbook b = new HSSFWorkbook()) { HSSFSheet s = b.createSheet("Test"); HSSFFooter f = s.getFooter(); @@ -152,7 +152,7 @@ public final class TestHSSFHeaderFooter { } @Test - public void testReadDBCSHeaderFooter() throws IOException { + void testReadDBCSHeaderFooter() throws IOException { try (HSSFWorkbook wb = openSampleWorkbook("DBCSHeader.xls")) { HSSFSheet s = wb.getSheetAt(0); HSSFHeader h = s.getHeader(); @@ -171,7 +171,7 @@ public final class TestHSSFHeaderFooter { * Excel tolerates files with missing HEADER/FOOTER records. POI should do the same. */ @Test - public void testMissingHeaderFooterRecord_bug47244() throws IOException { + void testMissingHeaderFooterRecord_bug47244() throws IOException { // noHeaderFooter47244.xls was created by a slightly modified POI // which omitted the HEADER/FOOTER records try (HSSFWorkbook wb = openSampleWorkbook("noHeaderFooter47244.xls")) { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java index 180624a495..e5e9deb692 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java @@ -44,7 +44,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { * Test that we can read hyperlinks. */ @Test - public void testRead() { + void testRead() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls"); @@ -90,7 +90,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { } @Test - public void testModify() { + void testModify() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls"); HSSFSheet sheet; @@ -121,7 +121,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { * @throws IOException */ @Test - public void testCreateDocumentLink() throws IOException { + void testCreateDocumentLink() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); //link to a place in this workbook @@ -168,7 +168,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { } @Test - public void testCloneSheet() { + void testCloneSheet() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("HyperlinksOnManySheets.xls"); HSSFCell cell; @@ -188,7 +188,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { } @Test - public void testCreate() throws IOException { + void testCreate() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFHyperlink link; @@ -220,7 +220,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { * see bugs #46445 and #29957 */ @Test - public void testShiftRows(){ + void testShiftRows(){ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("46445.xls"); @@ -268,7 +268,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink { /* @Test - public void testCopyXSSFHyperlink() throws IOException { + void testCopyXSSFHyperlink() throws IOException { XSSFWorkbook wb = new XSSFWorkbook(); XSSFCreationHelper helper = wb.getCreationHelper(); XSSFHyperlink xlink = helper.createHyperlink(Hyperlink.LINK_URL); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java index cc4d519c65..e3e6cea444 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java @@ -55,7 +55,7 @@ public final class TestHSSFName extends BaseTestNamedRange { } @Test - public void testRepeatingRowsAndColumnsNames() throws Exception { + void testRepeatingRowsAndColumnsNames() throws Exception { // First test that setting RR&C for same sheet more than once only creates a // single Print_Titles built-in record HSSFWorkbook wb = new HSSFWorkbook(); @@ -103,7 +103,7 @@ public final class TestHSSFName extends BaseTestNamedRange { } @Test - public void testNamedRange() throws Exception { + void testNamedRange() throws Exception { HSSFWorkbook wb1 = HSSFTestDataSamples.openSampleWorkbook("Simple.xls"); //Creating new Named Range @@ -141,7 +141,7 @@ public final class TestHSSFName extends BaseTestNamedRange { * Addresses Bug <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=9632" target="_bug">#9632</a> */ @Test - public void testNamedRead() throws Exception { + void testNamedRead() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("namedinput.xls"); //Get index of the named range with the name = "NamedRangeName" , which was defined in input.xls as A1:D10 @@ -174,7 +174,7 @@ public final class TestHSSFName extends BaseTestNamedRange { * Addresses Bug <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=16411" target="_bug">#16411</a> */ @Test - public void testNamedReadModify() throws Exception { + void testNamedReadModify() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("namedinput.xls"); HSSFName name = wb.getNameAt(0); @@ -195,7 +195,7 @@ public final class TestHSSFName extends BaseTestNamedRange { * Test to see if the print area can be retrieved from an excel created file */ @Test - public void testPrintAreaFileRead() throws Exception { + void testPrintAreaFileRead() throws Exception { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("SimpleWithPrintArea.xls"); String sheetName = workbook.getSheetName(0); @@ -206,7 +206,7 @@ public final class TestHSSFName extends BaseTestNamedRange { } @Test - public void testDeletedReference() throws Exception { + void testDeletedReference() throws Exception { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("24207.xls")) { assertEquals(2, wb.getNumberOfNames()); @@ -232,7 +232,7 @@ public final class TestHSSFName extends BaseTestNamedRange { * otherwise created named don't appear in the drop-down to the left of formula bar in Excel */ @Test - public void testTypeOfRootPtg() throws Exception { + void testTypeOfRootPtg() throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("CSCO"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFOptimiser.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFOptimiser.java index c7c3ddbffb..1a58009863 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFOptimiser.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFOptimiser.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestHSSFOptimiser { @Test - public void testDoesNoHarmIfNothingToDo() { + void testDoesNoHarmIfNothingToDo() { HSSFWorkbook wb = new HSSFWorkbook(); // New files start with 4 built in fonts, and 21 built in styles @@ -69,7 +69,7 @@ public final class TestHSSFOptimiser { } @Test - public void testOptimiseFonts() { + void testOptimiseFonts() { HSSFWorkbook wb = new HSSFWorkbook(); // Add 6 fonts, some duplicates @@ -168,7 +168,7 @@ public final class TestHSSFOptimiser { } @Test - public void testOptimiseStyles() { + void testOptimiseStyles() { HSSFWorkbook wb = new HSSFWorkbook(); // Two fonts @@ -285,7 +285,7 @@ public final class TestHSSFOptimiser { } @Test - public void testOptimiseStylesCheckActualStyles() { + void testOptimiseStylesCheckActualStyles() { HSSFWorkbook wb = new HSSFWorkbook(); // Several styles @@ -326,7 +326,7 @@ public final class TestHSSFOptimiser { } @Test - public void testColumnAndRowStyles() { + void testColumnAndRowStyles() { HSSFWorkbook wb = new HSSFWorkbook(); assertEquals(21, wb.getNumCellStyles(), "Usually we have 21 pre-defined styles in a newly created Workbook, see InternalWorkbook.createWorkbook()"); @@ -359,7 +359,7 @@ public final class TestHSSFOptimiser { } @Test - public void testUnusedStyle() { + void testUnusedStyle() { HSSFWorkbook wb = new HSSFWorkbook(); assertEquals(21, wb.getNumCellStyles(), "Usually we have 21 pre-defined styles in a newly created Workbook, see InternalWorkbook.createWorkbook()"); @@ -397,7 +397,7 @@ public final class TestHSSFOptimiser { } @Test - public void testUnusedStyleOneUsed() { + void testUnusedStyleOneUsed() { HSSFWorkbook wb = new HSSFWorkbook(); assertEquals(21, wb.getNumCellStyles(), "Usually we have 21 pre-defined styles in a newly created Workbook, see InternalWorkbook.createWorkbook()"); @@ -435,7 +435,7 @@ public final class TestHSSFOptimiser { } @Test - public void testDefaultColumnStyleWitoutCell() { + void testDefaultColumnStyleWitoutCell() { HSSFWorkbook wb = new HSSFWorkbook(); assertEquals(21, wb.getNumCellStyles(), "Usually we have 21 pre-defined styles in a newly created Workbook, see InternalWorkbook.createWorkbook()"); @@ -477,7 +477,7 @@ public final class TestHSSFOptimiser { } @Test - public void testUserDefinedStylesAreNeverOptimizedAway() { + void testUserDefinedStylesAreNeverOptimizedAway() { HSSFWorkbook wb = new HSSFWorkbook(); assertEquals(21, wb.getNumCellStyles(), "Usually we have 21 pre-defined styles in a newly created Workbook, see InternalWorkbook.createWorkbook()"); @@ -536,7 +536,7 @@ public final class TestHSSFOptimiser { } @Test - public void testBug57517() { + void testBug57517() { HSSFWorkbook wb = new HSSFWorkbook(); assertEquals(21, wb.getNumCellStyles(), "Usually we have 21 pre-defined styles in a newly created Workbook, see InternalWorkbook.createWorkbook()"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java index d009a6f58a..a265c0bda3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java @@ -50,7 +50,7 @@ public final class TestHSSFPalette { * Verifies that a custom palette can be created, saved, and reloaded */ @Test - public void testCustomPalette() { + void testCustomPalette() { //reading sample xls HSSFWorkbook book = HSSFTestDataSamples.openSampleWorkbook("Simple.xls"); @@ -86,7 +86,7 @@ public final class TestHSSFPalette { */ @SuppressWarnings("ConstantConditions") @Test - public void testPaletteFromCellColours() { + void testPaletteFromCellColours() { HSSFWorkbook book = HSSFTestDataSamples.openSampleWorkbook("SimpleWithColours.xls"); HSSFPalette p = book.getCustomPalette(); @@ -146,7 +146,7 @@ public final class TestHSSFPalette { @SuppressWarnings("ConstantConditions") @Test - public void testFindSimilar() throws IOException { + void testFindSimilar() throws IOException { HSSFWorkbook book = new HSSFWorkbook(); HSSFPalette p = book.getCustomPalette(); @@ -237,7 +237,7 @@ public final class TestHSSFPalette { * hardcoded values in the HSSFColor default color palette */ @Test - public void testGnumericStrings() { + void testGnumericStrings() { compareToDefaults((expected, palette) -> assertEquals(expected.getHexString(), palette.getHexString())); } @@ -245,7 +245,7 @@ public final class TestHSSFPalette { * Verifies that the palette handles invalid palette indexes */ @Test - public void testBadIndexes() { + void testBadIndexes() { //too small _hssfPalette.setColorAtIndex((short) 2, (byte) 255, (byte) 255, (byte) 255); //too large @@ -271,7 +271,7 @@ public final class TestHSSFPalette { } @Test - public void testAddColor() { + void testAddColor() { assertThrows(RuntimeException.class, () -> _hssfPalette.addColor((byte)10,(byte)10,(byte)10), "Failing because by default there are no colours left in the palette."); } @@ -281,7 +281,7 @@ public final class TestHSSFPalette { } @Test - public void test48403() throws Exception { + void test48403() throws Exception { HSSFWorkbook wb = new HSSFWorkbook(); Color color = Color.decode("#006B6B"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java index 4e81dbc402..5d4608a7c1 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public final class TestHSSFPatriarch { @Test - public void testBasic() throws IOException { + void testBasic() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); @@ -38,7 +38,7 @@ public final class TestHSSFPatriarch { } @Test - public void test44916() throws IOException { + void test44916() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java index 0a9a0b8894..b2f767465b 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java @@ -54,7 +54,7 @@ public final class TestHSSFPictureData { } @Test - public void testPictures() throws IOException { + void testPictures() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("SimpleWithImages.xls"); // TODO - add getFormat() to interface PictureData and genericise wb.getAllPictures() @@ -91,7 +91,7 @@ public final class TestHSSFPictureData { } @Test - public void testMacPicture() throws IOException { + void testMacPicture() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("53446.xls"); try{ @@ -116,7 +116,7 @@ public final class TestHSSFPictureData { } @Test - public void testNotNullPictures() { + void testNotNullPictures() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("SheetWithDrawing.xls"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRichTextString.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRichTextString.java index 36d8f13c78..45c084e47d 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRichTextString.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRichTextString.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; public final class TestHSSFRichTextString { @Test - public void testApplyFont() { + void testApplyFont() { HSSFRichTextString r = new HSSFRichTextString("testing"); assertEquals(0,r.numFormattingRuns()); r.applyFont(2,4, new HSSFFont((short)1, null)); @@ -64,7 +64,7 @@ public final class TestHSSFRichTextString { } @Test - public void testClearFormatting() { + void testClearFormatting() { HSSFRichTextString r = new HSSFRichTextString("testing"); assertEquals(0, r.numFormattingRuns()); r.applyFont(2, 4, new HSSFFont( (short) 1, null)); @@ -78,7 +78,7 @@ public final class TestHSSFRichTextString { * Test case proposed in Bug 40520: formated twice => will format whole String */ @Test - public void test40520_1() { + void test40520_1() { short font = 3; HSSFRichTextString r = new HSSFRichTextString("f0_123456789012345678901234567890123456789012345678901234567890"); @@ -95,7 +95,7 @@ public final class TestHSSFRichTextString { * Test case proposed in Bug 40520: overlapped range => will format whole String */ @Test - public void test40520_2() { + void test40520_2() { short font = 3; HSSFRichTextString r = new HSSFRichTextString("f0_123456789012345678901234567890123456789012345678901234567890"); @@ -112,7 +112,7 @@ public final class TestHSSFRichTextString { * Test case proposed in Bug 40520: formated twice => will format whole String */ @Test - public void test40520_3() { + void test40520_3() { short font = 3; HSSFRichTextString r = new HSSFRichTextString("f0_123456789012345678901234567890123456789012345678901234567890"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java index 8efbfde89f..ce0cdcb4b8 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java @@ -44,7 +44,7 @@ public final class TestHSSFRow extends BaseTestRow { } @Test - public void testLastAndFirstColumns_bug46654() throws IOException { + void testLastAndFirstColumns_bug46654() throws IOException { int ROW_IX = 10; int COL_IX = 3; HSSFWorkbook workbook = new HSSFWorkbook(); @@ -73,7 +73,7 @@ public final class TestHSSFRow extends BaseTestRow { } @Test - public void testMoveCell() throws IOException { + void testMoveCell() throws IOException { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); HSSFRow row = sheet.createRow(0); @@ -113,7 +113,7 @@ public final class TestHSSFRow extends BaseTestRow { @Override @Test - public void testRowHeight() throws IOException{ + protected void testRowHeight() throws IOException{ HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); HSSFRow row = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java index 15c9ef2414..b941234a7d 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java @@ -1067,7 +1067,7 @@ public final class TestHSSFSheet extends BaseTestSheet { } @Test - public void test58746() throws IOException { + void test58746() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet first = wb.createSheet("first"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftColumns.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftColumns.java index 5da9a1c606..a3fc474a55 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftColumns.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftColumns.java @@ -60,21 +60,21 @@ public class TestHSSFSheetShiftColumns extends BaseTestSheetShiftColumns { @Override @Disabled("see <https://bz.apache.org/bugzilla/show_bug.cgi?id=62030>") @Test - public void testBug54524() throws IOException { + protected void testBug54524() throws IOException { // This override is used only in order to test failing for HSSF. Please remove method after code is fixed on hssf, // so that original method from BaseTestSheetShiftColumns can be executed. } @Override @Disabled("see <https://bz.apache.org/bugzilla/show_bug.cgi?id=62030>") @Test - public void testCommentsShifting() throws IOException { + protected void testCommentsShifting() throws IOException { // This override is used only in order to test failing for HSSF. Please remove method after code is fixed on hssf, // so that original method from BaseTestSheetShiftColumns can be executed. } @Override @Disabled("see <https://bz.apache.org/bugzilla/show_bug.cgi?id=62030>") @Test - public void testShiftWithMergedRegions() throws IOException { + protected void testShiftWithMergedRegions() throws IOException { // This override is used only in order to test failing for HSSF. Please remove method after code is fixed on hssf, // so that original method from BaseTestSheetShiftColumns can be executed. // After removing, you can re-add 'final' keyword to specification of original method. @@ -82,5 +82,5 @@ public class TestHSSFSheetShiftColumns extends BaseTestSheetShiftColumns { @Override @Disabled("see <https://bz.apache.org/bugzilla/show_bug.cgi?id=62030>") @Test - public void testShiftHyperlinks() throws IOException {} + protected void testShiftHyperlinks() throws IOException {} } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java index 7007c1edbc..9142347640 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheetUpdateArrayFormulas.java @@ -53,7 +53,7 @@ public final class TestHSSFSheetUpdateArrayFormulas extends BaseTestSheetUpdateA // Test methods common with XSSF are in superclass // Local methods here test HSSF-specific details of updating array formulas @Test - public void testHSSFSetArrayFormula_singleCell() throws IOException { + void testHSSFSetArrayFormula_singleCell() throws IOException { try (HSSFWorkbook workbook = new HSSFWorkbook()) { HSSFSheet sheet = workbook.createSheet("Sheet1"); @@ -80,7 +80,7 @@ public final class TestHSSFSheetUpdateArrayFormulas extends BaseTestSheetUpdateA * Makes sure the internal state of HSSFSheet is consistent after removing array formulas */ @Test - public void testAddRemoveArrayFormulas_recordUpdates() throws IOException { + void testAddRemoveArrayFormulas_recordUpdates() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet("Sheet1"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFTextbox.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFTextbox.java index 8d01fb2bc1..692c487a31 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFTextbox.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFTextbox.java @@ -32,7 +32,7 @@ public final class TestHSSFTextbox { * Test that accessors to horizontal and vertical alignment work properly */ @Test - public void testAlignment() throws IOException { + void testAlignment() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sh1 = wb.createSheet(); HSSFPatriarch patriarch = sh1.createDrawingPatriarch(); @@ -53,7 +53,7 @@ public final class TestHSSFTextbox { * When inserting text make sure that if font is not set we must set the default one. */ @Test - public void testSetDeafultTextFormat() throws IOException { + void testSetDeafultTextFormat() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java index 9cf92f3c1e..97a0655fd1 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java @@ -857,7 +857,7 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook { } @Test - public void testMethods() throws IOException { + void testMethods() throws IOException { try (HSSFWorkbook wb=new HSSFWorkbook()) { assertDoesNotThrow(wb::insertChartRecord); //wb.dumpDrawingGroupRecords(true); @@ -1012,7 +1012,7 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook { } @Test - public void test49423() throws Exception + void test49423() throws Exception { HSSFWorkbook workbook = openSampleWorkbook("49423.xls"); @@ -1045,7 +1045,7 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook { } @Test - public void testRewriteFileBug58480() throws IOException { + void testRewriteFileBug58480() throws IOException { final File file = TempFile.createTempFile("TestHSSFWorkbook", ".xls"); try { @@ -1167,7 +1167,7 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook { } @Test - public void testWriteToNewFile() throws Exception { + void testWriteToNewFile() throws Exception { // Save to a new temp file final File file = TempFile.createTempFile("TestHSSFWorkbook", ".xls"); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java b/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java index 6a4a6dc885..4a8bfc97e1 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java @@ -41,7 +41,7 @@ public final class TestNonStandardWorkbookStreamNames { * Test that we can open a file with WORKBOOK */ @Test - public void testOpenWORKBOOK() throws IOException { + void testOpenWORKBOOK() throws IOException { // Try to open the workbook InputStream is = HSSFTestDataSamples.openSampleFileStream(xlsA); HSSFWorkbook wb = new HSSFWorkbook(is); @@ -62,7 +62,7 @@ public final class TestNonStandardWorkbookStreamNames { * Test that we can open a file with BOOK */ @Test - public void testOpenBOOK() throws IOException { + void testOpenBOOK() throws IOException { // Try to open the workbook InputStream is = HSSFTestDataSamples.openSampleFileStream(xlsB); HSSFWorkbook wb = new HSSFWorkbook(is); @@ -83,7 +83,7 @@ public final class TestNonStandardWorkbookStreamNames { * Test that when we write out, we go back to the correct case */ @Test - public void testWrite() throws IOException { + void testWrite() throws IOException { for (String file : new String[] {xlsA, xlsB}) { // Open the workbook, not preserving nodes InputStream is = HSSFTestDataSamples.openSampleFileStream(file); @@ -110,7 +110,7 @@ public final class TestNonStandardWorkbookStreamNames { * correct case */ @Test - public void testWritePreserve() throws IOException { + void testWritePreserve() throws IOException { // Open the workbook, not preserving nodes InputStream is = HSSFTestDataSamples.openSampleFileStream(xlsA); HSSFWorkbook wb = new HSSFWorkbook(is,true); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java b/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java index 7df9275555..b7f67c84d4 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestOLE2Embeding.java @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; public final class TestOLE2Embeding { @Test - public void testEmbeding() throws Exception { + void testEmbeding() throws Exception { // This used to break, until bug #43116 was fixed try (HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("ole2-embedding.xls")) { // Check we can get at the Escher layer still @@ -49,7 +49,7 @@ public final class TestOLE2Embeding { } @Test - public void testEmbeddedObjects() throws Exception { + void testEmbeddedObjects() throws Exception { try (HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("ole2-embedding.xls")) { List<HSSFObjectData> objects = workbook.getAllEmbeddedObjects(); assertEquals(2, objects.size(), "Wrong number of objects"); @@ -59,7 +59,7 @@ public final class TestOLE2Embeding { } @Test - public void testReallyEmbedSomething() throws Exception { + void testReallyEmbedSomething() throws Exception { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java b/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java index 62b27c1800..877ae6e42e 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java @@ -38,7 +38,7 @@ public class TestPOIFSProperties { private static final String title = "Testing POIFS properties"; @Test - public void testFail() throws Exception { + void testFail() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); { // read the workbook, adjust the SummaryInformation and write the data to a byte array POIFSFileSystem fs = openFileSystem(); @@ -60,7 +60,7 @@ public class TestPOIFSProperties { } @Test - public void testOK() throws Exception { + void testOK() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); { // read the workbook, adjust the SummaryInformation and write the data to a byte array POIFSFileSystem fs = openFileSystem(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestPatriarch.java b/src/testcases/org/apache/poi/hssf/usermodel/TestPatriarch.java index 30dfe80b5a..b60d779120 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestPatriarch.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestPatriarch.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; public class TestPatriarch { @Test - public void testGetPatriarch(){ + void testGetPatriarch(){ HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sh = wb.createSheet(); assertNull(sh.getDrawingPatriarch()); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestPolygon.java b/src/testcases/org/apache/poi/hssf/usermodel/TestPolygon.java index f76cd0983b..0857ca7dd0 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestPolygon.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestPolygon.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public class TestPolygon { @Test - public void testResultEqualsToAbstractShape() throws IOException { + void testResultEqualsToAbstractShape() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sh = wb.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -76,7 +76,7 @@ public class TestPolygon { } @Test - public void testPolygonPoints() throws IOException { + void testPolygonPoints() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sh = wb.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -129,7 +129,7 @@ public class TestPolygon { } @Test - public void testSetGetProperties() throws IOException { + void testSetGetProperties() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -178,7 +178,7 @@ public class TestPolygon { } @Test - public void testAddToExistingFile() throws IOException { + void testAddToExistingFile() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -232,7 +232,7 @@ public class TestPolygon { } @Test - public void testExistingFile() throws IOException { + void testExistingFile() throws IOException { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls"); HSSFSheet sheet = wb.getSheet("polygon"); HSSFPatriarch drawing = sheet.getDrawingPatriarch(); @@ -248,7 +248,7 @@ public class TestPolygon { } @Test - public void testPolygonType() throws IOException { + void testPolygonType() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestReadWriteChart.java b/src/testcases/org/apache/poi/hssf/usermodel/TestReadWriteChart.java index 7f0cc0c24f..44bd3d8caa 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestReadWriteChart.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestReadWriteChart.java @@ -42,7 +42,7 @@ public final class TestReadWriteChart { * In the presence of a chart we need to make sure BOF/EOF records still exist. */ @Test - public void testBOFandEOFRecords() throws Exception { + void testBOFandEOFRecords() throws Exception { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("SimpleChart.xls"); HSSFSheet sheet = workbook.getSheetAt(0); HSSFRow firstRow = sheet.getRow(0); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java index f94b63ce2e..36fb392f74 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java @@ -41,7 +41,7 @@ public final class TestRowStyle { * HSSFSheet last row or first row is incorrect. <P> */ @Test - public void testWriteSheetFont() throws IOException { + void testWriteSheetFont() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); HSSFFont fnt = wb.createFont(); @@ -68,7 +68,7 @@ public final class TestRowStyle { * Tests that is creating a file with a date or an calendar works correctly. */ @Test - public void testDataStyle() throws IOException { + void testDataStyle() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); HSSFCellStyle cs = wb.createCellStyle(); @@ -106,7 +106,7 @@ public final class TestRowStyle { * HSSFSheet last row or first row is incorrect. <P> */ @Test - public void testWriteSheetStyle() throws IOException { + void testWriteSheetStyle() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet s = wb.createSheet(); HSSFFont fnt = wb.createFont(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java b/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java index cd020fe6d1..b77f98edfb 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestSanityChecker.java @@ -46,7 +46,7 @@ public final class TestSanityChecker { } @Test - public void testCheckRecordOrder() { + void testCheckRecordOrder() { final SanityChecker c = new SanityChecker(); List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); records.add(new BOFRecord()); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestShapeGroup.java b/src/testcases/org/apache/poi/hssf/usermodel/TestShapeGroup.java index c927b9273f..a3db849f14 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestShapeGroup.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestShapeGroup.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public class TestShapeGroup { @Test - public void testSetGetCoordinates() throws IOException { + void testSetGetCoordinates() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -64,7 +64,7 @@ public class TestShapeGroup { } @Test - public void testAddToExistingFile() throws IOException { + void testAddToExistingFile() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -94,7 +94,7 @@ public class TestShapeGroup { } @Test - public void testModify() throws IOException { + void testModify() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); // create a sheet with a text box @@ -172,7 +172,7 @@ public class TestShapeGroup { } @Test - public void testAddShapesToGroup() throws IOException { + void testAddShapesToGroup() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); // create a sheet with a text box @@ -234,7 +234,7 @@ public class TestShapeGroup { } @Test - public void testSpgrRecord() throws IOException { + void testSpgrRecord() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); // create a sheet with a text box @@ -251,7 +251,7 @@ public class TestShapeGroup { } @Test - public void testClearShapes() throws IOException { + void testClearShapes() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestSheetHiding.java b/src/testcases/org/apache/poi/hssf/usermodel/TestSheetHiding.java index 0164a69189..5a1e8f05b1 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestSheetHiding.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestSheetHiding.java @@ -36,7 +36,7 @@ public final class TestSheetHiding extends BaseTestSheetHiding { } @Test - public void testInternalWorkbookHidden() { + void testInternalWorkbookHidden() { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet("MySheet"); InternalWorkbook intWb = wb.getWorkbook(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestText.java b/src/testcases/org/apache/poi/hssf/usermodel/TestText.java index 751f7f5fb3..81b9c6e5a3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestText.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestText.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public class TestText { @Test - public void testResultEqualsToNonExistingAbstractShape() throws IOException { + void testResultEqualsToNonExistingAbstractShape() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sh = wb.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -88,7 +88,7 @@ public class TestText { } @Test - public void testAddTextToExistingFile() throws Exception { + void testAddTextToExistingFile() throws Exception { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -123,7 +123,7 @@ public class TestText { } @Test - public void testSetGetProperties() throws Exception { + void testSetGetProperties() throws Exception { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sh = wb1.createSheet(); HSSFPatriarch patriarch = sh.createDrawingPatriarch(); @@ -196,7 +196,7 @@ public class TestText { } @Test - public void testExistingFileWithText() throws Exception { + void testExistingFileWithText() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("drawings.xls"); HSSFSheet sheet = wb.getSheet("text"); HSSFPatriarch drawing = sheet.getDrawingPatriarch(); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java index 828e8b6087..855d82eec2 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java @@ -42,7 +42,7 @@ import org.junit.jupiter.api.Test; */ public final class TestUnfixedBugs { @Test - public void testFormulaRecordAggregate_1() throws Exception { + void testFormulaRecordAggregate_1() throws Exception { // fails at formula "=MEHRFACH.OPERATIONEN(E$3;$B$5;$D4)" try (Workbook wb = HSSFTestDataSamples.openSampleWorkbook("44958_1.xls")) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { @@ -66,7 +66,7 @@ public final class TestUnfixedBugs { } @Test - public void testFormulaRecordAggregate() throws Exception { + void testFormulaRecordAggregate() throws Exception { // fails at formula "=MEHRFACH.OPERATIONEN(E$3;$B$5;$D4)" try (Workbook wb = HSSFTestDataSamples.openSampleWorkbook("44958.xls")) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { @@ -90,7 +90,7 @@ public final class TestUnfixedBugs { } @Test - public void testBug57074() throws IOException { + void testBug57074() throws IOException { Workbook wb = HSSFTestDataSamples.openSampleWorkbook("57074.xls"); Sheet sheet = wb.getSheet("Sheet1"); Row row = sheet.getRow(0); @@ -109,13 +109,13 @@ public final class TestUnfixedBugs { } @Test - public void testBug62242() { + void testBug62242() { CellFormat cfUK = CellFormat.getInstance("_ * #,##0.00_ ;_ * \\-#,##0.00_ ;_ * \"-\"??_ ;_ @_"); assertEquals(" - ", cfUK.apply((double) 0).text); } @Test - public void testDataFormattingWithQuestionMarkBug62242() { + void testDataFormattingWithQuestionMarkBug62242() { // The question mark in the format should be replaced by blanks, but // this is currently not handled when producing the Java formatting and // so we end up with a trailing zero here @@ -124,7 +124,7 @@ public final class TestUnfixedBugs { } @Test - public void testDataFormattingWithQuestionMarkAndPoundBug62242() { + void testDataFormattingWithQuestionMarkAndPoundBug62242() { char pound = '\u00A3'; // The question mark in the format should be replaced by blanks, but diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestUnicodeWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestUnicodeWorkbook.java index d4e19943b5..ec5d519275 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestUnicodeWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestUnicodeWorkbook.java @@ -33,7 +33,7 @@ public final class TestUnicodeWorkbook { * It should have been written as a compressed unicode. */ @Test - public void testUmlatReadWrite() throws IOException { + void testUmlatReadWrite() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { //Create a unicode sheet name (euro symbol) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java index 678dd9e976..4d2f395b23 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java @@ -60,7 +60,7 @@ public final class TestWorkbook { * HSSFSheet last row or first row is incorrect. <P> */ @Test - public void testWriteSheetSimple() throws IOException { + void testWriteSheetSimple() throws IOException { try (HSSFWorkbook wb1 = new HSSFWorkbook()) { HSSFSheet s = wb1.createSheet(); @@ -89,7 +89,7 @@ public final class TestWorkbook { * HSSFSheet last row or first row is incorrect. <P> */ @Test - public void testWriteModifySheetSimple() throws IOException { + void testWriteModifySheetSimple() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet s = wb1.createSheet(); @@ -127,7 +127,7 @@ public final class TestWorkbook { * in the sheet in their known positions.<P> */ @Test - public void testReadSimple() throws IOException { + void testReadSimple() throws IOException { HSSFWorkbook wb = openSample("Simple.xls"); HSSFSheet sheet = wb.getSheetAt(0); @@ -144,7 +144,7 @@ public final class TestWorkbook { * in the sheet in their known positions.<P> */ @Test - public void testReadSimpleWithDataFormat() throws IOException { + void testReadSimpleWithDataFormat() throws IOException { HSSFWorkbook wb = openSample("SimpleWithDataFormat.xls"); HSSFSheet sheet = wb.getSheetAt(0); HSSFDataFormat format = wb.createDataFormat(); @@ -165,7 +165,7 @@ public final class TestWorkbook { * in the sheet in their known positions.<P> */ @Test - public void testWriteDataFormat() throws IOException { + void testWriteDataFormat() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet s1 = wb1.createSheet(); HSSFDataFormat format = wb1.createDataFormat(); @@ -204,7 +204,7 @@ public final class TestWorkbook { * */ @Test - public void testReadEmployeeSimple() throws IOException { + void testReadEmployeeSimple() throws IOException { HSSFWorkbook wb = openSample("Employee.xls"); HSSFSheet sheet = wb.getSheetAt(0); @@ -228,7 +228,7 @@ public final class TestWorkbook { * is incorrect or has not been replaced. <P> */ @Test - public void testModifySimple() throws IOException { + void testModifySimple() throws IOException { HSSFWorkbook wb1 = openSample("Simple.xls"); HSSFSheet sheet = wb1.getSheetAt(0); HSSFCell cell = sheet.getRow(0).getCell(0); @@ -257,7 +257,7 @@ public final class TestWorkbook { * or is incorrect. <P> */ @Test - public void testModifySimpleWithSkip() throws IOException { + void testModifySimpleWithSkip() throws IOException { HSSFWorkbook wb1 = openSample("SimpleWithSkip.xls"); HSSFSheet sheet = wb1.getSheetAt(0); HSSFCell cell = sheet.getRow(0).getCell(1); @@ -295,7 +295,7 @@ public final class TestWorkbook { * is incorrect or has not been replaced. <P> */ @Test - public void testModifySimpleWithStyling() throws IOException { + void testModifySimpleWithStyling() throws IOException { HSSFWorkbook wb1 = openSample("SimpleWithStyling.xls"); HSSFSheet sheet = wb1.getSheetAt(0); @@ -328,7 +328,7 @@ public final class TestWorkbook { * is incorrect or has not been replaced. <P> */ @Test - public void testModifyEmployee() throws IOException { + void testModifyEmployee() throws IOException { HSSFWorkbook wb1 = openSample("Employee.xls"); HSSFSheet sheet = wb1.getSheetAt(0); HSSFCell cell = sheet.getRow(3).getCell(2); @@ -358,7 +358,7 @@ public final class TestWorkbook { * FAILURE: HSSF does not read a sheet or excepts. HSSF incorrectly identifies the cell<P> */ @Test - public void testReadSheetWithRK() throws IOException { + void testReadSheetWithRK() throws IOException { HSSFWorkbook wb = openSample("rk.xls"); HSSFSheet s = wb.getSheetAt(0); HSSFCell c = s.getRow(0).getCell(0); @@ -378,7 +378,7 @@ public final class TestWorkbook { * HSSFSheet last row or first row is incorrect. <P> */ @Test - public void testWriteModifySheetMerged() throws IOException { + void testWriteModifySheetMerged() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet s = wb1.createSheet(); @@ -426,7 +426,7 @@ public final class TestWorkbook { * Test the backup field gets set as expected. */ @Test - public void testBackupRecord() throws IOException { + void testBackupRecord() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); wb.createSheet(); InternalWorkbook workbook = wb.getWorkbook(); @@ -467,7 +467,7 @@ public final class TestWorkbook { * We need to make sure only one LabelSSTRecord is produced. */ @Test - public void testRepeatingBug() throws IOException { + void testRepeatingBug() throws IOException { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("Design Variants"); HSSFRow row = sheet.createRow(2); @@ -490,7 +490,7 @@ public final class TestWorkbook { * This bug was first fixed in svn r352609. */ @Test - public void testRowIndexesBeyond32768() throws IOException { + void testRowIndexesBeyond32768() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet(); HSSFRow row; @@ -520,7 +520,7 @@ public final class TestWorkbook { * Generate a file to verify repeating rows and cols made it */ @Test - public void testRepeatingColsRows() throws IOException { + void testRepeatingColsRows() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); HSSFSheet sheet = wb1.createSheet("Test Print Titles"); @@ -546,7 +546,7 @@ public final class TestWorkbook { * Test setRepeatingRowsAndColumns when startRow and startColumn are -1. */ @Test - public void testRepeatingColsRowsMinusOne() throws IOException + void testRepeatingColsRowsMinusOne() throws IOException { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("Test Print Titles"); @@ -568,7 +568,7 @@ public final class TestWorkbook { } @Test - public void testBug58085RemoveSheetWithNames() throws Exception { + void testBug58085RemoveSheetWithNames() throws Exception { HSSFWorkbook wb1 = new HSSFWorkbook(); Sheet sheet1 = wb1.createSheet("sheet1"); Sheet sheet2 = wb1.createSheet("sheet2"); diff --git a/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java b/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java index c3c68a3dca..24bbe95c70 100644 --- a/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java +++ b/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java @@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test; public final class TestAreaReference { @Test - public void testAreaRef1() { + void testAreaRef1() { AreaReference ar = new AreaReference("$A$1:$B$2", SpreadsheetVersion.EXCEL97); assertFalse(ar.isSingleCell(), "Two cells expected"); CellReference cf = ar.getFirstCell(); @@ -91,7 +91,7 @@ public final class TestAreaReference { * Arne.Clauss@gedas.de */ @Test - public void testReferenceWithSheet() { + void testReferenceWithSheet() { AreaReference ar; ar = new AreaReference("Tabelle1!B5:B5", SpreadsheetVersion.EXCEL97); @@ -115,7 +115,7 @@ public final class TestAreaReference { } @Test - public void testContiguousReferences() { + void testContiguousReferences() { String refSimple = "$C$10:$C$10"; String ref2D = "$C$10:$D$11"; String refDCSimple = "$C$10:$C$10,$D$12:$D$12,$E$14:$E$14"; @@ -199,7 +199,7 @@ public final class TestAreaReference { } @Test - public void testDiscontinousReference() throws Exception { + void testDiscontinousReference() throws Exception { try (InputStream is = HSSFTestDataSamples.openSampleFileStream("44167.xls"); HSSFWorkbook wb = new HSSFWorkbook(is)) { InternalWorkbook workbook = TestHSSFWorkbook.getInternalWorkbook(wb); @@ -263,7 +263,7 @@ public final class TestAreaReference { } @Test - public void testSpecialSheetNames() { + void testSpecialSheetNames() { AreaReference ar; ar = new AreaReference("'Sheet A'!A1:A1", SpreadsheetVersion.EXCEL97); confirmAreaSheetName(ar, "Sheet A", "'Sheet A'!A1"); @@ -288,7 +288,7 @@ public final class TestAreaReference { } @Test - public void testWholeColumnRefs() { + void testWholeColumnRefs() { confirmWholeColumnRef("A:A", 0, 0, false, false); confirmWholeColumnRef("$C:D", 2, 3, true, false); confirmWholeColumnRef("AD:$AE", 29, 30, false, true); diff --git a/src/testcases/org/apache/poi/hssf/util/TestCellReference.java b/src/testcases/org/apache/poi/hssf/util/TestCellReference.java index ab23476c1d..f35ea33a50 100644 --- a/src/testcases/org/apache/poi/hssf/util/TestCellReference.java +++ b/src/testcases/org/apache/poi/hssf/util/TestCellReference.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; */ public final class TestCellReference { @Test - public void testColNumConversion() { + void testColNumConversion() { assertEquals(0, CellReference.convertColStringToIndex("A")); assertEquals(1, CellReference.convertColStringToIndex("B")); assertEquals(25, CellReference.convertColStringToIndex("Z")); @@ -61,7 +61,7 @@ public final class TestCellReference { } @Test - public void testAbsRef1(){ + void testAbsRef1(){ CellReference cf = new CellReference("$B$5"); confirmCell(cf, null, 4, 1, true, true, "$B$5"); } @@ -109,7 +109,7 @@ public final class TestCellReference { } @Test - public void testSpecialSheetNames() { + void testSpecialSheetNames() { CellReference cf; cf = new CellReference("'profit + loss'!A1"); confirmCell(cf, "profit + loss", 0, 0, false, false, "'profit + loss'!A1"); @@ -133,7 +133,7 @@ public final class TestCellReference { } @Test - public void testClassifyCellReference() { + void testClassifyCellReference() { confirmNameType("a1", NameType.CELL); confirmNameType("pfy1", NameType.NAMED_RANGE); confirmNameType("pf1", NameType.NAMED_RANGE); // (col) out of cell range @@ -148,7 +148,7 @@ public final class TestCellReference { } @Test - public void testClassificationOfRowReferences(){ + void testClassificationOfRowReferences(){ confirmNameType("10", NameType.ROW); confirmNameType("$10", NameType.ROW); confirmNameType("65536", NameType.ROW); diff --git a/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java b/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java index ac636c8f5c..64cbd3df06 100644 --- a/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java +++ b/src/testcases/org/apache/poi/hssf/util/TestHSSFColor.java @@ -27,13 +27,13 @@ import org.junit.jupiter.api.Test; public final class TestHSSFColor { @Test - public void testBasics() { + void testBasics() { assertTrue(HSSFColorPredefined.YELLOW.getIndex() > 0); assertTrue(HSSFColorPredefined.YELLOW.getIndex2() > 0); } @Test - public void testContents() { + void testContents() { short[] triplet = HSSFColorPredefined.YELLOW.getTriplet(); assertEquals(3, triplet.length); assertEquals(255, triplet[0]); @@ -44,7 +44,7 @@ public final class TestHSSFColor { } @Test - public void testTripletHash() { + void testTripletHash() { Map<String, HSSFColor> triplets = HSSFColor.getTripletHash(); assertEquals( diff --git a/src/testcases/org/apache/poi/hssf/util/TestRKUtil.java b/src/testcases/org/apache/poi/hssf/util/TestRKUtil.java index 28e1964ff7..a976666e57 100644 --- a/src/testcases/org/apache/poi/hssf/util/TestRKUtil.java +++ b/src/testcases/org/apache/poi/hssf/util/TestRKUtil.java @@ -30,7 +30,7 @@ public final class TestRKUtil { * Check we can decode correctly. */ @Test - public void testDecode() { + void testDecode() { int[] values = { 1074266112, 1081384961, 1081397249, 0x3FF00000, 0x405EC001, 0x02F1853A, 0x02F1853B, 0xFCDD699A, |