diff options
Diffstat (limited to 'src/testcases')
416 files changed, 2007 insertions, 2080 deletions
diff --git a/src/testcases/org/apache/poi/TestJDK12.java b/src/testcases/org/apache/poi/TestJDK12.java index d1d6d087f4..588192671a 100644 --- a/src/testcases/org/apache/poi/TestJDK12.java +++ b/src/testcases/org/apache/poi/TestJDK12.java @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; */ public class TestJDK12 { @Test - public void test() { + void test() { assertDoesNotThrow(() -> { BufferedImage img = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = img.createGraphics(); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherBSERecord.java b/src/testcases/org/apache/poi/ddf/TestEscherBSERecord.java index 82d573df18..1ddb8afa3e 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherBSERecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherBSERecord.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherBSERecord { @Test - public void testFillFields() { + void testFillFields() { String data = "01 00 00 00 24 00 00 00 05 05 01 02 03 04 " + " 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00 01 00 00 00 " + " 00 00 02 00 00 00 03 00 00 00 04 05 06 07"; @@ -52,7 +52,7 @@ public final class TestEscherBSERecord { } @Test - public void testSerialize() throws IOException { + void testSerialize() throws IOException { EscherBSERecord r = createRecord(); String exp64 = "H4sIAAAAAAAAAGNkYP+gwsDAwMrKyMTMwsrGzsHJxc3Dy8fPwMgAAkxAzAzEICkAgs9OoSwAAAA="; byte[] expected = RawDataUtil.decompress(exp64); @@ -82,7 +82,7 @@ public final class TestEscherBSERecord { } @Test - public void testToString() { + void testToString() { EscherBSERecord record = createRecord(); String expected = "{ /* BSE */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java index d1644f052e..7ce2f22a2e 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java @@ -34,7 +34,7 @@ public final class TestEscherBlipRecord { //test reading/serializing of a PNG blip @Test - public void testReadPNG() { + void testReadPNG() { //provided in bug-44886 byte[] data = _samples.readFile("Container.dat"); @@ -80,7 +80,7 @@ public final class TestEscherBlipRecord { //test reading/serializing of a PICT metafile @Test - public void testReadPICT() { + void testReadPICT() { //provided in bug-44886 byte[] data = _samples.readFile("Container.dat"); @@ -133,7 +133,7 @@ public final class TestEscherBlipRecord { //integral test: check that the read-write-read round trip is consistent @Test - public void testContainer() { + void testContainer() { byte[] data = _samples.readFile("Container.dat"); EscherContainerRecord record = new EscherContainerRecord(); @@ -147,7 +147,7 @@ public final class TestEscherBlipRecord { * The test data was created from pl031405.xls attached to Bugzilla #47143 */ @Test - public void test47143() { + void test47143() { byte[] data = _samples.readFile("47143.dat"); EscherBSERecord bse = new EscherBSERecord(); bse.fillFields(data, 0, new DefaultEscherRecordFactory()); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java b/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java index 4f34ab1fb8..3d62c6a457 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherBoolProperty { @Test - public void testToString() { + void testToString() { EscherBoolProperty p = new EscherBoolProperty(EscherPropertyTypes.GEOMETRY__FILLOK, 1); String expected = "{ /* GEOMETRY__FILLOK */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java index c6d67052be..cd70f8223f 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherChildAnchorRecord { @Test - public void testSerialize() { + void testSerialize() { EscherChildAnchorRecord r = createRecord(); byte[] data = new byte[8 + 16]; @@ -41,7 +41,7 @@ public final class TestEscherChildAnchorRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "01 00 " + "0F F0 " + "10 00 00 00 " + @@ -63,7 +63,7 @@ public final class TestEscherChildAnchorRecord { } @Test - public void testToString(){ + void testToString(){ String expected = "{ /* CHILD_ANCHOR */\n" + "\t \"recordId\": -4081 /* 0xf00f */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherClientAnchorRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherClientAnchorRecord.java index 1cca9dd476..fcf1ead697 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherClientAnchorRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherClientAnchorRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public class TestEscherClientAnchorRecord { @Test - public void testSerialize() { + void testSerialize() { EscherClientAnchorRecord r = createRecord(); byte[] data = new byte[8 + 18 + 2]; @@ -41,7 +41,7 @@ public class TestEscherClientAnchorRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "01 00 " + "10 F0 " + "14 00 00 00 " + @@ -69,7 +69,7 @@ public class TestEscherClientAnchorRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* CLIENT_ANCHOR */\n" + "\t \"recordId\": -4080 /* 0xf010 */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherClientDataRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherClientDataRecord.java index e10a86ef84..c5cce8c28f 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherClientDataRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherClientDataRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public class TestEscherClientDataRecord { @Test - public void testSerialize() { + void testSerialize() { EscherClientDataRecord r = createRecord(); byte[] data = new byte[8]; @@ -38,7 +38,7 @@ public class TestEscherClientDataRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "02 00 " + "11 F0 " + "00 00 00 00 "; @@ -52,7 +52,7 @@ public class TestEscherClientDataRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* CLIENT_DATA */\n" + "\t \"recordId\": -4079 /* 0xf011 */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherContainerRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherContainerRecord.java index 832e66afd9..fb8559e89d 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherContainerRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherContainerRecord.java @@ -37,7 +37,7 @@ public final class TestEscherContainerRecord { private static final POIDataSamples _samples = POIDataSamples.getDDFInstance(); @Test - public void testFillFields() { + void testFillFields() { EscherRecordFactory f = new DefaultEscherRecordFactory(); byte[] data = HexRead.readFromString("0F 02 11 F1 00 00 00 00"); EscherRecord r = f.createRecord(data, 0); @@ -57,7 +57,7 @@ public final class TestEscherContainerRecord { } @Test - public void testSerialize() { + void testSerialize() { UnknownEscherRecord r = new UnknownEscherRecord(); r.setOptions((short) 0x123F); r.setRecordId((short) 0xF112); @@ -78,7 +78,7 @@ public final class TestEscherContainerRecord { } @Test - public void testToString() { + void testToString() { EscherContainerRecord r = new EscherContainerRecord(); r.setRecordId(EscherContainerRecord.SP_CONTAINER); r.setOptions((short) 0x000F); @@ -176,7 +176,7 @@ public final class TestEscherContainerRecord { } @Test - public void testGetRecordSize() { + void testGetRecordSize() { EscherContainerRecord r = new EscherContainerRecord(); r.addChildRecord(new DummyEscherRecord()); assertEquals(18, r.getRecordSize()); @@ -187,7 +187,7 @@ public final class TestEscherContainerRecord { * but hopefully we now read the correct size. */ @Test - public void testBug44857() { + void testBug44857() { byte[] data = _samples.readFile("Container.dat"); // This used to fail with an OutOfMemory @@ -203,7 +203,7 @@ public final class TestEscherContainerRecord { * Ensure {@link EscherContainerRecord} doesn't spill its guts everywhere */ @Test - public void testChildren() { + void testChildren() { EscherContainerRecord ecr = new EscherContainerRecord(); List<EscherRecord> children0 = ecr.getChildRecords(); assertEquals(0, children0.size()); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherDgRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherDgRecord.java index 8de2256f58..5407c23339 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherDgRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherDgRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherDgRecord { @Test - public void testSerialize() { + void testSerialize() { EscherDgRecord r = createRecord(); byte[] data = new byte[16]; @@ -40,7 +40,7 @@ public final class TestEscherDgRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "10 00 " + "08 F0 " + "08 00 00 00 " + @@ -56,7 +56,7 @@ public final class TestEscherDgRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* DG */\n" + "\t \"recordId\": -4088 /* 0xf008 */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherDggRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherDggRecord.java index 8666fd5693..75d3cdcbc3 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherDggRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherDggRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherDggRecord { @Test - public void testSerialize() { + void testSerialize() { EscherDggRecord r = createRecord(); byte[] data = new byte[32]; @@ -43,7 +43,7 @@ public final class TestEscherDggRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "00 00 " + "06 F0 " + "18 00 00 00 " + @@ -67,7 +67,7 @@ public final class TestEscherDggRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* DGG */\n" + "\t \"recordId\": -4090 /* 0xf006 */\n" + @@ -104,7 +104,7 @@ public final class TestEscherDggRecord { } @Test - public void testGetRecordSize() { + void testGetRecordSize() { EscherDggRecord r = new EscherDggRecord(); r.setFileIdClusters(new EscherDggRecord.FileIdCluster[] { new EscherDggRecord.FileIdCluster(0,0) } ); assertEquals(32,r.getRecordSize()); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherDump.java b/src/testcases/org/apache/poi/ddf/TestEscherDump.java index d53bb9496c..a9bb9551a3 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherDump.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherDump.java @@ -74,7 +74,7 @@ public class TestEscherDump { // simple test to at least cover some parts of the class @Test - public void testSimple() throws Exception { + void testSimple() throws Exception { // Decode the stream to bytes byte[] bytes = RawDataUtil.decompress(recordData); // Dump the contents of escher to stream. @@ -91,13 +91,13 @@ public class TestEscherDump { } @Test - public void testWithData() { + void testWithData() { dumper.dump(8, new byte[] {0, 0, 0, 0, 0, 0, 0, 0}, stream); assertEquals(6, countProperties()); } @Test - public void testWithSamplefile() throws Exception { + void testWithSamplefile() throws Exception { //InputStream stream = HSSFTestDataSamples.openSampleFileStream(") byte[] data = POIDataSamples.getDDFInstance().readFile("Container.dat"); dumper.dump(data.length, data, stream); @@ -113,7 +113,7 @@ public class TestEscherDump { } @Test - public void testCopy() throws Exception { + void testCopy() throws Exception { byte[] data1 = RawDataUtil.decompress(recordData); EscherRecordFactory recordFactory = new DefaultEscherRecordFactory(); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java index 79fcd66ad4..bac1991a6b 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherOptRecord { @Test - public void testFillFields() { + void testFillFields() { checkFillFieldsSimple(); checkFillFieldsComplex(); } @@ -81,7 +81,7 @@ public final class TestEscherOptRecord { } @Test - public void testSerialize() { + void testSerialize() { checkSerializeSimple(); checkSerializeComplex(); } @@ -139,7 +139,7 @@ public final class TestEscherOptRecord { } @Test - public void testToString() { + void testToString() { EscherOptRecord r = new EscherOptRecord(); // don't try to shoot in foot, please -- vlsergey // r.setOptions((short)0x000F); @@ -173,7 +173,7 @@ public final class TestEscherOptRecord { * This test is currently broken! */ @Test - public void testComplexSerialise() { + void testComplexSerialise() { byte[] data = { 0x53, 0x01, 0x0B, 0xF0-256, 0x9C-256, 0x01, 0x00, 0x00, // Simple data follows @@ -273,7 +273,7 @@ public final class TestEscherOptRecord { * See Bug 41946 for details. */ @Test - public void test41946() throws IOException { + void test41946() throws IOException { String data64 = "H4sIAAAAAAAAAB3SuW5TQRjF8TPfOOZCHMeARAluEKIzSEgUSCQsLaLgDYCehgIJCe8L+xIgQB6"+ "AEvEAOI6zOwlhX54BpBRIiGqY+Vvy7x6d+3k8nmufje/ISzVVrjrVNftWapCb5JbSqyMX7ZJ72I"+ @@ -302,7 +302,7 @@ public final class TestEscherOptRecord { * with empty complex part. */ @Test - public void testEmptyArrayProperty() { + void testEmptyArrayProperty() { EscherOptRecord r = new EscherOptRecord(); EscherArrayProperty p = new EscherArrayProperty(EscherPropertyTypes.FILL__SHADECOLORS, false, 0); assertEquals(0, p.getNumberOfElementsInArray()); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherProperty.java b/src/testcases/org/apache/poi/ddf/TestEscherProperty.java index a7a4774b0a..a7ca599726 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherProperty.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherProperty.java @@ -30,7 +30,7 @@ public class TestEscherProperty { * See Bugzilla 50401 */ @Test - public void testPropertyNames() throws Exception { + void testPropertyNames() throws Exception { EscherProperty p1 = new EscherSimpleProperty( EscherPropertyTypes.GROUPSHAPE__SHAPENAME, 0); assertEquals("groupshape.shapename", p1.getName()); assertEquals(EscherPropertyTypes.GROUPSHAPE__SHAPENAME.propNumber, p1.getPropertyNumber()); diff --git a/src/testcases/org/apache/poi/ddf/TestEscherPropertyFactory.java b/src/testcases/org/apache/poi/ddf/TestEscherPropertyFactory.java index dd64bd5e7c..48789db45e 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherPropertyFactory.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherPropertyFactory.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; public class TestEscherPropertyFactory { @Test - public void testCreateProperties() { + void testCreateProperties() { String dataStr = "41 C1 " + // propid, complex ind "03 00 00 00 " + // size of complex property "01 00 " + // propid, complex ind diff --git a/src/testcases/org/apache/poi/ddf/TestEscherSpRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherSpRecord.java index 8f1826c18c..1f4c553920 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherSpRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherSpRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public class TestEscherSpRecord { @Test - public void testSerialize() { + void testSerialize() { EscherSpRecord r = createRecord(); byte[] data = new byte[16]; @@ -40,7 +40,7 @@ public class TestEscherSpRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "02 00 " + "0A F0 " + "08 00 00 00 " + @@ -56,7 +56,7 @@ public class TestEscherSpRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* SP */\n" + "\t \"recordId\": -4086 /* 0xf00a */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherSpgrRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherSpgrRecord.java index 54c7589b81..6e3ae093ef 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherSpgrRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherSpgrRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherSpgrRecord { @Test - public void testSerialize() { + void testSerialize() { EscherSpgrRecord r = createRecord(); byte[] data = new byte[24]; @@ -42,7 +42,7 @@ public final class TestEscherSpgrRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "10 00 " + "09 F0 " + "10 00 00 00 " + @@ -62,7 +62,7 @@ public final class TestEscherSpgrRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* SPGR */\n" + "\t \"recordId\": -4087 /* 0xf009 */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestEscherSplitMenuColorsRecord.java b/src/testcases/org/apache/poi/ddf/TestEscherSplitMenuColorsRecord.java index 3180b6ddaa..59584ec0e7 100644 --- a/src/testcases/org/apache/poi/ddf/TestEscherSplitMenuColorsRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestEscherSplitMenuColorsRecord.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public final class TestEscherSplitMenuColorsRecord { @Test - public void testSerialize() { + void testSerialize() { EscherSplitMenuColorsRecord r = createRecord(); byte[] data = new byte[24]; @@ -42,7 +42,7 @@ public final class TestEscherSplitMenuColorsRecord { } @Test - public void testFillFields() { + void testFillFields() { String hexData = "40 00 " + "1E F1 " + "10 00 00 00 " + @@ -62,7 +62,7 @@ public final class TestEscherSplitMenuColorsRecord { } @Test - public void testToString() { + void testToString() { String expected = "{ /* SPLIT_MENU_COLORS */\n" + "\t \"recordId\": -3810 /* 0xf11e */\n" + diff --git a/src/testcases/org/apache/poi/ddf/TestUnknownEscherRecord.java b/src/testcases/org/apache/poi/ddf/TestUnknownEscherRecord.java index 2b7217de1c..d6afeaa8ff 100644 --- a/src/testcases/org/apache/poi/ddf/TestUnknownEscherRecord.java +++ b/src/testcases/org/apache/poi/ddf/TestUnknownEscherRecord.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; public final class TestUnknownEscherRecord { @Test - public void testFillFields() { + void testFillFields() { String testData = "0F 02 " + // options "11 F1 " + // record id @@ -123,7 +123,7 @@ public final class TestUnknownEscherRecord { } @Test - public void testSerialize() { + void testSerialize() { UnknownEscherRecord r = new UnknownEscherRecord(); r.setOptions( (short) 0x1234 ); r.setRecordId( (short) 0xF112 ); @@ -144,7 +144,7 @@ public final class TestUnknownEscherRecord { } @Test - public void testToString() { + void testToString() { UnknownEscherRecord r = new UnknownEscherRecord(); r.setOptions( (short) 0x1234 ); r.setRecordId( (short) 0xF112 ); diff --git a/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java b/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java index 6fcc2a89b4..9c3095be4a 100644 --- a/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java +++ b/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; public class TestVariantSupport { @Test - public void test52337() throws Exception { + void test52337() throws Exception { // document summary stream from test1-excel.doc attached to Bugzilla 52337 String documentSummaryEnc = "H4sIAAAAAAAAAG2RsUvDQBjFXxsraiuNKDoI8ZwclIJOjhYCGpQitINbzXChgTQtyQ3+Hw52cHB0E"+ diff --git a/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java b/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java deleted file mode 100644 index 51556b6bc5..0000000000 --- a/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.hpsf.basic; - -import org.apache.poi.POIDataSamples; - -import java.io.File; -import java.io.FileFilter; -import java.util.logging.Logger; - -/** - * <p>Processes a test method for all OLE2 files in the HPSF test data - * directory. Well, this class does not check whether a file is an OLE2 file but - * rather whether its name begins with "Test".</p> - */ -public class AllDataFilesTester { - private static final POIDataSamples _samples = POIDataSamples.getHPSFInstance(); - - /** - * <p>Interface specifying how to run a test on a single file.</p> - */ - public interface TestTask - { - /** - * <p>Executes a test on a single file.</p> - * - * @param file the file - * @throws Throwable if the method throws anything. - */ - void runTest(File file) throws Throwable; - } - - /** - * <p>Tests the simplified custom properties.</p> - * - * @param task the task to execute - * @throws Throwable - */ - public void runTests(final TestTask task) throws Throwable - { - POIDataSamples _samples = POIDataSamples.getHPSFInstance(); - final File dataDir = _samples.getFile(""); - final File[] docs = dataDir.listFiles(new FileFilter() - { - @Override - public boolean accept(final File file) - { - return file.isFile() && file.getName().startsWith("Test"); - }}); - for (final File doc : docs) { - final Logger logger = Logger.getLogger(getClass().getName()); - logger.info("Processing file \" " + doc + "\"."); - - /* Execute the test task. */ - task.runTest(doc); - } - } - -} diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java b/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java index dfccfdc235..07cbced68f 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java @@ -87,7 +87,7 @@ public final class TestBasic { * are expected to be in a certain order.</p> */ @Test - public void testReadFiles() { + void testReadFiles() { String[] expected = POI_FILES; for (int i = 0; i < expected.length; i++) { assertEquals(poiFiles.get(i).getName(), expected[i]); @@ -109,7 +109,7 @@ public final class TestBasic { * supported. */ @Test - public void testCreatePropertySets() + void testCreatePropertySets() throws UnsupportedEncodingException, IOException { Class<?>[] expected = { SummaryInformation.class, @@ -140,7 +140,7 @@ public final class TestBasic { * @exception HPSFException if any HPSF exception occurs */ @Test - public void testPropertySetMethods() throws IOException, HPSFException { + void testPropertySetMethods() throws IOException, HPSFException { /* Loop over the two property sets. */ for (int i = 0; i < 2; i++) { byte[] b = poiFiles.get(i).getBytes(); @@ -164,7 +164,7 @@ public final class TestBasic { * @exception HPSFException if any HPSF exception occurs */ @Test - public void testSectionMethods() throws IOException, HPSFException { + void testSectionMethods() throws IOException, HPSFException { InputStream is = new ByteArrayInputStream(poiFiles.get(0).getBytes()); final SummaryInformation si = (SummaryInformation)PropertySetFactory.create(is); final List<Section> sections = si.getSections(); diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java b/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java index cdba3e4a25..27723e33fa 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java @@ -39,7 +39,7 @@ public final class TestClassID { * Various tests of overridden .equals() */ @Test - public void testEquals() { + void testEquals() { ClassID clsidTest1 = new ClassID(BUF16, 0); ClassID clsidTest2 = new ClassID(BUF16, 0); byte[] buf2 = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17}; @@ -55,24 +55,24 @@ public final class TestClassID { * throw an Exception */ @Test - public void testWriteArrayStoreException1() { + void testWriteArrayStoreException1() { assertThrows(ArrayStoreException.class, () -> new ClassID(BUF16, 0).write(new byte[15], 0)); } @Test - public void testWriteArrayStoreException2() { + void testWriteArrayStoreException2() { assertThrows(ArrayIndexOutOfBoundsException.class, () -> new ClassID(BUF16, 0).write(new byte[16], 1)); } @Test - public void testWriteArrayStoreException3() { + void testWriteArrayStoreException3() { ClassID clsidTest = new ClassID(BUF16, 0); assertDoesNotThrow(() -> clsidTest.write(new byte[16], 0)); assertDoesNotThrow(() -> clsidTest.write(new byte[17], 1)); } @Test - public void testClassID() { + void testClassID() { ClassID clsidTest = new ClassID(BUF16, 0); assertEquals("{04030201-0605-0807-090A-0B0C0D0E0F10}", clsidTest.toString()); } diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java b/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java index dd1bf74e0b..1fcb06a3cf 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java @@ -80,7 +80,7 @@ public final class TestEmptyProperties { * are expected to be in a certain order. */ @Test - public void testReadFiles() { + void testReadFiles() { String[] expected = POI_FILES; for (int i = 0; i < expected.length; i++) assertEquals(poiFiles.get(i).getName(), expected[i]); @@ -101,7 +101,7 @@ public final class TestEmptyProperties { * supported. */ @Test - public void testCreatePropertySets() + void testCreatePropertySets() throws UnsupportedEncodingException, IOException { Class<?>[] expected = { NoPropertySetStreamException.class, @@ -130,7 +130,7 @@ public final class TestEmptyProperties { * @exception HPSFException if an HPSF operation fails */ @Test - public void testPropertySetMethods() throws IOException, HPSFException { + void testPropertySetMethods() throws IOException, HPSFException { byte[] b = poiFiles.get(1).getBytes(); PropertySet ps = PropertySetFactory.create(new ByteArrayInputStream(b)); SummaryInformation s = (SummaryInformation) ps; diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestHPSFBugs.java b/src/testcases/org/apache/poi/hpsf/basic/TestHPSFBugs.java index a8cbbbbd95..6aba5837d5 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestHPSFBugs.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestHPSFBugs.java @@ -52,7 +52,7 @@ public final class TestHPSFBugs { * reload, and still access & change them. */ @Test - public void test48832() throws IOException { + void test48832() throws IOException { HSSFWorkbook wb1 = new HSSFWorkbook(); // Starts empty @@ -112,7 +112,7 @@ public final class TestHPSFBugs { * reading junk */ @Test - public void test54233() throws IOException, NoPropertySetStreamException, MarkUnsupportedException { + void test54233() throws IOException, NoPropertySetStreamException, MarkUnsupportedException { InputStream is = _samples.openResourceAsStream("TestNon4ByteBoundary.doc"); POIFSFileSystem fs = new POIFSFileSystem(is); is.close(); @@ -150,7 +150,7 @@ public final class TestHPSFBugs { * CodePage Strings can be zero length */ @Test - public void test56138() throws IOException, NoPropertySetStreamException { + void test56138() throws IOException, NoPropertySetStreamException { InputStream is = _samples.openResourceAsStream("TestZeroLengthCodePage.mpp"); POIFSFileSystem fs = new POIFSFileSystem(is); is.close(); diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java b/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java index f3f0d35cd3..983b659aef 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java @@ -74,7 +74,7 @@ public final class TestMetaDataIPI { * Sets the most important information in DocumentSummaryInformation and Summary Information and rereads it */ @Test - public void testOne() throws Exception { + void testOne() throws Exception { // DocumentSummaryInformation dsi.setCompany("xxxCompanyxxx"); @@ -154,7 +154,7 @@ public final class TestMetaDataIPI { * Test very long input in each of the fields (approx 30-60KB each) */ @Test - public void testTwo() throws Exception { + void testTwo() throws Exception { String company = elongate("company"); String manager = elongate("manager"); @@ -238,7 +238,7 @@ public final class TestMetaDataIPI { * Tests with strange characters in keys and data (Umlaute etc.) */ @Test - public void testThree() throws Exception { + void testThree() throws Exception { String company = strangize("company"); String manager = strangize("manager"); @@ -322,7 +322,7 @@ public final class TestMetaDataIPI { * Iterative testing: writing, reading etc. */ @Test - public void testFour() throws Exception { + void testFour() throws Exception { for (int i = 1; i < 100; i++) { testThree(); closeAndReOpen(); @@ -333,7 +333,7 @@ public final class TestMetaDataIPI { * Unicode test */ @Test - public void testUnicode() throws Exception { + void testUnicode() throws Exception { String company = strangizeU("company"); String manager = strangizeU("manager"); String category = strangizeU("category"); @@ -414,7 +414,7 @@ public final class TestMetaDataIPI { * */ @Test - public void testSix() throws Exception { + void testSix() throws Exception { for (int i = 1; i < 100; i++) { testUnicode(); closeAndReOpen(); @@ -426,7 +426,7 @@ public final class TestMetaDataIPI { * Tests conversion in custom fields and errors */ @Test - public void testConvAndExistence() throws Exception { + void testConvAndExistence() throws Exception { CustomProperties customProperties = dsi.getCustomProperties(); if (customProperties == null) { diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java b/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java index 498c9119e0..39a0b1d7ff 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java @@ -72,7 +72,7 @@ public class TestUnicode { * @exception HPSFException if an HPSF exception occurs */ @Test - public void testPropertySetMethods() throws IOException, HPSFException { + void testPropertySetMethods() throws IOException, HPSFException { POIFile poiFile = Util.readPOIFiles(data, POI_FILES).get(0); byte[] b = poiFile.getBytes(); PropertySet ps = PropertySetFactory.create(new ByteArrayInputStream(b)); diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java b/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java index 3d3c962a82..c443d99e71 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java @@ -170,7 +170,7 @@ public class TestWriteWellKnown { * @throws IOException if some I/O error occurred. */ @Test - public void testWriteWellKnown() throws Exception { + void testWriteWellKnown() throws Exception { POIDataSamples _samples = POIDataSamples.getHPSFInstance(); final File doc1 = TempFile.createTempFile("POI_HPSF_Test1.", ".tmp"); @@ -509,7 +509,7 @@ public class TestWriteWellKnown { * Tests basic custom property features. */ @Test - public void testCustomerProperties() + void testCustomerProperties() { final String KEY = "Schl\u00fcssel \u00e4"; final String VALUE_1 = "Wert 1"; @@ -548,7 +548,7 @@ public class TestWriteWellKnown { * custom properties which are not pure. */ @Test - public void testGetCustomerProperties() + void testGetCustomerProperties() { final int ID_1 = 2; final int ID_2 = 3; diff --git a/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java b/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java index 4c697074fa..3f05f1729d 100644 --- a/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java +++ b/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java @@ -36,7 +36,7 @@ public final class TestHPSFPropertiesExtractor { private static final POIDataSamples _samples = POIDataSamples.getHPSFInstance(); @Test - public void testNormalProperties() throws Exception { + void testNormalProperties() throws Exception { try (InputStream is = _samples.openResourceAsStream("TestMickey.doc"); POIFSFileSystem fs = new POIFSFileSystem(is); HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs)) { @@ -59,7 +59,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void testNormalUnicodeProperties() throws Exception { + void testNormalUnicodeProperties() throws Exception { try (InputStream is = _samples.openResourceAsStream("TestUnicode.xls"); POIFSFileSystem fs = new POIFSFileSystem(is); @@ -83,7 +83,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void testCustomProperties() throws Exception { + void testCustomProperties() throws Exception { try (InputStream is = _samples.openResourceAsStream("TestMickey.doc"); POIFSFileSystem fs = new POIFSFileSystem(is); HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs)) { @@ -100,7 +100,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void testConstructors() throws IOException { + void testConstructors() throws IOException { final String fsText; final String hwText; final String eeText; @@ -136,7 +136,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void test42726() throws IOException { + void test42726() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("42726.xls"); HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(wb)) { String txt = ext.getText(); @@ -148,7 +148,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void testThumbnail() throws Exception { + void testThumbnail() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_samples.openResourceAsStream("TestThumbnail.xls")); HSSFWorkbook wb = new HSSFWorkbook(fs); Thumbnail thumbnail = new Thumbnail(wb.getSummaryInformation().getThumbnail()); @@ -159,7 +159,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void test52258() throws Exception { + void test52258() throws Exception { try (InputStream is = _samples.openResourceAsStream("TestVisioWithCodepage.vsd"); POIFSFileSystem fs = new POIFSFileSystem(is); HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs)) { @@ -172,7 +172,7 @@ public final class TestHPSFPropertiesExtractor { } @Test - public void test61300Extractor() throws IOException { + void test61300Extractor() throws IOException { try (POIFSFileSystem poifs = new POIFSFileSystem( POIDataSamples.getPOIFSInstance().getFile("61300.bin"))) { HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(poifs); 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, diff --git a/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java b/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java index 6a2d8d8709..9d64bed0c4 100644 --- a/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java +++ b/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java @@ -41,7 +41,7 @@ public class TestXorEncryption { private static final HSSFTestDataSamples samples = new HSSFTestDataSamples(); @Test - public void testXorEncryption() { + void testXorEncryption() { // Xor-Password: abc // 2.5.343 XORObfuscation // key = 20810 @@ -58,7 +58,7 @@ public class TestXorEncryption { @SuppressWarnings("static-access") @Test - public void testUserFile() throws IOException { + void testUserFile() throws IOException { File f = samples.getSampleFile("xor-encryption-abc.xls"); Biff8EncryptionKey.setCurrentUserPassword("abc"); try (POIFSFileSystem fs = new POIFSFileSystem(f, true); diff --git a/src/testcases/org/apache/poi/poifs/crypt/binaryrc4/TestBinaryRC4.java b/src/testcases/org/apache/poi/poifs/crypt/binaryrc4/TestBinaryRC4.java index 373b9af4fc..f5ec5245e3 100644 --- a/src/testcases/org/apache/poi/poifs/crypt/binaryrc4/TestBinaryRC4.java +++ b/src/testcases/org/apache/poi/poifs/crypt/binaryrc4/TestBinaryRC4.java @@ -45,7 +45,7 @@ public class TestBinaryRC4 { } @Test - public void testValidateWithDefaultPassword() throws GeneralSecurityException { + void testValidateWithDefaultPassword() throws GeneralSecurityException { String docIdSuffixA = "F 35 52 38 0D 75 4A E6 85 C2 FD 78 CE 3D D1 B6"; // valid prefix is 'D' String saltHashA = "30 38 BE 5E 93 C5 7E B4 5F 52 CD A1 C6 8F B6 2A"; @@ -62,7 +62,7 @@ public class TestBinaryRC4 { } @Test - public void testValidateWithSuppliedPassword() throws GeneralSecurityException { + void testValidateWithSuppliedPassword() throws GeneralSecurityException { String docId = "DF 35 52 38 0D 75 4A E6 85 C2 FD 78 CE 3D D1 B6"; String saltData = "D4 04 43 EC B7 A7 6F 6A D2 68 C7 DF CF A8 80 68"; diff --git a/src/testcases/org/apache/poi/poifs/dev/TestPOIFSDump.java b/src/testcases/org/apache/poi/poifs/dev/TestPOIFSDump.java index ef4eec6417..00348fb388 100644 --- a/src/testcases/org/apache/poi/poifs/dev/TestPOIFSDump.java +++ b/src/testcases/org/apache/poi/poifs/dev/TestPOIFSDump.java @@ -136,7 +136,7 @@ public class TestPOIFSDump { } @Test - public void testMain() throws Exception { + void testMain() throws Exception { POIFSDump.main(new String[] { TEST_FILE }); @@ -149,7 +149,7 @@ public class TestPOIFSDump { } } @Test - public void testInvalidFile() { + void testInvalidFile() { assertThrows(NotOLE2FileException.class, () -> POIFSDump.main(new String[]{INVALID_FILE})); assertThrows(OfficeXmlFileException.class, () -> POIFSDump.main(new String[]{INVALID_XLSX_FILE})); @@ -161,12 +161,12 @@ public class TestPOIFSDump { @Disabled("Calls System.exit()") @Test - public void testMainNoArgs() throws Exception { + void testMainNoArgs() throws Exception { POIFSDump.main(new String[] {}); } @Test - public void testFailToWrite() throws IOException { + void testFailToWrite() throws IOException { File dir = TempFile.createTempFile("TestPOIFSDump", ".tst"); assertTrue(dir.exists(), "Had: " + dir); assertTrue(dir.delete(), "Had: " + dir); diff --git a/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java b/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java index 89457e22b1..cad76dd749 100644 --- a/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java +++ b/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java @@ -60,7 +60,7 @@ public final class TestPOIFSReaderRegistry { * Test empty registry */ @Test - public void testEmptyRegistry() { + void testEmptyRegistry() { POIFSReaderRegistry registry = new POIFSReaderRegistry(); for (POIFSDocumentPath path : paths) { @@ -77,7 +77,7 @@ public final class TestPOIFSReaderRegistry { * Test mixed registration operations */ @Test - public void testMixedRegistrationOperations() { + void testMixedRegistrationOperations() { POIFSReaderRegistry registry = new POIFSReaderRegistry(); for (int j = 0; j < listeners.length; j++) diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDirectoryNode.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDirectoryNode.java index 92536e96f4..b9642326fa 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDirectoryNode.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDirectoryNode.java @@ -42,7 +42,7 @@ public final class TestDirectoryNode { * test trivial constructor (a DirectoryNode with no children) */ @Test - public void testEmptyConstructor() throws IOException { + void testEmptyConstructor() throws IOException { try (POIFSFileSystem fs = new POIFSFileSystem()) { DirectoryProperty property1 = new DirectoryProperty("parent"); DirectoryProperty property2 = new DirectoryProperty("child"); @@ -90,7 +90,7 @@ public final class TestDirectoryNode { * test non-trivial constructor (a DirectoryNode with children) */ @Test - public void testNonEmptyConstructor() throws IOException { + void testNonEmptyConstructor() throws IOException { DirectoryProperty property1 = new DirectoryProperty("parent"); DirectoryProperty property2 = new DirectoryProperty("child1"); @@ -142,7 +142,7 @@ public final class TestDirectoryNode { * test deletion methods */ @Test - public void testDeletion() throws IOException { + void testDeletion() throws IOException { try (POIFSFileSystem fs = new POIFSFileSystem()) { DirectoryEntry root = fs.getRoot(); @@ -186,7 +186,7 @@ public final class TestDirectoryNode { * test change name methods */ @Test - public void testRename() throws IOException { + void testRename() throws IOException { try (POIFSFileSystem fs = new POIFSFileSystem()) { DirectoryEntry root = fs.getRoot(); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java index 91b58df0d9..459ecfacf9 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java @@ -43,7 +43,7 @@ public class TestDocument { * Integration test -- really about all we can do */ @Test - public void testPOIFSDocument() throws IOException { + void testPOIFSDocument() throws IOException { try (POIFSFileSystem poifs = new POIFSFileSystem()) { diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentDescriptor.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentDescriptor.java index c548042a2e..17a2fb9def 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentDescriptor.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentDescriptor.java @@ -31,7 +31,7 @@ public final class TestDocumentDescriptor { * test equality */ @Test - public void testEquality() { + void testEquality() { String[] names = { "c1", "c2", "c3", "c4", "c5" }; POIFSDocumentPath a1 = new POIFSDocumentPath(); POIFSDocumentPath a2 = new POIFSDocumentPath(null); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java index af5466b052..81e2da9a3a 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java @@ -77,7 +77,7 @@ public final class TestDocumentInputStream { * test constructor */ @Test - public void testConstructor() throws IOException { + void testConstructor() throws IOException { try (DocumentInputStream nstream = new DocumentInputStream(_workbook_n)) { assertEquals(_workbook_size, _workbook_n.getSize()); assertEquals(_workbook_size, available(nstream)); @@ -88,7 +88,7 @@ public final class TestDocumentInputStream { * test available() behavior */ @Test - public void testAvailable() throws IOException { + void testAvailable() throws IOException { DocumentInputStream nstream = new DocumentInputStream(_workbook_n); assertEquals(_workbook_size, available(nstream)); nstream.close(); @@ -101,7 +101,7 @@ public final class TestDocumentInputStream { */ @SuppressWarnings("ResultOfMethodCallIgnored") @Test - public void testMarkFunctions() throws IOException { + void testMarkFunctions() throws IOException { byte[] buffer = new byte[_workbook_size / 5]; byte[] small_buffer = new byte[212]; @@ -215,7 +215,7 @@ public final class TestDocumentInputStream { */ @SuppressWarnings("ResultOfMethodCallIgnored") @Test - public void testReadSingleByte() throws IOException { + void testReadSingleByte() throws IOException { DocumentInputStream stream = new DocumentInputStream(_workbook_n); int remaining = _workbook_size; @@ -241,7 +241,7 @@ public final class TestDocumentInputStream { */ @SuppressWarnings("ResultOfMethodCallIgnored") @Test - public void testBufferRead() throws IOException { + void testBufferRead() throws IOException { DocumentInputStream stream = new DocumentInputStream(_workbook_n); // Need to give a byte array to read assertThrows(NullPointerException.class, () -> stream.read(null)); @@ -284,7 +284,7 @@ public final class TestDocumentInputStream { */ @SuppressWarnings("ResultOfMethodCallIgnored") @Test - public void testComplexBufferRead() throws IOException { + void testComplexBufferRead() throws IOException { DocumentInputStream stream = new DocumentInputStream(_workbook_n); assertThrows(IllegalArgumentException.class, () -> stream.read(null, 0, 1)); @@ -340,7 +340,7 @@ public final class TestDocumentInputStream { * Tests that we can skip within the stream */ @Test - public void testSkip() throws IOException { + void testSkip() throws IOException { DocumentInputStream stream = new DocumentInputStream(_workbook_n); assertEquals(_workbook_size, available(stream)); int count = available(stream); @@ -368,7 +368,7 @@ public final class TestDocumentInputStream { * Test that we can read files at multiple levels down the tree */ @Test - public void testReadMultipleTreeLevels() throws Exception { + void testReadMultipleTreeLevels() throws Exception { final POIDataSamples _samples = POIDataSamples.getPublisherInstance(); File sample = _samples.getFile("Sample.pub"); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentOutputStream.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentOutputStream.java index 36d31da9f7..dadd8dd944 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentOutputStream.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentOutputStream.java @@ -38,7 +38,7 @@ public final class TestDocumentOutputStream { * test write(int) behavior */ @Test - public void testWrite1() throws IOException { + void testWrite1() throws IOException { final byte[] expected = data(25); POIFSWriterListener l = (event) -> { @@ -62,7 +62,7 @@ public final class TestDocumentOutputStream { * test write(byte[]) behavior */ @Test - public void testWrite2() throws IOException { + void testWrite2() throws IOException { final byte[] expected = data(24); POIFSWriterListener l = (event) -> { @@ -84,7 +84,7 @@ public final class TestDocumentOutputStream { * test write(byte[], int, int) behavior */ @Test - public void testWrite3() throws IOException { + void testWrite3() throws IOException { byte[] input = data(50); byte[] expected = Arrays.copyOfRange(input, 1, 1+25); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java b/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java index bfd5a9c004..f83572b2f4 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java @@ -33,7 +33,7 @@ public final class TestEmptyDocument { private static final POILogger LOG = POILogFactory.getLogger(TestEmptyDocument.class); @Test - public void testSingleEmptyDocument() throws IOException { + void testSingleEmptyDocument() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dir = fs.getRoot(); dir.createDocument("Foo", new ByteArrayInputStream(new byte[] {})); @@ -45,7 +45,7 @@ public final class TestEmptyDocument { } @Test - public void testSingleEmptyDocumentEvent() throws IOException { + void testSingleEmptyDocumentEvent() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dir = fs.getRoot(); dir.createDocument("Foo", 0, event -> LOG.log(POILogger.WARN, "written")); @@ -57,7 +57,7 @@ public final class TestEmptyDocument { } @Test - public void testEmptyDocumentWithFriend() throws IOException { + void testEmptyDocumentWithFriend() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dir = fs.getRoot(); dir.createDocument("Bar", new ByteArrayInputStream(new byte[] { 0 })); @@ -70,7 +70,7 @@ public final class TestEmptyDocument { } @Test - public void testEmptyDocumentEventWithFriend() throws IOException { + void testEmptyDocumentEventWithFriend() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dir = fs.getRoot(); dir.createDocument("Bar", 1, event -> { @@ -89,7 +89,7 @@ public final class TestEmptyDocument { } @Test - public void testEmptyDocumentBug11744() throws Exception { + void testEmptyDocumentBug11744() throws Exception { byte[] testData = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; POIFSFileSystem fs = new POIFSFileSystem(); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java b/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java index 984844a4d2..73cf49da5b 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java @@ -37,7 +37,7 @@ public class TestEntryUtils { private static final byte[] dataSmallB = new byte[] { 11, 73, 21, -92, -103 }; @Test - public void testCopyRecursively() throws IOException { + void testCopyRecursively() throws IOException { POIFSFileSystem fsD = new POIFSFileSystem(); POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dirA = fs.createDirectory("DirA"); @@ -100,7 +100,7 @@ public class TestEntryUtils { } @Test - public void testAreDocumentsIdentical() throws IOException { + void testAreDocumentsIdentical() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dirA = fs.createDirectory("DirA"); DirectoryEntry dirB = fs.createDirectory("DirB"); @@ -149,7 +149,7 @@ public class TestEntryUtils { } @Test - public void testAreDirectoriesIdentical() throws IOException { + void testAreDirectoriesIdentical() throws IOException { POIFSFileSystem fs = new POIFSFileSystem(); DirectoryEntry dirA = fs.createDirectory("DirA"); DirectoryEntry dirB = fs.createDirectory("DirB"); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java b/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java index 1cd92b952f..9f91a2aff1 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java @@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test; public class TestFileMagic { @Test - public void testFileMagic() { + void testFileMagic() { assertEquals(FileMagic.XML, FileMagic.valueOf("XML")); assertEquals(FileMagic.XML, FileMagic.valueOf("<?xml".getBytes(StandardCharsets.UTF_8))); @@ -66,13 +66,13 @@ public class TestFileMagic { } @Test - public void testFileMagicFile() throws IOException { + void testFileMagicFile() throws IOException { assertEquals(FileMagic.OLE2, FileMagic.valueOf(POIDataSamples.getSpreadSheetInstance().getFile("SampleSS.xls"))); assertEquals(FileMagic.OOXML, FileMagic.valueOf(POIDataSamples.getSpreadSheetInstance().getFile("SampleSS.xlsx"))); } @Test - public void testFileMagicStream() throws IOException { + void testFileMagicStream() throws IOException { try (InputStream stream = new BufferedInputStream(new FileInputStream(POIDataSamples.getSpreadSheetInstance().getFile("SampleSS.xls")))) { assertEquals(FileMagic.OLE2, FileMagic.valueOf(stream)); } @@ -82,7 +82,7 @@ public class TestFileMagic { } @Test - public void testPrepare() throws IOException { + void testPrepare() throws IOException { try (InputStream stream = new BufferedInputStream(new FileInputStream(POIDataSamples.getSpreadSheetInstance().getFile("SampleSS.xlsx")))) { assertSame(stream, FileMagic.prepareToCheckMagic(stream)); } @@ -98,7 +98,7 @@ public class TestFileMagic { } @Test - public void testMatchingButTooLessData() { + void testMatchingButTooLessData() { // this matches JPG, but is not long enough, previously this caused an Exception byte[] data = new byte[] { -1, -40, -1, -32, 0, 16, 74, 70 }; @@ -106,7 +106,7 @@ public class TestFileMagic { } @Test - public void testShortFile() throws IOException { + void testShortFile() throws IOException { // having a file shorter than 8 bytes previously caused an exception fetchMagicFromData(new byte[] { -1, -40, -1, -32, 0 }); fetchMagicFromData(new byte[] { -1, -40, -1, -32 }); @@ -130,7 +130,7 @@ public class TestFileMagic { } @Test - public void testMarkRequired() throws IOException { + void testMarkRequired() throws IOException { byte[] data = new byte[] { -1, -40, -1, -32, 0 }; File file = TempFile.createTempFile("TestFileMagic", ".bin"); @@ -151,7 +151,7 @@ public class TestFileMagic { } @Test - public void testPatterns() { + void testPatterns() { // just try to trash the functionality with some byte-patterns for(int i = 0; i < 256;i++) { final byte[] data = new byte[12]; @@ -164,7 +164,7 @@ public class TestFileMagic { } @Test - public void testRandomPatterns() { + void testRandomPatterns() { Random random = new Random(); // just try to trash the functionality with some byte-patterns diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java b/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java index dee7a17c4b..588dd04564 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java @@ -84,7 +84,7 @@ public final class TestFileSystemBugs { * These have a top level directory without a name.... */ @Test - public void testNotesOLE2Files() throws Exception { + void testNotesOLE2Files() throws Exception { // Check the contents DirectoryNode root = openSample("Notes.ole2"); assertEquals(1, root.getEntryCount()); @@ -119,7 +119,7 @@ public final class TestFileSystemBugs { * can't cope with this level of corruption */ @Test - public void testCorruptedProperties() throws Exception { + void testCorruptedProperties() throws Exception { DirectoryNode root = openSample("unknown_properties.msg"); assertEquals(42, root.getEntryCount()); } @@ -128,7 +128,7 @@ public final class TestFileSystemBugs { * With heavily nested documents, ensure we still re-write the same */ @Test - public void testHeavilyNestedReWrite() throws Exception { + void testHeavilyNestedReWrite() throws Exception { DirectoryNode root = openSSSample("ex42570-20305.xls"); // Record the structure Map<String,Integer> entries = new HashMap<>(); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java b/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java index e511bc2609..e0f1988e33 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestFilteringDirectoryNode.java @@ -58,7 +58,7 @@ public final class TestFilteringDirectoryNode { } @Test - public void testNoFiltering() throws Exception { + void testNoFiltering() throws Exception { FilteringDirectoryNode d = new FilteringDirectoryNode(fs.getRoot(), new HashSet<>()); assertEquals(3, d.getEntryCount()); assertEquals(dirA.getName(), d.getEntry(dirA.getName()).getName()); @@ -80,7 +80,7 @@ public final class TestFilteringDirectoryNode { } @Test - public void testChildFiltering() throws Exception { + void testChildFiltering() throws Exception { List<String> excl = Arrays.asList("NotThere", "AlsoNotThere", eRoot.getName()); FilteringDirectoryNode d1 = new FilteringDirectoryNode(fs.getRoot(), excl); @@ -132,7 +132,7 @@ public final class TestFilteringDirectoryNode { } @Test - public void testNestedFiltering() throws Exception { + void testNestedFiltering() throws Exception { List<String> excl = Arrays.asList(dirA.getName() + "/" + "MadeUp", dirA.getName() + "/" + eA.getName(), dirA.getName() + "/" + dirAA.getName() + "/Test", @@ -158,7 +158,7 @@ public final class TestFilteringDirectoryNode { } @Test - public void testNullDirectory() { + void testNullDirectory() { assertThrows(IllegalArgumentException.class, () -> new FilteringDirectoryNode(null, null)); } }
\ No newline at end of file diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestNotOLE2Exception.java b/src/testcases/org/apache/poi/poifs/filesystem/TestNotOLE2Exception.java index d43833bb1f..6ad8e316ce 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestNotOLE2Exception.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestNotOLE2Exception.java @@ -42,7 +42,7 @@ public class TestNotOLE2Exception { } @Test - public void testRawXMLException() throws IOException { + void testRawXMLException() throws IOException { try (InputStream in = openXLSSampleStream("SampleSS.xml")) { NotOLE2FileException e = assertThrows(NotOLE2FileException.class, () -> new POIFSFileSystem(in)); assertContains(e.getMessage(), "The supplied data appears to be a raw XML file"); @@ -51,7 +51,7 @@ public class TestNotOLE2Exception { } @Test - public void testMSWriteException() throws IOException { + void testMSWriteException() throws IOException { try (InputStream in = openDOCSampleStream("MSWriteOld.wri")) { NotOLE2FileException e = assertThrows(NotOLE2FileException.class, () -> new POIFSFileSystem(in)); assertContains(e.getMessage(), "The supplied data appears to be in the old MS Write"); @@ -60,7 +60,7 @@ public class TestNotOLE2Exception { } @Test - public void testBiff3Exception() throws IOException { + void testBiff3Exception() throws IOException { try (InputStream in = openXLSSampleStream("testEXCEL_3.xls")) { OldExcelFormatException e = assertThrows(OldExcelFormatException.class, () -> new POIFSFileSystem(in)); assertContains(e.getMessage(), "The supplied data appears to be in BIFF3 format"); @@ -69,7 +69,7 @@ public class TestNotOLE2Exception { } @Test - public void testBiff4Exception() throws IOException { + void testBiff4Exception() throws IOException { try (InputStream in = openXLSSampleStream("testEXCEL_4.xls")) { OldExcelFormatException e = assertThrows(OldExcelFormatException.class, () -> new POIFSFileSystem(in)); assertContains(e.getMessage(), "The supplied data appears to be in BIFF4 format"); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestOfficeXMLException.java b/src/testcases/org/apache/poi/poifs/filesystem/TestOfficeXMLException.java index bd727fafcb..dfd6b20b3c 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestOfficeXMLException.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestOfficeXMLException.java @@ -42,7 +42,7 @@ public class TestOfficeXMLException { } @Test - public void testOOXMLException() throws IOException { + void testOOXMLException() throws IOException { try (InputStream in = openSampleStream("sample.xlsx")) { OfficeXmlFileException ex = assertThrows(OfficeXmlFileException.class, () -> new POIFSFileSystem(in)); assertTrue(ex.getMessage().contains("You are calling the part of POI that deals with OLE2 Office Documents")); @@ -50,7 +50,7 @@ public class TestOfficeXMLException { } @Test - public void test2003XMLException() throws IOException { + void test2003XMLException() throws IOException { try (InputStream in = openSampleStream("SampleSS.xml")) { NotOLE2FileException ex = assertThrows(NotOLE2FileException.class, () -> new POIFSFileSystem(in)); assertTrue(ex.getMessage().contains("The supplied data appears to be a raw XML file")); @@ -58,7 +58,7 @@ public class TestOfficeXMLException { } @Test - public void testDetectAsPOIFS() throws IOException { + void testDetectAsPOIFS() throws IOException { // ooxml file isn't confirmIsPOIFS("SampleSS.xlsx", FileMagic.OOXML); @@ -86,7 +86,7 @@ public class TestOfficeXMLException { } @Test - public void testFileCorruption() throws Exception { + void testFileCorruption() throws Exception { // create test InputStream byte[] testData = {1, 2, 3}; @@ -106,7 +106,7 @@ public class TestOfficeXMLException { @Test - public void testFileCorruptionOPOIFS() throws Exception { + void testFileCorruptionOPOIFS() throws Exception { // create test InputStream byte[] testData = {(byte) 1, (byte) 2, (byte) 3}; diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java b/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java index 7aa4efaf7a..a575c2b05c 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java @@ -40,7 +40,7 @@ public class TestOle10Native { private static final POIDataSamples dataSamples = POIDataSamples.getPOIFSInstance(); @Test - public void testOleNative() throws IOException, Ole10NativeException { + void testOleNative() throws IOException, Ole10NativeException { POIFSFileSystem fs = new POIFSFileSystem(dataSamples.openResourceAsStream("oleObject1.bin")); Ole10Native ole = Ole10Native.createFromEmbeddedOleObject(fs); @@ -50,7 +50,7 @@ public class TestOle10Native { } @Test - public void testFiles() throws IOException, Ole10NativeException { + void testFiles() throws IOException, Ole10NativeException { File[] files = { // bug 51891 POIDataSamples.getPOIFSInstance().getFile("multimedia.doc"), @@ -98,7 +98,7 @@ public class TestOle10Native { } @Test - public void testOleNativeOOM() throws IOException { + void testOleNativeOOM() throws IOException { try (POIFSFileSystem fs = new POIFSFileSystem(dataSamples.openResourceAsStream("60256.bin"))) { RecordFormatException ex = assertThrows( RecordFormatException.class, diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSDocumentPath.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSDocumentPath.java index 58119d8a13..1d6fbcb933 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSDocumentPath.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSDocumentPath.java @@ -38,7 +38,7 @@ public final class TestPOIFSDocumentPath { * Test default constructor */ @Test - public void testDefaultConstructor() { + void testDefaultConstructor() { POIFSDocumentPath path = new POIFSDocumentPath(); assertEquals(0, path.length()); @@ -48,7 +48,7 @@ public final class TestPOIFSDocumentPath { * Test full path constructor */ @Test - public void testFullPathConstructor() { + void testFullPathConstructor() { String[] components = {"foo", "bar", "foobar", "fubar"}; for (int j = 0; j < components.length; j++) { @@ -82,7 +82,7 @@ public final class TestPOIFSDocumentPath { * Test relative path constructor */ @Test - public void testRelativePathConstructor() { + void testRelativePathConstructor() { String[] initialComponents = {"a", "b", "c"}; for (int n = 0; n < initialComponents.length; n++) { @@ -135,7 +135,7 @@ public final class TestPOIFSDocumentPath { * test equality */ @Test - public void testEquality() { + void testEquality() { POIFSDocumentPath a1 = new POIFSDocumentPath(); POIFSDocumentPath a2 = new POIFSDocumentPath(null); POIFSDocumentPath a3 = new POIFSDocumentPath(new String[ 0 ]); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java index cff04d3e78..2bf0493cb9 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java @@ -111,7 +111,7 @@ public final class TestPOIFSFileSystem { * POIFSFileSystem was not closing the input stream. */ @Test - public void testAlwaysClose() throws IOException { + void testAlwaysClose() throws IOException { // Normal case - read until EOF and close try (TestIS testIS = new TestIS(openSampleStream("13224.xls"), -1); POIFSFileSystem ignored = new POIFSFileSystem(testIS)){ @@ -138,7 +138,7 @@ public final class TestPOIFSFileSystem { * POIFS, since it seems to be slight wrong */ @Test - public void testShortLastBlock() throws Exception { + void testShortLastBlock() throws Exception { String[] files = new String[] { "ShortLastBlock.qwp", "ShortLastBlock.wps" }; @@ -163,7 +163,7 @@ public final class TestPOIFSFileSystem { * sectors that exist in the file. */ @Test - public void testFATandDIFATsectors() throws Exception { + void testFATandDIFATsectors() throws Exception { try (InputStream stream = _samples.openResourceAsStream("ReferencesInvalidSectors.mpp")) { IndexOutOfBoundsException ex = assertThrows( IndexOutOfBoundsException.class, @@ -181,7 +181,7 @@ public final class TestPOIFSFileSystem { * to have an XBAT in it, we don't have a test one. So, generate it. */ @Test - public void testBATandXBAT() throws Exception { + void testBATandXBAT() throws Exception { byte[] hugeStream = new byte[8*1024*1024]; POIFSFileSystem fs = new POIFSFileSystem(); fs.getRoot().createDocument( @@ -230,7 +230,7 @@ public final class TestPOIFSFileSystem { * use 4k blocks. Check that we can open these. */ @Test - public void test4KBlocks() throws Exception { + void test4KBlocks() throws Exception { POIDataSamples _samples = POIDataSamples.getPOIFSInstance(); try (InputStream inp = _samples.openResourceAsStream("BlockSize4096.zvi")) { // First up, check that we can process the header properly @@ -291,7 +291,7 @@ public final class TestPOIFSFileSystem { } @Test - public void test64322() throws NoPropertySetStreamException, IOException { + void test64322() throws NoPropertySetStreamException, IOException { try (POIFSFileSystem poiFS = new POIFSFileSystem(_samples.getFile("64322.ole2"))) { int count = recurseDir(poiFS.getRoot()); @@ -300,7 +300,7 @@ public final class TestPOIFSFileSystem { } @Test - public void test64322a() throws NoPropertySetStreamException, IOException { + void test64322a() throws NoPropertySetStreamException, IOException { try (POIFSFileSystem poiFS = new POIFSFileSystem(_samples.openResourceAsStream("64322.ole2"))) { int count = recurseDir(poiFS.getRoot()); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java index 26f8d6b8fa..98493fb530 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSMiniStore.java @@ -46,7 +46,7 @@ public final class TestPOIFSMiniStore { * out what the next one is */ @Test - public void testNextBlock() throws Exception { + void testNextBlock() throws Exception { // It's the same on 512 byte and 4096 byte block files! POIFSFileSystem fsA = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); POIFSFileSystem fsB = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); @@ -124,7 +124,7 @@ public final class TestPOIFSMiniStore { * Check we get the right data back for each block */ @Test - public void testGetBlock() throws Exception { + void testGetBlock() throws Exception { // It's the same on 512 byte and 4096 byte block files! POIFSFileSystem fsA = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); POIFSFileSystem fsB = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); @@ -195,7 +195,7 @@ public final class TestPOIFSMiniStore { * to be had from the SFAT */ @Test - public void testGetFreeBlockWithSpare() throws Exception { + void testGetFreeBlockWithSpare() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); POIFSMiniStore ministore = fs.getMiniStore(); @@ -227,7 +227,7 @@ public final class TestPOIFSMiniStore { * stream needs to be extended and another SBAT added */ @Test - public void testGetFreeBlockWithNoneSpare() throws Exception { + void testGetFreeBlockWithNoneSpare() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); POIFSMiniStore ministore = fs.getMiniStore(); @@ -269,7 +269,7 @@ public final class TestPOIFSMiniStore { * big blocks that make up the ministream as needed */ @Test - public void testCreateBlockIfNeeded() throws Exception { + void testCreateBlockIfNeeded() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); POIFSMiniStore ministore = fs.getMiniStore(); @@ -344,7 +344,7 @@ public final class TestPOIFSMiniStore { } @Test - public void testCreateMiniStoreFirst() throws Exception { + void testCreateMiniStoreFirst() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(); POIFSMiniStore ministore = fs.getMiniStore(); DocumentInputStream dis; @@ -412,7 +412,7 @@ public final class TestPOIFSMiniStore { } @Test - public void testMultiBlockStream() throws Exception { + void testMultiBlockStream() throws Exception { byte[] data1B = new byte[63]; byte[] data2B = new byte[64 + 14]; for (int i = 0; i < data1B.length; i++) { diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java index 4803441911..16ab39c391 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java @@ -67,7 +67,7 @@ public final class TestPOIFSStream { * Read a single block stream */ @Test - public void testReadTinyStream() throws Exception { + void testReadTinyStream() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); // 98 is actually the last block in a two block stream... @@ -94,7 +94,7 @@ public final class TestPOIFSStream { * Read a stream with only two blocks in it */ @Test - public void testReadShortStream() throws Exception { + void testReadShortStream() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); // 97 -> 98 -> end @@ -133,7 +133,7 @@ public final class TestPOIFSStream { * Read a stream with many blocks */ @Test - public void testReadLongerStream() throws Exception { + void testReadLongerStream() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); ByteBuffer b0 = null; @@ -193,7 +193,7 @@ public final class TestPOIFSStream { * Read a stream with several blocks in a 4096 byte block file */ @Test - public void testReadStream4096() throws Exception { + void testReadStream4096() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize4096.zvi")); // 0 -> 1 -> 2 -> end @@ -244,7 +244,7 @@ public final class TestPOIFSStream { * Craft a nasty file with a loop, and ensure we don't get stuck */ @Test - public void testReadFailsOnLoop() throws Exception { + void testReadFailsOnLoop() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi")); // Hack the FAT so that it goes 0->1->2->0 @@ -281,7 +281,7 @@ public final class TestPOIFSStream { * stored in the mini stream. */ @Test - public void testReadMiniStreams() throws Exception { + void testReadMiniStreams() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); POIFSMiniStore ministore = fs.getMiniStore(); @@ -333,7 +333,7 @@ public final class TestPOIFSStream { * Writing the same amount of data as before */ @Test - public void testReplaceStream() throws Exception { + void testReplaceStream() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); byte[] data = new byte[512]; @@ -367,7 +367,7 @@ public final class TestPOIFSStream { * to be freed */ @Test - public void testReplaceStreamWithLess() throws Exception { + void testReplaceStreamWithLess() throws Exception { try (InputStream is = _inst.openResourceAsStream("BlockSize512.zvi"); POIFSFileSystem fs = new POIFSFileSystem(is)) { @@ -408,7 +408,7 @@ public final class TestPOIFSStream { * Writes more data than before, new blocks will be needed */ @Test - public void testReplaceStreamWithMore() throws Exception { + void testReplaceStreamWithMore() throws Exception { try (InputStream is = _inst.openResourceAsStream("BlockSize512.zvi"); POIFSFileSystem fs = new POIFSFileSystem(is)) { @@ -455,7 +455,7 @@ public final class TestPOIFSStream { * Writes to a new stream in the file */ @Test - public void testWriteNewStream() throws Exception { + void testWriteNewStream() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); // 100 is our first free one @@ -550,7 +550,7 @@ public final class TestPOIFSStream { * to support this */ @Test - public void testWriteNewStreamExtraFATs() throws Exception { + void testWriteNewStreamExtraFATs() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize512.zvi")); // Allocate almost all the blocks @@ -592,7 +592,7 @@ public final class TestPOIFSStream { * more data than before, in a 4096 byte block file */ @Test - public void testWriteStream4096() throws Exception { + void testWriteStream4096() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(_inst.openResourceAsStream("BlockSize4096.zvi")); // 0 -> 1 -> 2 -> end @@ -647,7 +647,7 @@ public final class TestPOIFSStream { * Tests that we can write into the mini stream */ @Test - public void testWriteMiniStreams() throws Exception { + void testWriteMiniStreams() throws Exception { try (InputStream is = _inst.openResourceAsStream("BlockSize512.zvi"); POIFSFileSystem fs = new POIFSFileSystem(is)) { @@ -838,7 +838,7 @@ public final class TestPOIFSStream { * Craft a nasty file with a loop, and ensure we don't get stuck */ @Test - public void testWriteFailsOnLoop() throws Exception { + void testWriteFailsOnLoop() throws Exception { try (POIFSFileSystem fs = new POIFSFileSystem(_inst.getFile("BlockSize512.zvi"))) { // Hack the FAT so that it goes 0->1->2->0 @@ -867,7 +867,7 @@ public final class TestPOIFSStream { * Tests adding a new stream, writing and reading it. */ @Test - public void testReadWriteNewStream() throws Exception { + void testReadWriteNewStream() throws Exception { try (POIFSFileSystem fs = new POIFSFileSystem()) { POIFSStream stream = new POIFSStream(fs); @@ -933,7 +933,7 @@ public final class TestPOIFSStream { * Writes a stream, then replaces it */ @Test - public void testWriteThenReplace() throws Exception { + void testWriteThenReplace() throws Exception { POIFSFileSystem fs = new POIFSFileSystem(); // Starts empty, other that Properties and BAT diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java index aa50517cbf..7e54151c8e 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPropertySorter.java @@ -66,7 +66,7 @@ public final class TestPropertySorter { * Test sorting of properties in <code>DirectoryProperty</code> */ @Test - public void testSortProperties() throws IOException { + void testSortProperties() throws IOException { POIFSFileSystem fs = openSampleFS(); Property[] props = getVBAProperties(fs); @@ -98,7 +98,7 @@ public final class TestPropertySorter { * Serialize file system and verify that the order of properties is the same as in the original file. */ @Test - public void testSerialization() throws IOException { + void testSerialization() throws IOException { POIFSFileSystem fs = openSampleFS(); ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/src/testcases/org/apache/poi/poifs/nio/TestDataSource.java b/src/testcases/org/apache/poi/poifs/nio/TestDataSource.java index 8373d8f795..c9734f162b 100644 --- a/src/testcases/org/apache/poi/poifs/nio/TestDataSource.java +++ b/src/testcases/org/apache/poi/poifs/nio/TestDataSource.java @@ -44,7 +44,7 @@ public class TestDataSource { private static final POIDataSamples data = POIDataSamples.getPOIFSInstance(); @Test - public void testFile() throws Exception { + void testFile() throws Exception { File f = data.getFile("Notes.ole2"); try (FileBackedDataSource ds = new FileBackedDataSource(f)) { @@ -58,7 +58,7 @@ public class TestDataSource { } @Test - public void testFileWritable() throws Exception { + void testFileWritable() throws Exception { File temp = TempFile.createTempFile("TestDataSource", ".test"); try { writeDataToFile(temp); @@ -81,7 +81,7 @@ public class TestDataSource { @Test - public void testRewritableFile() throws Exception { + void testRewritableFile() throws Exception { File temp = TempFile.createTempFile("TestDataSource", ".test"); try { writeDataToFile(temp); @@ -167,7 +167,7 @@ public class TestDataSource { } @Test - public void testByteArray() { + void testByteArray() { byte[] data = new byte[256]; byte b; for (int i = 0; i < data.length; i++) { diff --git a/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java b/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java index f43d32d136..1cc6b85c19 100644 --- a/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java +++ b/src/testcases/org/apache/poi/poifs/property/TestDirectoryProperty.java @@ -44,7 +44,7 @@ public final class TestDirectoryProperty { * Test constructing DirectoryProperty */ @Test - public void testConstructor() throws IOException { + void testConstructor() throws IOException { createBasicDirectoryProperty(); verifyProperty(); } @@ -53,7 +53,7 @@ public final class TestDirectoryProperty { * Test pre-write functionality */ @Test - public void testPreWrite() throws IOException { + void testPreWrite() throws IOException { createBasicDirectoryProperty(); _property.preWrite(); @@ -200,7 +200,7 @@ public final class TestDirectoryProperty { } @Test - public void testAddChild() throws IOException { + void testAddChild() throws IOException { createBasicDirectoryProperty(); _property.addChild(new LocalProperty(1)); _property.addChild(new LocalProperty(2)); @@ -210,7 +210,7 @@ public final class TestDirectoryProperty { } @Test - public void testDeleteChild() throws IOException { + void testDeleteChild() throws IOException { createBasicDirectoryProperty(); Property p1 = new LocalProperty(1); @@ -222,7 +222,7 @@ public final class TestDirectoryProperty { } @Test - public void testChangeName() throws IOException { + void testChangeName() throws IOException { createBasicDirectoryProperty(); Property p1 = new LocalProperty(1); String originalName = p1.getName(); @@ -241,7 +241,7 @@ public final class TestDirectoryProperty { } @Test - public void testReadingConstructor() { + void testReadingConstructor() { String[] input = { "42 00 6F 00 6F 00 74 00 20 00 45 00 6E 00 74 00 72 00 79 00 00 00 00 00 00 00 00 00 00 00 00 00", "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", diff --git a/src/testcases/org/apache/poi/poifs/property/TestDocumentProperty.java b/src/testcases/org/apache/poi/poifs/property/TestDocumentProperty.java index ed10478d7b..ee538cb561 100644 --- a/src/testcases/org/apache/poi/poifs/property/TestDocumentProperty.java +++ b/src/testcases/org/apache/poi/poifs/property/TestDocumentProperty.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public final class TestDocumentProperty { @Test - public void testConstructor() throws IOException { + void testConstructor() throws IOException { // test with short name, small file verifyProperty("foo", 1234); @@ -52,7 +52,7 @@ public final class TestDocumentProperty { } @Test - public void testReadingConstructor() throws IOException { + void testReadingConstructor() throws IOException { String[] hexData = { "52 00 6F 00 6F 00 74 00 20 00 45 00 6E 00 74 00 72 00 79 00 00 00 00 00 00 00 00 00 00 00 00 00", "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", diff --git a/src/testcases/org/apache/poi/poifs/property/TestPropertyFactory.java b/src/testcases/org/apache/poi/poifs/property/TestPropertyFactory.java index 4c9f72817a..c141bc344c 100644 --- a/src/testcases/org/apache/poi/poifs/property/TestPropertyFactory.java +++ b/src/testcases/org/apache/poi/poifs/property/TestPropertyFactory.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public final class TestPropertyFactory { @Test - public void testConvertToProperties() throws IOException { + void testConvertToProperties() throws IOException { // real data from a real file! String hexData = diff --git a/src/testcases/org/apache/poi/poifs/property/TestPropertyTable.java b/src/testcases/org/apache/poi/poifs/property/TestPropertyTable.java index f8dc48df45..ea6cef0dfd 100644 --- a/src/testcases/org/apache/poi/poifs/property/TestPropertyTable.java +++ b/src/testcases/org/apache/poi/poifs/property/TestPropertyTable.java @@ -90,7 +90,7 @@ public final class TestPropertyTable { * extracted from a file known to be acceptable to Excel. */ @Test - public void testWriterPropertyTable() throws IOException { + void testWriterPropertyTable() throws IOException { // create the PropertyTable HeaderBlock headerBlock = new HeaderBlock(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS); @@ -147,7 +147,7 @@ public final class TestPropertyTable { } @Test - public void testReadingConstructor() throws IOException { + void testReadingConstructor() throws IOException { // first, we need the raw data blocks String raw_data_array = diff --git a/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java b/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java index a2e992ed11..19de78ceeb 100644 --- a/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java +++ b/src/testcases/org/apache/poi/poifs/property/TestRootProperty.java @@ -39,7 +39,7 @@ public final class TestRootProperty { private byte[] _testblock; @Test - public void testConstructor() throws IOException { + void testConstructor() throws IOException { createBasicRootProperty(); verifyProperty(); } @@ -92,7 +92,7 @@ public final class TestRootProperty { } @Test - public void testSetSize() { + void testSetSize() { for (int j = 0; j < 10; j++) { createBasicRootProperty(); _property.setSize(j); @@ -101,7 +101,7 @@ public final class TestRootProperty { } @Test - public void testReadingConstructor() { + void testReadingConstructor() { String[] input = { "52 00 6F 00 6F 00 74 00 20 00 45 00 6E 00 74 00 72 00 79 00 00 00 00 00 00 00 00 00 00 00 00 00", "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", diff --git a/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java index dac1ae1108..40cb3c787e 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestBATBlock.java @@ -36,22 +36,22 @@ public final class TestBATBlock { @Test - public void testEntriesPerBlock() { + void testEntriesPerBlock() { assertEquals(128, POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS.getBATEntriesPerBlock()); } @Test - public void testEntriesPerXBATBlock() { + void testEntriesPerXBATBlock() { assertEquals(127, POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS.getXBATEntriesPerBlock()); } @Test - public void testGetXBATChainOffset() { + void testGetXBATChainOffset() { assertEquals(508, POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS.getNextXBATChainOffset()); } @Test - public void testCalculateMaximumSize() { + void testCalculateMaximumSize() { // Zero fat blocks isn't technically valid, but it'd be header only assertEquals( 512, @@ -123,7 +123,7 @@ public final class TestBATBlock { } @Test - public void testUsedSectors() { + void testUsedSectors() { POIFSBigBlockSize b512 = POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS; POIFSBigBlockSize b4096 = POIFSConstants.LARGER_BIG_BLOCK_SIZE_DETAILS; @@ -177,7 +177,7 @@ public final class TestBATBlock { } @Test - public void testOccupiedSize() { + void testOccupiedSize() { POIFSBigBlockSize b512 = POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS; POIFSBigBlockSize b4096 = POIFSConstants.LARGER_BIG_BLOCK_SIZE_DETAILS; @@ -238,7 +238,7 @@ public final class TestBATBlock { } @Test - public void testGetBATBlockAndIndex() { + void testGetBATBlockAndIndex() { HeaderBlock header = new HeaderBlock(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS); List<BATBlock> blocks = new ArrayList<>(); int offset; diff --git a/src/testcases/org/apache/poi/poifs/storage/TestHeaderBlockReading.java b/src/testcases/org/apache/poi/poifs/storage/TestHeaderBlockReading.java index 40cb3bec52..9c30f75d9a 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestHeaderBlockReading.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestHeaderBlockReading.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public final class TestHeaderBlockReading { @Test - public void testConstructors() throws IOException { + void testConstructors() throws IOException { String[] hexData = { "D0 CF 11 E0 A1 B1 1A E1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 03 00 FE FF 09 00", "06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE FF FF FF 00 00 00 00 00 10 00 00 FE FF FF FF", diff --git a/src/testcases/org/apache/poi/sl/draw/geom/TestFormulaParser.java b/src/testcases/org/apache/poi/sl/draw/geom/TestFormulaParser.java index 1fd8125749..a5c57ab88e 100644 --- a/src/testcases/org/apache/poi/sl/draw/geom/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/sl/draw/geom/TestFormulaParser.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; */ public class TestFormulaParser { @Test - public void testParse(){ + void testParse(){ Formula[] ops = { newGuide("adj1", "val 100"), diff --git a/src/testcases/org/apache/poi/sl/draw/geom/TestPresetGeometries.java b/src/testcases/org/apache/poi/sl/draw/geom/TestPresetGeometries.java index f7f623bb67..c70c77fcd5 100644 --- a/src/testcases/org/apache/poi/sl/draw/geom/TestPresetGeometries.java +++ b/src/testcases/org/apache/poi/sl/draw/geom/TestPresetGeometries.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public class TestPresetGeometries { @Test - public void testRead(){ + void testRead(){ PresetGeometries shapes = PresetGeometries.getInstance(); assertEquals(187, shapes.size()); assertEquals(0x4533584F, shapes.hashCode()); @@ -52,7 +52,7 @@ public class TestPresetGeometries { @Disabled("problem solved? Turn back on if this debugging is still in process.") @Test - public void testCheckXMLParser() throws Exception{ + void testCheckXMLParser() throws Exception{ // Gump reports a strange error because of an unavailable XML Parser, let's try to find out where // this comes from // diff --git a/src/testcases/org/apache/poi/ss/TestSpreadsheetVersion.java b/src/testcases/org/apache/poi/ss/TestSpreadsheetVersion.java index 7a2003fc74..71f5a843b4 100644 --- a/src/testcases/org/apache/poi/ss/TestSpreadsheetVersion.java +++ b/src/testcases/org/apache/poi/ss/TestSpreadsheetVersion.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; public final class TestSpreadsheetVersion { @Test - public void testExcel97(){ + void testExcel97(){ SpreadsheetVersion v = SpreadsheetVersion.EXCEL97; assertEquals(1 << 8, v.getMaxColumns()); assertEquals(v.getMaxColumns() - 1, v.getLastColumnIndex()); @@ -39,7 +39,7 @@ public final class TestSpreadsheetVersion { } @Test - public void testExcel2007(){ + void testExcel2007(){ SpreadsheetVersion v = SpreadsheetVersion.EXCEL2007; assertEquals(1 << 14, v.getMaxColumns()); assertEquals(v.getMaxColumns() - 1, v.getLastColumnIndex()); diff --git a/src/testcases/org/apache/poi/ss/format/TestCellFormat.java b/src/testcases/org/apache/poi/ss/format/TestCellFormat.java index f87d42a22a..ea48d51789 100644 --- a/src/testcases/org/apache/poi/ss/format/TestCellFormat.java +++ b/src/testcases/org/apache/poi/ss/format/TestCellFormat.java @@ -71,7 +71,7 @@ public class TestCellFormat { } @Test - public void testSome() { + void testSome() { JLabel l = new JLabel(); CellFormat fmt = CellFormat.getInstance( "\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)"); @@ -79,56 +79,56 @@ public class TestCellFormat { } @Test - public void testPositiveFormatHasOnePart() { + void testPositiveFormatHasOnePart() { CellFormat fmt = CellFormat.getInstance("0.00"); CellFormatResult result = fmt.apply(12.345); assertEquals("12.35", result.text); } @Test - public void testNegativeFormatHasOnePart() { + void testNegativeFormatHasOnePart() { CellFormat fmt = CellFormat.getInstance("0.00"); CellFormatResult result = fmt.apply(-12.345); assertEquals("-12.35", result.text); } @Test - public void testZeroFormatHasOnePart() { + void testZeroFormatHasOnePart() { CellFormat fmt = CellFormat.getInstance("0.00"); CellFormatResult result = fmt.apply(0.0); assertEquals("0.00", result.text); } @Test - public void testPositiveFormatHasPosAndNegParts() { + void testPositiveFormatHasPosAndNegParts() { CellFormat fmt = CellFormat.getInstance("0.00;-0.00"); CellFormatResult result = fmt.apply(12.345); assertEquals("12.35", result.text); } @Test - public void testNegativeFormatHasPosAndNegParts() { + void testNegativeFormatHasPosAndNegParts() { CellFormat fmt = CellFormat.getInstance("0.00;-0.00"); CellFormatResult result = fmt.apply(-12.345); assertEquals("-12.35", result.text); } @Test - public void testNegativeFormatHasPosAndNegParts2() { + void testNegativeFormatHasPosAndNegParts2() { CellFormat fmt = CellFormat.getInstance("0.00;(0.00)"); CellFormatResult result = fmt.apply(-12.345); assertEquals("(12.35)", result.text); } @Test - public void testZeroFormatHasPosAndNegParts() { + void testZeroFormatHasPosAndNegParts() { CellFormat fmt = CellFormat.getInstance("0.00;-0.00"); CellFormatResult result = fmt.apply(0.0); assertEquals("0.00", result.text); } @Test - public void testFormatWithThreeSections() { + void testFormatWithThreeSections() { CellFormat fmt = CellFormat.getInstance("0.00;-0.00;-"); assertEquals("12.35", fmt.apply(12.345).text); @@ -138,7 +138,7 @@ public class TestCellFormat { } @Test - public void testFormatWithFourSections() { + void testFormatWithFourSections() { CellFormat fmt = CellFormat.getInstance("0.00;-0.00;-; @ "); assertEquals("12.35", fmt.apply(12.345).text); @@ -148,7 +148,7 @@ public class TestCellFormat { } @Test - public void testApplyCellForGeneralFormat() throws Exception { + void testApplyCellForGeneralFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -189,7 +189,7 @@ public class TestCellFormat { } @Test - public void testApplyCellForAtFormat() throws Exception { + void testApplyCellForAtFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -230,7 +230,7 @@ public class TestCellFormat { } @Test - public void testApplyCellForDateFormat() throws Exception { + void testApplyCellForDateFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -253,7 +253,7 @@ public class TestCellFormat { } @Test - public void testApplyCellForTimeFormat() throws Exception { + void testApplyCellForTimeFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -271,7 +271,7 @@ public class TestCellFormat { } @Test - public void testApplyCellForDateFormatAndNegativeFormat() throws Exception { + void testApplyCellForDateFormatAndNegativeFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -294,7 +294,7 @@ public class TestCellFormat { } @Test - public void testApplyJLabelCellForGeneralFormat() throws Exception { + void testApplyJLabelCellForGeneralFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -346,7 +346,7 @@ public class TestCellFormat { } @Test - public void testApplyJLabelCellForAtFormat() throws Exception { + void testApplyJLabelCellForAtFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -398,7 +398,7 @@ public class TestCellFormat { } @Test - public void testApplyJLabelCellForDateFormat() throws Exception { + void testApplyJLabelCellForDateFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -426,7 +426,7 @@ public class TestCellFormat { } @Test - public void testApplyJLabelCellForTimeFormat() throws Exception { + void testApplyJLabelCellForTimeFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -447,7 +447,7 @@ public class TestCellFormat { } @Test - public void testApplyJLabelCellForDateFormatAndNegativeFormat() throws Exception { + void testApplyJLabelCellForDateFormatAndNegativeFormat() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -475,7 +475,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasOnePartAndPartHasCondition() throws Exception { + void testApplyFormatHasOnePartAndPartHasCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -504,7 +504,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasTwoPartsFirstHasCondition() throws Exception { + void testApplyFormatHasTwoPartsFirstHasCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -539,7 +539,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasTwoPartsBothHaveCondition() throws Exception { + void testApplyFormatHasTwoPartsBothHaveCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -571,7 +571,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasThreePartsFirstHasCondition() throws Exception { + void testApplyFormatHasThreePartsFirstHasCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -605,7 +605,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasThreePartsFirstTwoHaveCondition() throws Exception { + void testApplyFormatHasThreePartsFirstTwoHaveCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -634,7 +634,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasThreePartsFirstIsDateFirstTwoHaveCondition() throws Exception { + void testApplyFormatHasThreePartsFirstIsDateFirstTwoHaveCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -663,7 +663,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasTwoPartsFirstHasConditionSecondIsGeneral() throws Exception { + void testApplyFormatHasTwoPartsFirstHasConditionSecondIsGeneral() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -692,7 +692,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasThreePartsFirstTwoHaveConditionThirdIsGeneral() throws Exception { + void testApplyFormatHasThreePartsFirstTwoHaveConditionThirdIsGeneral() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -721,7 +721,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasFourPartsFirstHasCondition() throws Exception { + void testApplyFormatHasFourPartsFirstHasCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -755,7 +755,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasFourPartsSecondHasCondition() throws Exception { + void testApplyFormatHasFourPartsSecondHasCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -790,7 +790,7 @@ public class TestCellFormat { } @Test - public void testApplyFormatHasFourPartsFirstTwoHaveCondition() throws Exception { + void testApplyFormatHasFourPartsFirstTwoHaveCondition() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -825,7 +825,7 @@ public class TestCellFormat { * Test apply(Object value) with a number as parameter */ @Test - public void testApplyObjectNumber() { + void testApplyObjectNumber() { CellFormat cf1 = CellFormat.getInstance("0.000"); @@ -853,7 +853,7 @@ public class TestCellFormat { * Test apply(Object value) with a Date as parameter */ @Test - public void testApplyObjectDate() throws ParseException { + void testApplyObjectDate() throws ParseException { CellFormat cf1 = CellFormat.getInstance("m/d/yyyy"); SimpleDateFormat sdf1 = new SimpleDateFormat("M/d/y", Locale.ROOT); sdf1.setTimeZone(TimeZone.getTimeZone("CET")); @@ -862,7 +862,7 @@ public class TestCellFormat { } @Test - public void testApplyCellForDateFormatWithConditions() throws Exception { + void testApplyCellForDateFormatWithConditions() throws Exception { // Create a workbook, row and cell to test with Workbook wb = new HSSFWorkbook(); @@ -888,7 +888,7 @@ public class TestCellFormat { * Test apply(Object value) with a String as parameter */ @Test - public void testApplyObjectString() { + void testApplyObjectString() { CellFormat cf = CellFormat.getInstance("0.00"); @@ -900,7 +900,7 @@ public class TestCellFormat { * Test apply(Object value) with a Boolean as parameter */ @Test - public void testApplyObjectBoolean() { + void testApplyObjectBoolean() { CellFormat cf1 = CellFormat.getInstance("0"); CellFormat cf2 = CellFormat.getInstance("General"); @@ -913,7 +913,7 @@ public class TestCellFormat { } @Test - public void testSimpleFractionFormat() throws IOException { + void testSimpleFractionFormat() throws IOException { CellFormat cf1 = CellFormat.getInstance("# ?/?"); // Create a workbook, row and cell to test with try (Workbook wb = new HSSFWorkbook()) { @@ -927,7 +927,7 @@ public class TestCellFormat { } @Test - public void testAccountingFormats() { + void testAccountingFormats() { char pound = '\u00A3'; char euro = '\u20AC'; @@ -978,7 +978,7 @@ public class TestCellFormat { } @Test - public void testThreePartComplexFormat1() { + void testThreePartComplexFormat1() { // verify a rather complex format found e.g. in http://wahl.land-oberoesterreich.gv.at/Downloads/bp10.xls CellFormatPart posPart = new CellFormatPart("[$-F400]h:mm:ss\\ AM/PM"); assertNotNull(posPart); @@ -996,7 +996,7 @@ public class TestCellFormat { } @Test - public void testThreePartComplexFormat2() { + void testThreePartComplexFormat2() { // verify a rather complex format found e.g. in http://wahl.land-oberoesterreich.gv.at/Downloads/bp10.xls CellFormatPart posPart = new CellFormatPart("dd/mm/yyyy"); assertNotNull(posPart); @@ -1014,13 +1014,13 @@ public class TestCellFormat { } @Test - public void testBug62865() { + void testBug62865() { CellFormat cf = CellFormat.getInstance("\"ca. \"0"); assertEquals("ca. 5", cf.apply((double) 5).text); } @Test - public void testNamedColors() { + void testNamedColors() { assertTrue(CellFormatPart.NAMED_COLORS.size() >= HSSFColor.HSSFColorPredefined.values().length); Stream.of("GREEN", "Green", "RED", "Red", "BLUE", "Blue", "YELLOW", "Yellow") .map(CellFormatPart.NAMED_COLORS::get) diff --git a/src/testcases/org/apache/poi/ss/format/TestCellFormatCondition.java b/src/testcases/org/apache/poi/ss/format/TestCellFormatCondition.java index 87ea43ac15..5bbe32db53 100644 --- a/src/testcases/org/apache/poi/ss/format/TestCellFormatCondition.java +++ b/src/testcases/org/apache/poi/ss/format/TestCellFormatCondition.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; public class TestCellFormatCondition { @Test - public void testSVConditions() { + void testSVConditions() { CellFormatCondition lt = CellFormatCondition.getInstance("<", "1.5"); assertTrue(lt.pass(1.4)); assertFalse(lt.pass(1.5)); diff --git a/src/testcases/org/apache/poi/ss/format/TestCellFormatResult.java b/src/testcases/org/apache/poi/ss/format/TestCellFormatResult.java index 51290e6e79..ac5e8a46df 100644 --- a/src/testcases/org/apache/poi/ss/format/TestCellFormatResult.java +++ b/src/testcases/org/apache/poi/ss/format/TestCellFormatResult.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; public class TestCellFormatResult { @Test - public void testNullTextRaisesException() { + void testNullTextRaisesException() { final boolean applies = true; final String text = null; final Color textColor = Color.BLACK; diff --git a/src/testcases/org/apache/poi/ss/formula/BaseTestExternalFunctions.java b/src/testcases/org/apache/poi/ss/formula/BaseTestExternalFunctions.java index 5472a92591..bd65b8e843 100644 --- a/src/testcases/org/apache/poi/ss/formula/BaseTestExternalFunctions.java +++ b/src/testcases/org/apache/poi/ss/formula/BaseTestExternalFunctions.java @@ -95,7 +95,7 @@ public abstract class BaseTestExternalFunctions { } @Test - public void testExternalFunctions() throws IOException { + void testExternalFunctions() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); diff --git a/src/testcases/org/apache/poi/ss/formula/BaseTestMissingWorkbook.java b/src/testcases/org/apache/poi/ss/formula/BaseTestMissingWorkbook.java index 2fbdf1df6f..d38b9a1a19 100644 --- a/src/testcases/org/apache/poi/ss/formula/BaseTestMissingWorkbook.java +++ b/src/testcases/org/apache/poi/ss/formula/BaseTestMissingWorkbook.java @@ -75,7 +75,7 @@ public abstract class BaseTestMissingWorkbook { } @Test - public void testMissingWorkbookMissing() { + void testMissingWorkbookMissing() { FormulaEvaluator evaluator = mainWorkbook.getCreationHelper().createFormulaEvaluator(); Sheet lSheet = mainWorkbook.getSheetAt(0); @@ -89,7 +89,7 @@ public abstract class BaseTestMissingWorkbook { } @Test - public void testMissingWorkbookMissingOverride() { + void testMissingWorkbookMissingOverride() { Sheet lSheet = mainWorkbook.getSheetAt(0); Cell lA1Cell = lSheet.getRow(0).getCell(0); Cell lB1Cell = lSheet.getRow(1).getCell(0); @@ -118,7 +118,7 @@ public abstract class BaseTestMissingWorkbook { } @Test - public void testExistingWorkbook() { + void testExistingWorkbook() { Sheet lSheet = mainWorkbook.getSheetAt(0); Cell lA1Cell = lSheet.getRow(0).getCell(0); Cell lB1Cell = lSheet.getRow(1).getCell(0); diff --git a/src/testcases/org/apache/poi/ss/formula/TestCellCacheEntry.java b/src/testcases/org/apache/poi/ss/formula/TestCellCacheEntry.java index 4ac48ed808..bd90938116 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestCellCacheEntry.java +++ b/src/testcases/org/apache/poi/ss/formula/TestCellCacheEntry.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; public class TestCellCacheEntry { @Test - public void testBasic() { + void testBasic() { CellCacheEntry pcce = new PlainValueCellCacheEntry(new NumberEval(42.0)); ValueEval ve = pcce.getValue(); assertEquals(42, ((NumberEval)ve).getNumberValue(), 0.0); diff --git a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java index 80b6368d74..5a88757a63 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java +++ b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java @@ -311,7 +311,7 @@ public class TestEvaluationCache { } @Test - public void testMediumComplex() { + void testMediumComplex() { MySheet ms = createMediumComplex(); // completely fresh evaluation confirmEvaluate(ms, "A1", 46); @@ -389,7 +389,7 @@ public class TestEvaluationCache { } @Test - public void testMediumComplexWithDependencyChange() { + void testMediumComplexWithDependencyChange() { // Changing an intermediate formula MySheet ms = createMediumComplex(); confirmEvaluate(ms, "A1", 46); @@ -448,7 +448,7 @@ public class TestEvaluationCache { * only when the plain cell's value actually changes */ @Test - public void testRedundantUpdate() { + void testRedundantUpdate() { MySheet ms = new MySheet(); ms.setCellValue("B1", 12); @@ -492,7 +492,7 @@ public class TestEvaluationCache { * effect in almost every function and operator. */ @Test - public void testSimpleWithDependencyChange() { + void testSimpleWithDependencyChange() { MySheet ms = new MySheet(); ms.setCellFormula("A1", "INDEX(C1:E1,1,B1)"); @@ -542,7 +542,7 @@ public class TestEvaluationCache { } @Test - public void testBlankCells() { + void testBlankCells() { MySheet ms = new MySheet(); ms.setCellFormula("A1", "sum(B1:D4,B5:E6)"); @@ -592,7 +592,7 @@ public class TestEvaluationCache { * have their cached results cleared. */ @Test - public void testBlankCellChangedToValueCell_bug46053() { + void testBlankCellChangedToValueCell_bug46053() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); @@ -628,7 +628,7 @@ public class TestEvaluationCache { * same use-case as the test for bug 46053, but checking trace values too */ @Test - public void testBlankCellChangedToValueCell() { + void testBlankCellChangedToValueCell() { MySheet ms = new MySheet(); @@ -669,7 +669,7 @@ public class TestEvaluationCache { } @Test - public void testPlainValueCache() { + void testPlainValueCache() { Workbook wb = new HSSFWorkbook(); int numberOfSheets = 4098; // Bug 51448 reported that Evaluation Cache got messed up after 256 sheets diff --git a/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java b/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java index 299fbf2058..51d3f5742d 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java +++ b/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java @@ -42,7 +42,7 @@ public final class TestFormulaShifter { * moved */ @Test - public void testShiftAreasSourceRows() { + void testShiftAreasSourceRows() { // all these operations are on an area ref spanning rows 10 to 20 AreaPtg aptg = createAreaPtgRow(10, 20); @@ -82,7 +82,7 @@ public final class TestFormulaShifter { } @Test - public void testShiftAreasSourceColumns() { + void testShiftAreasSourceColumns() { // all these operations are on an area ref spanning columns 10 to 20 AreaPtg aptg = createAreaPtgColumn(10, 20); @@ -122,7 +122,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceRowsRelRel() { + void testCopyAreasSourceRowsRelRel() { // all these operations are on an area ref spanning rows 10 to 20 final AreaPtg aptg = createAreaPtgRow(10, 20, true, true); @@ -132,7 +132,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceRowsRelAbs() { + void testCopyAreasSourceRowsRelAbs() { // all these operations are on an area ref spanning rows 10 to 20 final AreaPtg aptg = createAreaPtgRow(10, 20, true, false); @@ -143,7 +143,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceRowsAbsRel() { + void testCopyAreasSourceRowsAbsRel() { // aptg is part of a formula in a cell that was just copied to another row // aptg row references should be updated by the difference in rows that the cell was copied // No other references besides the cells that were involved in the copy need to be updated @@ -159,7 +159,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceRowsAbsAbs() { + void testCopyAreasSourceRowsAbsAbs() { // aptg is part of a formula in a cell that was just copied to another row // aptg row references should be updated by the difference in rows that the cell was copied // No other references besides the cells that were involved in the copy need to be updated @@ -175,7 +175,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceColumnsRelRel() { + void testCopyAreasSourceColumnsRelRel() { // all these operations are on an area ref spanning columns 10 to 20 final AreaPtg aptg = createAreaPtgColumn(10, 20, true, true); @@ -185,7 +185,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceColumnsRelAbs() { + void testCopyAreasSourceColumnsRelAbs() { // all these operations are on an area ref spanning columns 10 to 20 final AreaPtg aptg = createAreaPtgColumn(10, 20, true, false); @@ -196,7 +196,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceColumnsAbsRel() { + void testCopyAreasSourceColumnsAbsRel() { // aptg is part of a formula in a cell that was just copied to another column // aptg column references should be updated by the difference in columns that the cell was copied // No other references besides the cells that were involved in the copy need to be updated @@ -212,7 +212,7 @@ public final class TestFormulaShifter { } @Test - public void testCopyAreasSourceColumnsAbsAbs() { + void testCopyAreasSourceColumnsAbsAbs() { // aptg is part of a formula in a cell that was just copied to another column // aptg column references should be updated by the difference in columns that the cell was copied // No other references besides the cells that were involved in the copy need to be updated @@ -234,7 +234,7 @@ public final class TestFormulaShifter { * that area ref */ @Test - public void testShiftAreasDestRows() { + void testShiftAreasDestRows() { // all these operations are on an area ref spanning rows 20 to 25 AreaPtg aptg = createAreaPtgRow(20, 25); @@ -254,7 +254,7 @@ public final class TestFormulaShifter { * that area ref */ @Test - public void testShiftAreasDestColumns() { + void testShiftAreasDestColumns() { // all these operations are on an area ref spanning columns 20 to 25 AreaPtg aptg = createAreaPtgColumn(20, 25); @@ -382,7 +382,7 @@ public final class TestFormulaShifter { } @Test - public void testShiftSheet() { + void testShiftSheet() { // 4 sheets, move a sheet from pos 2 to pos 0, i.e. current 0 becomes 1, current 1 becomes pos 2 FormulaShifter shifter = FormulaShifter.createForSheetShift(2, 0); @@ -406,7 +406,7 @@ public final class TestFormulaShifter { } @Test - public void testShiftSheet2() { + void testShiftSheet2() { // 4 sheets, move a sheet from pos 1 to pos 2, i.e. current 2 becomes 1, current 1 becomes pos 2 FormulaShifter shifter = FormulaShifter.createForSheetShift(1, 2); @@ -430,7 +430,7 @@ public final class TestFormulaShifter { } @Test - public void testInvalidArgument() { + void testInvalidArgument() { assertThrows(IllegalArgumentException.class, () -> FormulaShifter.createForRowShift(1, "name", 1, 2, 0, SpreadsheetVersion.EXCEL97)); assertThrows(IllegalArgumentException.class, () -> @@ -438,12 +438,12 @@ public final class TestFormulaShifter { } @Test - public void testConstructor() { + void testConstructor() { assertNotNull(FormulaShifter.createForRowShift(1, "name", 1, 2, 2, SpreadsheetVersion.EXCEL97)); } @Test - public void testToString() { + void testToString() { FormulaShifter shifter = FormulaShifter.createForRowShift(0, "sheet", 123, 456, 789, SpreadsheetVersion.EXCEL2007); assertNotNull(shifter); diff --git a/src/testcases/org/apache/poi/ss/formula/TestFunctionRegistry.java b/src/testcases/org/apache/poi/ss/formula/TestFunctionRegistry.java index 915510bd4d..8f8bccc4f0 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestFunctionRegistry.java +++ b/src/testcases/org/apache/poi/ss/formula/TestFunctionRegistry.java @@ -68,14 +68,14 @@ public class TestFunctionRegistry { } @Test - public void testRegisterInRuntimeA() { + void testRegisterInRuntimeA() { HSSFCell cellA = row.createCell(0); cellA.setCellFormula("FISHER(A5)"); assertThrows(NotImplementedException.class, () -> fe.evaluate(cellA)); } @Test - public void testRegisterInRuntimeB() { + void testRegisterInRuntimeB() { HSSFCell cellA = row.createCell(0); cellA.setCellFormula("FISHER(A5)"); FunctionEval.registerFunction("FISHER", (args, srcRowIndex, srcColumnIndex) -> ErrorEval.NA); @@ -84,14 +84,14 @@ public class TestFunctionRegistry { } @Test - public void testRegisterInRuntimeC() { + void testRegisterInRuntimeC() { HSSFCell cellB = row.createCell(1); cellB.setCellFormula("CUBEMEMBERPROPERTY(A5)"); assertThrows(NotImplementedException.class, () -> fe.evaluate(cellB)); } @Test - public void testRegisterInRuntimeD() { + void testRegisterInRuntimeD() { HSSFCell cellB = row.createCell(1); cellB.setCellFormula("CUBEMEMBERPROPERTY(A5)"); @@ -106,7 +106,7 @@ public class TestFunctionRegistry { } @Test - public void testExceptionsA() { + void testExceptionsA() { IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> FunctionEval.registerFunction("SUM", TestFunctionRegistry::na) @@ -115,7 +115,7 @@ public class TestFunctionRegistry { } @Test - public void testExceptionsB() { + void testExceptionsB() { IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> FunctionEval.registerFunction("SUMXXX", TestFunctionRegistry::na) @@ -124,7 +124,7 @@ public class TestFunctionRegistry { } @Test - public void testExceptionsC() { + void testExceptionsC() { IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> FunctionEval.registerFunction("ISODD", TestFunctionRegistry::na) @@ -139,7 +139,7 @@ public class TestFunctionRegistry { } @Test - public void testExceptionsD() { + void testExceptionsD() { IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> AnalysisToolPak.registerFunction("ISODD", TestFunctionRegistry::atpFunc) @@ -148,7 +148,7 @@ public class TestFunctionRegistry { } @Test - public void testExceptionsE() { + void testExceptionsE() { IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> AnalysisToolPak.registerFunction("ISODDXXX", TestFunctionRegistry::atpFunc) @@ -157,7 +157,7 @@ public class TestFunctionRegistry { } @Test - public void testExceptionsF() { + void testExceptionsF() { IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> AnalysisToolPak.registerFunction("SUM", TestFunctionRegistry::atpFunc) diff --git a/src/testcases/org/apache/poi/ss/formula/TestPlainCellCache.java b/src/testcases/org/apache/poi/ss/formula/TestPlainCellCache.java index 1f06565fc3..957fd59367 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestPlainCellCache.java +++ b/src/testcases/org/apache/poi/ss/formula/TestPlainCellCache.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public class TestPlainCellCache { @Test - public void testLoc(){ + void testLoc(){ PlainCellCache cache = new PlainCellCache(); for (int bookIndex = 0; bookIndex < 0x1000; bookIndex += 0x100) { for (int sheetIndex = 0; sheetIndex < 0x1000; sheetIndex += 0x100) { diff --git a/src/testcases/org/apache/poi/ss/formula/TestSheetNameFormatter.java b/src/testcases/org/apache/poi/ss/formula/TestSheetNameFormatter.java index 22b9224a0a..f96b2a824f 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestSheetNameFormatter.java +++ b/src/testcases/org/apache/poi/ss/formula/TestSheetNameFormatter.java @@ -35,7 +35,7 @@ public final class TestSheetNameFormatter { * Tests main public method 'format' */ @Test - public void testFormat() { + void testFormat() { confirmFormat("abc", "abc"); confirmFormat("123", "'123'"); @@ -74,7 +74,7 @@ public final class TestSheetNameFormatter { } @Test - public void testFormatWithWorkbookName() { + void testFormatWithWorkbookName() { confirmFormat("abc", "abc", "[abc]abc"); confirmFormat("abc", "123", "'[abc]123'"); @@ -113,7 +113,7 @@ public final class TestSheetNameFormatter { } @Test - public void testFormatException() { + void testFormatException() { Appendable mock = new Appendable() { @Override public Appendable append(CharSequence csq) throws IOException { @@ -136,7 +136,7 @@ public final class TestSheetNameFormatter { } @Test - public void testBooleanLiterals() { + void testBooleanLiterals() { confirmFormat("TRUE", "'TRUE'"); confirmFormat("FALSE", "'FALSE'"); confirmFormat("True", "'True'"); @@ -155,7 +155,7 @@ public final class TestSheetNameFormatter { * would look (to Excel) like a cell name. */ @Test - public void testLooksLikePlainCellReference() { + void testLooksLikePlainCellReference() { confirmCellNameMatch("A1", true); confirmCellNameMatch("a111", true); @@ -178,7 +178,7 @@ public final class TestSheetNameFormatter { * letters followed by one or more digits). */ @Test - public void testCellRange() { + void testCellRange() { confirmCellRange("A1", 1, true); confirmCellRange("a111", 1, true); confirmCellRange("A65536", 1, true); diff --git a/src/testcases/org/apache/poi/ss/formula/TestWorkbookEvaluator.java b/src/testcases/org/apache/poi/ss/formula/TestWorkbookEvaluator.java index 05cebd4cc2..df5e1aa042 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestWorkbookEvaluator.java +++ b/src/testcases/org/apache/poi/ss/formula/TestWorkbookEvaluator.java @@ -74,7 +74,7 @@ public class TestWorkbookEvaluator { * the whole formula which converts tAttrSum to tFuncVar("SUM") ) */ @Test - public void testAttrSum() { + void testAttrSum() { Ptg[] ptgs = { new IntPtg(42), @@ -91,7 +91,7 @@ public class TestWorkbookEvaluator { * to the error constant #REF! ) */ @Test - public void testRefErr() { + void testRefErr() { confirmRefErr(new RefErrorPtg()); confirmRefErr(new AreaErrPtg()); @@ -112,7 +112,7 @@ public class TestWorkbookEvaluator { * the whole formula which converts tAttrSum to tFuncVar("SUM") ) */ @Test - public void testMemFunc() { + void testMemFunc() { Ptg[] ptgs = { new IntPtg(42), AttrPtg.SUM, @@ -123,7 +123,7 @@ public class TestWorkbookEvaluator { } @Test - public void testEvaluateMultipleWorkbooks() { + void testEvaluateMultipleWorkbooks() { HSSFWorkbook wbA = HSSFTestDataSamples.openSampleWorkbook("multibookFormulaA.xls"); HSSFWorkbook wbB = HSSFTestDataSamples.openSampleWorkbook("multibookFormulaB.xls"); @@ -189,7 +189,7 @@ public class TestWorkbookEvaluator { * the result of a function gets translated to {@link BlankEval}. */ @Test - public void testMissingArg() { + void testMissingArg() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); @@ -225,7 +225,7 @@ public class TestWorkbookEvaluator { * should be dereferenced by the evaluator */ @Test - public void testResultOutsideRange() throws IOException { + void testResultOutsideRange() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Cell cell = wb.createSheet("Sheet1").createRow(0).createCell(0); cell.setCellFormula("D2:D5"); // IF(TRUE,D2:D5,D2) or OFFSET(D2:D5,0,0) would work too @@ -256,7 +256,7 @@ public class TestWorkbookEvaluator { * formulas with defined names. */ @Test - public void testNamesInFormulas() throws IOException { + void testNamesInFormulas() throws IOException { Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet("Sheet1"); @@ -311,7 +311,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIgnoreMissingWorkbooks() { + void testIgnoreMissingWorkbooks() { // TODO: update this test for meaningful functional behavior WorkbookEvaluator evaluator = new WorkbookEvaluator(null, null, null); assertFalse(evaluator.isIgnoreMissingWorkbooks()); @@ -324,7 +324,7 @@ public class TestWorkbookEvaluator { } @Test - public void testDebugEvaluationOutputForNextEval() { + void testDebugEvaluationOutputForNextEval() { // TODO: update this test for meaningful functional behavior WorkbookEvaluator evaluator = new WorkbookEvaluator(null, null, null); assertFalse(evaluator.isDebugEvaluationOutputForNextEval()); @@ -413,7 +413,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_NumericLiteral() { + void testIFEqualsFormulaEvaluation_NumericLiteral() { final String formula = "IF(A1=1, 2, 3)"; final CellType cellType = CellType.NUMERIC; final String expectedFormula = "IF(A1=1,2,3)"; @@ -422,7 +422,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_Numeric() { + void testIFEqualsFormulaEvaluation_Numeric() { final String formula = "IF(A1=1, B1, C1)"; final CellType cellType = CellType.NUMERIC; final String expectedFormula = "IF(A1=1,B1,C1)"; @@ -431,7 +431,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_NumericCoerceToString() { + void testIFEqualsFormulaEvaluation_NumericCoerceToString() { final String formula = "IF(A1&\"\"=\"1\", B1, C1)"; final CellType cellType = CellType.NUMERIC; final String expectedFormula = "IF(A1&\"\"=\"1\",B1,C1)"; @@ -440,7 +440,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_String() { + void testIFEqualsFormulaEvaluation_String() { final String formula = "IF(A1=1, B1, C1)"; final CellType cellType = CellType.STRING; final String expectedFormula = "IF(A1=1,B1,C1)"; @@ -449,7 +449,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_StringCompareToString() { + void testIFEqualsFormulaEvaluation_StringCompareToString() { final String formula = "IF(A1=\"1\", B1, C1)"; final CellType cellType = CellType.STRING; final String expectedFormula = "IF(A1=\"1\",B1,C1)"; @@ -458,7 +458,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_StringCoerceToNumeric() { + void testIFEqualsFormulaEvaluation_StringCoerceToNumeric() { final String formula = "IF(A1+0=1, B1, C1)"; final CellType cellType = CellType.STRING; final String expectedFormula = "IF(A1+0=1,B1,C1)"; @@ -468,7 +468,7 @@ public class TestWorkbookEvaluator { @Disabled("Bug 58591: this test currently fails") @Test - public void testIFEqualsFormulaEvaluation_Boolean() { + void testIFEqualsFormulaEvaluation_Boolean() { final String formula = "IF(A1=1, B1, C1)"; final CellType cellType = CellType.BOOLEAN; final String expectedFormula = "IF(A1=1,B1,C1)"; @@ -478,7 +478,7 @@ public class TestWorkbookEvaluator { @Disabled("Bug 58591: this test currently fails") @Test - public void testIFEqualsFormulaEvaluation_BooleanSimple() { + void testIFEqualsFormulaEvaluation_BooleanSimple() { final String formula = "3-(A1=1)"; final CellType cellType = CellType.BOOLEAN; final String expectedFormula = "3-(A1=1)"; @@ -487,7 +487,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_Formula() { + void testIFEqualsFormulaEvaluation_Formula() { final String formula = "IF(A1=1, B1, C1)"; final CellType cellType = CellType.FORMULA; final String expectedFormula = "IF(A1=1,B1,C1)"; @@ -496,7 +496,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_Blank() { + void testIFEqualsFormulaEvaluation_Blank() { final String formula = "IF(A1=1, B1, C1)"; final CellType cellType = CellType.BLANK; final String expectedFormula = "IF(A1=1,B1,C1)"; @@ -505,7 +505,7 @@ public class TestWorkbookEvaluator { } @Test - public void testIFEqualsFormulaEvaluation_BlankCompareToZero() { + void testIFEqualsFormulaEvaluation_BlankCompareToZero() { final String formula = "IF(A1=0, B1, C1)"; final CellType cellType = CellType.BLANK; final String expectedFormula = "IF(A1=0,B1,C1)"; @@ -515,7 +515,7 @@ public class TestWorkbookEvaluator { @Disabled("Bug 58591: this test currently fails") @Test - public void testIFEqualsFormulaEvaluation_BlankInverted() { + void testIFEqualsFormulaEvaluation_BlankInverted() { final String formula = "IF(NOT(A1)=1, B1, C1)"; final CellType cellType = CellType.BLANK; final String expectedFormula = "IF(NOT(A1)=1,B1,C1)"; @@ -525,7 +525,7 @@ public class TestWorkbookEvaluator { @Disabled("Bug 58591: this test currently fails") @Test - public void testIFEqualsFormulaEvaluation_BlankInvertedSimple() { + void testIFEqualsFormulaEvaluation_BlankInvertedSimple() { final String formula = "3-(NOT(A1)=1)"; final CellType cellType = CellType.BLANK; final String expectedFormula = "3-(NOT(A1)=1)"; @@ -607,7 +607,7 @@ public class TestWorkbookEvaluator { } @Test - public void testRefToBlankCellInArrayFormula() { + void testRefToBlankCellInArrayFormula() { Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestIfError.java b/src/testcases/org/apache/poi/ss/formula/atp/TestIfError.java index c94ec8c42d..a049454cfc 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestIfError.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestIfError.java @@ -41,7 +41,7 @@ public class TestIfError { * =IFERROR(C1,\"Error in calculation\")" References the result of dividing 55 by 0 and returns the error text */ @Test - public void testEvaluate() throws IOException { + void testEvaluate() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sh = wb.createSheet(); Row row1 = sh.createRow(0); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestMRound.java b/src/testcases/org/apache/poi/ss/formula/atp/TestMRound.java index 290e4663fc..bb0c88cf1b 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestMRound.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestMRound.java @@ -38,7 +38,7 @@ public class TestMRound { =MROUND(5, -2) Returns an error, because -2 and 5 have different signs (#NUM!) * */ @Test - public void testEvaluate(){ + void testEvaluate(){ Workbook wb = new HSSFWorkbook(); Sheet sh = wb.createSheet(); Cell cell1 = sh.createRow(0).createCell(0); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java b/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java index 2d87aca37e..ff2c1d1863 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestNetworkdaysFunction.java @@ -44,47 +44,47 @@ public class TestNetworkdaysFunction { private static final OperationEvaluationContext EC = new OperationEvaluationContext(null, null, 1, 1, 1, null); @Test - public void testFailWhenNoArguments() { + void testFailWhenNoArguments() { assertEquals(VALUE_INVALID, NetworkdaysFunction.instance.evaluate(new ValueEval[0], null)); } @Test - public void testFailWhenLessThan2Arguments() { + void testFailWhenLessThan2Arguments() { assertEquals(VALUE_INVALID, NetworkdaysFunction.instance.evaluate(new ValueEval[1], null)); } @Test - public void testFailWhenMoreThan3Arguments() { + void testFailWhenMoreThan3Arguments() { assertEquals(VALUE_INVALID, NetworkdaysFunction.instance.evaluate(new ValueEval[4], null)); } @Test - public void testFailWhenArgumentsAreNotDates() { + void testFailWhenArgumentsAreNotDates() { assertEquals(VALUE_INVALID, NetworkdaysFunction.instance.evaluate(new ValueEval[]{ new StringEval("Potato"), new StringEval("Cucumber") }, EC)); } @Test - public void testFailWhenStartDateAfterEndDate() { + void testFailWhenStartDateAfterEndDate() { assertEquals(NAME_INVALID, NetworkdaysFunction.instance.evaluate(new ValueEval[]{ new StringEval(END_DATE), new StringEval(STARTING_DATE) }, EC)); } @Test - public void testReturnNetworkdays() { + void testReturnNetworkdays() { assertEquals(108, (int) ((NumericValueEval) NetworkdaysFunction.instance.evaluate(new ValueEval[]{ new StringEval(STARTING_DATE), new StringEval(END_DATE) }, EC)).getNumberValue()); } @Test - public void testReturnNetworkdaysWithAHoliday() { + void testReturnNetworkdaysWithAHoliday() { assertEquals(107, (int) ((NumericValueEval) NetworkdaysFunction.instance.evaluate(new ValueEval[]{ new StringEval(STARTING_DATE), new StringEval(END_DATE), new StringEval(FIRST_HOLIDAY) }, EC)).getNumberValue()); } @Test - public void testReturnNetworkdaysWithManyHolidays() { + void testReturnNetworkdaysWithManyHolidays() { assertEquals(105, (int) ((NumericValueEval) NetworkdaysFunction.instance.evaluate(new ValueEval[]{ new StringEval(STARTING_DATE), new StringEval(END_DATE), new MockAreaEval(FIRST_HOLIDAY, SECOND_HOLIDAY, THIRD_HOLIDAY)}, EC)).getNumberValue()); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestPercentile.java b/src/testcases/org/apache/poi/ss/formula/atp/TestPercentile.java index 6c3ecbfc3c..c50bc2f08a 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestPercentile.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestPercentile.java @@ -53,7 +53,7 @@ public class TestPercentile { } @Test - public void testBasic() { + void testBasic() { ValueEval[] values = { new NumberEval(210.128), new NumberEval(65.2182), new NumberEval(32.231), new NumberEval(12.123), new NumberEval(45.32) }; ValueEval percentile = new NumberEval(0.95); @@ -61,7 +61,7 @@ public class TestPercentile { } @Test - public void testBlanks() { + void testBlanks() { ValueEval[] values = { new NumberEval(210.128), new NumberEval(65.2182), new NumberEval(32.231), BlankEval.instance, new NumberEval(45.32) }; ValueEval percentile = new NumberEval(0.95); @@ -69,7 +69,7 @@ public class TestPercentile { } @Test - public void testUnusualArgs() { + void testUnusualArgs() { ValueEval[] values = { new NumberEval(1), new NumberEval(2), BoolEval.TRUE, BoolEval.FALSE }; ValueEval percentile = new NumberEval(0.95); confirmPercentile(percentile, values, 1.95); @@ -77,7 +77,7 @@ public class TestPercentile { //percentile has to be between 0 and 1 - here we test less than zero @Test - public void testUnusualArgs2() { + void testUnusualArgs2() { ValueEval[] values = { new NumberEval(1), new NumberEval(2), }; ValueEval percentile = new NumberEval(-0.1); confirmPercentile(percentile, values, ErrorEval.NUM_ERROR); @@ -85,7 +85,7 @@ public class TestPercentile { //percentile has to be between 0 and 1 - here we test more than 1 @Test - public void testUnusualArgs3() { + void testUnusualArgs3() { ValueEval[] values = { new NumberEval(1), new NumberEval(2) }; ValueEval percentile = new NumberEval(1.1); confirmPercentile(percentile, values, ErrorEval.NUM_ERROR); @@ -93,7 +93,7 @@ public class TestPercentile { //here we test where there are errors as part of inputs @Test - public void testErrors() { + void testErrors() { ValueEval[] values = { new NumberEval(1), ErrorEval.NAME_INVALID, new NumberEval(3), ErrorEval.DIV_ZERO, }; ValueEval percentile = new NumberEval(0.95); confirmPercentile(percentile, values, ErrorEval.NAME_INVALID); @@ -101,7 +101,7 @@ public class TestPercentile { //here we test where there are errors as part of inputs @Test - public void testErrors2() { + void testErrors2() { ValueEval[] values = { new NumberEval(1), new NumberEval(2), new NumberEval(3), ErrorEval.DIV_ZERO, }; ValueEval percentile = new NumberEval(0.95); confirmPercentile(percentile, values, ErrorEval.DIV_ZERO); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java b/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java index 666d6cb643..b5632a177e 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java @@ -56,7 +56,7 @@ public class TestRandBetween { * Check where values are the same */ @Test - public void testRandBetweenSameValues() { + void testRandBetweenSameValues() { evaluator.clearAllCachedResultValues(); formulaCell.setCellFormula("RANDBETWEEN(1,1)"); evaluator.evaluateFormulaCell(formulaCell); @@ -69,7 +69,7 @@ public class TestRandBetween { } @Test - public void testRandBetweenLargeLongs() { + void testRandBetweenLargeLongs() { for (int i = 0; i < 100; i++) { evaluator.clearAllCachedResultValues(); formulaCell.setCellFormula("RANDBETWEEN(0,9999999999)"); @@ -85,7 +85,7 @@ public class TestRandBetween { * top value. */ @Test - public void testRandBetweenSpecialCase() { + void testRandBetweenSpecialCase() { bottomValueCell.setCellValue(0.05); topValueCell.setCellValue(0.1); formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)"); @@ -116,7 +116,7 @@ public class TestRandBetween { * Check top value of BLANK which Excel will evaluate as 0 */ @Test - public void testRandBetweenTopBlank() { + void testRandBetweenTopBlank() { bottomValueCell.setCellValue(-1); topValueCell.setBlank(); formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)"); @@ -129,7 +129,7 @@ public class TestRandBetween { * Check where input values are of wrong type */ @Test - public void testRandBetweenWrongInputTypes() { + void testRandBetweenWrongInputTypes() { // Check case where bottom input is of the wrong type bottomValueCell.setCellValue("STRING"); topValueCell.setCellValue(1); @@ -163,7 +163,7 @@ public class TestRandBetween { * Check case where bottom is greater than top */ @Test - public void testRandBetweenBottomGreaterThanTop() { + void testRandBetweenBottomGreaterThanTop() { // Check case where bottom is greater than top bottomValueCell.setCellValue(1); topValueCell.setCellValue(0); @@ -185,7 +185,7 @@ public class TestRandBetween { * Boundary check of Double MIN and MAX values */ @Test - public void testRandBetweenBoundaryCheck() { + void testRandBetweenBoundaryCheck() { bottomValueCell.setCellValue(Double.MIN_VALUE); topValueCell.setCellValue(Double.MAX_VALUE); formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)"); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java b/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java index 06a69c03a8..8066eb8994 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java @@ -30,28 +30,28 @@ import org.junit.jupiter.api.Test; public class TestWorkdayCalculator { @Test - public void testCalculateWorkdaysShouldReturnJustWeekdaysWhenNoWeekend() { + void testCalculateWorkdaysShouldReturnJustWeekdaysWhenNoWeekend() { final double A_MONDAY = DateUtil.getExcelDate(d(2011, 12, 12)); final double A_FRIDAY = DateUtil.getExcelDate(d(2011, 12, 16)); assertEquals(5, WorkdayCalculator.instance.calculateWorkdays(A_MONDAY, A_FRIDAY, new double[0])); } @Test - public void testCalculateWorkdaysShouldReturnAllDaysButNoSaturdays() { + void testCalculateWorkdaysShouldReturnAllDaysButNoSaturdays() { final double A_WEDNESDAY = DateUtil.getExcelDate(d(2011, 12, 14)); final double A_SATURDAY = DateUtil.getExcelDate(d(2011, 12, 18)); assertEquals(3, WorkdayCalculator.instance.calculateWorkdays(A_WEDNESDAY, A_SATURDAY, new double[0])); } @Test - public void testCalculateWorkdaysShouldReturnAllDaysButNoSundays() { + void testCalculateWorkdaysShouldReturnAllDaysButNoSundays() { final double A_SUNDAY = DateUtil.getExcelDate(d(2011, 12, 11)); final double A_THURSDAY = DateUtil.getExcelDate(d(2011, 12, 15)); assertEquals(4, WorkdayCalculator.instance.calculateWorkdays(A_SUNDAY, A_THURSDAY, new double[0])); } @Test - public void testCalculateWorkdaysShouldReturnAllDaysButNoHolidays() { + void testCalculateWorkdaysShouldReturnAllDaysButNoHolidays() { final double A_MONDAY = DateUtil.getExcelDate(d(2011, 12, 12)); final double A_FRIDAY = DateUtil.getExcelDate(d(2011, 12, 16)); final double A_WEDNESDAY = DateUtil.getExcelDate(d(2011, 12, 14)); @@ -59,7 +59,7 @@ public class TestWorkdayCalculator { } @Test - public void testCalculateWorkdaysShouldIgnoreWeekendHolidays() { + void testCalculateWorkdaysShouldIgnoreWeekendHolidays() { final double A_FRIDAY = DateUtil.getExcelDate(d(2011, 12, 16)); final double A_SATURDAY = DateUtil.getExcelDate(d(2011, 12, 17)); final double A_SUNDAY = DateUtil.getExcelDate(d(2011, 12, 18)); @@ -68,60 +68,60 @@ public class TestWorkdayCalculator { } @Test - public void testCalculateWorkdaysOnSameDayShouldReturn1ForWeekdays() { + void testCalculateWorkdaysOnSameDayShouldReturn1ForWeekdays() { final double A_MONDAY = DateUtil.getExcelDate(d(2017, 1, 2)); assertEquals(1, WorkdayCalculator.instance.calculateWorkdays(A_MONDAY, A_MONDAY, new double[0])); } @Test - public void testCalculateWorkdaysOnSameDayShouldReturn0ForHolidays() { + void testCalculateWorkdaysOnSameDayShouldReturn0ForHolidays() { final double A_MONDAY = DateUtil.getExcelDate(d(2017, 1, 2)); assertEquals(0, WorkdayCalculator.instance.calculateWorkdays(A_MONDAY, A_MONDAY, new double[]{ A_MONDAY })); } @Test - public void testCalculateWorkdaysOnSameDayShouldReturn0ForWeekends() { + void testCalculateWorkdaysOnSameDayShouldReturn0ForWeekends() { final double A_SUNDAY = DateUtil.getExcelDate(d(2017, 1, 1)); assertEquals(0, WorkdayCalculator.instance.calculateWorkdays(A_SUNDAY, A_SUNDAY, new double[0])); } @Test - public void testCalculateWorkdaysNumberOfDays() { + void testCalculateWorkdaysNumberOfDays() { double start = 41553.0; int days = 1; assertEquals(d(2013, 10, 7), WorkdayCalculator.instance.calculateWorkdays(start, days, new double[0])); } @Test - public void testPastDaysOfWeekShouldReturn0Past0Saturdays() { + void testPastDaysOfWeekShouldReturn0Past0Saturdays() { final double A_WEDNESDAY = DateUtil.getExcelDate(d(2011, 12, 7)); final double A_FRIDAY = DateUtil.getExcelDate(d(2011, 12, 9)); assertEquals(0, WorkdayCalculator.instance.pastDaysOfWeek(A_WEDNESDAY, A_FRIDAY, SATURDAY)); } @Test - public void testPastDaysOfWeekShouldReturn1Past1Saturdays() { + void testPastDaysOfWeekShouldReturn1Past1Saturdays() { final double A_WEDNESDAY = DateUtil.getExcelDate(d(2011, 12, 7)); final double A_SUNDAY = DateUtil.getExcelDate(d(2011, 12, 11)); assertEquals(1, WorkdayCalculator.instance.pastDaysOfWeek(A_WEDNESDAY, A_SUNDAY, SATURDAY)); } @Test - public void testPastDaysOfWeekShouldReturn2Past2Saturdays() { + void testPastDaysOfWeekShouldReturn2Past2Saturdays() { final double A_THURSDAY = DateUtil.getExcelDate(d(2011, 12, 8)); final double A_MONDAY = DateUtil.getExcelDate(d(2011, 12, 19)); assertEquals(2, WorkdayCalculator.instance.pastDaysOfWeek(A_THURSDAY, A_MONDAY, SATURDAY)); } @Test - public void testPastDaysOfWeekShouldReturn1BeginningFromASaturday() { + void testPastDaysOfWeekShouldReturn1BeginningFromASaturday() { final double A_SATURDAY = DateUtil.getExcelDate(d(2011, 12, 10)); final double A_SUNDAY = DateUtil.getExcelDate(d(2011, 12, 11)); assertEquals(1, WorkdayCalculator.instance.pastDaysOfWeek(A_SATURDAY, A_SUNDAY, SATURDAY)); } @Test - public void testPastDaysOfWeekShouldReturn1EndingAtASaturday() { + void testPastDaysOfWeekShouldReturn1EndingAtASaturday() { final double A_THURSDAY = DateUtil.getExcelDate(d(2011, 12, 8)); final double A_SATURDAY = DateUtil.getExcelDate(d(2011, 12, 10)); assertEquals(1, WorkdayCalculator.instance.pastDaysOfWeek(A_THURSDAY, A_SATURDAY, SATURDAY)); @@ -133,7 +133,7 @@ public class TestWorkdayCalculator { } @Test - public void testCalculateNonWeekendHolidays() { + void testCalculateNonWeekendHolidays() { final double start = DateUtil.getExcelDate(d(2016, 12, 24)); final double end = DateUtil.getExcelDate(d(2016, 12, 31)); final double holiday1 = DateUtil.getExcelDate(d(2016, 12, 25)); @@ -143,7 +143,7 @@ public class TestWorkdayCalculator { } @Test - public void testCalculateNonWeekendHolidaysOneDay() { + void testCalculateNonWeekendHolidaysOneDay() { final double start = DateUtil.getExcelDate(d(2016, 12, 26)); final double end = DateUtil.getExcelDate(d(2016, 12, 26)); final double holiday1 = DateUtil.getExcelDate(d(2016, 12, 25)); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java b/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java index 5772103fbf..4414276574 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java @@ -49,31 +49,31 @@ public class TestWorkdayFunction { private static final OperationEvaluationContext EC = new OperationEvaluationContext(null, null, 1, 1, 1, null); @Test - public void testFailWhenNoArguments() { + void testFailWhenNoArguments() { ValueEval[] ve = new ValueEval[0]; assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, null)); } @Test - public void testFailWhenLessThan2Arguments() { + void testFailWhenLessThan2Arguments() { ValueEval[] ve = new ValueEval[1]; assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, null)); } @Test - public void testFailWhenMoreThan3Arguments() { + void testFailWhenMoreThan3Arguments() { ValueEval[] ve = new ValueEval[4]; assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, null)); } @Test - public void testFailWhenArgumentsAreNotDatesNorNumbers() { + void testFailWhenArgumentsAreNotDatesNorNumbers() { ValueEval[] ve = {new StringEval("Potato"), new StringEval("Cucumber")}; assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, EC)); } @Test - public void testReturnWorkdays() { + void testReturnWorkdays() { Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 3, 30); Date expDate = expCal.getTime(); ValueEval[] ve = {new StringEval(STARTING_DATE), new NumberEval(151)}; @@ -82,7 +82,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnWorkdaysSpanningAWeekendSubtractingDays() { + void testReturnWorkdaysSpanningAWeekendSubtractingDays() { Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 8, 27); Date expDate = expCal.getTime(); @@ -95,7 +95,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnWorkdaysSpanningAWeekendAddingDays() { + void testReturnWorkdaysSpanningAWeekendAddingDays() { Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 8, 30); Date expDate = expCal.getTime(); @@ -108,7 +108,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnWorkdaysWhenStartIsWeekendAddingDays() { + void testReturnWorkdaysWhenStartIsWeekendAddingDays() { Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 9, 7); Date expDate = expCal.getTime(); @@ -121,7 +121,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnWorkdaysWhenStartIsWeekendSubtractingDays() { + void testReturnWorkdaysWhenStartIsWeekendSubtractingDays() { Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 9, 4); Date expDate = expCal.getTime(); @@ -134,7 +134,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnWorkdaysWithDaysTruncated() { + void testReturnWorkdaysWithDaysTruncated() { Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 3, 30); Date expDate = expCal.getTime(); @@ -146,7 +146,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnRetroativeWorkday() { + void testReturnRetroativeWorkday() { Calendar expCal = LocaleUtil.getLocaleCalendar(2008, 8, 23); Date expDate = expCal.getTime(); @@ -158,7 +158,7 @@ public class TestWorkdayFunction { } @Test - public void testReturnNetworkdaysWithManyHolidays() { + void testReturnNetworkdaysWithManyHolidays() { Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 4, 5); Date expDate = expCal.getTime(); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculator.java b/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculator.java index c9737102c6..29747bebd4 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculator.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculator.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; public final class TestYearFracCalculator { @Test - public void testBasis1() { + void testBasis1() { confirm(md(1999, 1, 1), md(1999, 4, 5), 1, 0.257534247); confirm(md(1999, 4, 1), md(1999, 4, 5), 1, 0.010958904); confirm(md(1999, 4, 1), md(1999, 4, 4), 1, 0.008219178); diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculatorFromSpreadsheet.java b/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculatorFromSpreadsheet.java index b3dd5db273..e556858e7a 100644 --- a/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculatorFromSpreadsheet.java +++ b/src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculatorFromSpreadsheet.java @@ -52,7 +52,7 @@ public final class TestYearFracCalculatorFromSpreadsheet { } @Test - public void testAll() throws Exception { + void testAll() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("yearfracExamples.xls"); HSSFSheet sheet = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/ss/formula/constant/TestConstantValueParser.java b/src/testcases/org/apache/poi/ss/formula/constant/TestConstantValueParser.java index aad09be92a..46ddea521b 100644 --- a/src/testcases/org/apache/poi/ss/formula/constant/TestConstantValueParser.java +++ b/src/testcases/org/apache/poi/ss/formula/constant/TestConstantValueParser.java @@ -45,13 +45,13 @@ public final class TestConstantValueParser { "10 07 00 00 00 00 00 00 00"); @Test - public void testGetEncodedSize() { + void testGetEncodedSize() { int actual = ConstantValueParser.getEncodedSize(SAMPLE_VALUES); assertEquals(51, actual); } @Test - public void testEncode() { + void testEncode() { int size = ConstantValueParser.getEncodedSize(SAMPLE_VALUES); byte[] data = new byte[size]; @@ -61,7 +61,7 @@ public final class TestConstantValueParser { } @Test - public void testDecode() { + void testDecode() { LittleEndianInput in = TestcaseRecordInputStream.createLittleEndian(SAMPLE_ENCODING); Object[] values = ConstantValueParser.parse(in, 4); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/BaseTestCircularReferences.java b/src/testcases/org/apache/poi/ss/formula/eval/BaseTestCircularReferences.java index 9ab60c9fb2..74de1ca32c 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/BaseTestCircularReferences.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/BaseTestCircularReferences.java @@ -76,7 +76,7 @@ public abstract class BaseTestCircularReferences { * "INDEX() formula cannot contain its own location in the data array range" */ @Test - public void testIndexFormula() throws IOException { + void testIndexFormula() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("Sheet1"); @@ -105,7 +105,7 @@ public abstract class BaseTestCircularReferences { * Cell A1 has formula "=A1" */ @Test - public void testSimpleCircularReference() throws IOException { + void testSimpleCircularReference() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("Sheet1"); @@ -124,7 +124,7 @@ public abstract class BaseTestCircularReferences { * A1=B1, B1=C1, C1=D1, D1=A1 */ @Test - public void testMultiLevelCircularReference() throws IOException { + void testMultiLevelCircularReference() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("Sheet1"); @@ -142,7 +142,7 @@ public abstract class BaseTestCircularReferences { } @Test - public void testIntermediateCircularReferenceResults_bug46898() throws IOException { + void testIntermediateCircularReferenceResults_bug46898() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("Sheet1"); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestAreaEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestAreaEval.java index 83c7616459..8f8f136695 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestAreaEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestAreaEval.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public final class TestAreaEval { @Test - public void testGetValue_bug44950() { + void testGetValue_bug44950() { // TODO - this test probably isn't testing much anymore AreaPtg ptg = new AreaPtg(new AreaReference("B2:D3", SpreadsheetVersion.EXCEL97)); NumberEval one = new NumberEval(1); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestDivideEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestDivideEval.java index 1d786f9e01..092d6fbd55 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestDivideEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestDivideEval.java @@ -39,7 +39,7 @@ public final class TestDivideEval { } @Test - public void testBasic() { + void testBasic() { confirm(new NumberEval(5), new NumberEval(2), 2.5); confirm(new NumberEval(3), new NumberEval(16), 0.1875); confirm(new NumberEval(-150), new NumberEval(-15), 10.0); @@ -48,14 +48,14 @@ public final class TestDivideEval { } @Test - public void test1x1Area() { + void test1x1Area() { AreaEval ae0 = EvalFactory.createAreaEval("B2:B2", new ValueEval[] { new NumberEval(50), }); AreaEval ae1 = EvalFactory.createAreaEval("C2:C2", new ValueEval[] { new NumberEval(10), }); confirm(ae0, ae1, 5); } @Test - public void testDivZero() { + void testDivZero() { ValueEval[] args = { new NumberEval(5), NumberEval.ZERO, }; diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java index c22583dbaa..f67b6dbce0 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java @@ -34,7 +34,7 @@ public final class TestEqualEval { * The value from a 1x1 area should be taken immediately, regardless of srcRow and srcCol */ @Test - public void test1x1AreaOperand() { + void test1x1AreaOperand() { ValueEval[] values = { BoolEval.FALSE, }; ValueEval[] args = { @@ -51,7 +51,7 @@ public final class TestEqualEval { * Empty string is equal to blank */ @Test - public void testBlankEqualToEmptyString() { + void testBlankEqualToEmptyString() { ValueEval[] args = { new StringEval(""), @@ -67,7 +67,7 @@ public final class TestEqualEval { * Test for bug 46613 (observable at svn r737248) */ @Test - public void testStringInsensitive_bug46613() { + void testStringInsensitive_bug46613() { assertTrue(evalStringCmp("abc", "aBc", EvalInstances.Equal)); assertTrue(evalStringCmp("ABC", "azz", EvalInstances.LessThan)); assertTrue(evalStringCmp("abc", "AZZ", EvalInstances.LessThan)); @@ -87,7 +87,7 @@ public final class TestEqualEval { } @Test - public void testBooleanCompares() { + void testBooleanCompares() { confirmCompares(BoolEval.TRUE, new StringEval("TRUE"), +1); confirmCompares(BoolEval.TRUE, new NumberEval(1.0), +1); confirmCompares(BoolEval.TRUE, BoolEval.TRUE, 0); @@ -130,7 +130,7 @@ public final class TestEqualEval { * See {@link TestMinusZeroResult} for more specific tests regarding -0.0. */ @Test - public void testZeroEquality_bug47198() { + void testZeroEquality_bug47198() { NumberEval zero = new NumberEval(0.0); NumberEval mZero = (NumberEval) evaluate(UnaryMinusEval.instance, new ValueEval[] { zero, }, 0, 0); assertNotEquals(0x8000000000000000L, Double.doubleToLongBits(mZero.getNumberValue()), @@ -141,7 +141,7 @@ public final class TestEqualEval { } @Test - public void testRounding_bug47598() { + void testRounding_bug47598() { double x = 1+1.0028-0.9973; // should be 1.0055, but has IEEE rounding assertNotEquals(1.0055, x, 0.0); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestExternalFunction.java b/src/testcases/org/apache/poi/ss/formula/eval/TestExternalFunction.java index 6fcca886c0..ee9da53893 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestExternalFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestExternalFunction.java @@ -56,7 +56,7 @@ public final class TestExternalFunction { * Checks that an external function can get invoked from the formula evaluator. */ @Test - public void testInvoke() throws IOException { + void testInvoke() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("testNames.xls")) { HSSFSheet sheet = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java b/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java index c74d1050f8..fa6ce1b86a 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java @@ -46,7 +46,7 @@ public final class TestFormulaBugs { * added <em>long</em> after the relevant functionality was fixed. */ @Test - public void test27349() throws Exception { + void test27349() throws Exception { // 27349-vlookupAcrossSheets.xls is bugzilla/attachment.cgi?id=10622 InputStream is = HSSFTestDataSamples.openSampleFileStream("27349-vlookupAcrossSheets.xls"); // original bug may have thrown exception here, @@ -78,7 +78,7 @@ public final class TestFormulaBugs { * seems to be a duplicate of 24925 */ @Test - public void test27405() throws Exception { + void test27405() throws Exception { Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet("input"); // input row 0 @@ -127,7 +127,7 @@ public final class TestFormulaBugs { * Bug 42448 - Can't parse SUMPRODUCT(A!C7:A!C67, B8:B68) / B69 <p> */ @Test - public void test42448() throws IOException { + void test42448() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet1 = wb.createSheet("Sheet1"); @@ -178,7 +178,7 @@ public final class TestFormulaBugs { } @Test - public void test55032() throws IOException { + void test55032() throws IOException { Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet("input"); @@ -199,7 +199,7 @@ public final class TestFormulaBugs { // bug 52063: LOOKUP(2-arg) and LOOKUP(3-arg) // FIXME: This could be moved into LookupFunctionsTestCaseData.xls, which is tested by TestLookupFunctionsFromSpreadsheet.java @Test - public void testLookupFormula() throws Exception { + void testLookupFormula() throws Exception { Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet("52063"); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java b/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java index e278665d42..c239f1f933 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java @@ -41,7 +41,7 @@ public final class TestMinusZeroResult { private static final double MINUS_ZERO = -0.0; @Test - public void testSimpleOperators() { + void testSimpleOperators() { // unary plus is a no-op checkEval(MINUS_ZERO, UnaryPlusEval.instance, MINUS_ZERO); @@ -63,14 +63,14 @@ public final class TestMinusZeroResult { * gets to the comparison operator) */ @Test - public void testComparisonOperators() { + void testComparisonOperators() { checkEval(false, EvalInstances.Equal, 0.0, MINUS_ZERO); checkEval(true, EvalInstances.GreaterThan, 0.0, MINUS_ZERO); checkEval(true, EvalInstances.LessThan, MINUS_ZERO, 0.0); } @Test - public void testTextRendering() { + void testTextRendering() { confirmTextRendering(MINUS_ZERO); // sub-normal negative numbers also display as '-0' confirmTextRendering(Double.longBitsToDouble(0x8000100020003000L)); @@ -107,7 +107,7 @@ public final class TestMinusZeroResult { * Not really a POI test - just shows similar behaviour of '-0.0' in Java. */ @Test - public void testJava() { + void testJava() { assertEquals(0x8000000000000000L, Double.doubleToLongBits(MINUS_ZERO)); // The simple operators consider all zeros to be the same diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestMissingArgEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestMissingArgEval.java index b63f38d8e7..4eeffce2bc 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestMissingArgEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestMissingArgEval.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; public final class TestMissingArgEval { @Test - public void testEvaluateMissingArgs() throws IOException { + void testEvaluateMissingArgs() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); HSSFSheet sheet = wb.createSheet("Sheet1"); @@ -57,7 +57,7 @@ public final class TestMissingArgEval { } @Test - public void testCompareMissingArgs() throws IOException { + void testCompareMissingArgs() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); HSSFSheet sheet = wb.createSheet("Sheet1"); @@ -117,7 +117,7 @@ public final class TestMissingArgEval { } @Test - public void testCountFuncs() throws IOException { + void testCountFuncs() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); HSSFSheet sheet = wb.createSheet("Sheet1"); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java index a8914d2264..88050c8bb6 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java @@ -124,7 +124,7 @@ public final class TestMultiSheetEval { @ParameterizedTest @MethodSource("data") - public void testFunction(String testName, String functionName, Cell expected, Row testRow) { + void testFunction(String testName, String functionName, Cell expected, Row testRow) { Cell c = testRow.getCell(SS.COLUMN_INDEX_ACTUAL_VALUE); if (c == null || c.getCellType() != CellType.FORMULA) { diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java b/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java index 7785a425b3..dbf333cb1e 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java @@ -31,14 +31,14 @@ import org.junit.jupiter.api.Test; */ public final class TestOperandResolver { @Test - public void testParseDouble_bug48472() { + void testParseDouble_bug48472() { // bug 48472 - StringIndexOutOfBoundsException Double resolvedValue = OperandResolver.parseDouble("-"); assertNull(resolvedValue); } @Test - public void testParseDouble_bug49723() { + void testParseDouble_bug49723() { String value = ".1"; Double resolvedValue = OperandResolver.parseDouble(value); @@ -49,7 +49,7 @@ public final class TestOperandResolver { * Tests that a list of valid strings all return a non null value from {@link OperandResolver#parseDouble(String)} */ @Test - public void testParseDoubleValidStrings() { + void testParseDoubleValidStrings() { String[] values = new String[]{".19", "0.19", "1.9", "1E4", "-.19", "-0.19", "8.5","-1E4", ".5E6","+1.5","+1E5", " +1E5 ", " 123 ", "1E4", "-123" }; @@ -64,7 +64,7 @@ public final class TestOperandResolver { * Tests that a list of invalid strings all return null from {@link OperandResolver#parseDouble(String)} */ @Test - public void testParseDoubleInvalidStrings() { + void testParseDoubleInvalidStrings() { String[] values = new String[]{"-", "ABC", "-X", "1E5a", "Infinity", "NaN", ".5F", "1,000"}; for (String value : values) { @@ -73,7 +73,7 @@ public final class TestOperandResolver { } @Test - public void testCoerceDateStringToNumber() throws EvaluationException { + void testCoerceDateStringToNumber() throws EvaluationException { Map<String, Double> values = new LinkedHashMap<>(); values.put("2019/1/18", 43483.); values.put("01/18/2019", 43483.); @@ -86,7 +86,7 @@ public final class TestOperandResolver { } @Test - public void testCoerceTimeStringToNumber() throws EvaluationException { + void testCoerceTimeStringToNumber() throws EvaluationException { Map<String, Double> values = new LinkedHashMap<>(); values.put("00:00", 0.0); values.put("12:00", 0.5); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestPercentEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestPercentEval.java index 8357fd6e9e..d03b1b4dfb 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestPercentEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestPercentEval.java @@ -48,7 +48,7 @@ public final class TestPercentEval { } @Test - public void testBasic() { + void testBasic() { confirm(new NumberEval(5), 0.05); confirm(new NumberEval(3000), 30.0); confirm(new NumberEval(-150), -1.5); @@ -57,13 +57,13 @@ public final class TestPercentEval { } @Test - public void test1x1Area() { + void test1x1Area() { AreaEval ae = EvalFactory.createAreaEval("B2:B2", new ValueEval[] { new NumberEval(50), }); confirm(ae, 0.5); } @Test - public void testInSpreadSheet() throws IOException { + void testInSpreadSheet() throws IOException { try (HSSFWorkbook wb = new HSSFWorkbook()) { HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestPowerEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestPowerEval.java index 5fdfda90ad..300be69851 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestPowerEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestPowerEval.java @@ -33,14 +33,14 @@ import org.junit.jupiter.api.Test; */ public final class TestPowerEval { @Test - public void testPositiveValues() { + void testPositiveValues() { confirm(0, 0, 1); confirm(1, 1, 0); confirm(9, 3, 2); } @Test - public void testNegativeValues() { + void testNegativeValues() { confirm(-1, -1, 1); confirm(1, 1, -1); confirm(1, -10, 0); @@ -48,22 +48,22 @@ public final class TestPowerEval { } @Test - public void testPositiveDecimalValues() { + void testPositiveDecimalValues() { confirm(3, 27, (1/3.0)); } @Test - public void testNegativeDecimalValues() { + void testNegativeDecimalValues() { confirm(-3, -27, (1/3.0)); } @Test - public void testErrorValues() { + void testErrorValues() { confirmError(-1.00001, 1.1); } @Test - public void testInSpreadSheet() { + void testInSpreadSheet() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestRangeEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestRangeEval.java index dfde9986a3..458e74df90 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestRangeEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestRangeEval.java @@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test; */ public final class TestRangeEval { @Test - public void testPermutations() { + void testPermutations() { confirm("B3", "D7", "B3:D7"); confirm("B1", "B1", "B1:B1"); @@ -136,7 +136,7 @@ public final class TestRangeEval { } @Test - public void testRangeUsingOffsetFunc_bug46948() { + void testRangeUsingOffsetFunc_bug46948() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFRow row = wb.createSheet("Sheet1").createRow(0); HSSFCell cellA1 = row.createCell(0); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestUnaryPlusEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestUnaryPlusEval.java index 9846c192b5..d3c63547b9 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestUnaryPlusEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestUnaryPlusEval.java @@ -34,7 +34,7 @@ public final class TestUnaryPlusEval { * The code for handling column operands had been copy-pasted from the row handling code. */ @Test - public void testColumnOperand() { + void testColumnOperand() { short firstRow = (short)8; short lastRow = (short)12; diff --git a/src/testcases/org/apache/poi/ss/formula/eval/forked/BaseTestForkedEvaluator.java b/src/testcases/org/apache/poi/ss/formula/eval/forked/BaseTestForkedEvaluator.java index 8f67e87d65..5c3dcb9875 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/forked/BaseTestForkedEvaluator.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/forked/BaseTestForkedEvaluator.java @@ -61,7 +61,7 @@ public class BaseTestForkedEvaluator { * Shows a basic use-case for {@link ForkedEvaluator} */ @Test - public void testBasic() throws IOException { + void testBasic() throws IOException { try (Workbook wb = createWorkbook()) { // The stability classifier is useful to reduce memory consumption of caching logic @@ -102,7 +102,7 @@ public class BaseTestForkedEvaluator { * <i>read-only</i> with respect to the ForkedEvaluator. */ @Test - public void testMissingInputCellH() throws IOException { + void testMissingInputCellH() throws IOException { try (Workbook wb = createWorkbook()) { ForkedEvaluator fe = ForkedEvaluator.create(wb, null, null); diff --git a/src/testcases/org/apache/poi/ss/formula/function/TestFunctionMetadataRegistry.java b/src/testcases/org/apache/poi/ss/formula/function/TestFunctionMetadataRegistry.java index 7c100f76b0..84ad7d58fb 100644 --- a/src/testcases/org/apache/poi/ss/formula/function/TestFunctionMetadataRegistry.java +++ b/src/testcases/org/apache/poi/ss/formula/function/TestFunctionMetadataRegistry.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test; public final class TestFunctionMetadataRegistry { @Test - public void testWellKnownFunctions() { + void testWellKnownFunctions() { confirmFunction(0, "COUNT"); confirmFunction(1, "IF"); diff --git a/src/testcases/org/apache/poi/ss/formula/function/TestParseMissingBuiltInFuncs.java b/src/testcases/org/apache/poi/ss/formula/function/TestParseMissingBuiltInFuncs.java index 3f5c55fb1f..d3837d57a9 100644 --- a/src/testcases/org/apache/poi/ss/formula/function/TestParseMissingBuiltInFuncs.java +++ b/src/testcases/org/apache/poi/ss/formula/function/TestParseMissingBuiltInFuncs.java @@ -67,38 +67,38 @@ public final class TestParseMissingBuiltInFuncs { } @Test - public void testDatedif() throws IOException { + void testDatedif() throws IOException { int expSize = 4; // NB would be 5 if POI added tAttrVolatile properly confirmFunc("DATEDIF(NOW(),NOW(),\"d\")", expSize, false, 351); } @Test - public void testDdb() throws IOException { + void testDdb() throws IOException { confirmFunc("DDB(1,1,1,1,1)", 6, true, 144); } @Test - public void testAtan() throws IOException { + void testAtan() throws IOException { confirmFunc("ATAN(1)", 2, false, 18); } @Test - public void testUsdollar() throws IOException { + void testUsdollar() throws IOException { confirmFunc("USDOLLAR(1)", 2, true, 204); } @Test - public void testDBCS() throws IOException { + void testDBCS() throws IOException { confirmFunc("DBCS(\"abc\")", 2, false, 215); } @Test - public void testIsnontext() throws IOException { + void testIsnontext() throws IOException { confirmFunc("ISNONTEXT(\"abc\")", 2, false, 190); } @Test - public void testDproduct() throws IOException { + void testDproduct() throws IOException { confirmFunc("DPRODUCT(C1:E5,\"HarvestYield\",G1:H2)", 4, false, 189); } } diff --git a/src/testcases/org/apache/poi/ss/formula/function/TestReadMissingBuiltInFuncs.java b/src/testcases/org/apache/poi/ss/formula/function/TestReadMissingBuiltInFuncs.java index d5f4a81800..6dc3800160 100644 --- a/src/testcases/org/apache/poi/ss/formula/function/TestReadMissingBuiltInFuncs.java +++ b/src/testcases/org/apache/poi/ss/formula/function/TestReadMissingBuiltInFuncs.java @@ -71,7 +71,7 @@ public final class TestReadMissingBuiltInFuncs { } @Test - public void testDatedif() { + void testDatedif() { String formula; try { formula = getCellFormula(0); @@ -91,28 +91,28 @@ public final class TestReadMissingBuiltInFuncs { } @Test - public void testDdb() { + void testDdb() { String formula = getCellFormula(1); assertNotEquals("externalflag(1,1,1,1,1)", formula, "DDB() not registered"); assertEquals("DDB(1,1,1,1,1)", formula); } @Test - public void testAtan() { + void testAtan() { String formula = getCellFormula(2); assertNotEquals("ARCTAN(1)", formula, "func ix 18 registered as ARCTAN() instead of ATAN()"); assertEquals("ATAN(1)", formula); } @Test - public void testUsdollar() { + void testUsdollar() { String formula = getCellFormula(3); assertNotEquals("YEN(1)", formula, "func ix 204 registered as YEN() instead of USDOLLAR()"); assertEquals("USDOLLAR(1)", formula); } @Test - public void testDBCS() { + void testDBCS() { String formula = ""; try { formula = getCellFormula(4); @@ -128,7 +128,7 @@ public final class TestReadMissingBuiltInFuncs { } @Test - public void testIsnontext() { + void testIsnontext() { String formula; try { formula = getCellFormula(5); @@ -141,7 +141,7 @@ public final class TestReadMissingBuiltInFuncs { } @Test - public void testDproduct() { + void testDproduct() { String formula = getCellFormula(6); assertEquals("DPRODUCT(C1:E5,\"HarvestYield\",G1:H2)", formula); } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestAddress.java b/src/testcases/org/apache/poi/ss/formula/functions/TestAddress.java index 62f7f5e647..b9bf41f854 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestAddress.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestAddress.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public final class TestAddress { @Test - public void testAddress() { + void testAddress() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFCell cell = wb.createSheet().createRow(0).createCell(0); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestAreas.java b/src/testcases/org/apache/poi/ss/formula/functions/TestAreas.java index 5861d42ecf..8f9828e004 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestAreas.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestAreas.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; public final class TestAreas { @Test - public void testAreas() { + void testAreas() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFCell cell = wb.createSheet().createRow(0).createCell(0); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestAverage.java b/src/testcases/org/apache/poi/ss/formula/functions/TestAverage.java index 32ac46a525..5f12764210 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestAverage.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestAverage.java @@ -48,7 +48,7 @@ public final class TestAverage { } @Test - public void testBasic() { + void testBasic() { ValueEval[] values = { new NumberEval(1), @@ -76,7 +76,7 @@ public final class TestAverage { * Valid cases where values are not pure numbers */ @Test - public void testUnusualArgs() { + void testUnusualArgs() { ValueEval[] values = { new NumberEval(1), new NumberEval(2), @@ -89,7 +89,7 @@ public final class TestAverage { } @Test - public void testErrors() { + void testErrors() { ValueEval[] values = { new NumberEval(1), ErrorEval.NAME_INVALID, diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestBin2Dec.java b/src/testcases/org/apache/poi/ss/formula/functions/TestBin2Dec.java index ab906cdb24..314d22a8a9 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestBin2Dec.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestBin2Dec.java @@ -54,7 +54,7 @@ public final class TestBin2Dec { } @Test - public void testBasic() { + void testBasic() { confirmValue("Converts binary '00101' to decimal (5)", "00101", "5"); confirmValue("Converts binary '1111111111' to decimal (-1)", "1111111111", "-1"); confirmValue("Converts binary '1111111110' to decimal (-2)", "1111111110", "-2"); @@ -62,14 +62,14 @@ public final class TestBin2Dec { } @Test - public void testErrors() { + void testErrors() { confirmValueError("does not support more than 10 digits","01010101010", ErrorEval.NUM_ERROR); confirmValueError("not a valid binary number","GGGGGGG", ErrorEval.NUM_ERROR); confirmValueError("not a valid binary number","3.14159", ErrorEval.NUM_ERROR); } @Test - public void testEvalOperationEvaluationContext() { + void testEvalOperationEvaluationContext() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; @@ -80,7 +80,7 @@ public final class TestBin2Dec { } @Test - public void testEvalOperationEvaluationContextFails() { + void testEvalOperationEvaluationContextFails() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 0) }; @@ -99,7 +99,7 @@ public final class TestBin2Dec { } @Test - public void testRefs() { + void testRefs() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestCalendarFieldFunction.java b/src/testcases/org/apache/poi/ss/formula/functions/TestCalendarFieldFunction.java index cf5dcb6fee..59932a9681 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestCalendarFieldFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestCalendarFieldFunction.java @@ -45,7 +45,7 @@ public final class TestCalendarFieldFunction { } @Test - public void testValid() { + void testValid() { confirm("YEAR(2.26)", 1900); confirm("MONTH(2.26)", 1); confirm("DAY(2.26)", 2); @@ -62,7 +62,7 @@ public final class TestCalendarFieldFunction { } @Test - public void testRounding() { + void testRounding() { // 41484.999994200 = 23:59:59,499 // 41484.9999942129 = 23:59:59,500 (but sub-milliseconds are below 0.5 (0.49999453965575), XLS-second results in 59) // 41484.9999942130 = 23:59:59,500 (sub-milliseconds are 0.50000334065408, XLS-second results in 00) @@ -82,7 +82,7 @@ public final class TestCalendarFieldFunction { } @Test - public void testDaylightSaving() { + void testDaylightSaving() { confirm("HOUR(41364.08263888890000)", 1); // 31.03.2013 01:59:00,000 confirm("HOUR(41364.08333333330000)", 2); // 31.03.2013 02:00:00,000 (this time does not exist in TZ CET, but EXCEL does not care) confirm("HOUR(41364.08402777780000)", 2); // 31.03.2013 02:01:00,000 @@ -91,7 +91,7 @@ public final class TestCalendarFieldFunction { } @Test - public void testBugDate() { + void testBugDate() { confirm("YEAR(0.0)", 1900); confirm("MONTH(0.0)", 1); confirm("DAY(0.0)", 0); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestClean.java b/src/testcases/org/apache/poi/ss/formula/functions/TestClean.java index d6542611c1..9a11fe69cc 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestClean.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestClean.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public final class TestClean { @Test - public void testClean() { + void testClean() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFCell cell = wb.createSheet().createRow(0).createCell(0); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestCode.java b/src/testcases/org/apache/poi/ss/formula/functions/TestCode.java index 9b9e315a24..aa5b170f6d 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestCode.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestCode.java @@ -47,7 +47,7 @@ public class TestCode { } @Test - public void testBasic() { + void testBasic() { confirmValue("Displays the numeric code for A (65)", "A", "65"); confirmValue("Displays the numeric code for the first character in text ABCDEFGHI (65)", "ABCDEFGHI", "65"); @@ -55,7 +55,7 @@ public class TestCode { } @Test - public void testErrors() { + void testErrors() { confirmValueError("Empty text", "", ErrorEval.VALUE_INVALID); } } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestComplex.java b/src/testcases/org/apache/poi/ss/formula/functions/TestComplex.java index dd16248742..9f710bebd2 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestComplex.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestComplex.java @@ -47,7 +47,7 @@ public class TestComplex { } @Test - public void testBasic() { + void testBasic() { confirmValue("Complex number with 3 and 4 as the real and imaginary coefficients (3 + 4i)", "3","4", "", "3+4i"); confirmValue("Complex number with 3 and 4 as the real and imaginary coefficients, and j as the suffix (3 + 4j)", "3","4", "j", "3+4j"); @@ -61,7 +61,7 @@ public class TestComplex { } @Test - public void testErrors() { + void testErrors() { confirmValueError("argument is nonnumeric", "ABCD", "","", ErrorEval.VALUE_INVALID); confirmValueError("argument is nonnumeric", "1", "ABCD","", ErrorEval.VALUE_INVALID); confirmValueError("f suffix is neither \"i\" nor \"j\"", "1", "1","k", ErrorEval.VALUE_INVALID); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestCountFuncs.java b/src/testcases/org/apache/poi/ss/formula/functions/TestCountFuncs.java index 65238d17fb..174a71e24d 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestCountFuncs.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestCountFuncs.java @@ -51,7 +51,7 @@ public final class TestCountFuncs { private static final String NULL = null; @Test - public void testCountBlank() { + void testCountBlank() { AreaEval range; ValueEval[] values; @@ -79,7 +79,7 @@ public final class TestCountFuncs { } @Test - public void testCountA() { + void testCountA() { ValueEval[] args; args = new ValueEval[] { @@ -109,7 +109,7 @@ public final class TestCountFuncs { } @Test - public void testCountIf() { + void testCountIf() { AreaEval range; ValueEval[] values; @@ -146,7 +146,7 @@ public final class TestCountFuncs { } @Test - public void testCriteriaPredicateNe_Bug46647() { + void testCriteriaPredicateNe_Bug46647() { I_MatchPredicate mp = Countif.createCriteriaPredicate(new StringEval("<>aa"), 0, 0); assertNotNull(mp); StringEval seA = new StringEval("aa"); // this should not match the criteria '<>aa' @@ -201,7 +201,7 @@ public final class TestCountFuncs { * for example, the string "apples" and the string "APPLES" will match the same cells. */ @Test - public void testCaseInsensitiveStringComparison() { + void testCaseInsensitiveStringComparison() { AreaEval range; ValueEval[] values; @@ -222,7 +222,7 @@ public final class TestCountFuncs { * special case where the criteria argument is a cell reference */ @Test - public void testCountIfWithCriteriaReference() { + void testCountIfWithCriteriaReference() { ValueEval[] values = { new NumberEval(22), @@ -266,7 +266,7 @@ public final class TestCountFuncs { * the criteria arg is mostly handled by {@link OperandResolver#getSingleValue(org.apache.poi.ss.formula.eval.ValueEval, int, int)}} */ @Test - public void testCountifAreaCriteria() { + void testCountifAreaCriteria() { int srcColIx = 2; // anything but column A ValueEval v0 = new NumberEval(2.0); @@ -306,7 +306,7 @@ public final class TestCountFuncs { } @Test - public void testCountifEmptyStringCriteria() { + void testCountifEmptyStringCriteria() { I_MatchPredicate mp; // pred '=' matches blank cell but not empty string @@ -326,7 +326,7 @@ public final class TestCountFuncs { } @Test - public void testCountifComparisons() { + void testCountifComparisons() { I_MatchPredicate mp; mp = createCriteriaPredicate(new StringEval(">5")); @@ -368,7 +368,7 @@ public final class TestCountFuncs { * propagate to the COUNTIF result). */ @Test - public void testCountifErrorCriteria() { + void testCountifErrorCriteria() { I_MatchPredicate mp; mp = createCriteriaPredicate(new StringEval("#REF!")); @@ -397,7 +397,7 @@ public final class TestCountFuncs { * and NEQ cases */ @Test - public void testCountifBug51498() { + void testCountifBug51498() { final int REF_COL = 4; final int EVAL_COL = 3; @@ -438,7 +438,7 @@ public final class TestCountFuncs { } @Test - public void testWildCards() { + void testWildCards() { I_MatchPredicate mp; mp = createCriteriaPredicate(new StringEval("a*b")); @@ -471,7 +471,7 @@ public final class TestCountFuncs { } @Test - public void testNotQuiteWildCards() { + void testNotQuiteWildCards() { I_MatchPredicate mp; // make sure special reg-ex chars are treated like normal chars @@ -505,7 +505,7 @@ public final class TestCountFuncs { } @Test - public void testCountifFromSpreadsheet() { + void testCountifFromSpreadsheet() { testCountFunctionFromSpreadsheet("countifExamples.xls", 1, 2, 3, "countif"); } @@ -514,7 +514,7 @@ public final class TestCountFuncs { * http://office.microsoft.com/en-us/excel-help/countif-function-HP010069840.aspx?CTT=5&origin=HA010277524 */ @Test - public void testCountifExamples() { + void testCountifExamples() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("countifExamples.xls"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); @@ -552,7 +552,7 @@ public final class TestCountFuncs { } @Test - public void testCountBlankFromSpreadsheet() { + void testCountBlankFromSpreadsheet() { testCountFunctionFromSpreadsheet("countblankExamples.xls", 1, 3, 4, "countblank"); } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestDate.java b/src/testcases/org/apache/poi/ss/formula/functions/TestDate.java index 851b8da32d..4a4053b255 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestDate.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestDate.java @@ -51,13 +51,13 @@ public final class TestDate { */ @Test @Disabled - public void testSomeArgumentsMissing() { + void testSomeArgumentsMissing() { confirm("DATE(, 1, 0)", 0.0); confirm("DATE(, 1, 1)", 1.0); } @Test - public void testValid() { + void testValid() { confirm("DATE(1900, 1, 1)", 1); confirm("DATE(1900, 1, 32)", 32); confirm("DATE(1900, 222, 1)", 6727); @@ -67,7 +67,7 @@ public final class TestDate { } @Test - public void testBugDate() { + void testBugDate() { confirm("DATE(1900, 2, 29)", 60); confirm("DATE(1900, 2, 30)", 61); confirm("DATE(1900, 1, 222)", 222); @@ -76,7 +76,7 @@ public final class TestDate { } @Test - public void testPartYears() { + void testPartYears() { confirm("DATE(4, 1, 1)", 1462.00); confirm("DATE(14, 1, 1)", 5115.00); confirm("DATE(104, 1, 1)", 37987.00); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestDateValue.java b/src/testcases/org/apache/poi/ss/formula/functions/TestDateValue.java index b6b2368be5..8a63924c4c 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestDateValue.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestDateValue.java @@ -53,7 +53,7 @@ public final class TestDateValue { } @Test - public void testDateValue() { + void testDateValue() { LocaleUtil.setUserLocale(Locale.ENGLISH); try { int days1900 = (int)ChronoUnit.DAYS.between( diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestDays360.java b/src/testcases/org/apache/poi/ss/formula/functions/TestDays360.java index 590a33a5d8..d994077853 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestDays360.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestDays360.java @@ -49,7 +49,7 @@ public final class TestDays360 { } @Test - public void testBasic() { + void testBasic() { confirm(120, 2009, 1, 15, 2009, 5, 15); confirm(158, 2009, 1, 26, 2009, 7, 4); @@ -84,7 +84,7 @@ public final class TestDays360 { * is the last day of the month that does <em>not</em> have 30 days. */ @Test - public void testMonthBoundaries() { + void testMonthBoundaries() { // jan confirmMonthBoundary(false, 2001, 1, 0, 0, 2, 3, 4); confirmMonthBoundary(true, 2001, 1, 0, 0, 1, 2, 3); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Bin.java b/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Bin.java index dd13c85aee..d3b481d95b 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Bin.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Bin.java @@ -62,7 +62,7 @@ public final class TestDec2Bin { } @Test - public void testBasic() { + void testBasic() { confirmValue("Converts binary '00101' from binary (5)", "5", "101"); confirmValue("Converts binary '1111111111' from binary (-1)", "-1", "1111111111"); confirmValue("Converts binary '1111111110' from binary (-2)", "-2", "1111111110"); @@ -71,7 +71,7 @@ public final class TestDec2Bin { } @Test - public void testErrors() { + void testErrors() { confirmValueError("fails for >= 512 or < -512","512", ErrorEval.NUM_ERROR); confirmValueError("fails for >= 512 or < -512","-513", ErrorEval.NUM_ERROR); confirmValueError("not a valid decimal number","GGGGGGG", ErrorEval.VALUE_INVALID); @@ -79,7 +79,7 @@ public final class TestDec2Bin { } @Test - public void testEvalOperationEvaluationContext() { + void testEvalOperationEvaluationContext() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; @@ -90,7 +90,7 @@ public final class TestDec2Bin { } @Test - public void testEvalOperationEvaluationContextFails() { + void testEvalOperationEvaluationContextFails() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ErrorEval.VALUE_INVALID }; @@ -119,7 +119,7 @@ public final class TestDec2Bin { } @Test - public void testRefs() { + void testRefs() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; @@ -130,7 +130,7 @@ public final class TestDec2Bin { } @Test - public void testWithPlacesIntInt() { + void testWithPlacesIntInt() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1) }; @@ -142,7 +142,7 @@ public final class TestDec2Bin { } @Test - public void testWithPlaces() { + void testWithPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1) }; @@ -154,7 +154,7 @@ public final class TestDec2Bin { } @Test - public void testWithToShortPlaces() { + void testWithToShortPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 3) }; @@ -165,7 +165,7 @@ public final class TestDec2Bin { } @Test - public void testWithTooManyParamsIntInt() { + void testWithTooManyParamsIntInt() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1), ctx.getRefEval(0, 1) }; @@ -176,7 +176,7 @@ public final class TestDec2Bin { } @Test - public void testWithTooManyParams() { + void testWithTooManyParams() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1), ctx.getRefEval(0, 1) }; @@ -187,7 +187,7 @@ public final class TestDec2Bin { } @Test - public void testWithErrorPlaces() { + void testWithErrorPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ErrorEval.NULL_INTERSECTION }; @@ -198,7 +198,7 @@ public final class TestDec2Bin { } @Test - public void testWithNegativePlaces() { + void testWithNegativePlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 2) }; @@ -209,7 +209,7 @@ public final class TestDec2Bin { } @Test - public void testWithZeroPlaces() { + void testWithZeroPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), new NumberEval(0.0) }; @@ -220,7 +220,7 @@ public final class TestDec2Bin { } @Test - public void testWithEmptyPlaces() { + void testWithEmptyPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(1, 0) }; @@ -231,7 +231,7 @@ public final class TestDec2Bin { } @Test - public void testBackAndForth() { + void testBackAndForth() { for (int i = -512; i < 512; i++) { ValueEval result = invokeValue(Integer.toString(i)); assertEquals(StringEval.class, result.getClass(), "Had: " + result); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Hex.java b/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Hex.java index 286c3c837e..4548b9a476 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Hex.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestDec2Hex.java @@ -73,7 +73,7 @@ public final class TestDec2Hex { } @Test - public void testBasic() { + void testBasic() { confirmValue("Converts decimal 100 to hexadecimal with 0 characters (64)", "100","0", "64"); confirmValue("Converts decimal 100 to hexadecimal with 4 characters (0064)", "100","4", "0064"); confirmValue("Converts decimal 100 to hexadecimal with 5 characters (0064)", "100","5", "00064"); @@ -107,7 +107,7 @@ public final class TestDec2Hex { } @Test - public void testErrors() { + void testErrors() { confirmValueError("Out of range min number","-549755813889","0", ErrorEval.NUM_ERROR); confirmValueError("Out of range max number","549755813888","0", ErrorEval.NUM_ERROR); @@ -116,7 +116,7 @@ public final class TestDec2Hex { } @Test - public void testEvalOperationEvaluationContextFails() { + void testEvalOperationEvaluationContextFails() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ErrorEval.VALUE_INVALID }; @@ -143,7 +143,7 @@ public final class TestDec2Hex { } @Test - public void testRefs() { + void testRefs() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; @@ -154,7 +154,7 @@ public final class TestDec2Hex { } @Test - public void testWithPlacesIntInt() { + void testWithPlacesIntInt() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1) }; @@ -165,7 +165,7 @@ public final class TestDec2Hex { } @Test - public void testWithPlaces() { + void testWithPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1) }; @@ -176,7 +176,7 @@ public final class TestDec2Hex { } @Test - public void testWithTooManyParamsIntInt() { + void testWithTooManyParamsIntInt() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1), ctx.getRefEval(0, 1) }; @@ -187,7 +187,7 @@ public final class TestDec2Hex { } @Test - public void testWithTooManyParams() { + void testWithTooManyParams() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 1), ctx.getRefEval(0, 1) }; @@ -198,7 +198,7 @@ public final class TestDec2Hex { } @Test - public void testWithErrorPlaces() { + void testWithErrorPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ErrorEval.NULL_INTERSECTION }; @@ -209,7 +209,7 @@ public final class TestDec2Hex { } @Test - public void testWithNegativePlaces() { + void testWithNegativePlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 2) }; @@ -220,7 +220,7 @@ public final class TestDec2Hex { } @Test - public void testWithEmptyPlaces() { + void testWithEmptyPlaces() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(1, 0) }; @@ -231,7 +231,7 @@ public final class TestDec2Hex { } @Test - public void testBackAndForth() { + void testBackAndForth() { for (int i = -512; i < 512; i++) { ValueEval result = invokeValue(Integer.toString(i)); assertEquals(StringEval.class, result.getClass(), "Had: " + result); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestDelta.java b/src/testcases/org/apache/poi/ss/formula/functions/TestDelta.java index b7f64c22e6..0271ac36de 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestDelta.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestDelta.java @@ -50,7 +50,7 @@ public final class TestDelta { } @Test - public void testBasic() { + void testBasic() { confirmValue("5","4", 0); // Checks whether 5 equals 4 (0) confirmValue("5","5", 1); // Checks whether 5 equals 5 (1) @@ -60,7 +60,7 @@ public final class TestDelta { } @Test - public void testErrors() { + void testErrors() { confirmValueError("A1","B2"); confirmValueError("AAAA","BBBB"); } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestEDate.java b/src/testcases/org/apache/poi/ss/formula/functions/TestEDate.java index 3bcebaa613..c6b2a0f02e 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestEDate.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestEDate.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public class TestEDate { @Test - public void testEDateProperValues() { + void testEDateProperValues() { // verify some border-case combinations of startDate and month-increase checkValue(1000, 0, 1000d); checkValue(1, 0, 1d); @@ -55,14 +55,14 @@ public class TestEDate { } @Test - public void testEDateInvalidValues() { + void testEDateInvalidValues() { EDate eDate = new EDate(); ErrorEval result = (ErrorEval) eDate.evaluate(new ValueEval[]{new NumberEval(1000)}, null); assertEquals(FormulaError.VALUE.getCode(), result.getErrorCode(), 0); } @Test - public void testEDateIncrease() { + void testEDateIncrease() { EDate eDate = new EDate(); Date startDate = new Date(); int offset = 2; @@ -76,7 +76,7 @@ public class TestEDate { } @Test - public void testEDateDecrease() { + void testEDateDecrease() { EDate eDate = new EDate(); Date startDate = new Date(); int offset = -2; @@ -89,34 +89,34 @@ public class TestEDate { } @Test - public void testBug56688() { + void testBug56688() { EDate eDate = new EDate(); NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[]{new NumberEval(1000), new RefEvalImplementation(new NumberEval(0))}, null); assertEquals(1000d, result.getNumberValue(), 0); } @Test - public void testRefEvalStartDate() { + void testRefEvalStartDate() { EDate eDate = new EDate(); NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[]{new RefEvalImplementation(new NumberEval(1000)), new NumberEval(0)}, null); assertEquals(1000d, result.getNumberValue(), 0); } @Test - public void testEDateInvalidValueEval() { + void testEDateInvalidValueEval() { ValueEval evaluate = new EDate().evaluate(new ValueEval[]{new ValueEval() {}, new NumberEval(0)}, null); assertTrue(evaluate instanceof ErrorEval); assertEquals(ErrorEval.VALUE_INVALID, evaluate); } @Test - public void testEDateBlankValueEval() { + void testEDateBlankValueEval() { NumberEval evaluate = (NumberEval) new EDate().evaluate(new ValueEval[]{BlankEval.instance, new NumberEval(0)}, null); assertEquals(-1.0d, evaluate.getNumberValue(), 0); } @Test - public void testEDateBlankRefValueEval() { + void testEDateBlankRefValueEval() { EDate eDate = new EDate(); NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[]{new RefEvalImplementation(BlankEval.instance), new NumberEval(0)}, null); assertEquals(-1.0d, result.getNumberValue(), 0, "0 startDate triggers BAD_DATE currently, thus -1.0!"); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java b/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java index 0d7f60e2f0..998423e72b 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java @@ -51,7 +51,7 @@ public class TestEOMonth { private final OperationEvaluationContext ec = new OperationEvaluationContext(null, null, 0, 0, 0, null); @Test - public void testEOMonthProperValues() { + void testEOMonthProperValues() { // verify some border-case combinations of startDate and month-increase checkValue(DATE_1900_01_01, 0, DATE_1900_01_31); checkValue(DATE_1900_01_01, 1, DATE_1900_02_28); @@ -61,7 +61,7 @@ public class TestEOMonth { } @Test - public void testEOMonthBadDateValues() { + void testEOMonthBadDateValues() { checkValue(0.0, -2, BAD_DATE); checkValue(0.0, -3, BAD_DATE); checkValue(DATE_1900_01_31, -1, BAD_DATE); @@ -74,7 +74,7 @@ public class TestEOMonth { } @Test - public void testEOMonthZeroDate() { + void testEOMonthZeroDate() { NumberEval result = (NumberEval) eOMonth.evaluate(new ValueEval[] {new NumberEval(0), new NumberEval(0)}, ec); assertEquals(DATE_1900_01_31, result.getNumberValue(), 0, "0 startDate is 1900-01-00"); @@ -83,7 +83,7 @@ public class TestEOMonth { } @Test - public void testEOMonthInvalidArguments() { + void testEOMonthInvalidArguments() { ValueEval result = eOMonth.evaluate(new ValueEval[] {new NumberEval(DATE_1902_09_26)}, ec); assertTrue(result instanceof ErrorEval); assertEquals(FormulaError.VALUE.getCode(), ((ErrorEval) result).getErrorCode(), 0); @@ -120,27 +120,27 @@ public class TestEOMonth { } @Test - public void testBug56688() { + void testBug56688() { ValueEval[] ve = {new NumberEval(DATE_1902_09_26), new RefEvalImplementation(new NumberEval(0))}; NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec); assertEquals(DATE_1902_09_30, result.getNumberValue(), 0); } @Test - public void testRefEvalStartDate() { + void testRefEvalStartDate() { ValueEval[] ve = {new RefEvalImplementation(new NumberEval(DATE_1902_09_26)), new NumberEval(0)}; NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec); assertEquals(DATE_1902_09_30, result.getNumberValue(), 0); } @Test - public void testEOMonthBlankValueEval() { + void testEOMonthBlankValueEval() { NumberEval evaluate = (NumberEval) eOMonth.evaluate(new ValueEval[] {BlankEval.instance, new NumberEval(0)}, ec); assertEquals(DATE_1900_01_31, evaluate.getNumberValue(), 0, "Blank is handled as 0"); } @Test - public void testEOMonthBlankRefValueEval() { + void testEOMonthBlankRefValueEval() { ValueEval[] ve1 = {new RefEvalImplementation(BlankEval.instance), new NumberEval(1)}; NumberEval result = (NumberEval) eOMonth.evaluate(ve1, ec); assertEquals(DATE_1900_02_28, result.getNumberValue(), 0, "Blank is handled as 0"); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java b/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java index 8a151ea2ac..07cf625a36 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public class TestFinanceLib extends BaseTestNumeric { @Test - public void testFv() { + void testFv() { double f, r, y, p, x; int n; boolean t = false; @@ -74,7 +74,7 @@ public class TestFinanceLib extends BaseTestNumeric { } @Test - public void testNpv() { + void testNpv() { double r; double[] v; double npv; @@ -102,7 +102,7 @@ public class TestFinanceLib extends BaseTestNumeric { } @Test - public void testPmt() { + void testPmt() { double f, r, y, p, x; int n; boolean t = false; @@ -136,7 +136,7 @@ public class TestFinanceLib extends BaseTestNumeric { } @Test - public void testPv() { + void testPv() { double f, r, y, p, x; int n; boolean t = false; @@ -180,7 +180,7 @@ public class TestFinanceLib extends BaseTestNumeric { } @Test - public void testNper() { + void testNper() { double f, r, y, p, x, n; boolean t = false; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestFind.java b/src/testcases/org/apache/poi/ss/formula/functions/TestFind.java index 520cd435b1..daa7130dec 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestFind.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestFind.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public final class TestFind { @Test - public void testFind() throws IOException { + void testFind() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFCell cell = wb.createSheet().createRow(0).createCell(0); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestFixed.java b/src/testcases/org/apache/poi/ss/formula/functions/TestFixed.java index 9b2da6b1ec..00293bbc2e 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestFixed.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestFixed.java @@ -52,7 +52,7 @@ public final class TestFixed { } @Test - public void testValid() { + void testValid() { // thousands separator confirm("FIXED(1234.56789,2,TRUE)", "1234.57"); confirm("FIXED(1234.56789,2,FALSE)", "1,234.57"); @@ -88,7 +88,7 @@ public final class TestFixed { } @Test - public void testOptionalParams() { + void testOptionalParams() { Fixed fixed = new Fixed(); ValueEval evaluate = fixed.evaluate(0, 0, new NumberEval(1234.56789)); assertTrue(evaluate instanceof StringEval); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestFrequency.java b/src/testcases/org/apache/poi/ss/formula/functions/TestFrequency.java index 271cba7d20..c6ea4e3fe9 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestFrequency.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestFrequency.java @@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test; public class TestFrequency { @Test - public void testHistogram() { + void testHistogram() { assertArrayEquals(new int[]{3, 2, 2, 0, 1, 1}, histogram( new double[]{11, 12, 13, 21, 29, 36, 40, 58, 69}, @@ -61,7 +61,7 @@ public class TestFrequency { } @Test - public void testEvaluate() { + void testEvaluate() { Workbook wb = new HSSFWorkbook(); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestHex2Dec.java b/src/testcases/org/apache/poi/ss/formula/functions/TestHex2Dec.java index d09810bd98..40190a2701 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestHex2Dec.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestHex2Dec.java @@ -54,20 +54,20 @@ public final class TestHex2Dec { } @Test - public void testBasic() { + void testBasic() { confirmValue("Converts hex 'A5' to decimal (165)", "A5", "165"); confirmValue("Converts hex FFFFFFFF5B to decimal (-165)", "FFFFFFFF5B", "-165"); confirmValue("Converts hex 3DA408B9 to decimal (-165)", "3DA408B9", "1034160313"); } @Test - public void testErrors() { + void testErrors() { confirmValueError("not a valid hex number","GGGGGGG", ErrorEval.NUM_ERROR); confirmValueError("not a valid hex number","3.14159", ErrorEval.NUM_ERROR); } @Test - public void testEvalOperationEvaluationContext() { + void testEvalOperationEvaluationContext() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; @@ -78,7 +78,7 @@ public final class TestHex2Dec { } @Test - public void testEvalOperationEvaluationContextFails() { + void testEvalOperationEvaluationContextFails() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 0) }; @@ -97,7 +97,7 @@ public final class TestHex2Dec { } @Test - public void testRefs() { + void testRefs() { OperationEvaluationContext ctx = createContext(); ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) }; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestIPMT.java b/src/testcases/org/apache/poi/ss/formula/functions/TestIPMT.java index 2fc27bbdb2..309bacfd57 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestIPMT.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestIPMT.java @@ -39,7 +39,7 @@ public final class TestIPMT { * from http://office.microsoft.com/en-001/excel-help/ipmt-HP005209145.aspx */ @Test - public void testFromFile() { + void testFromFile() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("finance.xls"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestIndex.java b/src/testcases/org/apache/poi/ss/formula/functions/TestIndex.java index bc44ab3c15..5e71f608a8 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestIndex.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestIndex.java @@ -61,7 +61,7 @@ public final class TestIndex { * For the case when the first argument to INDEX() is an area reference */ @Test - public void testEvaluateAreaReference() { + void testEvaluateAreaReference() { double[] values = TEST_VALUES0; confirmAreaEval("C1:D6", values, 4, 1, 7); @@ -110,7 +110,7 @@ public final class TestIndex { * This problem was found while fixing bug 47048 and is observable up to svn r773441. */ @Test - public void testMissingArg() { + void testMissingArg() { ValueEval[] values = { new NumberEval(25.0), new NumberEval(26.0), @@ -133,7 +133,7 @@ public final class TestIndex { * This works because the INDEX() function returns a reference to A2 (not the value of A2) */ @Test - public void testReferenceResult() { + void testReferenceResult() { ValueEval[] values = new ValueEval[4]; Arrays.fill(values, NumberEval.ZERO); AreaEval arg0 = EvalFactory.createAreaEval("A1:B2", values); @@ -158,7 +158,7 @@ public final class TestIndex { } @Test - public void test61859(){ + void test61859(){ Workbook wb = HSSFTestDataSamples.openSampleWorkbook("maxindextest.xls"); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); @@ -180,7 +180,7 @@ public final class TestIndex { } @Test - public void test61116(){ + void test61116(){ Workbook workbook = HSSFTestDataSamples.openSampleWorkbook("61116.xls"); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); Sheet sheet = workbook.getSheet("sample2"); @@ -199,7 +199,7 @@ public final class TestIndex { * INDEX returns the value in the cell at the intersection of Row_num and Column_num */ @Test - public void testReference2DArea(){ + void testReference2DArea(){ Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); /* @@ -229,7 +229,7 @@ public final class TestIndex { * If Column_num is 0 (zero), INDEX returns the array of values for the entire row. */ @Test - public void testArrayArgument_RowLookup(){ + void testArrayArgument_RowLookup(){ Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); /* @@ -261,7 +261,7 @@ public final class TestIndex { * If Row_num is 0 (zero), INDEX returns the array of values for the entire column. */ @Test - public void testArrayArgument_ColumnLookup(){ + void testArrayArgument_ColumnLookup(){ Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); /* @@ -295,7 +295,7 @@ public final class TestIndex { * which is the sum of B1:B2. */ @Test - public void testDynamicReference(){ + void testDynamicReference(){ Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); /* diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java b/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java index 7bd3025c1c..341e4ad6a1 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java @@ -97,7 +97,7 @@ public final class TestIndirect { } @Test - public void testBasic() throws Exception { + void testBasic() throws Exception { HSSFWorkbook wbA = createWBA(); HSSFCell c = wbA.getSheetAt(0).createRow(5).createCell(2); @@ -155,7 +155,7 @@ public final class TestIndirect { } @Test - public void testMultipleWorkbooks() throws Exception { + void testMultipleWorkbooks() throws Exception { HSSFWorkbook wbA = createWBA(); HSSFCell cellA = wbA.getSheetAt(0).createRow(10).createCell(0); HSSFFormulaEvaluator feA = new HSSFFormulaEvaluator(wbA); @@ -197,7 +197,7 @@ public final class TestIndirect { } @Test - public void testInvalidInput() { + void testInvalidInput() { assertEquals(ErrorEval.VALUE_INVALID, Indirect.instance.evaluate(new ValueEval[] {}, null)); } } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestIntercept.java b/src/testcases/org/apache/poi/ss/formula/functions/TestIntercept.java index e375051c12..b1453c4677 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestIntercept.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestIntercept.java @@ -60,7 +60,7 @@ public final class TestIntercept { } @Test - public void testBasic() { + void testBasic() { Double exp = Math.pow(10, 7.5); ValueEval[] yValues = { new NumberEval(3+exp), @@ -89,7 +89,7 @@ public final class TestIntercept { * number of items in array is not limited to 30 */ @Test - public void testLargeArrays() { + void testLargeArrays() { ValueEval[] yValues = createMockNumberArray(100, 3); // [1,2,0,1,2,0,...,0,1] yValues[0] = new NumberEval(2.0); // Changes first element to 2 ValueEval[] xValues = createMockNumberArray(100, 101); // [1,2,3,4,...,99,100] @@ -112,7 +112,7 @@ public final class TestIntercept { } @Test - public void testErrors() { + void testErrors() { ValueEval[] xValues = { ErrorEval.REF_INVALID, new NumberEval(2), @@ -150,7 +150,7 @@ public final class TestIntercept { * http://office.microsoft.com/en-us/excel-help/intercept-function-HP010062512.aspx?CTT=5&origin=HA010277524 */ @Test - public void testFromFile() { + void testFromFile() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("intercept.xls"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestIrr.java b/src/testcases/org/apache/poi/ss/formula/functions/TestIrr.java index 3630f48b0e..73b9e75132 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestIrr.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestIrr.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public final class TestIrr { @Test - public void testIrr() { + void testIrr() { // http://en.wikipedia.org/wiki/Internal_rate_of_return#Example double[] incomes = {-4000d, 1200d, 1410d, 1875d, 1050d}; double irr = Irr.irr(incomes); @@ -65,7 +65,7 @@ public final class TestIrr { } @Test - public void testEvaluateInSheet() { + void testEvaluateInSheet() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); @@ -87,7 +87,7 @@ public final class TestIrr { } @Test - public void testIrrFromSpreadsheet(){ + void testIrrFromSpreadsheet(){ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("IrrNpvTestCaseData.xls"); HSSFSheet sheet = wb.getSheet("IRR-NPV"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestIsBlank.java b/src/testcases/org/apache/poi/ss/formula/functions/TestIsBlank.java index 989d88f474..749139d240 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestIsBlank.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestIsBlank.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public final class TestIsBlank { @Test - public void test3DArea() { + void test3DArea() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet1 = wb.createSheet(); wb.setSheetName(0, "Sheet1"); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestLeftRight.java b/src/testcases/org/apache/poi/ss/formula/functions/TestLeftRight.java index a96def2d7e..97af42c745 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestLeftRight.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestLeftRight.java @@ -49,13 +49,13 @@ public class TestLeftRight { } @Test - public void testLeftRight_bug49841() { + void testLeftRight_bug49841() { invokeLeft(ANY_STRING_VALUE, NEGATIVE_OPERAND); invokeRight(ANY_STRING_VALUE, NEGATIVE_OPERAND); } @Test - public void testLeftRightNegativeOperand() { + void testLeftRightNegativeOperand() { assertEquals(ErrorEval.VALUE_INVALID, invokeRight(ANY_STRING_VALUE, NEGATIVE_OPERAND)); assertEquals(ErrorEval.VALUE_INVALID, invokeLeft(ANY_STRING_VALUE, NEGATIVE_OPERAND)); } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestLen.java b/src/testcases/org/apache/poi/ss/formula/functions/TestLen.java index 6ff7be55a5..5283b969ac 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestLen.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestLen.java @@ -52,7 +52,7 @@ public final class TestLen { } @Test - public void testBasic() { + void testBasic() { confirmLen(new StringEval("galactic"), 8); } @@ -60,7 +60,7 @@ public final class TestLen { * Valid cases where text arg is not exactly a string */ @Test - public void testUnusualArgs() { + void testUnusualArgs() { // text (first) arg type is number, other args are strings with fractional digits confirmLen(new NumberEval(123456), 6); @@ -70,7 +70,7 @@ public final class TestLen { } @Test - public void testErrors() { + void testErrors() { confirmLen(ErrorEval.NAME_INVALID, ErrorEval.NAME_INVALID); } } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestLogicalFunction.java b/src/testcases/org/apache/poi/ss/formula/functions/TestLogicalFunction.java index d14e9f6591..50db51c962 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestLogicalFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestLogicalFunction.java @@ -80,7 +80,7 @@ public class TestLogicalFunction { } @Test - public void testIsErr() { + void testIsErr() { cell1 = row3.createCell(0); cell1.setCellFormula("ISERR(B1)"); // produces #DIV/0! cell2 = row3.createCell(1); @@ -94,7 +94,7 @@ public class TestLogicalFunction { } @Test - public void testIsError() { + void testIsError() { cell1 = row3.createCell(0); cell1.setCellFormula("ISERROR(B1)"); // produces #DIV/0! cell2 = row3.createCell(1); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMatch.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMatch.java index 8e172a3646..fd434fb23c 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestMatch.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMatch.java @@ -59,7 +59,7 @@ public final class TestMatch { } @Test - public void testSimpleNumber() { + void testSimpleNumber() { ValueEval[] values = { new NumberEval(4), @@ -81,7 +81,7 @@ public final class TestMatch { } @Test - public void testReversedNumber() { + void testReversedNumber() { ValueEval[] values = { new NumberEval(25), @@ -103,7 +103,7 @@ public final class TestMatch { } @Test - public void testSimpleString() { + void testSimpleString() { // Arrange ValueEval[] values = { new StringEval("Albert"), @@ -125,7 +125,7 @@ public final class TestMatch { } @Test - public void testSimpleWildcardValuesString() { + void testSimpleWildcardValuesString() { // Arrange ValueEval[] values = { new StringEval("Albert"), @@ -155,7 +155,7 @@ public final class TestMatch { } @Test - public void testTildeString() { + void testTildeString() { ValueEval[] values = { new StringEval("what?"), @@ -169,7 +169,7 @@ public final class TestMatch { } @Test - public void testSimpleBoolean() { + void testSimpleBoolean() { ValueEval[] values = { BoolEval.FALSE, @@ -188,7 +188,7 @@ public final class TestMatch { } @Test - public void testHeterogeneous() { + void testHeterogeneous() { ValueEval[] values = { new NumberEval(4), @@ -241,7 +241,7 @@ public final class TestMatch { * Bugzilla 44421 */ @Test - public void testMatchArgTypeArea() { + void testMatchArgTypeArea() { ValueEval[] values = { new NumberEval(4), @@ -268,7 +268,7 @@ public final class TestMatch { } @Test - public void testInvalidMatchType() { + void testInvalidMatchType() { ValueEval[] values = { new NumberEval(4), diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java index a5b0a53499..e408fceb7e 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public class TestMathX extends BaseTestNumeric { @Test - public void testAcosh() { + void testAcosh() { double d; d = MathX.acosh(0); @@ -57,7 +57,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testAsinh() { + void testAsinh() { double d; d = MathX.asinh(0); @@ -84,7 +84,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testAtanh() { + void testAtanh() { double d; d = MathX.atanh(0); assertDouble("atanh 0", d, 0); @@ -116,7 +116,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testCosh() { + void testCosh() { double d; d = MathX.cosh(0); assertDouble("cosh 0", 1, d); @@ -148,7 +148,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testTanh() { + void testTanh() { double d; d = MathX.tanh(0); assertDouble("tanh 0", 0, d); @@ -180,7 +180,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testMax() { + void testMax() { double[] d = new double[100]; d[0] = 1.1; d[1] = 2.1; d[2] = 3.1; d[3] = 4.1; d[4] = 5.1; d[5] = 6.1; d[6] = 7.1; d[7] = 8.1; @@ -215,7 +215,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testMin() { + void testMin() { double[] d = new double[100]; d[0] = 1.1; d[1] = 2.1; d[2] = 3.1; d[3] = 4.1; d[4] = 5.1; d[5] = 6.1; d[6] = 7.1; d[7] = 8.1; @@ -259,7 +259,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testProduct() { + void testProduct() { assertDouble("Product ", 0, MathX.product(null)); assertDouble("Product ", 0, MathX.product(new double[] {})); assertDouble("Product ", 0, MathX.product(new double[] {1, 0})); @@ -305,7 +305,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testMod() { + void testMod() { //example from Excel help assertDouble(1.0, MathX.mod(3, 2)); @@ -327,7 +327,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testNChooseK() { + void testNChooseK() { int n=100; int k=50; double d = MathX.nChooseK(n, k); @@ -376,7 +376,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSign() { + void testSign() { final short minus = -1; final short zero = 0; final short plus = 1; @@ -429,7 +429,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSinh() { + void testSinh() { double d; d = MathX.sinh(0); assertDouble("sinh 0", 0, d); @@ -461,7 +461,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSum() { + void testSum() { double[] d = new double[100]; d[0] = 1.1; d[1] = 2.1; d[2] = 3.1; d[3] = 4.1; d[4] = 5.1; d[5] = 6.1; d[6] = 7.1; d[7] = 8.1; @@ -495,7 +495,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSumsq() { + void testSumsq() { double[] d = new double[100]; d[0] = 1.1; d[1] = 2.1; d[2] = 3.1; d[3] = 4.1; d[4] = 5.1; d[5] = 6.1; d[6] = 7.1; d[7] = 8.1; @@ -528,7 +528,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testFactorial() { + void testFactorial() { int n; double s; @@ -558,7 +558,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSumx2my2() { + void testSumx2my2() { double[] xarr; double[] yarr; @@ -584,7 +584,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSumx2py2() { + void testSumx2py2() { double[] xarr; double[] yarr; @@ -610,7 +610,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testSumxmy2() { + void testSumxmy2() { double[] xarr; double[] yarr; @@ -655,7 +655,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testRound() { + void testRound() { double d; int p; @@ -727,7 +727,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testRoundDown() { + void testRoundDown() { double d; int p; @@ -799,7 +799,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testRoundUp() { + void testRoundUp() { double d; int p; @@ -876,7 +876,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testCeiling() { + void testCeiling() { double d; double s; @@ -962,7 +962,7 @@ public class TestMathX extends BaseTestNumeric { } @Test - public void testFloor() { + void testFloor() { double d; double s; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMid.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMid.java index e1641528c3..7046329998 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestMid.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMid.java @@ -55,7 +55,7 @@ public final class TestMid { } @Test - public void testBasic() { + void testBasic() { confirmMid(new StringEval("galactic"), new NumberEval(3), new NumberEval(4), "lact"); } @@ -64,7 +64,7 @@ public final class TestMid { * Valid cases where args are not precisely (string, int, int) but can be resolved OK. */ @Test - public void testUnusualArgs() { + void testUnusualArgs() { // startPos with fractional digits confirmMid(new StringEval("galactic"), new NumberEval(3.1), new NumberEval(4), "lact"); @@ -91,7 +91,7 @@ public final class TestMid { * Extreme values for startPos and numChars */ @Test - public void testExtremes() { + void testExtremes() { confirmMid(new StringEval("galactic"), new NumberEval(4), new NumberEval(400), "actic"); confirmMid(new StringEval("galactic"), new NumberEval(30), new NumberEval(4), ""); @@ -102,7 +102,7 @@ public final class TestMid { * All sorts of ways to make MID return defined errors. */ @Test - public void testErrors() { + void testErrors() { confirmMid(ErrorEval.NAME_INVALID, new NumberEval(3), new NumberEval(4), ErrorEval.NAME_INVALID); confirmMid(new StringEval("galactic"), ErrorEval.NAME_INVALID, new NumberEval(4), ErrorEval.NAME_INVALID); confirmMid(new StringEval("galactic"), new NumberEval(3), ErrorEval.NAME_INVALID, ErrorEval.NAME_INVALID); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java index 9eabaa44a6..db7bc7f17d 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java @@ -42,7 +42,7 @@ import org.junit.jupiter.api.Test; public final class TestMirr { @Test - public void testMirr() throws EvaluationException { + void testMirr() throws EvaluationException { Mirr mirr = new Mirr(); double mirrValue; @@ -77,7 +77,7 @@ public final class TestMirr { } @Test - public void testMirrErrors_expectDIV0() { + void testMirrErrors_expectDIV0() { Mirr mirr = new Mirr(); double reinvestRate = 0.05; @@ -89,7 +89,7 @@ public final class TestMirr { } @Test - public void testEvaluateInSheet() { + void testEvaluateInSheet() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); @@ -114,7 +114,7 @@ public final class TestMirr { } @Test - public void testMirrFromSpreadsheet() { + void testMirrFromSpreadsheet() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("mirrTest.xls"); HSSFSheet sheet = wb.getSheet("Mirr"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMultiOperandNumericFunction.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMultiOperandNumericFunction.java index c077e47aaf..76a51544cd 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestMultiOperandNumericFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMultiOperandNumericFunction.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public class TestMultiOperandNumericFunction { @Test - public void testSettings() { + void testSettings() { MultiOperandNumericFunction fun = new MultiOperandNumericFunction(true, true) { @Override protected double evaluate(double[] values) throws EvaluationException { diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java b/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java index d2a82e2de1..9ced557280 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; public final class TestNper { @Test - public void testSimpleEvaluate() { + void testSimpleEvaluate() { ValueEval[] args = { new NumberEval(0.05), new NumberEval(250), @@ -50,7 +50,7 @@ public final class TestNper { } @Test - public void testEvaluate_bug_45732() throws IOException { + void testEvaluate_bug_45732() throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFCell cell = sheet.createRow(0).createCell(0); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java b/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java index c51158e959..35d91b732b 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; public final class TestNpv { @Test - public void testEvaluateInSheetExample2() { + void testEvaluateInSheetExample2() { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Sheet1"); HSSFRow row = sheet.createRow(0); @@ -73,7 +73,7 @@ public final class TestNpv { * the cached formula result pre-calculated by Excel */ @Test - public void testNpvFromSpreadsheet(){ + void testNpvFromSpreadsheet(){ HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("IrrNpvTestCaseData.xls"); HSSFSheet sheet = wb.getSheet("IRR-NPV"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestOct2Dec.java b/src/testcases/org/apache/poi/ss/formula/functions/TestOct2Dec.java index 26cc445394..a714044d92 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestOct2Dec.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestOct2Dec.java @@ -50,7 +50,7 @@ public final class TestOct2Dec { } @Test - public void testBasic() { + void testBasic() { confirmValue("Converts octal '' to decimal (0)", "", "0"); confirmValue("Converts octal 54 to decimal (44)", "54", "44"); confirmValue("Converts octal 7777777533 to decimal (-165)", "7777777533", "-165"); @@ -59,7 +59,7 @@ public final class TestOct2Dec { } @Test - public void testErrors() { + void testErrors() { confirmValueError("not a valid octal number","ABCDEFGH", ErrorEval.NUM_ERROR); confirmValueError("not a valid octal number","99999999", ErrorEval.NUM_ERROR); confirmValueError("not a valid octal number","3.14159", ErrorEval.NUM_ERROR); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java b/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java index 293796867e..deaafbbd20 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java @@ -54,12 +54,12 @@ public final class TestOffset { "+0.01, 0", "0.00, 0","-0.01, -1", "-0.99, -1", "-1.00, -1", "-1.01, -2", "-1.99, -2", "-2.00, -2", "-2.01, -3" }) - public void testDoubleConversion(double doubleVal, int expected) throws EvaluationException { + void testDoubleConversion(double doubleVal, int expected) throws EvaluationException { assertEquals(expected, Offset.evaluateIntArg(new NumberEval(doubleVal), -1, -1)); } @Test - public void testLinearOffsetRange() { + void testLinearOffsetRange() { LinearOffsetRange lor; lor = new LinearOffsetRange(3, 2); @@ -89,7 +89,7 @@ public final class TestOffset { } @Test - public void testOffsetWithEmpty23Arguments() throws IOException { + void testOffsetWithEmpty23Arguments() throws IOException { try (Workbook workbook = new HSSFWorkbook()) { Cell cell = workbook.createSheet().createRow(0).createCell(0); cell.setCellFormula("OFFSET(B1,,)"); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestPPMT.java b/src/testcases/org/apache/poi/ss/formula/functions/TestPPMT.java index 3ecffc04c3..f928a1dcd8 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestPPMT.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestPPMT.java @@ -39,7 +39,7 @@ public final class TestPPMT { * http://office.microsoft.com/en-001/excel-help/ppmt-function-HP010342774.aspx */ @Test - public void testFromFile() { + void testFromFile() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("finance.xls"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java b/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java index 8a251707a7..b2b8bab366 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java @@ -58,13 +58,13 @@ public final class TestPmt { } @Test - public void testBasic() { + void testBasic() { confirm(-1037.0321, (0.08/12), 10, 10000, 0, false); confirm(-1030.1643, (0.08/12), 10, 10000, 0, true); } @Test - public void test3args() { + void test3args() { ValueEval[] args = { new NumberEval(0.005), diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestPoisson.java b/src/testcases/org/apache/poi/ss/formula/functions/TestPoisson.java index d8838e2c78..2c2a96da03 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestPoisson.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestPoisson.java @@ -45,7 +45,7 @@ public class TestPoisson { } @Test - public void testCumulativeProbability() + void testCumulativeProbability() { double x = 1; double mean = 0.2; @@ -57,7 +57,7 @@ public class TestPoisson { } @Test - public void testNonCumulativeProbability() + void testNonCumulativeProbability() { double x = 0; double mean = 0.2; @@ -69,7 +69,7 @@ public class TestPoisson { } @Test - public void testNegativeMean() + void testNegativeMean() { double x = 0; double mean = -0.2; @@ -80,7 +80,7 @@ public class TestPoisson { } @Test - public void testNegativeX() + void testNegativeX() { double x = -1; double mean = 0.2; @@ -91,7 +91,7 @@ public class TestPoisson { } @Test - public void testXAsDecimalNumber() + void testXAsDecimalNumber() { double x = 1.1; double mean = 0.2; @@ -103,7 +103,7 @@ public class TestPoisson { } @Test - public void testXZeroMeanZero() + void testXZeroMeanZero() { double x = 0; double mean = 0; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestQuotient.java b/src/testcases/org/apache/poi/ss/formula/functions/TestQuotient.java index b636e30811..9ca2837bd5 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestQuotient.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestQuotient.java @@ -48,7 +48,7 @@ public class TestQuotient { } @Test - public void testBasic() { + void testBasic() { confirmValue("Integer portion of 5/2 (2)", "5", "2", "2"); confirmValue("Integer portion of 4.5/3.1 (1)", "4.5", "3.1", "1"); @@ -59,7 +59,7 @@ public class TestQuotient { } @Test - public void testErrors() { + void testErrors() { confirmValueError("numerator is nonnumeric", "ABCD", "", ErrorEval.VALUE_INVALID); confirmValueError("denominator is nonnumeric", "", "ABCD", ErrorEval.VALUE_INVALID); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestRank.java b/src/testcases/org/apache/poi/ss/formula/functions/TestRank.java index 70923618fa..a6b8e650e0 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestRank.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestRank.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public final class TestRank { @Test - public void testFromFile() { + void testFromFile() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("rank.xls"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestRelationalOperations.java b/src/testcases/org/apache/poi/ss/formula/functions/TestRelationalOperations.java index b63b6e3dcc..7c0a0f1364 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestRelationalOperations.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestRelationalOperations.java @@ -38,7 +38,7 @@ public class TestRelationalOperations { * */ @Test - public void testEqMatrixByScalar_Numbers() { + void testEqMatrixByScalar_Numbers() { ValueEval[] values = new ValueEval[4]; for (int i = 0; i < values.length; i++) { values[i] = new NumberEval(1); @@ -62,7 +62,7 @@ public class TestRelationalOperations { } @Test - public void testEqMatrixByScalar_String() { + void testEqMatrixByScalar_String() { ValueEval[] values = new ValueEval[4]; for (int i = 0; i < values.length; i++) { values[i] = new StringEval("ABC"); @@ -85,7 +85,7 @@ public class TestRelationalOperations { } @Test - public void testEqMatrixBy_Row() { + void testEqMatrixBy_Row() { ValueEval[] matrix = { new NumberEval(-1), new NumberEval(1), new NumberEval(-1), new NumberEval(1) @@ -119,7 +119,7 @@ public class TestRelationalOperations { } @Test - public void testEqMatrixBy_Column() { + void testEqMatrixBy_Column() { ValueEval[] matrix = { new NumberEval(-1), new NumberEval(1), new NumberEval(-1), new NumberEval(1) @@ -156,7 +156,7 @@ public class TestRelationalOperations { } @Test - public void testEqMatrixBy_Matrix() { + void testEqMatrixBy_Matrix() { // A1:B2 ValueEval[] matrix1 = { new NumberEval(-1), new NumberEval(1), diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java b/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java index bee18ea272..3a73915f71 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java @@ -37,22 +37,22 @@ public final class TestRoundFuncs { // https://github.com/apache/poi/pull/43 @Disabled("ROUNDUP(3987*0.2, 2) currently fails by returning 797.41") @Test - public void testRoundUp() { + void testRoundUp() { assertRoundUpEquals(797.40, 3987*0.2, 2, 1e-10); } @Test - public void testRoundDown() { + void testRoundDown() { assertRoundDownEquals(797.40, 3987*0.2, 2, 1e-10); } @Test - public void testRound() { + void testRound() { assertRoundEquals(797.40, 3987*0.2, 2, 1e-10); } @Test - public void testRoundDownWithStringArg() { + void testRoundDownWithStringArg() { ValueEval strArg = new StringEval("abc"); ValueEval[] args = { strArg, new NumberEval(2), }; ValueEval result = NumericFunction.ROUNDDOWN.evaluate(args, -1, (short)-1); @@ -60,7 +60,7 @@ public final class TestRoundFuncs { } @Test - public void testRoundUpWithStringArg() { + void testRoundUpWithStringArg() { ValueEval strArg = new StringEval("abc"); ValueEval[] args = { strArg, new NumberEval(2), }; ValueEval result = NumericFunction.ROUNDUP.evaluate(args, -1, (short)-1); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestRowCol.java b/src/testcases/org/apache/poi/ss/formula/functions/TestRowCol.java index 0b73dc5b69..efdb2dad87 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestRowCol.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestRowCol.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public final class TestRowCol { @Test - public void testCol() { + void testCol() { Function target = new Column(); { ValueEval[] args = { EvalFactory.createRefEval("C5"), }; @@ -45,7 +45,7 @@ public final class TestRowCol { } @Test - public void testRow() { + void testRow() { Function target = new RowFunc(); { ValueEval[] args = { EvalFactory.createRefEval("C5"), }; @@ -60,7 +60,7 @@ public final class TestRowCol { } @Test - public void testColumns() { + void testColumns() { confirmColumnsFunc("A1:F1", 6, 1); confirmColumnsFunc("A1:C2", 3, 2); @@ -73,7 +73,7 @@ public final class TestRowCol { } @Test - public void testRows() { + void testRows() { confirmRowsFunc("A1:F1", 6, 1); confirmRowsFunc("A1:C2", 3, 2); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSlope.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSlope.java index a54d508f8d..76bc55d0a3 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestSlope.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSlope.java @@ -55,7 +55,7 @@ public final class TestSlope { } @Test - public void testBasic() { + void testBasic() { Double exp = Math.pow(10, 7.5); ValueEval[] yValues = { new NumberEval(3+exp), @@ -84,7 +84,7 @@ public final class TestSlope { * number of items in array is not limited to 30 */ @Test - public void testLargeArrays() { + void testLargeArrays() { ValueEval[] yValues = createMockNumberArray(100, 3); // [1,2,0,1,2,0,...,0,1] yValues[0] = new NumberEval(2.0); // Changes first element to 2 ValueEval[] xValues = createMockNumberArray(100, 101); // [1,2,3,4,...,99,100] @@ -107,7 +107,7 @@ public final class TestSlope { } @Test - public void testErrors() { + void testErrors() { ValueEval[] xValues = { ErrorEval.REF_INVALID, new NumberEval(2), diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestStatsLib.java b/src/testcases/org/apache/poi/ss/formula/functions/TestStatsLib.java index a462448097..e2391359ba 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestStatsLib.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestStatsLib.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; public class TestStatsLib extends BaseTestNumeric { @Test - public void testDevsq() { + void testDevsq() { double[] v; double d, x; @@ -69,7 +69,7 @@ public class TestStatsLib extends BaseTestNumeric { } @Test - public void testKthLargest() { + void testKthLargest() { double[] v; double d, x; @@ -106,11 +106,11 @@ public class TestStatsLib extends BaseTestNumeric { @Test @Disabled("... implement ...") - public void testKthSmallest() { + void testKthSmallest() { } @Test - public void testAvedev() { + void testAvedev() { double[] v; double d, x; @@ -146,7 +146,7 @@ public class TestStatsLib extends BaseTestNumeric { } @Test - public void testMedian() { + void testMedian() { double[] v; double d, x; @@ -192,7 +192,7 @@ public class TestStatsLib extends BaseTestNumeric { } @Test - public void testMode() { + void testMode() { double[] v; v = new double[] {1,2,3,4,5,6,7,8,9,10}; @@ -240,7 +240,7 @@ public class TestStatsLib extends BaseTestNumeric { } @Test - public void testStddev() { + void testStddev() { double[] v; double d, x; @@ -276,7 +276,7 @@ public class TestStatsLib extends BaseTestNumeric { } @Test - public void testVar() { + void testVar() { double[] v; double d, x; @@ -302,7 +302,7 @@ public class TestStatsLib extends BaseTestNumeric { } @Test - public void testVarp() { + void testVarp() { double[] v; double d, x; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSubstitute.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSubstitute.java index 9a076e9336..83e02996ec 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestSubstitute.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSubstitute.java @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class TestSubstitute { @Test - public void testSubstitute() { + void testSubstitute() { Substitute fun = new Substitute(); assertEquals("ADEFC", ((StringValueEval)fun.evaluate(0, 1, new StringEval("ABC"), new StringEval("B"), new StringEval("DEF"))).getStringValue()); @@ -41,7 +41,7 @@ public class TestSubstitute { } @Test - public void testSubstituteInvalidArg() { + void testSubstituteInvalidArg() { Substitute fun = new Substitute(); assertEquals(ErrorEval.valueOf(FormulaError.VALUE.getLongCode()), fun.evaluate(0, 1, @@ -59,7 +59,7 @@ public class TestSubstitute { } @Test - public void testSubstituteOne() { + void testSubstituteOne() { Substitute fun = new Substitute(); assertEquals("ADEFC", ((StringValueEval)fun.evaluate(0, 1, new StringEval("ABC"), new StringEval("B"), new StringEval("DEF"), new NumberEval(1))).getStringValue()); @@ -69,7 +69,7 @@ public class TestSubstitute { } @Test - public void testSubstituteNotFound() { + void testSubstituteNotFound() { Substitute fun = new Substitute(); assertEquals("ABC", ((StringValueEval)fun.evaluate(0, 1, new StringEval("ABC"), new StringEval("B"), new StringEval("DEF"), new NumberEval(12))).getStringValue()); @@ -79,7 +79,7 @@ public class TestSubstitute { } @Test - public void testSearchEmpty() { + void testSearchEmpty() { Substitute fun = new Substitute(); assertEquals("ABC", ((StringValueEval)fun.evaluate(0, 1, new StringEval("ABC"), new StringEval(""), new StringEval("CDE"))).getStringValue()); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java index 240d48b05a..f42e21c68d 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java @@ -75,7 +75,7 @@ public final class TestSubtotal { } @Test - public void testBasics() { + void testBasics() { confirmSubtotal(FUNCTION_SUM, 55.0); confirmSubtotal(FUNCTION_AVERAGE, 5.5); confirmSubtotal(FUNCTION_COUNT, 10.0); @@ -86,7 +86,7 @@ public final class TestSubtotal { } @Test - public void testAvg() throws IOException { + void testAvg() throws IOException { Workbook wb = new HSSFWorkbook(); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); @@ -120,7 +120,7 @@ public final class TestSubtotal { } @Test - public void testSum() throws IOException { + void testSum() throws IOException { Workbook wb = new HSSFWorkbook(); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); @@ -153,7 +153,7 @@ public final class TestSubtotal { } @Test - public void testCount() throws IOException { + void testCount() throws IOException { Workbook wb = new HSSFWorkbook(); @@ -187,7 +187,7 @@ public final class TestSubtotal { } @Test - public void testCounta() throws IOException { + void testCounta() throws IOException { Workbook wb = new HSSFWorkbook(); @@ -221,7 +221,7 @@ public final class TestSubtotal { } @Test - public void testMax() throws IOException { + void testMax() throws IOException { Workbook wb = new HSSFWorkbook(); @@ -255,7 +255,7 @@ public final class TestSubtotal { } @Test - public void testMin() throws IOException { + void testMin() throws IOException { Workbook wb = new HSSFWorkbook(); @@ -289,7 +289,7 @@ public final class TestSubtotal { } @Test - public void testStdev() throws IOException { + void testStdev() throws IOException { Workbook wb = new HSSFWorkbook(); @@ -323,7 +323,7 @@ public final class TestSubtotal { } @Test - public void test50209() throws IOException { + void test50209() throws IOException { Workbook wb = new HSSFWorkbook(); Sheet sh = wb.createSheet(); Cell a1 = sh.createRow(1).createCell(1); @@ -349,7 +349,7 @@ public final class TestSubtotal { } @Test - public void testFunctionsFromTestSpreadsheet() throws IOException { + void testFunctionsFromTestSpreadsheet() throws IOException { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("SubtotalsNested.xls"); HSSFSheet sheet = workbook.getSheetAt(0); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); @@ -389,7 +389,7 @@ public final class TestSubtotal { } @Test - public void testUnimplemented() throws IOException { + void testUnimplemented() throws IOException { Workbook wb = new HSSFWorkbook(); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java index 894c93609a..582e330e22 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java @@ -50,7 +50,7 @@ public final class TestSumif { } @Test - public void testBasic() { + void testBasic() { ValueEval[] arg0values = new ValueEval[] { _30, _30, _40, _40, _50, _50 }; ValueEval[] arg2values = new ValueEval[] { _30, _40, _50, _60, _60, _60 }; @@ -82,7 +82,7 @@ public final class TestSumif { * test for bug observed near svn r882931 */ @Test - public void testCriteriaArgRange() { + void testCriteriaArgRange() { ValueEval[] arg0values = new ValueEval[] { _50, _60, _50, _50, _50, _30, }; ValueEval[] arg1values = new ValueEval[] { _30, _40, _50, _60, }; @@ -110,7 +110,7 @@ public final class TestSumif { } @Test - public void testEvaluateException() { + void testEvaluateException() { assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, BlankEval.instance, new NumberEval(30.0))); assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, BlankEval.instance, new NumberEval(30.0), new NumberEval(30.0))); assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, new NumberEval(30.0), BlankEval.instance, new NumberEval(30.0))); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSumifs.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSumifs.java index 667c58f0d6..2170872874 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestSumifs.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSumifs.java @@ -61,7 +61,7 @@ public final class TestSumifs { * http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010047504.aspx */ @Test - public void testExample1() { + void testExample1() { // mimic test sample from http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010047504.aspx ValueEval[] a2a9 = new ValueEval[] { new NumberEval(5), @@ -144,7 +144,7 @@ public final class TestSumifs { * http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010047504.aspx */ @Test - public void testExample2() { + void testExample2() { ValueEval[] b2e2 = new ValueEval[] { new NumberEval(100), new NumberEval(390), @@ -195,7 +195,7 @@ public final class TestSumifs { * http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010047504.aspx */ @Test - public void testExample3() { + void testExample3() { //3.3 0.8 5.5 5.5 ValueEval[] b2e2 = new ValueEval[] { new NumberEval(3.3), @@ -239,7 +239,7 @@ public final class TestSumifs { * Criteria entered as reference and by using wildcard characters */ @Test - public void testFromFile() { + void testFromFile() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("sumifs.xls"); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); @@ -278,7 +278,7 @@ public final class TestSumifs { } @Test - public void testBug56655() { + void testBug56655() { ValueEval[] a2a9 = new ValueEval[] { new NumberEval(5), new NumberEval(4), @@ -310,7 +310,7 @@ public final class TestSumifs { } @Test - public void testBug56655b() { + void testBug56655b() { /* setCellFormula(sheet, 0, 0, "B1*C1"); sheet.getRow(0).createCell(1).setCellValue("A"); @@ -335,7 +335,7 @@ public final class TestSumifs { } @Test - public void testBug56655c() { + void testBug56655c() { /* setCellFormula(sheet, 0, 0, "B1*C1"); sheet.getRow(0).createCell(1).setCellValue("A"); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSumproduct.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSumproduct.java index 47b1751ae9..17384986e1 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestSumproduct.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSumproduct.java @@ -48,7 +48,7 @@ public final class TestSumproduct { } @Test - public void testScalarSimple() { + void testScalarSimple() { RefEval refEval = EvalFactory.createRefEval("A1", new NumberEval(3)); ValueEval[] args = { @@ -60,7 +60,7 @@ public final class TestSumproduct { } @Test - public void testAreaSimple() { + void testAreaSimple() { ValueEval[] aValues = { new NumberEval(2), new NumberEval(4), @@ -83,7 +83,7 @@ public final class TestSumproduct { * For scalar products, the terms may be 1x1 area refs */ @Test - public void testOneByOneArea() { + void testOneByOneArea() { AreaEval ae = EvalFactory.createAreaEval("A1:A1", new ValueEval[] { new NumberEval(7), }); @@ -96,7 +96,7 @@ public final class TestSumproduct { } @Test - public void testMismatchAreaDimensions() { + void testMismatchAreaDimensions() { AreaEval aeA = EvalFactory.createAreaEval("A1:A3", new ValueEval[3]); AreaEval aeB = EvalFactory.createAreaEval("B1:D1", new ValueEval[3]); @@ -110,7 +110,7 @@ public final class TestSumproduct { } @Test - public void testAreaWithErrorCell() { + void testAreaWithErrorCell() { ValueEval[] aValues = { ErrorEval.REF_INVALID, null, diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestTFunc.java b/src/testcases/org/apache/poi/ss/formula/functions/TestTFunc.java index efadacf610..a6fd25a68e 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestTFunc.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestTFunc.java @@ -65,7 +65,7 @@ public final class TestTFunc { } @Test - public void testTextValues() { + void testTextValues() { confirmText("abc"); confirmText(""); confirmText(" "); @@ -80,7 +80,7 @@ public final class TestTFunc { } @Test - public void testErrorValues() { + void testErrorValues() { confirmError(ErrorEval.VALUE_INVALID); confirmError(ErrorEval.NA); @@ -98,14 +98,14 @@ public final class TestTFunc { } @Test - public void testOtherValues() { + void testOtherValues() { confirmOther(new NumberEval(2)); confirmOther(BoolEval.FALSE); confirmOther(BlankEval.instance); // can this particular case be verified? } @Test - public void testRefValues() { + void testRefValues() { ValueEval eval; eval = invokeTWithReference(new StringEval("def")); @@ -123,7 +123,7 @@ public final class TestTFunc { } @Test - public void testAreaArg() { + void testAreaArg() { ValueEval[] areaValues = new ValueEval[] { new StringEval("abc"), new StringEval("def"), new StringEval("ghi"), new StringEval("jkl"), diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestText.java b/src/testcases/org/apache/poi/ss/formula/functions/TestText.java index 4bde9abb10..acf2fae2f5 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestText.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestText.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; */ public final class TestText { @Test - public void testTextWithStringFirstArg() { + void testTextWithStringFirstArg() { ValueEval strArg = new StringEval("abc"); ValueEval formatArg = new StringEval("abc"); ValueEval[] args = { strArg, formatArg }; @@ -45,7 +45,7 @@ public final class TestText { } @Test - public void testTextWithDeciamlFormatSecondArg() { + void testTextWithDeciamlFormatSecondArg() { ValueEval numArg = new NumberEval(321321.321); ValueEval formatArg = new StringEval("#,###.00000"); ValueEval[] args = { numArg, formatArg }; @@ -71,7 +71,7 @@ public final class TestText { } @Test - public void testTextWithFractionFormatSecondArg() { + void testTextWithFractionFormatSecondArg() { ValueEval numArg = new NumberEval(321.321); ValueEval formatArg = new StringEval("# #/#"); ValueEval[] args = { numArg, formatArg }; @@ -93,7 +93,7 @@ public final class TestText { } @Test - public void testTextWithDateFormatSecondArg() { + void testTextWithDateFormatSecondArg() { TimeZone userTZ = LocaleUtil.getUserTimeZone(); LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CET")); try { diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestTime.java b/src/testcases/org/apache/poi/ss/formula/functions/TestTime.java index 87b049585f..858423cd2f 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestTime.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestTime.java @@ -60,13 +60,13 @@ public final class TestTime { } @Test - public void testSomeArgumentsMissing() { + void testSomeArgumentsMissing() { confirm("00:00:00", "TIME(, 0, 0)"); confirm("12:00:00", "TIME(12, , )"); } @Test - public void testValid() { + void testValid() { confirm("00:00:01", 0, 0, 1); confirm("00:01:00", 0, 1, 0); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestTrim.java b/src/testcases/org/apache/poi/ss/formula/functions/TestTrim.java index 4d889116ae..edc39f7706 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestTrim.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestTrim.java @@ -53,7 +53,7 @@ public final class TestTrim { } @Test - public void testBasic() { + void testBasic() { confirmTrim(new StringEval(" hi "), "hi"); confirmTrim(new StringEval("hi "), "hi"); @@ -67,7 +67,7 @@ public final class TestTrim { * Valid cases where text arg is not exactly a string */ @Test - public void testUnusualArgs() { + void testUnusualArgs() { // text (first) arg type is number, other args are strings with fractional digits confirmTrim(new NumberEval(123456), "123456"); @@ -77,7 +77,7 @@ public final class TestTrim { } @Test - public void testErrors() { + void testErrors() { confirmTrim(ErrorEval.NAME_INVALID, ErrorEval.NAME_INVALID); } } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java b/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java index ba137bdd28..da6c969a93 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java @@ -34,7 +34,7 @@ public final class TestTrunc extends BaseTestNumeric { private static final NumericFunction F = null; @Test - public void testTruncWithStringArg() { + void testTruncWithStringArg() { ValueEval strArg = new StringEval("abc"); ValueEval[] args = { strArg, new NumberEval(2) }; @@ -43,7 +43,7 @@ public final class TestTrunc extends BaseTestNumeric { } @Test - public void testTruncWithWholeNumber() { + void testTruncWithWholeNumber() { ValueEval[] args = { new NumberEval(200), new NumberEval(2) }; @SuppressWarnings("static-access") ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1); @@ -51,7 +51,7 @@ public final class TestTrunc extends BaseTestNumeric { } @Test - public void testTruncWithDecimalNumber() { + void testTruncWithDecimalNumber() { ValueEval[] args = { new NumberEval(2.612777), new NumberEval(3) }; @SuppressWarnings("static-access") ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1); @@ -59,14 +59,14 @@ public final class TestTrunc extends BaseTestNumeric { } @Test - public void testTruncWithProblematicDecimalNumber() { + void testTruncWithProblematicDecimalNumber() { ValueEval[] args = { new NumberEval(0.29), new NumberEval(2) }; ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1); assertDouble("TRUNC", (new NumberEval(0.29d)).getNumberValue(), ((NumberEval)result).getNumberValue()); } @Test - public void testTruncWithProblematicCalculationResult() { + void testTruncWithProblematicCalculationResult() { ValueEval[] args = { new NumberEval(21.624d / 24d + .009d), new NumberEval(2) }; ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1); @@ -74,14 +74,14 @@ public final class TestTrunc extends BaseTestNumeric { } @Test - public void testTruncWithDecimalNumberOneArg() { + void testTruncWithDecimalNumberOneArg() { ValueEval[] args = { new NumberEval(2.612777) }; ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1); assertDouble("TRUNC", (new NumberEval(2d)).getNumberValue(), ((NumberEval)result).getNumberValue()); } @Test - public void testNegative() { + void testNegative() { ValueEval[] args = { new NumberEval(-8.9), new NumberEval(0) }; @SuppressWarnings("static-access") ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestValue.java b/src/testcases/org/apache/poi/ss/formula/functions/TestValue.java index 701d1eafd3..cf65c42817 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestValue.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestValue.java @@ -48,7 +48,7 @@ public final class TestValue { } @Test - public void testBasic() { + void testBasic() { confirmValue("100", 100); confirmValue("-2.3", -2.3); @@ -76,7 +76,7 @@ public final class TestValue { } @Test - public void testErrors() { + void testErrors() { confirmValueError("1+1"); confirmValueError("1 1"); confirmValueError("1,00.0"); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestWeekdayFunc.java b/src/testcases/org/apache/poi/ss/formula/functions/TestWeekdayFunc.java index dbcd5439b8..b7b6f27727 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestWeekdayFunc.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestWeekdayFunc.java @@ -45,7 +45,7 @@ public class TestWeekdayFunc { @Test - public void testEvaluate() { + void testEvaluate() { assertEvaluateEquals(2.0, 1.0); assertEvaluateEquals(2.0, 1.0, 1.0); assertEvaluateEquals(1.0, 1.0, 2.0); @@ -80,7 +80,7 @@ public class TestWeekdayFunc { } @Test - public void testEvaluateInvalid() { + void testEvaluateInvalid() { assertEvaluateEquals("no args", ErrorEval.VALUE_INVALID); assertEvaluateEquals("too many args", ErrorEval.VALUE_INVALID, new NumberEval(1.0), new NumberEval(1.0), new NumberEval(1.0)); assertEvaluateEquals("negative date", ErrorEval.NUM_ERROR, new NumberEval(-1.0)); diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java b/src/testcases/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java index b191bb4cfd..077061c316 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java @@ -57,7 +57,7 @@ public final class TestXYNumericFunction { } @Test - public void testBasic() { + void testBasic() { ValueEval[] xValues = { new NumberEval(1), new NumberEval(2), @@ -81,7 +81,7 @@ public final class TestXYNumericFunction { * number of items in array is not limited to 30 */ @Test - public void testLargeArrays() { + void testLargeArrays() { ValueEval[] xValues = createMockNumberArray(100, 3); ValueEval[] yValues = createMockNumberArray(100, 2); @@ -105,7 +105,7 @@ public final class TestXYNumericFunction { } @Test - public void testErrors() { + void testErrors() { ValueEval[] xValues = { ErrorEval.REF_INVALID, new NumberEval(2), diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestAbstractFunctionPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestAbstractFunctionPtg.java index c7a618812f..bc71f89c4b 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestAbstractFunctionPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestAbstractFunctionPtg.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; public class TestAbstractFunctionPtg { @Test - public void testConstructor() { + void testConstructor() { FunctionPtg ptg = new FunctionPtg(1, 2, null, 255); assertEquals(1, ptg.getFunctionIndex()); assertEquals(2, ptg.getDefaultOperandClass()); @@ -34,12 +34,12 @@ public class TestAbstractFunctionPtg { } @Test - public void testInvalidFunctionIndex() { + void testInvalidFunctionIndex() { assertThrows(RuntimeException.class, () -> new FunctionPtg(40000, 2, null, 255)); } @Test - public void testInvalidRuntimeClass() { + void testInvalidRuntimeClass() { assertThrows(RuntimeException.class, () -> new FunctionPtg(1, 300, null, 255)); } diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestArea3DPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestArea3DPtg.java index 9e89a4e9f0..6a5c1af504 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestArea3DPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestArea3DPtg.java @@ -34,7 +34,7 @@ public final class TestArea3DPtg extends BaseTestPtg { * confirms that sheet names get properly escaped */ @Test - public void testToFormulaString() throws IOException { + void testToFormulaString() throws IOException { Area3DPtg target = new Area3DPtg("A1:B1", (short)0); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaErrPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaErrPtg.java index ab946e5953..70b73f0c78 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaErrPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaErrPtg.java @@ -32,7 +32,7 @@ public final class TestAreaErrPtg extends BaseTestPtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() throws IOException { + void testReading() throws IOException { try (HSSFWorkbook workbook = loadWorkbook("AreaErrPtg.xls")) { assertEquals("SUM(#REF!)", workbook.getSheetAt(0).getRow(0).getCell(2).getCellFormula(), "Wrong formula string for area error"); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaPtg.java index 7c09db8f89..caa7f415cc 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestAreaPtg.java @@ -45,7 +45,7 @@ public final class TestAreaPtg { } @Test - public void testSortTopLeftToBottomRight() { + void testSortTopLeftToBottomRight() { AreaPtg ptg = new AreaPtg(new AreaReference("A$1:$B5", SpreadsheetVersion.EXCEL2007)); assertEquals("A$1:$B5", ptg.toFormulaString()); ptg.setFirstColumn(3); @@ -57,13 +57,13 @@ public final class TestAreaPtg { } @Test - public void testSetColumnsAbsolute() { + void testSetColumnsAbsolute() { resetColumns(absolute); validateReference(true, absolute); } @Test - public void testSetColumnsRelative() { + void testSetColumnsRelative() { resetColumns(relative); validateReference(false, relative); } @@ -87,7 +87,7 @@ public final class TestAreaPtg { } @Test - public void testAbsoluteRelativeRefs() { + void testAbsoluteRelativeRefs() { AreaPtg sca1 = new AreaPtg(4, 5, 6, 7, true, false, true, false); AreaPtg sca2 = new AreaPtg(4, 5, 6, 7, false, true, false, true); AreaPtg sca3 = new AreaPtg(5, 5, 7, 7, true, false, true, false); @@ -117,7 +117,7 @@ public final class TestAreaPtg { } @Test - public void testFormulaParser() { + void testFormulaParser() { String formula1="SUM($E$5:$E$6)"; String expectedFormula1="SUM($F$5:$F$6)"; String newFormula1 = shiftAllColumnsBy1(formula1); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestArrayPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestArrayPtg.java index 79114a6f8a..6f8c09ad08 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestArrayPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestArrayPtg.java @@ -57,7 +57,7 @@ public final class TestArrayPtg { * Lots of problems with ArrayPtg's decoding and encoding of the element value data */ @Test - public void testReadWriteTokenValueBytes() { + void testReadWriteTokenValueBytes() { ArrayPtg ptg = create(ENCODED_PTG_DATA, ENCODED_CONSTANT_DATA); assertEquals(3, ptg.getColumnCount()); assertEquals(2, ptg.getRowCount()); @@ -83,7 +83,7 @@ public final class TestArrayPtg { * Excel stores array elements column by column. This test makes sure POI does the same. */ @Test - public void testElementOrdering() { + void testElementOrdering() { ArrayPtg ptg = create(ENCODED_PTG_DATA, ENCODED_CONSTANT_DATA); assertEquals(3, ptg.getColumnCount()); assertEquals(2, ptg.getRowCount()); @@ -101,7 +101,7 @@ public final class TestArrayPtg { * A spreadsheet was added to make the ordering clearer. */ @Test - public void testElementOrderingInSpreadsheet() { + void testElementOrderingInSpreadsheet() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex42564-elementOrder.xls"); // The formula has an array with 3 rows and 5 columns @@ -112,7 +112,7 @@ public final class TestArrayPtg { } @Test - public void testToFormulaString() { + void testToFormulaString() { ArrayPtg ptg = create(ENCODED_PTG_DATA, ENCODED_CONSTANT_DATA); // bug 45380 - Unexpected constant class (java.lang.Boolean) String actualFormula = ptg.toFormulaString(); @@ -123,7 +123,7 @@ public final class TestArrayPtg { * worth checking since AttrPtg.sid=0x20 and Ptg.CLASS_* = (0x00, 0x20, and 0x40) */ @Test - public void testOperandClassDecoding() { + void testOperandClassDecoding() { confirmOperandClassDecoding(Ptg.CLASS_REF); confirmOperandClassDecoding(Ptg.CLASS_VALUE); confirmOperandClassDecoding(Ptg.CLASS_ARRAY); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestAttrPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestAttrPtg.java index 5d96832181..e09463ef10 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestAttrPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestAttrPtg.java @@ -33,7 +33,7 @@ public final class TestAttrPtg extends BaseTestPtg { * Fix for bug visible around svn r706772. */ @Test - public void testReserializeAttrChoose() { + void testReserializeAttrChoose() { byte[] data = HexRead.readFromString("19, 04, 03, 00, 08, 00, 11, 00, 1A, 00, 23, 00"); LittleEndianInput in = TestcaseRecordInputStream.createLittleEndian(data); Ptg[] ptgs = Ptg.readTokens(data.length, in); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestErrPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestErrPtg.java index c9cf488736..4b5a4b8c19 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestErrPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestErrPtg.java @@ -33,7 +33,7 @@ public final class TestErrPtg extends BaseTestPtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() throws IOException { + void testReading() throws IOException { try (HSSFWorkbook workbook = loadWorkbook("ErrPtg.xls")) { HSSFCell cell = workbook.getSheetAt(0).getRow(3).getCell(0); assertEquals(4.0, cell.getNumericCellValue(), 0.0, "Wrong cell value"); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java index 8cc8014a32..bdc92a70a9 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java @@ -37,7 +37,7 @@ public final class TestExternalFunctionFormulas { * tests <tt>NameXPtg.toFormulaString(Workbook)</tt> and logic in Workbook below that */ @Test - public void testReadFormulaContainingExternalFunction() throws Exception { + void testReadFormulaContainingExternalFunction() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("externalFunctionExample.xls"); String expectedFormula = "YEARFRAC(B1,C1)"; @@ -49,7 +49,7 @@ public final class TestExternalFunctionFormulas { } @Test - public void testParse() throws Exception { + void testParse() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("externalFunctionExample.xls"); Ptg[] ptgs = HSSFFormulaParser.parse("YEARFRAC(B1,C1)", wb); assertEquals(4, ptgs.length); @@ -72,7 +72,7 @@ public final class TestExternalFunctionFormulas { } @Test - public void testEvaluate() throws Exception { + void testEvaluate() throws Exception { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("externalFunctionExample.xls"); HSSFSheet sheet = wb.getSheetAt(0); HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java index 7974f57a01..7e3a9a44f8 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java @@ -42,7 +42,7 @@ public final class TestExternalNameReference { * tests <tt>NameXPtg for external cell reference by name</tt> and logic in Workbook below that */ @Test - public void testReadCalcSheet() { + void testReadCalcSheet() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("XRefCalc.xls"); HSSFName name = wb.getName("QUANT"); assertNotNull(name); @@ -78,7 +78,7 @@ public final class TestExternalNameReference { } @Test - public void testReadReferencedSheet() { + void testReadReferencedSheet() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("XRefCalcData.xls"); HSSFName name = wb.getName("COSTS"); assertNotNull(name); @@ -92,7 +92,7 @@ public final class TestExternalNameReference { } @Test - public void testEvaluate() { + void testEvaluate() { HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("XRefCalc.xls"); HSSFWorkbook wb2 = HSSFTestDataSamples.openSampleWorkbook("XRefCalcData.xls"); HSSFName name = wb.getName("QUANT"); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncPtg.java index 2b3b9415a0..dd91bff392 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncPtg.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public final class TestFuncPtg { @Test - public void testRead() { + void testRead() { // This function index represents the LEN() function byte[] fakeData = { 0x20, 0x00,}; @@ -40,7 +40,7 @@ public final class TestFuncPtg { } @Test - public void testNumberOfOperands() { + void testNumberOfOperands() { FuncPtg funcPtg = FuncPtg.create(27); // ROUND() - takes 2 args assertEquals(2, funcPtg.getNumberOfOperands()); assertEquals("ROUND", funcPtg.getName()); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java index 9b5891bb90..83c13ce1a1 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java @@ -37,7 +37,7 @@ public final class TestFuncVarPtg { * This functionality is related to the setParameterRVA() methods of <tt>FormulaParser</tt> */ @Test - public void testOperandClass() { + void testOperandClass() { HSSFWorkbook book = new HSSFWorkbook(); Ptg[] ptgs = HSSFFormulaParser.parse("sum(A1:A2)", book); assertEquals(2, ptgs.length); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestIntersectionPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestIntersectionPtg.java index a022c935b7..ac6ad197b6 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestIntersectionPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestIntersectionPtg.java @@ -33,7 +33,7 @@ public final class TestIntersectionPtg extends BaseTestPtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() throws IOException { + void testReading() throws IOException { try (HSSFWorkbook workbook = loadWorkbook("IntersectionPtg.xls")) { HSSFCell cell = workbook.getSheetAt(0).getRow(4).getCell(2); assertEquals(5.0, cell.getNumericCellValue(), 0.0, "Wrong cell value"); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestPercentPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestPercentPtg.java index f6e658c162..309db5bac7 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestPercentPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestPercentPtg.java @@ -33,7 +33,7 @@ public final class TestPercentPtg extends BaseTestPtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() throws IOException { + void testReading() throws IOException { try (HSSFWorkbook workbook = loadWorkbook("PercentPtg.xls")) { HSSFSheet sheet = workbook.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestRangePtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestRangePtg.java index 8d9b41d555..189af759b2 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestRangePtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestRangePtg.java @@ -33,7 +33,7 @@ public final class TestRangePtg extends BaseTestPtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() throws IOException { + void testReading() throws IOException { try (HSSFWorkbook workbook = loadWorkbook("RangePtg.xls")) { HSSFCell cell = workbook.getSheetAt(0).getRow(3).getCell(1); assertEquals(10.0, cell.getNumericCellValue(), 0.0, "Wrong cell value"); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestRef3DPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestRef3DPtg.java index b510cab68c..965428340a 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestRef3DPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestRef3DPtg.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; */ public final class TestRef3DPtg extends BaseTestPtg { @Test - public void testToFormulaString() throws IOException { + void testToFormulaString() throws IOException { Ref3DPtg target = new Ref3DPtg("A1", (short)0); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestReferencePtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestReferencePtg.java index acc2d6cf50..af571ecddd 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestReferencePtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestReferencePtg.java @@ -38,7 +38,7 @@ public final class TestReferencePtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() { + void testReading() { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("ReferencePtg.xls"); HSSFSheet sheet = workbook.getSheetAt(0); @@ -69,7 +69,7 @@ public final class TestReferencePtg { } @Test - public void testBug44921() throws IOException { + void testBug44921() throws IOException { try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex44921-21902.xls")) { HSSFTestDataSamples.writeOutAndReadBack(wb).close(); } @@ -80,7 +80,7 @@ public final class TestReferencePtg { }; @Test - public void testReadWrite_tRefN_bug45091() { + void testReadWrite_tRefN_bug45091() { LittleEndianInput in = TestcaseRecordInputStream.createLittleEndian(tRefN_data); Ptg[] ptgs = Ptg.readTokens(tRefN_data.length, in); byte[] outData = new byte[5]; @@ -94,7 +94,7 @@ public final class TestReferencePtg { * see Bugzilla 50096 */ @Test - public void testColumnGreater255() { + void testColumnGreater255() { RefPtgBase ptg; ptg = new RefPtg("IW1"); assertEquals(256, ptg.getColumn()); diff --git a/src/testcases/org/apache/poi/ss/formula/ptg/TestUnionPtg.java b/src/testcases/org/apache/poi/ss/formula/ptg/TestUnionPtg.java index dd2c423230..bde83c06b3 100644 --- a/src/testcases/org/apache/poi/ss/formula/ptg/TestUnionPtg.java +++ b/src/testcases/org/apache/poi/ss/formula/ptg/TestUnionPtg.java @@ -33,7 +33,7 @@ public final class TestUnionPtg extends BaseTestPtg { * Tests reading a file containing this ptg. */ @Test - public void testReading() throws IOException { + void testReading() throws IOException { try (HSSFWorkbook workbook = loadWorkbook("UnionPtg.xls")) { HSSFCell cell = workbook.getSheetAt(0).getRow(4).getCell(2); assertEquals(24.0, cell.getNumericCellValue(), 0.0, "Wrong cell value"); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBorderStyle.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBorderStyle.java index ca30b3eb8d..dbd7e5fc46 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBorderStyle.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBorderStyle.java @@ -44,7 +44,7 @@ public abstract class BaseTestBorderStyle { * how to format normal numbers */ @Test - public void testBorderStyle() throws IOException { + void testBorderStyle() throws IOException { String ext = _testDataProvider.getStandardFileNameExtension(); Workbook wb = _testDataProvider.openSampleWorkbook("59264."+ext); Sheet sh = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java index 0838857f80..f204019ffa 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java @@ -928,7 +928,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test56574OverwriteExistingRow() throws IOException { + void test56574OverwriteExistingRow() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); @@ -1035,7 +1035,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test57973() throws IOException { + void test57973() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { CreationHelper factory = wb.getCreationHelper(); @@ -1144,7 +1144,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test58113() throws IOException { + void test58113() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("Test"); @@ -1310,7 +1310,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test50319() throws IOException { + void test50319() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("Test"); sheet.createRow(0); @@ -1325,7 +1325,7 @@ public abstract class BaseTestBugzillaIssues { // Bug 58648: FormulaParser throws exception in parseSimpleFactor() when getCellFormula() // is called on a cell and the formula contains spaces between closing parentheses ") )" @Test - public void test58648() throws IOException { + void test58648() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = wb.createSheet().createRow(0).createCell(0); cell.setCellFormula("((1 + 1) )"); @@ -1337,7 +1337,7 @@ public abstract class BaseTestBugzillaIssues { * it as an empty cell, and avoid a NPE on auto-sizing */ @Test - public void test57034() throws Exception { + void test57034() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet s = wb.createSheet(); Cell cell = s.createRow(0).createCell(0); @@ -1355,7 +1355,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test52684() throws IOException { + void test52684() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); @@ -1380,7 +1380,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test58896() throws IOException { + void test58896() throws IOException { final int nrows = 160; final int ncols = 139; @@ -1524,7 +1524,7 @@ public abstract class BaseTestBugzillaIssues { @Disabled @Test - public void test57929() throws IOException { + void test57929() throws IOException { // Create a workbook with print areas on 2 sheets try (Workbook wb = _testDataProvider.createWorkbook()) { wb.createSheet("Sheet0"); @@ -1555,7 +1555,7 @@ public abstract class BaseTestBugzillaIssues { @Test - public void test55384() throws Exception { + void test55384() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sh = wb.createSheet(); for (int rownum = 0; rownum < 10; rownum++) { @@ -1709,7 +1709,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test59200() throws IOException { + void test59200() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Sheet sheet = wb.createSheet(); @@ -1763,7 +1763,7 @@ public abstract class BaseTestBugzillaIssues { } @Test - public void test60370() throws IOException { + void test60370() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Sheet sheet = wb.createSheet(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java index d4545857d7..a439b3e469 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java @@ -65,7 +65,7 @@ public abstract class BaseTestCell { } @Test - public void testSetValues() throws Exception { + void testSetValues() throws Exception { try (Workbook book = _testDataProvider.createWorkbook()) { Sheet sheet = book.createSheet("test"); Row row = sheet.createRow(0); @@ -189,7 +189,7 @@ public abstract class BaseTestCell { * test that Boolean (BoolErrRecord) are supported properly. */ @Test - public void testBool() throws IOException { + void testBool() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet s = wb1.createSheet("testSheet1"); Row r; @@ -235,7 +235,7 @@ public abstract class BaseTestCell { * @see #testBool */ @Test - public void testErr() throws IOException { + void testErr() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet s = wb1.createSheet("testSheet1"); @@ -282,7 +282,7 @@ public abstract class BaseTestCell { * test that Cell Styles being applied to formulas remain intact */ @Test - public void testFormulaStyle() throws Exception { + void testFormulaStyle() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet s = wb1.createSheet("testSheet1"); Row r; @@ -325,7 +325,7 @@ public abstract class BaseTestCell { /**tests the toString() method of HSSFCell*/ @Test - public void testToString() throws Exception { + void testToString() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Row r = wb1.createSheet("Sheet1").createRow(0); CreationHelper factory = wb1.getCreationHelper(); @@ -380,7 +380,7 @@ public abstract class BaseTestCell { * Test that setting cached formula result keeps the cell type */ @Test - public void testSetFormulaValue() throws Exception { + void testSetFormulaValue() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet s = wb.createSheet(); Row r = s.createRow(0); @@ -420,7 +420,7 @@ public abstract class BaseTestCell { * Make sure that formulas with unknown/unregistered UDFs can be written to and read back from a file. */ @Test - public void testFormulaWithUnknownUDF() throws IOException { + void testFormulaWithUnknownUDF() throws IOException { try (final Workbook wb1 = _testDataProvider.createWorkbook()) { final FormulaEvaluator evaluator1 = wb1.getCreationHelper().createFormulaEvaluator(); final Cell cell1 = wb1.createSheet().createRow(0).createCell(0); @@ -442,7 +442,7 @@ public abstract class BaseTestCell { } @Test - public void testChangeTypeStringToBool() throws IOException { + void testChangeTypeStringToBool() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = createACell(wb); @@ -467,7 +467,7 @@ public abstract class BaseTestCell { } @Test - public void testChangeTypeBoolToString() throws IOException { + void testChangeTypeBoolToString() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = createACell(wb); @@ -479,7 +479,7 @@ public abstract class BaseTestCell { } @Test - public void testChangeTypeErrorToNumber() throws IOException { + void testChangeTypeErrorToNumber() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = createACell(wb); cell.setCellErrorValue(FormulaError.NAME.getCode()); @@ -490,7 +490,7 @@ public abstract class BaseTestCell { } @Test - public void testChangeTypeErrorToBoolean() throws IOException { + void testChangeTypeErrorToBoolean() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Cell cell = createACell(wb); @@ -508,7 +508,7 @@ public abstract class BaseTestCell { * string result type. */ @Test - public void testConvertStringFormulaCell() throws IOException { + void testConvertStringFormulaCell() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cellA1 = createACell(wb); cellA1.setCellFormula("\"abc\""); @@ -532,7 +532,7 @@ public abstract class BaseTestCell { * lower level that {#link {@link Cell#setCellType(CellType)} works properly */ @Test - public void testSetTypeStringOnFormulaCell() throws IOException { + void testSetTypeStringOnFormulaCell() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cellA1 = createACell(wb); FormulaEvaluator fe = cellA1.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator(); @@ -578,7 +578,7 @@ public abstract class BaseTestCell { * Test for bug in convertCellValueToBoolean to make sure that formula results get converted */ @Test - public void testChangeTypeFormulaToBoolean() throws IOException { + void testChangeTypeFormulaToBoolean() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = createACell(wb); cell.setCellFormula("1=1"); @@ -594,7 +594,7 @@ public abstract class BaseTestCell { * ClassCastException if cell is created using HSSFRow.createCell(short column, int type) */ @Test - public void test40296() throws Exception { + void test40296() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet workSheet = wb1.createSheet("Sheet1"); Cell cell; @@ -634,7 +634,7 @@ public abstract class BaseTestCell { } @Test - public void testSetStringInFormulaCell_bug44606() throws Exception { + void testSetStringInFormulaCell_bug44606() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = wb.createSheet("Sheet1").createRow(0).createCell(0); cell.setCellFormula("B1&C1"); @@ -648,7 +648,7 @@ public abstract class BaseTestCell { * Make sure that cell.setBlank() preserves the cell style */ @Test - public void testSetBlank_bug47028() throws Exception { + void testSetBlank_bug47028() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { CellStyle style = wb.createCellStyle(); Cell cell = wb.createSheet("Sheet1").createRow(0).createCell(0); @@ -680,7 +680,7 @@ public abstract class BaseTestCell { * </ul> */ @Test - public void testNanAndInfinity() throws Exception { + void testNanAndInfinity() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet workSheet = wb1.createSheet("Sheet1"); Row row = workSheet.createRow(0); @@ -719,7 +719,7 @@ public abstract class BaseTestCell { } @Test - public void testDefaultStyleProperties() throws Exception { + void testDefaultStyleProperties() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Cell cell = wb1.createSheet("Sheet1").createRow(0).createCell(0); @@ -758,7 +758,7 @@ public abstract class BaseTestCell { } @Test - public void testBug55658SetNumericValue() throws Exception { + void testBug55658SetNumericValue() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sh = wb1.createSheet(); Row row = sh.createRow(0); @@ -780,7 +780,7 @@ public abstract class BaseTestCell { } @Test - public void testRemoveHyperlink() throws Exception { + void testRemoveHyperlink() throws Exception { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sh = wb1.createSheet("test"); Row row = sh.createRow(0); @@ -824,7 +824,7 @@ public abstract class BaseTestCell { * an problem that cell could not return error value form formula cell). */ @Test - public void testGetErrorCellValueFromFormulaCell() throws IOException { + void testGetErrorCellValueFromFormulaCell() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -836,7 +836,7 @@ public abstract class BaseTestCell { } @Test - public void testSetRemoveStyle() throws Exception { + void testSetRemoveStyle() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -875,7 +875,7 @@ public abstract class BaseTestCell { } @Test - public void test57008() throws IOException { + void test57008() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sheet = wb1.createSheet(); @@ -903,7 +903,7 @@ public abstract class BaseTestCell { */ @SuppressWarnings("ConstantConditions") @Test - public void testSetCellValueNullRichTextString() throws IOException { + void testSetCellValueNullRichTextString() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Cell cell = sheet.createRow(0).createCell(0); @@ -942,7 +942,7 @@ public abstract class BaseTestCell { * The maximum length of cell contents (text) is 32,767 characters. */ @Test - public void testMaxTextLength() throws IOException{ + void testMaxTextLength() throws IOException{ try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Cell cell = sheet.createRow(0).createCell(0); @@ -1016,7 +1016,7 @@ public abstract class BaseTestCell { } @Test - public void testSetErrorValue() throws Exception { + void testSetErrorValue() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -1039,7 +1039,7 @@ public abstract class BaseTestCell { } @Test - public void test62216() throws IOException { + void test62216() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell instance = wb.createSheet().createRow(0).createCell(0); String formula = "2"; @@ -1051,7 +1051,7 @@ public abstract class BaseTestCell { } @Test - public void testSetNullValues() throws IOException { + void testSetNullValues() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Cell cell = wb.createSheet("test").createRow(0).createCell(0); @@ -1081,7 +1081,7 @@ public abstract class BaseTestCell { } @Test - public void testFormulaSetValueDoesNotChangeType() throws IOException { + void testFormulaSetValueDoesNotChangeType() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -1111,7 +1111,7 @@ public abstract class BaseTestCell { } @Test - public void testGetNumericCellValueOnABlankCellReturnsZero() throws IOException { + void testGetNumericCellValueOnABlankCellReturnsZero() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Cell cell = workbook.createSheet().createRow(0).createCell(0); assertEquals(CellType.BLANK, cell.getCellType()); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCloneSheet.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCloneSheet.java index 22c5743628..7d9cd0c448 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCloneSheet.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCloneSheet.java @@ -40,7 +40,7 @@ public abstract class BaseTestCloneSheet { } @Test - public void testCloneSheetBasic() throws IOException{ + void testCloneSheetBasic() throws IOException{ Workbook b = _testDataProvider.createWorkbook(); Sheet s = b.createSheet("Test"); assertEquals(0, s.addMergedRegion(new CellRangeAddress(0, 1, 0, 1))); @@ -55,7 +55,7 @@ public abstract class BaseTestCloneSheet { * Ensures that pagebreak cloning works properly */ @Test - public void testPageBreakClones() throws IOException { + void testPageBreakClones() throws IOException { Workbook b = _testDataProvider.createWorkbook(); Sheet s = b.createSheet("Test"); s.setRowBreak(3); @@ -73,7 +73,7 @@ public abstract class BaseTestCloneSheet { } @Test - public void testCloneSheetIntValid() { + void testCloneSheetIntValid() { Workbook wb = _testDataProvider.createWorkbook(); wb.createSheet("Sheet01"); wb.cloneSheet(0); @@ -82,7 +82,7 @@ public abstract class BaseTestCloneSheet { } @Test - public void testCloneSheetIntInvalid() { + void testCloneSheetIntInvalid() { Workbook wb = _testDataProvider.createWorkbook(); wb.createSheet("Sheet01"); assertThrows(IllegalArgumentException.class, () -> wb.cloneSheet(1)); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestColumnShifting.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestColumnShifting.java index 8127d8e4d7..b5afa0dc47 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestColumnShifting.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestColumnShifting.java @@ -60,7 +60,7 @@ public abstract class BaseTestColumnShifting { protected void initColumnShifter() {} @Test - public void testShift3ColumnsRight() { + void testShift3ColumnsRight() { columnShifter.shiftColumns(1, 2, 3); Cell cell = sheet1.getRow(0).getCell(4); @@ -74,7 +74,7 @@ public abstract class BaseTestColumnShifting { } @Test - public void testShiftLeft() { + void testShiftLeft() { assertThrows(IllegalStateException.class, () -> columnShifter.shiftColumns(1, 2, -3), "Shift to negative indices should throw exception"); } diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java index 3d972cd49c..64a85c64ee 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java @@ -54,7 +54,7 @@ public abstract class BaseTestConditionalFormatting { protected abstract void assertColor(String hexExpected, Color actual); @Test - public void testBasic() throws Throwable { + void testBasic() throws Throwable { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sh = wb.createSheet(); SheetConditionalFormatting sheetCF = sh.getSheetConditionalFormatting(); @@ -100,7 +100,7 @@ public abstract class BaseTestConditionalFormatting { * Test format conditions based on a boolean formula */ @Test - public void testBooleanFormulaConditions() throws IOException { + void testBooleanFormulaConditions() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sh = wb.createSheet(); SheetConditionalFormatting sheetCF = sh.getSheetConditionalFormatting(); @@ -136,7 +136,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testSingleFormulaConditions() throws IOException { + void testSingleFormulaConditions() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sh = wb.createSheet(); SheetConditionalFormatting sheetCF = sh.getSheetConditionalFormatting(); @@ -200,7 +200,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCopy() throws IOException { + void testCopy() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet1 = wb.createSheet(); Sheet sheet2 = wb.createSheet(); @@ -240,7 +240,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testRemove() throws IOException { + void testRemove() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet1 = wb.createSheet(); SheetConditionalFormatting sheetCF = sheet1.getSheetConditionalFormatting(); @@ -274,7 +274,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreateCF() throws IOException { + void testCreateCF() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); String formula = "7"; @@ -352,7 +352,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testClone() throws IOException { + void testClone() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); String formula = "7"; @@ -384,7 +384,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testShiftRows() throws IOException { + void testShiftRows() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); @@ -522,7 +522,7 @@ public abstract class BaseTestConditionalFormatting { } } - public void testReadOffice2007(String filename) throws IOException { + protected void testReadOffice2007(String filename) throws IOException { try (Workbook wb = _testDataProvider.openSampleWorkbook(filename)) { Sheet s = wb.getSheet("CF"); @@ -851,7 +851,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreateFontFormatting() throws IOException { + void testCreateFontFormatting() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -919,7 +919,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreatePatternFormatting() throws IOException { + void testCreatePatternFormatting() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -966,7 +966,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testAllCreateBorderFormatting() throws IOException { + void testAllCreateBorderFormatting() throws IOException { // Make sure it is possible to create a conditional formatting rule // with every type of Border Style try (Workbook workbook = _testDataProvider.createWorkbook()) { @@ -997,7 +997,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreateBorderFormatting() throws IOException { + void testCreateBorderFormatting() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -1060,7 +1060,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreateIconFormatting() throws IOException { + void testCreateIconFormatting() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sheet = wb1.createSheet(); @@ -1115,7 +1115,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreateColorScaleFormatting() throws IOException { + void testCreateColorScaleFormatting() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sheet = wb1.createSheet(); @@ -1163,7 +1163,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testCreateDataBarFormatting() throws IOException { + void testCreateDataBarFormatting() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sheet = wb1.createSheet(); @@ -1214,7 +1214,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testBug55380() throws IOException { + void testBug55380() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); CellRangeAddress[] ranges = new CellRangeAddress[]{ @@ -1226,7 +1226,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testSetCellRangeAddresswithSingleRange() throws IOException { + void testSetCellRangeAddresswithSingleRange() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Sheet sheet = wb.createSheet("S1"); final SheetConditionalFormatting cf = sheet.getSheetConditionalFormatting(); @@ -1256,7 +1256,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testSetCellRangeAddressWithMultipleRanges() throws IOException { + void testSetCellRangeAddressWithMultipleRanges() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Sheet sheet = wb.createSheet("S1"); final SheetConditionalFormatting cf = sheet.getSheetConditionalFormatting(); @@ -1289,7 +1289,7 @@ public abstract class BaseTestConditionalFormatting { } @Test - public void testSetCellRangeAddressWithNullRanges() throws IOException { + void testSetCellRangeAddressWithNullRanges() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Sheet sheet = wb.createSheet("S1"); final SheetConditionalFormatting cf = sheet.getSheetConditionalFormatting(); @@ -1307,7 +1307,7 @@ public abstract class BaseTestConditionalFormatting { @Test - public void test52122() throws IOException { + void test52122() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet("Conditional Formatting Test"); sheet.setColumnWidth(0, 256 * 10); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java index 3fe041a1df..fbbdd4481a 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java @@ -79,7 +79,7 @@ public abstract class BaseTestDataFormat { * [Bug 49928] formatCellValue returns incorrect value for \u00a3 formatted cells */ @Test - public void test49928() throws IOException { + void test49928() throws IOException { String fileName = "49928.xls" + (getClass().getName().contains("xssf") ? "x" : ""); try (Workbook wb = _testDataProvider.openSampleWorkbook(fileName)) { DataFormatter df = new DataFormatter(); @@ -118,7 +118,7 @@ public abstract class BaseTestDataFormat { } @Test - public void testReadbackFormat() throws IOException { + void testReadbackFormat() throws IOException { readbackFormat("built-in format", "0.00"); readbackFormat("overridden built-in format", POUND_FMT); @@ -140,7 +140,7 @@ public abstract class BaseTestDataFormat { * [Bug 58532] Handle formats that go numnum, numK, numM etc */ @Test - public void test58532() throws IOException { + void test58532() throws IOException { String fileName = "FormatKM.xls" + (getClass().getName().contains("xssf") ? "x" : ""); try (Workbook wb = _testDataProvider.openSampleWorkbook(fileName)) { Sheet s = wb.getSheetAt(0); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataValidation.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataValidation.java index 162deac99f..7075dc4220 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataValidation.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataValidation.java @@ -465,7 +465,7 @@ public abstract class BaseTestDataValidation { } @Test - public void testDataValidation() throws Exception { + void testDataValidation() throws Exception { log("\nTest no. 2 - Test Excel's Data validation mechanism"); Workbook wb = _testDataProvider.createWorkbook(); WorkbookFormatter wf = new WorkbookFormatter(wb); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java index 267d72d928..8b571523fc 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestFormulaEvaluator.java @@ -47,7 +47,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testSimpleArithmetic() throws IOException { + void testSimpleArithmetic() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet s = wb.createSheet(); Row r = s.createRow(0); @@ -72,7 +72,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testSumCount() throws IOException { + void testSumCount() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet s = wb.createSheet(); Row r = s.createRow(0); @@ -117,7 +117,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testSharedFormulas() throws IOException { + void testSharedFormulas() throws IOException { String fileName = "shared_formulas.xls" + (getClass().getName().contains("xssf") ? "x" : ""); try (Workbook wb = _testDataProvider.openSampleWorkbook(fileName)) { @@ -148,7 +148,7 @@ public abstract class BaseTestFormulaEvaluator { * Test creation / evaluation of formulas with sheet-level names */ @Test - public void testSheetLevelFormulas() throws IOException { + void testSheetLevelFormulas() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Row row; @@ -184,7 +184,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testFullColumnRefs() throws IOException { + void testFullColumnRefs() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("Sheet1"); Row row = sheet.createRow(0); @@ -218,7 +218,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testRepeatedEvaluation() throws IOException { + void testRepeatedEvaluation() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); Sheet sheet = wb.createSheet("Sheet1"); @@ -271,7 +271,7 @@ public abstract class BaseTestFormulaEvaluator { * is <code>null</code> or blank. */ @Test - public void testEvaluateBlank() throws IOException { + void testEvaluateBlank() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); assertNull(fe.evaluate(null)); @@ -285,7 +285,7 @@ public abstract class BaseTestFormulaEvaluator { * Test for bug due to attempt to convert a cached formula error result to a boolean */ @Test - public void testUpdateCachedFormulaResultFromErrorToNumber_bug46479() throws IOException { + void testUpdateCachedFormulaResultFromErrorToNumber_bug46479() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("Sheet1"); Row row = sheet.createRow(0); @@ -312,7 +312,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testRounding_bug51339() throws IOException { + void testRounding_bug51339() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("Sheet1"); Row row = sheet.createRow(0); @@ -345,7 +345,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug61148() throws IOException { + void testBug61148() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Cell cell = wb.createSheet().createRow(0).createCell(0); cell.setCellFormula("1+2"); @@ -362,7 +362,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testMultisheetFormulaEval() throws IOException { + void testMultisheetFormulaEval() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet1 = wb.createSheet("Sheet1"); Sheet sheet2 = wb.createSheet("Sheet2"); @@ -403,7 +403,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843() throws IOException { + void testBug55843() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -425,7 +425,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843a() throws IOException { + void testBug55843a() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -447,7 +447,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843b() throws IOException { + void testBug55843b() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -470,7 +470,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843c() throws IOException { + void testBug55843c() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -487,7 +487,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843d() throws IOException { + void testBug55843d() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -504,7 +504,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843e() throws IOException { + void testBug55843e() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -521,7 +521,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug55843f() throws IOException { + void testBug55843f() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -538,7 +538,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug56655() throws IOException { + void testBug56655() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); @@ -555,7 +555,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug56655a() throws IOException { + void testBug56655a() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); @@ -601,7 +601,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testBug61532() throws IOException { + void testBug61532() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { final Cell cell = wb.createSheet().createRow(0).createCell(0); cell.setCellFormula("1+2"); @@ -628,7 +628,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testFormulaEvaluatorEvaluateSimpleFormulaCell() throws Exception { + void testFormulaEvaluatorEvaluateSimpleFormulaCell() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { final Row row = wb.createSheet().createRow(0); final Cell a1 = row.createCell(0, CellType.NUMERIC); @@ -654,7 +654,7 @@ public abstract class BaseTestFormulaEvaluator { } @Test - public void testFormulaEvaluatorEvaluateVlookupFormulaCell() throws Exception { + void testFormulaEvaluatorEvaluateVlookupFormulaCell() throws Exception { try (Workbook wb = _testDataProvider.createWorkbook()) { final Sheet mainSheet = wb.createSheet("main"); final Sheet otherSheet = wb.createSheet("other"); @@ -701,7 +701,7 @@ public abstract class BaseTestFormulaEvaluator { // setting an evaluation of function arguments with the intersect operator (space) // see https://bz.apache.org/bugzilla/show_bug.cgi?id=60980 @Test - public void testIntersectionInFunctionArgs_60980() throws IOException { + void testIntersectionInFunctionArgs_60980() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java index c269e2e6ea..44a33c3f20 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestHyperlink.java @@ -103,7 +103,7 @@ public abstract class BaseTestHyperlink { // copy a hyperlink via the copy constructor @Test - public void testCopyHyperlink() throws IOException { + void testCopyHyperlink() throws IOException { final Workbook wb = _testDataProvider.createWorkbook(); final CreationHelper createHelper = wb.getCreationHelper(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestNamedRange.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestNamedRange.java index 2c35c79302..8cc4b1c064 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestNamedRange.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestNamedRange.java @@ -605,7 +605,7 @@ public abstract class BaseTestNamedRange { } @Test - public void testBug56930() throws IOException { + void testBug56930() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); // x1 on sheet1 defines "x=1" @@ -638,7 +638,7 @@ public abstract class BaseTestNamedRange { // bug 56781: name validation only checks for first character's validity and presence of spaces // bug 60246: validate name does not allow DOT in named ranges @Test - public void testValid() throws IOException { + void testValid() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Name name = wb.createName(); @@ -658,7 +658,7 @@ public abstract class BaseTestNamedRange { } @Test - public void testInvalid() { + void testInvalid() { Workbook wb = _testDataProvider.createWorkbook(); Name name = wb.createName(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java index 4335f2553f..667f6295a3 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestPicture.java @@ -104,7 +104,7 @@ public abstract class BaseTestPicture { @Test - public void testResizeNoColumns() throws IOException { + void testResizeNoColumns() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); @@ -115,7 +115,7 @@ public abstract class BaseTestPicture { } @Test - public void testResizeWithColumns() throws IOException { + void testResizeWithColumns() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRangeCopier.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRangeCopier.java index f01f16a0e4..b1fae18150 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRangeCopier.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRangeCopier.java @@ -90,7 +90,7 @@ public abstract class BaseTestRangeCopier { } @Test - public void testEmptyRow() { + void testEmptyRow() { // leave some rows empty in-between Row row = sheet1.createRow(23); row.createCell(0).setCellValue(1.2); @@ -104,7 +104,7 @@ public abstract class BaseTestRangeCopier { } @Test - public void testSameSheet() { + void testSameSheet() { // leave some rows empty in-between Row row = sheet1.createRow(23); row.createCell(0).setCellValue(1.2); @@ -119,7 +119,7 @@ public abstract class BaseTestRangeCopier { } @Test - public void testCopyStyles() { + void testCopyStyles() { String cellContent = "D6 aligned to the right"; HorizontalAlignment toTheRight = HorizontalAlignment.RIGHT; // create cell with content aligned to the right @@ -138,7 +138,7 @@ public abstract class BaseTestRangeCopier { } @Test - public void testMergedRanges() { + void testMergedRanges() { String cellContent = "D6 merged to E7"; // create cell merged from D6 to E7 diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java index 2086fd70dc..c2205d240c 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java @@ -46,7 +46,7 @@ public abstract class BaseTestRow { } @Test - public void testLastAndFirstColumns() throws IOException { + void testLastAndFirstColumns() throws IOException { Workbook workbook = _testDataProvider.createWorkbook(); Sheet sheet = workbook.createSheet(); Row row = sheet.createRow(0); @@ -76,7 +76,7 @@ public abstract class BaseTestRow { * This test was added in response to bug report 44987. */ @Test - public void testBoundsInMultipleRows() throws IOException { + void testBoundsInMultipleRows() throws IOException { Workbook workbook = _testDataProvider.createWorkbook(); Sheet sheet = workbook.createSheet(); Row rowA = sheet.createRow(0); @@ -102,7 +102,7 @@ public abstract class BaseTestRow { } @Test - public void testRemoveCell() throws IOException { + void testRemoveCell() throws IOException { Workbook wb1 = _testDataProvider.createWorkbook(); { Sheet sheet = wb1.createSheet(); @@ -145,7 +145,7 @@ public abstract class BaseTestRow { } @Test - public void testRowBounds() throws IOException { + void testRowBounds() throws IOException { int maxRowNum = _testDataProvider.getSpreadsheetVersion().getLastRowIndex(); try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -201,7 +201,7 @@ public abstract class BaseTestRow { * number on the row */ @Test - public void testLastCellNumIsCorrectAfterAddCell_bug43901() throws IOException { + void testLastCellNumIsCorrectAfterAddCell_bug43901() throws IOException { Workbook workbook = _testDataProvider.createWorkbook(); Sheet sheet = workbook.createSheet("test"); Row row = sheet.createRow(0); @@ -223,7 +223,7 @@ public abstract class BaseTestRow { * Tests for the missing/blank cell policy stuff */ @Test - public void testGetCellPolicy() throws IOException { + void testGetCellPolicy() throws IOException { Workbook workbook = _testDataProvider.createWorkbook(); Sheet sheet = workbook.createSheet("test"); Row row = sheet.createRow(0); @@ -295,7 +295,7 @@ public abstract class BaseTestRow { } @Test - public void testRowHeight() throws IOException { + protected void testRowHeight() throws IOException { Workbook wb1 = _testDataProvider.createWorkbook(); Sheet sheet = wb1.createSheet(); Row row1 = sheet.createRow(0); @@ -351,7 +351,7 @@ public abstract class BaseTestRow { * Test adding cells to a row in various places and see if we can find them again. */ @Test - public void testCellIterator() throws IOException { + void testCellIterator() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -409,7 +409,7 @@ public abstract class BaseTestRow { } @Test - public void testRowStyle() throws IOException { + void testRowStyle() throws IOException { Workbook wb1 = _testDataProvider.createWorkbook(); Sheet sheet = wb1.createSheet("test"); Row row1 = sheet.createRow(0); @@ -452,7 +452,7 @@ public abstract class BaseTestRow { } @Test - public void testCellShiftingRight() { + protected void testCellShiftingRight() { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("sheet1"); Row row = sheet.createRow(0); @@ -481,8 +481,9 @@ public abstract class BaseTestRow { Cell c1 = row.getCell(2); assertNull(c1); } + @Test - public void testCellShiftingLeft() { + protected void testCellShiftingLeft() { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("sheet1"); Row row = sheet.createRow(0); @@ -511,7 +512,7 @@ public abstract class BaseTestRow { } @Test - public void testLastRowEmptySheet() { + void testLastRowEmptySheet() { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("sheet1"); @@ -523,7 +524,7 @@ public abstract class BaseTestRow { } @Test - public void testFirstRowEmptySheet() { + void testFirstRowEmptySheet() { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("sheet1"); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java index 56efecc08a..5cedd57dfd 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java @@ -756,7 +756,7 @@ public abstract class BaseTestSheet { } @Test - public void testGetSetMargin() throws IOException { + void testGetSetMargin() throws IOException { double[] defaultMargins = (getClass().getName().contains("xssf")) ? new double[]{0.7, 0.7, 0.75, 0.75, 0.3, 0.3} : new double[]{0.75, 0.75, 1.0, 1.0, 0.3, 0.3}; @@ -1277,7 +1277,7 @@ public abstract class BaseTestSheet { @Test - public void testRightToLeft() throws IOException { + void testRightToLeft() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); @@ -1290,7 +1290,7 @@ public abstract class BaseTestSheet { } @Test - public void testNoMergedRegionsIsEmptyList() throws IOException { + void testNoMergedRegionsIsEmptyList() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet(); assertTrue(sheet.getMergedRegions().isEmpty()); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java index 78642d21b8..95d79a9f63 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java @@ -99,7 +99,7 @@ public abstract class BaseTestSheetHiding { * the hidden flags are */ @Test - public void testTextSheets() { + void testTextSheets() { // Both should have two sheets assertEquals(2, wbH.getNumberOfSheets()); assertEquals(2, wbU.getNumberOfSheets()); @@ -128,7 +128,7 @@ public abstract class BaseTestSheetHiding { * as expected */ @Test - public void testHideUnHideFlags() { + void testHideUnHideFlags() { assertTrue(wbH.isSheetHidden(0)); assertFalse(wbH.isSheetHidden(1)); assertFalse(wbU.isSheetHidden(0)); @@ -140,7 +140,7 @@ public abstract class BaseTestSheetHiding { * one hidden */ @Test - public void testHide() throws IOException { + void testHide() throws IOException { wbU.setSheetHidden(0, true); assertTrue(wbU.isSheetHidden(0)); assertFalse(wbU.isSheetHidden(1)); @@ -155,7 +155,7 @@ public abstract class BaseTestSheetHiding { * none hidden */ @Test - public void testUnHide() throws IOException { + void testUnHide() throws IOException { wbH.setSheetHidden(0, false); assertFalse(wbH.isSheetHidden(0)); assertFalse(wbH.isSheetHidden(1)); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftColumns.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftColumns.java index 86f56daf61..a9a93d2640 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftColumns.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftColumns.java @@ -98,7 +98,7 @@ public abstract class BaseTestSheetShiftColumns { } @Test - public void testShiftOneColumnRight() { + void testShiftOneColumnRight() { sheet1.shiftColumns(1, 2, 1); double c1Value = sheet1.getRow(0).getCell(2).getNumericCellValue(); assertEquals(1d, c1Value, 0.01); @@ -127,7 +127,7 @@ public abstract class BaseTestSheetShiftColumns { } @Test - public void testShiftTwoColumnsRight() { + void testShiftTwoColumnsRight() { sheet1.shiftColumns(1, 2, 2); String formulaA4 = sheet1.getRow(3).getCell(0).getCellFormula(); assertEquals("A2*D3", formulaA4); @@ -145,7 +145,7 @@ public abstract class BaseTestSheetShiftColumns { } @Test - public void testShiftOneColumnLeft() { + void testShiftOneColumnLeft() { sheet1.shiftColumns(1, 2, -1); String formulaA5 = sheet1.getRow(4).getCell(0).getCellFormula(); @@ -159,12 +159,12 @@ public abstract class BaseTestSheetShiftColumns { } @Test - public void testShiftTwoColumnsLeft() { + void testShiftTwoColumnsLeft() { assertThrows(IllegalStateException.class, () -> sheet1.shiftColumns(1, 2, -2)); } @Test - public void testShiftHyperlinks() throws IOException { + protected void testShiftHyperlinks() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -312,7 +312,7 @@ public abstract class BaseTestSheetShiftColumns { } @Test - public void testShiftWithMergedRegions() throws IOException { + protected void testShiftWithMergedRegions() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -337,7 +337,7 @@ public abstract class BaseTestSheetShiftColumns { protected static final String AMDOCS_TEST = "Amdocs:\ntest\n"; @Test - public void testCommentsShifting() throws IOException { + protected void testCommentsShifting() throws IOException { Workbook inputWb = openWorkbook("56017.xlsx"); Sheet sheet = inputWb.getSheetAt(0); @@ -378,7 +378,7 @@ public abstract class BaseTestSheetShiftColumns { // transposed version of TestXSSFSheetShiftRows.testBug54524() @Test - public void testBug54524() throws IOException { + protected void testBug54524() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); Row firstRow = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java index 1fb3de3712..265042c603 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java @@ -136,7 +136,7 @@ public abstract class BaseTestSheetShiftRows { * When shifting rows, the page breaks should go with it */ @Test - public void testShiftRowBreaks() throws IOException { + protected void testShiftRowBreaks() throws IOException { // TODO - enable XSSF test try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet s = wb.createSheet(); @@ -150,7 +150,7 @@ public abstract class BaseTestSheetShiftRows { } @Test - public void testShiftWithComments() throws IOException { + void testShiftWithComments() throws IOException { Workbook wb1 = _testDataProvider.openSampleWorkbook("comments." + _testDataProvider.getStandardFileNameExtension()); Sheet sheet = wb1.getSheet("Sheet1"); @@ -478,7 +478,7 @@ public abstract class BaseTestSheetShiftRows { } @Test - public void testBug55280() throws IOException { + void testBug55280() throws IOException { Workbook w = _testDataProvider.createWorkbook(); Sheet s = w.createSheet(); for (int row = 0; row < 5000; ++row) { @@ -490,7 +490,7 @@ public abstract class BaseTestSheetShiftRows { } @Test - public void test47169() throws IOException { + void test47169() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); sheet.createRow(30); @@ -506,7 +506,7 @@ public abstract class BaseTestSheetShiftRows { * bug 52903: HSSFSheet.shiftRows should shift hyperlinks */ @Test - public void testBug46742_52903_shiftHyperlinks() throws IOException { + void testBug46742_52903_shiftHyperlinks() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet("test"); Row row = sheet.createRow(0); @@ -742,7 +742,7 @@ public abstract class BaseTestSheetShiftRows { } @Test - public void test61840_shifting_rows_up_does_not_produce_REF_errors() throws IOException { + void test61840_shifting_rows_up_does_not_produce_REF_errors() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); Sheet sheet = wb.createSheet(); Cell cell = sheet.createRow(4).createCell(0); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java index 34d5038544..ec5e3548ef 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java @@ -236,7 +236,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { * Test that we can set pre-calculated formula result for array formulas */ @Test - public void testModifyArrayCells_setFormulaResult() throws IOException { + void testModifyArrayCells_setFormulaResult() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -263,7 +263,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_setCellType() throws IOException { + void testModifyArrayCells_setCellType() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -298,7 +298,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_setCellFormula() throws IOException { + void testModifyArrayCells_setCellFormula() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -338,7 +338,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_removeCell() throws IOException { + void testModifyArrayCells_removeCell() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -380,7 +380,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_removeRow() throws IOException { + void testModifyArrayCells_removeRow() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); @@ -422,7 +422,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_mergeCellsSingle() throws IOException { + void testModifyArrayCells_mergeCellsSingle() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); assertEquals(0, sheet.getNumMergedRegions()); @@ -440,7 +440,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_mergeCellsMulti() throws IOException { + void testModifyArrayCells_mergeCellsMulti() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); int expectedNumMergedRegions = 0; @@ -480,7 +480,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas { } @Test - public void testModifyArrayCells_shiftRows() throws IOException { + void testModifyArrayCells_shiftRows() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook()) { Sheet sheet = workbook.createSheet(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java index b0015b18c3..8fc751c6a2 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java @@ -295,7 +295,7 @@ public abstract class BaseTestWorkbook { } @Test - public void testSetActiveCell() throws IOException { + void testSetActiveCell() throws IOException { try (Workbook wb = _testDataProvider.createWorkbook()) { Sheet sheet = wb.createSheet("new sheet"); final CellAddress initialActiveCell = sheet.getActiveCell(); @@ -764,7 +764,7 @@ public abstract class BaseTestWorkbook { } @Test - public void test58499() throws IOException { + void test58499() throws IOException { try (Workbook workbook = _testDataProvider.createWorkbook(); OutputStream os = new NullOutputStream()) { Sheet sheet = workbook.createSheet(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java b/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java index 57887aee8e..c9c0a43225 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java +++ b/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java @@ -86,7 +86,7 @@ public class TestDataFormatter { * how to format normal numbers */ @Test - public void testLocale() { + void testLocale() { DataFormatter dfUS = new DataFormatter(Locale.US); DataFormatter dfFR = new DataFormatter(Locale.FRENCH); @@ -103,7 +103,7 @@ public class TestDataFormatter { * the locale (eg '[$-1010409]') isn't there */ @Test - public void testLocaleBasedFormats() { + void testLocaleBasedFormats() { DataFormatter dfUS = new DataFormatter(Locale.US); // Standard formats @@ -122,7 +122,7 @@ public class TestDataFormatter { * how to format normal numbers */ @Test - public void testGrouping() { + void testGrouping() { DataFormatter dfUS = new DataFormatter(Locale.US); DataFormatter dfDE = new DataFormatter(Locale.GERMAN); @@ -140,7 +140,7 @@ public class TestDataFormatter { * zapped from within the format strings */ @Test - public void testColours() { + void testColours() { DataFormatter dfUS = new DataFormatter(Locale.US); String[] formats = { @@ -168,7 +168,7 @@ public class TestDataFormatter { } @Test - public void testColoursAndBrackets() { + void testColoursAndBrackets() { DataFormatter dfUS = new DataFormatter(Locale.US); // Without currency symbols @@ -203,7 +203,7 @@ public class TestDataFormatter { } @Test - public void testConditionalRanges() { + void testConditionalRanges() { DataFormatter dfUS = new DataFormatter(Locale.US); String format = "[>=10]#,##0;[<10]0.0"; @@ -218,7 +218,7 @@ public class TestDataFormatter { * yet in place for all of these */ @Test - public void testNegativeZero() { + void testNegativeZero() { DataFormatter dfUS = new DataFormatter(Locale.US); String all2dp = "00.00"; @@ -263,7 +263,7 @@ public class TestDataFormatter { * format string, eg # #/# */ @Test - public void testFractions() { + void testFractions() { DataFormatter dfUS = new DataFormatter(Locale.US); // Excel often prefers "# #/#" @@ -335,7 +335,7 @@ public class TestDataFormatter { * correctly ignored by us. */ @Test - public void testPaddingSpaces() { + void testPaddingSpaces() { DataFormatter dfUS = new DataFormatter(Locale.US); assertEquals("12.34", dfUS.formatRawCellContents(12.343, -1, "##.##_ ")); assertEquals("12.34", dfUS.formatRawCellContents(12.343, -1, "##.##_1")); @@ -352,7 +352,7 @@ public class TestDataFormatter { * DataFormatter is the CSV mode preserves spaces */ @Test - public void testPaddingSpacesCSV() { + void testPaddingSpacesCSV() { DataFormatter dfUS = new DataFormatter(Locale.US, true); assertEquals("12.34 ", dfUS.formatRawCellContents(12.343, -1, "##.##_ ")); assertEquals("-12.34 ", dfUS.formatRawCellContents(-12.343, -1, "##.##_ ")); @@ -386,7 +386,7 @@ public class TestDataFormatter { * gets turned into the first letter of the month */ @Test - public void testMMMMM() { + void testMMMMM() { DataFormatter dfUS = new DataFormatter(Locale.US); Calendar c = LocaleUtil.getLocaleCalendar(2010, 5, 1, 2, 0, 0); @@ -400,7 +400,7 @@ public class TestDataFormatter { * Tests that we do AM/PM handling properly */ @Test - public void testAMPM() { + void testAMPM() { DataFormatter dfUS = new DataFormatter(Locale.US); assertEquals("06:00", dfUS.formatRawCellContents(0.25, -1, "hh:mm")); @@ -418,7 +418,7 @@ public class TestDataFormatter { * eg formatting 1 day 4 hours as 28 hours */ @Test - public void testElapsedTime() { + void testElapsedTime() { DataFormatter dfUS = new DataFormatter(Locale.US); double hour = 1.0/24.0; @@ -516,7 +516,7 @@ public class TestDataFormatter { } @Test - public void testDateWindowing() { + void testDateWindowing() { DataFormatter dfUS = new DataFormatter(Locale.US); assertEquals("1899-12-31 00:00:00", dfUS.formatRawCellContents(0.0, -1, "yyyy-mm-dd hh:mm:ss")); @@ -525,7 +525,7 @@ public class TestDataFormatter { } @Test - public void testScientificNotation() { + void testScientificNotation() { DataFormatter dfUS = new DataFormatter(Locale.US); assertEquals("1.23E+01", dfUS.formatRawCellContents(12.343, -1, "0.00E+00")); @@ -534,7 +534,7 @@ public class TestDataFormatter { } @Test - public void testInvalidDate() { + void testInvalidDate() { DataFormatter df1 = new DataFormatter(Locale.US); assertEquals("-1.0", df1.formatRawCellContents(-1, -1, "mm/dd/yyyy")); @@ -544,7 +544,7 @@ public class TestDataFormatter { } @Test - public void testEscapes() { + void testEscapes() { DataFormatter dfUS = new DataFormatter(Locale.US); assertEquals("1901-01-01", dfUS.formatRawCellContents(367.0, -1, "yyyy-mm-dd")); @@ -558,7 +558,7 @@ public class TestDataFormatter { } @Test - public void testFormatsWithPadding() { + void testFormatsWithPadding() { DataFormatter dfUS = new DataFormatter(Locale.US, true); // These request space-padding, based on the cell width @@ -583,7 +583,7 @@ public class TestDataFormatter { } @Test - public void testErrors() throws IOException { + void testErrors() throws IOException { DataFormatter dfUS = new DataFormatter(Locale.US, true); // Create a spreadsheet with some formula errors in it @@ -601,7 +601,7 @@ public class TestDataFormatter { } @Test - public void testBoolean() throws IOException { + void testBoolean() throws IOException { DataFormatter formatter = new DataFormatter(); // Create a spreadsheet with some TRUE/FALSE boolean values in it @@ -624,7 +624,7 @@ public class TestDataFormatter { * should at least handle it as it if wasn't there */ @Test - public void testDatesWithLocales() { + void testDatesWithLocales() { DataFormatter dfUS = new DataFormatter(Locale.US, true); String dateFormatEnglish = "[$-409]mmmm dd yyyy h:mm AM/PM"; @@ -650,7 +650,7 @@ public class TestDataFormatter { */ @Test @Disabled - public void testCustomFormats() { + void testCustomFormats() { DataFormatter dfUS = new DataFormatter(Locale.US, true); String fmt; @@ -668,7 +668,7 @@ public class TestDataFormatter { * ExcelStyleDateFormatter should work for Milliseconds too */ @Test - public void testExcelStyleDateFormatterStringOnMillis() { + void testExcelStyleDateFormatterStringOnMillis() { // Test directly with the .000 style DateFormat formatter1 = new ExcelStyleDateFormatter("ss.000"); @@ -698,7 +698,7 @@ public class TestDataFormatter { } @Test - public void testBug54786() { + void testBug54786() { DataFormatter formatter = new DataFormatter(); String format = "[h]\"\"h\"\" m\"\"m\"\""; assertTrue(DateUtil.isADateFormat(-1,format)); @@ -721,7 +721,7 @@ public class TestDataFormatter { } @Test - public void testIsADateFormat() { + void testIsADateFormat() { // first check some cases that should not be a date, also call multiple times to ensure the cache is used assertFalse(DateUtil.isADateFormat(-1, null)); assertFalse(DateUtil.isADateFormat(-1, null)); @@ -744,7 +744,7 @@ public class TestDataFormatter { @Test - public void testLargeNumbersAndENotation() throws IOException{ + void testLargeNumbersAndENotation() throws IOException{ assertFormatsTo("1E+86", 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999d); assertFormatsTo("1E-84", 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000001d); // Smallest double @@ -794,7 +794,7 @@ public class TestDataFormatter { } @Test - public void testFormulaEvaluation() throws IOException { + void testFormulaEvaluation() throws IOException { Workbook wb = HSSFTestDataSamples.openSampleWorkbook("FormulaEvalTestData.xls"); CellReference ref = new CellReference("D47"); @@ -811,7 +811,7 @@ public class TestDataFormatter { } @Test - public void testFormatWithTrailingDotsUS() { + void testFormatWithTrailingDotsUS() { DataFormatter dfUS = new DataFormatter(Locale.US); assertEquals("1,000,000", dfUS.formatRawCellContents(1000000, -1, "#,##0")); assertEquals("1,000", dfUS.formatRawCellContents(1000000, -1, "#,##0,")); @@ -826,7 +826,7 @@ public class TestDataFormatter { } @Test - public void testFormatWithTrailingDotsOtherLocale() { + void testFormatWithTrailingDotsOtherLocale() { DataFormatter dfIT = new DataFormatter(Locale.ITALY); assertEquals("1.000.000", dfIT.formatRawCellContents(1000000, -1, "#,##0")); assertEquals("1.000", dfIT.formatRawCellContents(1000000, -1, "#,##0,")); @@ -844,7 +844,7 @@ public class TestDataFormatter { * bug 60031: DataFormatter parses months incorrectly when put at the end of date segment */ @Test - public void testBug60031() { + void testBug60031() { // 23-08-2016 08:51:01 which is 42605.368761574071 as double was parsed // with format "yyyy-dd-MM HH:mm:ss" into "2016-23-51 08:51:01". DataFormatter dfUS = new DataFormatter(Locale.US); @@ -866,7 +866,7 @@ public class TestDataFormatter { } @Test - public void testDateFormattingWithLocales() { + void testDateFormattingWithLocales() { // 2017-12-01 09:54:33 which is 42747.412892397523 as double DataFormatter dfDE = new DataFormatter(Locale.GERMANY); DataFormatter dfZH = new DataFormatter(Locale.PRC); @@ -882,7 +882,7 @@ public class TestDataFormatter { * bug 60422 : simple number formats seem ok */ @Test - public void testSimpleNumericFormatsInGermanyLocale() { + void testSimpleNumericFormatsInGermanyLocale() { Locale[] locales = new Locale[] {Locale.GERMANY, Locale.US, Locale.ROOT}; for (Locale locale : locales) { //show that LocaleUtil has no effect on these tests @@ -905,7 +905,7 @@ public class TestDataFormatter { * bug 60422 : DataFormatter has issues with a specific NumberFormat in Germany default locale ≈ */ @Test - public void testBug60422() { + void testBug60422() { char euro = '\u20AC'; DataFormatter df = new DataFormatter(Locale.GERMANY); String formatString = String.format(Locale.ROOT, @@ -916,7 +916,7 @@ public class TestDataFormatter { } @Test - public void testBug62839() { + void testBug62839() { Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); @@ -932,7 +932,7 @@ public class TestDataFormatter { * Bug #63292 */ @Test - public void test1904With4PartFormat() { + void test1904With4PartFormat() { Date date = new Date(); int formatIndex = 105; String formatString1 = "[$-F400]m/d/yy h:mm:ss\\ AM/PM"; @@ -960,7 +960,7 @@ public class TestDataFormatter { } @Test - public void testConcurrentCellFormat() throws Exception { + void testConcurrentCellFormat() throws Exception { DataFormatter formatter1 = new DataFormatter(); DataFormatter formatter2 = new DataFormatter(); doFormatTestSequential(formatter1); @@ -975,7 +975,7 @@ public class TestDataFormatter { * A numeric format string like 0E+0 should be E+ */ @Test - public void testWithEinFormat() throws Exception { + void testWithEinFormat() throws Exception { DataFormatter formatter = new DataFormatter(); // Format string literals with an E in them shouldn't be diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java b/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java index 47f47d3245..a5273a9dc6 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java +++ b/src/testcases/org/apache/poi/ss/usermodel/TestExcelStyleDateFormatter.java @@ -50,7 +50,7 @@ public class TestExcelStyleDateFormatter { * [Bug 60369] Month format 'MMMMM' issue with TEXT-formula and Java 8 */ @Test - public void test60369() { + void test60369() { Map<Locale, String> testMap = initializeLocales(); // We have to set up dates as well. @@ -137,13 +137,13 @@ public class TestExcelStyleDateFormatter { } @Test - public void testConstruct() { + void testConstruct() { new ExcelStyleDateFormatter(EXCEL_DATE_FORMAT, LocaleUtil.getUserLocale()); new ExcelStyleDateFormatter(EXCEL_DATE_FORMAT); } @Test - public void testWithLocale() throws ParseException { + void testWithLocale() throws ParseException { Locale before = LocaleUtil.getUserLocale(); try { LocaleUtil.setUserLocale(Locale.GERMAN); @@ -156,7 +156,7 @@ public class TestExcelStyleDateFormatter { } @Test - public void testWithPattern() throws ParseException { + void testWithPattern() throws ParseException { String dateStr = new ExcelStyleDateFormatter("yyyy|" + EXCEL_DATE_FORMAT + "|").format( DATE_FORMAT.parse("2016-03-26")); assertEquals("2016|M|", dateStr); diff --git a/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java b/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java index 0ae728d52c..74aaa63db6 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java +++ b/src/testcases/org/apache/poi/ss/usermodel/TestFractionFormat.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; */ public final class TestFractionFormat { @Test - public void testSingle() { + void testSingle() { FractionFormat f = new FractionFormat("", "##"); double val = 321.321; String ret = f.format(val); @@ -45,7 +45,7 @@ public final class TestFractionFormat { } @Test - public void testInvalid() { + void testInvalid() { assertThrows(IllegalStateException.class, () -> new FractionFormat("", "9999999999999999999999999999")); } @@ -61,7 +61,7 @@ public final class TestFractionFormat { } @Test - public void testWithBigWholePart() { + void testWithBigWholePart() { FractionFormat f = new FractionFormat("#", "???/???"); assertEquals("10100136259702", f.format(10100136259702d)); @@ -77,7 +77,7 @@ public final class TestFractionFormat { } @Test - public void testTruthFile() throws Exception { + void testTruthFile() throws Exception { File truthFile = HSSFTestDataSamples.getSampleFile("54686_fraction_formats.txt"); try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(truthFile), LocaleUtil.CHARSET_1252))) { Workbook wb = HSSFTestDataSamples.openSampleWorkbook("54686_fraction_formats.xls"); diff --git a/src/testcases/org/apache/poi/ss/util/TestAreaReference.java b/src/testcases/org/apache/poi/ss/util/TestAreaReference.java index 3d7f99839b..40a387ad3c 100644 --- a/src/testcases/org/apache/poi/ss/util/TestAreaReference.java +++ b/src/testcases/org/apache/poi/ss/util/TestAreaReference.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; */ public class TestAreaReference { @Test - public void testWholeColumn() { + void testWholeColumn() { AreaReference oldStyle = AreaReference.getWholeColumn(SpreadsheetVersion.EXCEL97, "A", "B"); assertEquals(0, oldStyle.getFirstCell().getCol()); assertEquals(0, oldStyle.getFirstCell().getRow()); @@ -56,7 +56,7 @@ public class TestAreaReference { } @Test - public void testWholeRow() { + void testWholeRow() { AreaReference oldStyle = AreaReference.getWholeRow(SpreadsheetVersion.EXCEL97, "1", "2"); assertEquals(0, oldStyle.getFirstCell().getCol()); assertEquals(0, oldStyle.getFirstCell().getRow()); @@ -71,7 +71,7 @@ public class TestAreaReference { } @Test - public void test62810() { + void test62810() { final Workbook wb = new HSSFWorkbook(); final Sheet sheet = wb.createSheet("Ctor test"); final String sheetName = sheet.getSheetName(); diff --git a/src/testcases/org/apache/poi/ss/util/TestCellAddress.java b/src/testcases/org/apache/poi/ss/util/TestCellAddress.java index dffeff5ea8..fa67df58fc 100644 --- a/src/testcases/org/apache/poi/ss/util/TestCellAddress.java +++ b/src/testcases/org/apache/poi/ss/util/TestCellAddress.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; */ public final class TestCellAddress { @Test - public void testConstructors() { + void testConstructors() { CellAddress cellAddress; final CellReference cellRef = new CellReference("Sheet1", 0, 0, true, true); final String address = "A1"; @@ -49,19 +49,19 @@ public final class TestCellAddress { } @Test - public void testFormatAsString() { + void testFormatAsString() { assertEquals("A1", CellAddress.A1.formatAsString()); } @Test - public void testEquals() { + void testEquals() { assertEquals(new CellReference(6, 4), new CellReference(6, 4)); assertNotEquals(new CellReference(4, 6), new CellReference(6, 4)); } @SuppressWarnings("EqualsWithItself") @Test - public void testCompareTo() { + void testCompareTo() { final CellAddress A1 = new CellAddress(0, 0); final CellAddress A2 = new CellAddress(1, 0); final CellAddress B1 = new CellAddress(0, 1); @@ -95,13 +95,13 @@ public final class TestCellAddress { } @Test - public void testGetRow() { + void testGetRow() { final CellAddress addr = new CellAddress(6, 4); assertEquals(6, addr.getRow()); } @Test - public void testGetColumn() { + void testGetColumn() { final CellAddress addr = new CellAddress(6, 4); assertEquals(4, addr.getColumn()); } diff --git a/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java b/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java index bdf715d4cb..03da3fed0d 100644 --- a/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java +++ b/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java @@ -41,7 +41,7 @@ public final class TestCellRangeAddress { }; @Test - public void testLoad() { + void testLoad() { CellRangeAddress ref = new CellRangeAddress( TestcaseRecordInputStream.create(0x000, data)); assertEquals(2, ref.getFirstRow()); @@ -53,14 +53,14 @@ public final class TestCellRangeAddress { } @Test - public void testLoadInvalid() { + void testLoadInvalid() { RuntimeException e = assertThrows(RuntimeException.class, () -> new CellRangeAddress(TestcaseRecordInputStream.create(0x000, new byte[]{(byte) 0x02}))); assertTrue(e.getMessage().contains("Ran out of data")); } @Test - public void testStore() throws IOException { + void testStore() throws IOException { CellRangeAddress ref = new CellRangeAddress(0, 0, 0, 0); byte[] recordBytes; @@ -93,26 +93,26 @@ public final class TestCellRangeAddress { } @Test - public void testCreateIllegal() { + void testCreateIllegal() { // for some combinations we expected exceptions assertThrows(IllegalArgumentException.class, () -> new CellRangeAddress(1, 0, 0, 0)); assertThrows(IllegalArgumentException.class, () -> new CellRangeAddress(0, 0, 1, 0)); } @Test - public void testCopy() throws IOException { + void testCopy() throws IOException { CellRangeAddress ref = new CellRangeAddress(1, 2, 3, 4); CellRangeAddress copy = ref.copy(); assertEquals(ref.toString(), copy.toString()); } @Test - public void testGetEncodedSize() { + void testGetEncodedSize() { assertEquals(2*CellRangeAddress.ENCODED_SIZE, CellRangeAddress.getEncodedSize(2)); } @Test - public void testFormatAsString() { + void testFormatAsString() { CellRangeAddress ref = new CellRangeAddress(1, 2, 3, 4); assertEquals("D2:E3", ref.formatAsString()); @@ -167,7 +167,7 @@ public final class TestCellRangeAddress { } @Test - public void testEquals() { + void testEquals() { final CellRangeAddress ref1 = new CellRangeAddress(1, 2, 3, 4); final CellRangeAddress ref2 = new CellRangeAddress(1, 2, 3, 4); assertEquals(ref1, ref2); @@ -187,7 +187,7 @@ public final class TestCellRangeAddress { } @Test - public void testGetMinMaxRow() { + void testGetMinMaxRow() { final CellRangeAddress ref = new CellRangeAddress(1, 2, 3, 4); assertEquals(1, ref.getMinRow()); assertEquals(2, ref.getMaxRow()); @@ -199,7 +199,7 @@ public final class TestCellRangeAddress { } @Test - public void testGetMinMaxColumn() { + void testGetMinMaxColumn() { final CellRangeAddress ref = new CellRangeAddress(1, 2, 3, 4); assertEquals(3, ref.getMinColumn()); assertEquals(4, ref.getMaxColumn()); @@ -211,7 +211,7 @@ public final class TestCellRangeAddress { } @Test - public void testIntersects() { + void testIntersects() { final CellRangeAddress baseRegion = new CellRangeAddress(0, 1, 0, 1); final CellRangeAddress duplicateRegion = new CellRangeAddress(0, 1, 0, 1); diff --git a/src/testcases/org/apache/poi/ss/util/TestCellRangeUtil.java b/src/testcases/org/apache/poi/ss/util/TestCellRangeUtil.java index 0de86405da..9d6c42cc64 100644 --- a/src/testcases/org/apache/poi/ss/util/TestCellRangeUtil.java +++ b/src/testcases/org/apache/poi/ss/util/TestCellRangeUtil.java @@ -42,7 +42,7 @@ public final class TestCellRangeUtil { private static final CellRangeAddress A1_A2 = new CellRangeAddress(0, 1, 0, 0); @Test - public void testMergeCellRanges() { + void testMergeCellRanges() { // Note that the order of the output array elements does not matter // And that there may be more than one valid outputs for a given input. Any valid output is accepted. // POI should use a strategy that is consistent and predictable (it currently is not). diff --git a/src/testcases/org/apache/poi/ss/util/TestCellReference.java b/src/testcases/org/apache/poi/ss/util/TestCellReference.java index b2222986d0..d3a209f680 100644 --- a/src/testcases/org/apache/poi/ss/util/TestCellReference.java +++ b/src/testcases/org/apache/poi/ss/util/TestCellReference.java @@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test; */ public final class TestCellReference { @Test - public void testConstructors() { + void testConstructors() { CellReference cellReference; final String sheet = "Sheet1"; final String cellRef = "A1"; @@ -87,7 +87,7 @@ public final class TestCellReference { } @Test - public void testCtorFromCell() { + void testCtorFromCell() { Cell cell = mock(Cell.class, RETURNS_DEEP_STUBS); when(cell.getSheet().getSheetName()).thenReturn("sheet"); @@ -100,7 +100,7 @@ public final class TestCellReference { } @Test - public void testFormatAsString() { + void testFormatAsString() { CellReference cellReference; cellReference = new CellReference(null, 0, 0, false, false); @@ -128,7 +128,7 @@ public final class TestCellReference { } @Test - public void testGetCellRefParts() { + void testGetCellRefParts() { CellReference cellReference; String[] parts; @@ -196,7 +196,7 @@ public final class TestCellReference { } @Test - public void testGetColNumFromRef() { + void testGetColNumFromRef() { String cellRef = "A1"; CellReference cellReference = new CellReference(cellRef); assertEquals(0, cellReference.getCol()); @@ -240,7 +240,7 @@ public final class TestCellReference { } @Test - public void testGetRowNumFromRef() { + void testGetRowNumFromRef() { String cellRef = "A1"; CellReference cellReference = new CellReference(cellRef); assertEquals(0, cellReference.getRow()); @@ -255,7 +255,7 @@ public final class TestCellReference { } @Test - public void testConvertNumToColString() { + void testConvertNumToColString() { short col = 702; String collRef = new CellReference(0, col).formatAsString(); assertEquals("AAA1", collRef); @@ -274,7 +274,7 @@ public final class TestCellReference { } @Test - public void testBadRowNumber() { + void testBadRowNumber() { SpreadsheetVersion v97 = SpreadsheetVersion.EXCEL97; SpreadsheetVersion v2007 = SpreadsheetVersion.EXCEL2007; @@ -295,7 +295,7 @@ public final class TestCellReference { } @Test - public void testInvalidReference() { + void testInvalidReference() { for (String s : new String[]{"Sheet1!#REF!", "'MySheetName'!#REF!", "#REF!"}) { assertThrows(IllegalArgumentException.class, () -> new CellReference(s), "Shouldn't be able to create a #REF! "+s); @@ -310,7 +310,7 @@ public final class TestCellReference { } @Test - public void testConvertColStringToIndex() { + void testConvertColStringToIndex() { assertEquals(0, CellReference.convertColStringToIndex("A")); assertEquals(1, CellReference.convertColStringToIndex("B")); assertEquals(14, CellReference.convertColStringToIndex("O")); @@ -326,7 +326,7 @@ public final class TestCellReference { } @Test - public void testConvertNumColColString() { + void testConvertNumColColString() { assertEquals("A", CellReference.convertNumToColString(0)); assertEquals("AV", CellReference.convertNumToColString(47)); assertEquals("AW", CellReference.convertNumToColString(48)); @@ -362,13 +362,13 @@ public final class TestCellReference { } @Test - public void testToString() { + void testToString() { CellReference ref = new CellReference("'Sheet 1'!A5"); assertEquals("org.apache.poi.ss.util.CellReference ['Sheet 1'!A5]", ref.toString()); } @Test - public void testEqualsAndHashCode() { + void testEqualsAndHashCode() { CellReference ref1 = new CellReference("'Sheet 1'!A5"); CellReference ref2 = new CellReference("Sheet 1", 4, 0, false, false); assertEquals(ref1, ref2); @@ -455,7 +455,7 @@ public final class TestCellReference { } @Test - public void test62828() { + void test62828() { final Workbook wb = new HSSFWorkbook(); final Sheet sheet = wb.createSheet("Ctor test"); final String sheetName = sheet.getSheetName(); diff --git a/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java b/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java index 5a6bb29ad0..fb5e1169e2 100644 --- a/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java +++ b/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java @@ -125,7 +125,7 @@ public final class TestDateFormatConverter { } @Test - public void testJavaDateFormatsInExcel() throws Exception { + void testJavaDateFormatsInExcel() throws Exception { Date date = new Date(); outputLocaleDataFormats(date, true, false, DateFormat.DEFAULT, "Default" ); @@ -148,19 +148,19 @@ public final class TestDateFormatConverter { } @Test - public void testJDK8EmptyLocale() { + void testJDK8EmptyLocale() { // JDK 8 seems to add an empty locale-string to the list returned via DateFormat.getAvailableLocales() // therefore we now cater for this special locale as well DateFormatConverter.getPrefixForLocale(new Locale("")); } @Test - public void testJDK11MyLocale() { + void testJDK11MyLocale() { DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.forLanguageTag("my")); } @Test - public void testAllKnownLocales() { + void testAllKnownLocales() { Pattern p = Pattern.compile("\\[\\$-(\\p{XDigit}+)]"); Set<String> excludeList = Stream.of( diff --git a/src/testcases/org/apache/poi/ss/util/TestDateParser.java b/src/testcases/org/apache/poi/ss/util/TestDateParser.java index 7b86ff1102..0af410571e 100644 --- a/src/testcases/org/apache/poi/ss/util/TestDateParser.java +++ b/src/testcases/org/apache/poi/ss/util/TestDateParser.java @@ -39,14 +39,14 @@ public class TestDateParser { // fail when is invalid date "13/13/13" }) - public void testFailWhenInvalidDate(String invalidDate) { + void testFailWhenInvalidDate(String invalidDate) { EvaluationException e = assertThrows(EvaluationException.class, () -> DateParser.parseDate(invalidDate), "Shouldn't parse " + invalidDate); assertEquals(ErrorEval.VALUE_INVALID, e.getErrorEval()); } @Test - public void testShouldParseValidDate() throws EvaluationException { + void testShouldParseValidDate() throws EvaluationException { Calendar expDate = LocaleUtil.getLocaleCalendar(1984, Calendar.OCTOBER, 20); Calendar actDate = DateParser.parseDate("1984/10/20"); assertEquals(expDate, actDate, @@ -55,7 +55,7 @@ public class TestDateParser { } @Test - public void testShouldIgnoreTimestamp() throws EvaluationException { + void testShouldIgnoreTimestamp() throws EvaluationException { Calendar expDate = LocaleUtil.getLocaleCalendar(1984, Calendar.OCTOBER, 20); Calendar actDate = DateParser.parseDate("1984/10/20 12:34:56"); assertEquals(expDate, actDate, diff --git a/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java b/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java index 7b285a60b4..937b53a036 100644 --- a/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java +++ b/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java @@ -32,7 +32,7 @@ public final class TestExpandedDouble { private static final BigInteger BIG_POW_10 = BigInteger.valueOf(1000000000); @Test - public void testNegative() { + void testNegative() { ExpandedDouble hd = new ExpandedDouble(0xC010000000000000L); assertNotEquals(-2046, hd.getBinaryExponent(), "identified bug - sign bit not masked out of exponent"); assertEquals(2, hd.getBinaryExponent()); @@ -42,7 +42,7 @@ public final class TestExpandedDouble { } @Test - public void testSubnormal() { + void testSubnormal() { ExpandedDouble hd = new ExpandedDouble(0x0000000000000001L); assertNotEquals(-1023, hd.getBinaryExponent(), "identified bug - subnormal numbers not decoded properly"); assertEquals(-1086, hd.getBinaryExponent()); @@ -55,7 +55,7 @@ public final class TestExpandedDouble { * Tests specific values for conversion from {@link ExpandedDouble} to {@link NormalisedDecimal} and back */ @Test - public void testRoundTripShifting() { + void testRoundTripShifting() { long[] rawValues = { 0x4010000000000004L, 0x7010000000000004L, diff --git a/src/testcases/org/apache/poi/ss/util/TestNumberComparer.java b/src/testcases/org/apache/poi/ss/util/TestNumberComparer.java index abd9a01177..d5f95cf407 100644 --- a/src/testcases/org/apache/poi/ss/util/TestNumberComparer.java +++ b/src/testcases/org/apache/poi/ss/util/TestNumberComparer.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; public final class TestNumberComparer { @Test - public void testAllComparisonExamples() { + void testAllComparisonExamples() { ComparisonExample[] examples = NumberComparisonExamples.getComparisonExamples(); boolean success = true; @@ -47,7 +47,7 @@ public final class TestNumberComparer { } @Test - public void testRoundTripOnComparisonExamples() { + void testRoundTripOnComparisonExamples() { ComparisonExample[] examples = NumberComparisonExamples.getComparisonExamples(); for(int i=0;i<examples.length; i++) { ComparisonExample ce = examples[i]; @@ -66,7 +66,7 @@ public final class TestNumberComparer { * The actual example from bug 47598 */ @Test - public void testSpecificExampleA() { + void testSpecificExampleA() { double a = 0.06-0.01; double b = 0.05; assertNotEquals(a, b, 0.0); @@ -77,7 +77,7 @@ public final class TestNumberComparer { * The example from the nabble posting */ @Test - public void testSpecificExampleB() { + void testSpecificExampleB() { double a = 1+1.0028-0.9973; double b = 1.0055; assertNotEquals(a, b, 0.0); diff --git a/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java b/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java index feb8fa8b0f..0cf5d6f818 100644 --- a/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java +++ b/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java @@ -36,7 +36,7 @@ public final class TestNumberToTextConverter { * up to contain the rendering as produced by Excel. */ @Test - public void testAll() { + void testAll() { ExampleConversion[] examples = NumberToTextConversionExamples.getExampleConversions(); for (ExampleConversion example : examples) { @@ -84,7 +84,7 @@ public final class TestNumberToTextConverter { } @Test - public void testSimpleRendering_bug56156() { + void testSimpleRendering_bug56156() { double dResult = 0.05+0.01; // values chosen to produce rounding anomaly String actualText = NumberToTextConverter.toText(dResult); String jdkText = Double.toString(dResult); diff --git a/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java b/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java index 0951e72afa..895766c7b3 100644 --- a/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java +++ b/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java @@ -46,7 +46,7 @@ public final class TestSheetBuilder { }; @Test - public void testNotCreateEmptyCells() throws IOException { + void testNotCreateEmptyCells() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = new SheetBuilder(wb, testData).build(); @@ -74,7 +74,7 @@ public final class TestSheetBuilder { } @Test - public void testEmptyCells() throws IOException { + void testEmptyCells() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = new SheetBuilder(wb, testData).setCreateEmptyCells(true).build(); @@ -85,7 +85,7 @@ public final class TestSheetBuilder { } @Test - public void testSheetName() throws IOException { + void testSheetName() throws IOException { final String sheetName = "TEST SHEET NAME"; try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = new SheetBuilder(wb, testData).setSheetName(sheetName).build(); diff --git a/src/testcases/org/apache/poi/ss/util/TestSheetUtil.java b/src/testcases/org/apache/poi/ss/util/TestSheetUtil.java index ebf84dc424..709b6deb9b 100644 --- a/src/testcases/org/apache/poi/ss/util/TestSheetUtil.java +++ b/src/testcases/org/apache/poi/ss/util/TestSheetUtil.java @@ -38,7 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public final class TestSheetUtil { @Test - public void testCellWithMerges() throws Exception { + void testCellWithMerges() throws Exception { try (Workbook wb = new HSSFWorkbook()) { Sheet s = wb.createSheet(); @@ -90,7 +90,7 @@ public final class TestSheetUtil { } @Test - public void testCanComputeWidthHSSF() throws IOException { + void testCanComputeWidthHSSF() throws IOException { try (Workbook wb = new HSSFWorkbook()) { // cannot check on result because on some machines we get back false here! SheetUtil.canComputeColumnWidth(wb.getFontAt(0)); @@ -98,7 +98,7 @@ public final class TestSheetUtil { } @Test - public void testGetCellWidthEmpty() throws IOException { + void testGetCellWidthEmpty() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("sheet"); Row row = sheet.createRow(0); @@ -110,7 +110,7 @@ public final class TestSheetUtil { } @Test - public void testGetCellWidthString() throws IOException { + void testGetCellWidthString() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("sheet"); Row row = sheet.createRow(0); @@ -123,7 +123,7 @@ public final class TestSheetUtil { } @Test - public void testGetCellWidthNumber() throws IOException { + void testGetCellWidthNumber() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("sheet"); Row row = sheet.createRow(0); @@ -136,7 +136,7 @@ public final class TestSheetUtil { } @Test - public void testGetCellWidthBoolean() throws IOException { + void testGetCellWidthBoolean() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("sheet"); Row row = sheet.createRow(0); @@ -149,7 +149,7 @@ public final class TestSheetUtil { } @Test - public void testGetColumnWidthString() throws IOException { + void testGetColumnWidthString() throws IOException { try (Workbook wb = new HSSFWorkbook()) { Sheet sheet = wb.createSheet("sheet"); Row row = sheet.createRow(0); diff --git a/src/testcases/org/apache/poi/ss/util/TestWorkbookUtil.java b/src/testcases/org/apache/poi/ss/util/TestWorkbookUtil.java index aa9b37ecac..3725c63940 100644 --- a/src/testcases/org/apache/poi/ss/util/TestWorkbookUtil.java +++ b/src/testcases/org/apache/poi/ss/util/TestWorkbookUtil.java @@ -32,7 +32,7 @@ public final class TestWorkbookUtil { * {@link org.apache.poi.hssf.record.TestBoundSheetRecord#testValidNames()} */ @Test - public void testCreateSafeNames() { + void testCreateSafeNames() { String p = "Sheet1"; String actual = WorkbookUtil.createSafeSheetName(p); diff --git a/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java b/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java index 1a84d13e0f..b833efe370 100644 --- a/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java +++ b/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java @@ -36,7 +36,7 @@ public class TestCellWalk { }; @Test - public void testNotTraverseEmptyCells() { + void testNotTraverseEmptyCells() { Workbook wb = new HSSFWorkbook(); Sheet sheet = new SheetBuilder(wb, testData).build(); CellRangeAddress range = CellRangeAddress.valueOf("A1:C3"); diff --git a/src/testcases/org/apache/poi/util/TestArrayUtil.java b/src/testcases/org/apache/poi/util/TestArrayUtil.java index 001d5c0595..8ad68e707d 100644 --- a/src/testcases/org/apache/poi/util/TestArrayUtil.java +++ b/src/testcases/org/apache/poi/util/TestArrayUtil.java @@ -40,7 +40,7 @@ public class TestArrayUtil { * Test to ensure that arrayMoveWithin works as expected */ @Test - public void testArrayMoveWithin() { + void testArrayMoveWithin() { // moveFrom, moveTo, numToMove, values... Integer[][] data = { // Moving to a later point in the array diff --git a/src/testcases/org/apache/poi/util/TestBitField.java b/src/testcases/org/apache/poi/util/TestBitField.java index d075c98fb0..2834466979 100644 --- a/src/testcases/org/apache/poi/util/TestBitField.java +++ b/src/testcases/org/apache/poi/util/TestBitField.java @@ -31,7 +31,7 @@ public final class TestBitField { private static BitField bf_single = BitFieldFactory.getInstance(0x4000); @Test - public void testGetValue() { + void testGetValue() { assertEquals(bf_multi.getValue(-1), 127); assertEquals(bf_multi.getValue(0), 0); assertEquals(bf_single.getValue(-1), 1); @@ -39,7 +39,7 @@ public final class TestBitField { } @Test - public void testGetShortValue() { + void testGetShortValue() { assertEquals(bf_multi.getShortValue(( short ) -1), ( short ) 127); assertEquals(bf_multi.getShortValue(( short ) 0), ( short ) 0); assertEquals(bf_single.getShortValue(( short ) -1), ( short ) 1); @@ -47,7 +47,7 @@ public final class TestBitField { } @Test - public void testGetRawValue() { + void testGetRawValue() { assertEquals(bf_multi.getRawValue(-1), 0x3F80); assertEquals(bf_multi.getRawValue(0), 0); assertEquals(bf_single.getRawValue(-1), 0x4000); @@ -55,7 +55,7 @@ public final class TestBitField { } @Test - public void testGetShortRawValue() { + void testGetShortRawValue() { assertEquals(bf_multi.getShortRawValue(( short ) -1), ( short ) 0x3F80); assertEquals(bf_multi.getShortRawValue(( short ) 0), ( short ) 0); @@ -65,7 +65,7 @@ public final class TestBitField { } @Test - public void testIsSet() { + void testIsSet() { assertFalse(bf_multi.isSet(0)); for (int j = 0x80; j <= 0x3F80; j += 0x80) { @@ -76,7 +76,7 @@ public final class TestBitField { } @Test - public void testIsAllSet() { + void testIsAllSet() { for (int j = 0; j < 0x3F80; j += 0x80) { assertFalse(bf_multi.isAllSet(j)); @@ -87,7 +87,7 @@ public final class TestBitField { } @Test - public void testSetValue() { + void testSetValue() { for (int j = 0; j < 128; j++) { assertEquals(bf_multi.getValue(bf_multi.setValue(0, j)), j); @@ -107,7 +107,7 @@ public final class TestBitField { } @Test - public void testSetShortValue() { + void testSetShortValue() { for (int j = 0; j < 128; j++) { assertEquals(bf_multi @@ -135,7 +135,7 @@ public final class TestBitField { } @Test - public void testByte() { + void testByte() { assertEquals(1, BitFieldFactory.getInstance(1).setByteBoolean(( byte ) 0, true)); assertEquals(2, BitFieldFactory.getInstance(2).setByteBoolean(( byte ) 0, true)); assertEquals(4, BitFieldFactory.getInstance(4).setByteBoolean(( byte ) 0, true)); @@ -162,31 +162,31 @@ public final class TestBitField { } @Test - public void testClear() { + void testClear() { assertEquals(bf_multi.clear(-1), 0xFFFFC07F); assertEquals(bf_single.clear(-1), 0xFFFFBFFF); } @Test - public void testClearShort() { + void testClearShort() { assertEquals(bf_multi.clearShort(( short ) -1), ( short ) 0xC07F); assertEquals(bf_single.clearShort(( short ) -1), ( short ) 0xBFFF); } @Test - public void testSet() { + void testSet() { assertEquals(bf_multi.set(0), 0x3F80); assertEquals(bf_single.set(0), 0x4000); } @Test - public void testSetShort() { + void testSetShort() { assertEquals(bf_multi.setShort(( short ) 0), ( short ) 0x3F80); assertEquals(bf_single.setShort(( short ) 0), ( short ) 0x4000); } @Test - public void testSetBoolean() { + void testSetBoolean() { assertEquals(bf_multi.set(0), bf_multi.setBoolean(0, true)); assertEquals(bf_single.set(0), bf_single.setBoolean(0, true)); assertEquals(bf_multi.clear(-1), bf_multi.setBoolean(-1, false)); @@ -194,7 +194,7 @@ public final class TestBitField { } @Test - public void testSetShortBoolean() { + void testSetShortBoolean() { assertEquals(bf_multi.setShort(( short ) 0), bf_multi.setShortBoolean(( short ) 0, true)); assertEquals(bf_single.setShort(( short ) 0), @@ -206,7 +206,7 @@ public final class TestBitField { } @Test - public void testSetLargeValues() { + void testSetLargeValues() { final BitField bf1 = new BitField(0xF), bf2 = new BitField(0xF0000000); int a = 0; a = bf1.setValue(a, 9); diff --git a/src/testcases/org/apache/poi/util/TestByteField.java b/src/testcases/org/apache/poi/util/TestByteField.java index 53e9b95738..782a87b032 100644 --- a/src/testcases/org/apache/poi/util/TestByteField.java +++ b/src/testcases/org/apache/poi/util/TestByteField.java @@ -36,7 +36,7 @@ public final class TestByteField { }; @Test - public void testConstructors() { + void testConstructors() { try { new ByteField(-1); fail("Should have caught ArrayIndexOutOfBoundsException"); @@ -80,7 +80,7 @@ public final class TestByteField { } @Test - public void testSet() { + void testSet() { ByteField field = new ByteField(0); byte[] array = new byte[ 1 ]; @@ -95,7 +95,7 @@ public final class TestByteField { } @Test - public void testReadFromBytes() { + void testReadFromBytes() { ByteField field = new ByteField(1); byte[] array = new byte[ 1 ]; @@ -114,7 +114,7 @@ public final class TestByteField { } @Test - public void testReadFromStream() throws IOException { + void testReadFromStream() throws IOException { ByteField field = new ByteField(0); ByteArrayInputStream stream = new ByteArrayInputStream(_test_array.clone()); @@ -125,7 +125,7 @@ public final class TestByteField { } @Test - public void testWriteToBytes() { + void testWriteToBytes() { ByteField field = new ByteField(0); byte[] array = new byte[ 1 ]; diff --git a/src/testcases/org/apache/poi/util/TestHexDump.java b/src/testcases/org/apache/poi/util/TestHexDump.java index d6a7d5d0e4..ef4a1539ec 100644 --- a/src/testcases/org/apache/poi/util/TestHexDump.java +++ b/src/testcases/org/apache/poi/util/TestHexDump.java @@ -48,7 +48,7 @@ public class TestHexDump { } @Test - public void testDump() throws IOException { + void testDump() throws IOException { byte[] testArray = testArray(); ByteArrayOutputStream streamAct = new ByteArrayOutputStream(); HexDump.dump(testArray, 0, streamAct, 0); @@ -133,7 +133,7 @@ public class TestHexDump { } @Test - public void testToHex() { + void testToHex() { assertEquals("000A", HexDump.toHex((short)0xA)); assertEquals("0A", HexDump.toHex((byte)0xA)); @@ -158,7 +158,7 @@ public class TestHexDump { } @Test - public void testDumpToString() { + void testDumpToString() { byte[] testArray = testArray(); String dump = HexDump.dump(testArray, 0, 0); //System.out.println("Hex: \n" + dump); @@ -170,19 +170,19 @@ public class TestHexDump { } @Test - public void testDumpToStringOutOfIndex1() { + void testDumpToStringOutOfIndex1() { assertThrows(ArrayIndexOutOfBoundsException.class, () -> HexDump.dump(new byte[1], 0, -1)); assertThrows(ArrayIndexOutOfBoundsException.class, () -> HexDump.dump(new byte[1], 0, 2)); assertThrows(ArrayIndexOutOfBoundsException.class, () -> HexDump.dump(new byte[1], 0, 1)); } @Test - public void testDumpToStringNoDataEOL1() { + void testDumpToStringNoDataEOL1() { HexDump.dump(new byte[0], 0, 1); } @Test - public void testDumpToStringNoDataEOL2() { + void testDumpToStringNoDataEOL2() { HexDump.dump(new byte[0], 0, 0); } diff --git a/src/testcases/org/apache/poi/util/TestIOUtils.java b/src/testcases/org/apache/poi/util/TestIOUtils.java index 6a7710484c..a4a3513ba5 100644 --- a/src/testcases/org/apache/poi/util/TestIOUtils.java +++ b/src/testcases/org/apache/poi/util/TestIOUtils.java @@ -72,61 +72,61 @@ public final class TestIOUtils { } @Test - public void testPeekFirst8Bytes() throws Exception { + void testPeekFirst8Bytes() throws Exception { assertArrayEquals("01234567".getBytes(StandardCharsets.UTF_8), IOUtils.peekFirst8Bytes(new ByteArrayInputStream("0123456789".getBytes(StandardCharsets.UTF_8)))); } @Test - public void testPeekFirst8BytesWithPushbackInputStream() throws Exception { + void testPeekFirst8BytesWithPushbackInputStream() throws Exception { assertArrayEquals("01234567".getBytes(StandardCharsets.UTF_8), IOUtils.peekFirst8Bytes(new PushbackInputStream(new ByteArrayInputStream("0123456789".getBytes(StandardCharsets.UTF_8)), 8))); } @Test - public void testPeekFirst8BytesTooLessAvailable() throws Exception { + void testPeekFirst8BytesTooLessAvailable() throws Exception { assertArrayEquals(new byte[] { 1, 2, 3, 0, 0, 0, 0, 0}, IOUtils.peekFirst8Bytes(data123())); } @Test - public void testPeekFirst8BytesEmpty() { + void testPeekFirst8BytesEmpty() { assertThrows(EmptyFileException.class, () -> IOUtils.peekFirst8Bytes(new ByteArrayInputStream(new byte[0]))); } @Test - public void testToByteArray() throws Exception { + void testToByteArray() throws Exception { assertArrayEquals(new byte[] { 1, 2, 3}, IOUtils.toByteArray(data123())); } @Test - public void testToByteArrayToSmall() { + void testToByteArrayToSmall() { assertThrows(IOException.class, () -> IOUtils.toByteArray(data123(), 10)); } @Test - public void testToByteArrayMaxLengthToSmall() { + void testToByteArrayMaxLengthToSmall() { assertThrows(IOException.class, () -> IOUtils.toByteArray(data123(), 10, 10)); } @Test - public void testToByteArrayNegativeLength() { + void testToByteArrayNegativeLength() { assertThrows(RecordFormatException.class, () -> IOUtils.toByteArray(data123(), -1)); } @Test - public void testToByteArrayNegativeMaxLength() { + void testToByteArrayNegativeMaxLength() { assertThrows(RecordFormatException.class, () -> IOUtils.toByteArray(data123(), 10, -1)); } @Test - public void testToByteArrayByteBuffer() { + void testToByteArrayByteBuffer() { assertArrayEquals(new byte[] { 1, 2, 3}, IOUtils.toByteArray(ByteBuffer.wrap(new byte[]{1, 2, 3}), 10)); } @Test - public void testToByteArrayByteBufferNonArray() { + void testToByteArrayByteBufferNonArray() { ByteBuffer buffer = ByteBuffer.allocate(3); buffer.put(new byte[] { 1, 2, 3}); buffer.position(0); @@ -138,13 +138,13 @@ public final class TestIOUtils { } @Test - public void testToByteArrayByteBufferToSmall() { + void testToByteArrayByteBufferToSmall() { assertArrayEquals(new byte[] { 1, 2, 3, 4, 5, 6, 7}, IOUtils.toByteArray(ByteBuffer.wrap(new byte[]{1, 2, 3, 4, 5, 6, 7}), 3)); } @Test - public void testSkipFully() throws IOException { + void testSkipFully() throws IOException { try (InputStream is = new FileInputStream(TMP)) { long skipped = IOUtils.skipFully(is, 20000L); assertEquals(LENGTH, skipped); @@ -152,7 +152,7 @@ public final class TestIOUtils { } @Test - public void testSkipFullyGtIntMax() throws IOException { + void testSkipFullyGtIntMax() throws IOException { try (InputStream is = new FileInputStream(TMP)) { long skipped = IOUtils.skipFully(is, Integer.MAX_VALUE + 20000L); assertEquals(LENGTH, skipped); @@ -160,7 +160,7 @@ public final class TestIOUtils { } @Test - public void testSkipFullyByteArray() throws IOException { + void testSkipFullyByteArray() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (InputStream is = new FileInputStream(TMP)) { IOUtils.copy(is, bos); @@ -170,7 +170,7 @@ public final class TestIOUtils { } @Test - public void testSkipFullyByteArrayGtIntMax() throws IOException { + void testSkipFullyByteArrayGtIntMax() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (InputStream is = new FileInputStream(TMP)) { IOUtils.copy(is, bos); @@ -180,18 +180,18 @@ public final class TestIOUtils { } @Test - public void testSkipFullyBug61294() throws IOException { + void testSkipFullyBug61294() throws IOException { IOUtils.skipFully(new ByteArrayInputStream(new byte[0]), 1); } @Test - public void testZeroByte() throws IOException { + void testZeroByte() throws IOException { long skipped = IOUtils.skipFully((new ByteArrayInputStream(new byte[0])), 100); assertEquals(-1L, skipped); } @Test - public void testSkipZero() throws IOException { + void testSkipZero() throws IOException { try (InputStream is = new FileInputStream(TMP)) { long skipped = IOUtils.skipFully(is, 0); assertEquals(0, skipped); @@ -199,21 +199,21 @@ public final class TestIOUtils { } @Test - public void testSkipNegative() throws IOException { + void testSkipNegative() throws IOException { try (InputStream is = new FileInputStream(TMP)) { assertThrows(IllegalArgumentException.class, () -> IOUtils.skipFully(is, -1)); } } @Test - public void testMaxLengthTooLong() throws IOException { + void testMaxLengthTooLong() throws IOException { try (InputStream is = new FileInputStream(TMP)) { assertThrows(RecordFormatException.class, () -> IOUtils.toByteArray(is, Integer.MAX_VALUE, 100)); } } @Test - public void testMaxLengthIgnored() throws IOException { + void testMaxLengthIgnored() throws IOException { try (InputStream is = new FileInputStream(TMP)) { IOUtils.toByteArray(is, 90, Integer.MAX_VALUE); IOUtils.toByteArray(is, 90, 100); @@ -222,20 +222,20 @@ public final class TestIOUtils { } @Test - public void testMaxLengthInvalid() throws IOException { + void testMaxLengthInvalid() throws IOException { try (InputStream is = new FileInputStream(TMP)) { assertThrows(RecordFormatException.class, () -> IOUtils.toByteArray(is, 90, 80)); } } @Test - public void testWonkyInputStream() throws IOException { + void testWonkyInputStream() throws IOException { long skipped = IOUtils.skipFully(new WonkyInputStream(), 10000); assertEquals(10000, skipped); } @Test - public void testSetMaxOverride() throws IOException { + void testSetMaxOverride() throws IOException { ByteArrayInputStream stream = new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8)); byte[] bytes = IOUtils.toByteArray(stream); assertNotNull(bytes); @@ -243,7 +243,7 @@ public final class TestIOUtils { } @Test - public void testSetMaxOverrideLimit() throws IOException { + void testSetMaxOverrideLimit() throws IOException { IOUtils.setByteArrayMaxOverride(30 * 1024 * 1024); try { ByteArrayInputStream stream = new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8)); @@ -256,7 +256,7 @@ public final class TestIOUtils { } @Test - public void testSetMaxOverrideOverLimit() { + void testSetMaxOverrideOverLimit() { IOUtils.setByteArrayMaxOverride(2); try { ByteArrayInputStream stream = new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8)); @@ -267,7 +267,7 @@ public final class TestIOUtils { } @Test - public void testSetMaxOverrideWithLength() throws IOException { + void testSetMaxOverrideWithLength() throws IOException { ByteArrayInputStream stream = new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8)); byte[] bytes = IOUtils.toByteArray(stream, 3, 100); assertNotNull(bytes); @@ -275,7 +275,7 @@ public final class TestIOUtils { } @Test - public void testSetMaxOverrideLimitWithLength() throws IOException { + void testSetMaxOverrideLimitWithLength() throws IOException { IOUtils.setByteArrayMaxOverride(30 * 1024 * 1024); try { ByteArrayInputStream stream = new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8)); @@ -288,7 +288,7 @@ public final class TestIOUtils { } @Test - public void testSetMaxOverrideOverLimitWithLength() throws IOException { + void testSetMaxOverrideOverLimitWithLength() throws IOException { IOUtils.setByteArrayMaxOverride(2); try { ByteArrayInputStream stream = new ByteArrayInputStream("abc".getBytes(StandardCharsets.UTF_8)); @@ -299,14 +299,14 @@ public final class TestIOUtils { } @Test - public void testSafelyAllocate() { + void testSafelyAllocate() { byte[] bytes = IOUtils.safelyAllocate(30, 200); assertNotNull(bytes); assertEquals(30, bytes.length); } @Test - public void testSafelyAllocateLimit() { + void testSafelyAllocateLimit() { IOUtils.setByteArrayMaxOverride(40); try { byte[] bytes = IOUtils.safelyAllocate(30, 200); @@ -318,28 +318,28 @@ public final class TestIOUtils { } @Test - public void testReadFully() throws IOException { + void testReadFully() throws IOException { byte[] bytes = new byte[2]; IOUtils.readFully(new ByteArrayInputStream(new byte[] {1, 2, 3}), bytes, 0, 2); assertArrayEquals(new byte[] {1,2}, bytes); } @Test - public void testReadFullySimple() throws IOException { + void testReadFullySimple() throws IOException { byte[] bytes = new byte[2]; IOUtils.readFully(new ByteArrayInputStream(new byte[] {1, 2, 3}), bytes); assertArrayEquals(new byte[] {1,2}, bytes); } @Test - public void testReadFullyOffset() throws IOException { + void testReadFullyOffset() throws IOException { byte[] bytes = new byte[3]; IOUtils.readFully(new ByteArrayInputStream(new byte[] {1, 2, 3}), bytes, 1, 2); assertArrayEquals(new byte[] {0, 1,2}, bytes); } @Test - public void testReadFullyAtLength() throws IOException { + void testReadFullyAtLength() throws IOException { byte[] bytes = new byte[3]; IOUtils.readFully(new ByteArrayInputStream(new byte[] {1, 2, 3}), bytes, 0, 3); assertArrayEquals(new byte[] {1,2, 3}, bytes); diff --git a/src/testcases/org/apache/poi/util/TestIntList.java b/src/testcases/org/apache/poi/util/TestIntList.java index 1efadc0c91..38e8cc2cc3 100644 --- a/src/testcases/org/apache/poi/util/TestIntList.java +++ b/src/testcases/org/apache/poi/util/TestIntList.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; */ public final class TestIntList { @Test - public void testConstructors() { + void testConstructors() { IntList list = new IntList(); assertTrue(list.isEmpty()); @@ -49,7 +49,7 @@ public final class TestIntList { } @Test - public void testAdd() { + void testAdd() { IntList list = new IntList(); int[] testArray = { @@ -111,7 +111,7 @@ public final class TestIntList { } @Test - public void testAddAll() { + void testAddAll() { IntList list = new IntList(); for (int j = 0; j < 5; j++) { @@ -175,7 +175,7 @@ public final class TestIntList { } @Test - public void testAddAllGrow() { + void testAddAllGrow() { IntList list = new IntList(0); IntList addList = new IntList(0); addList.add(1); @@ -185,7 +185,7 @@ public final class TestIntList { } @Test - public void testClear() { + void testClear() { IntList list = new IntList(); for (int j = 0; j < 500; j++) { @@ -204,7 +204,7 @@ public final class TestIntList { } @Test - public void testContains() { + void testContains() { IntList list = new IntList(); for (int j = 0; j < 1000; j += 2) { @@ -220,7 +220,7 @@ public final class TestIntList { } @Test - public void testContainsAll() { + void testContainsAll() { IntList list = new IntList(); assertTrue(list.containsAll(list)); @@ -240,7 +240,7 @@ public final class TestIntList { } @Test - public void testEquals() { + void testEquals() { IntList list = new IntList(); assertEquals(list, list); @@ -267,7 +267,7 @@ public final class TestIntList { } @Test - public void testGet() { + void testGet() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -281,7 +281,7 @@ public final class TestIntList { } @Test - public void testIndexOf() { + void testIndexOf() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -297,7 +297,7 @@ public final class TestIntList { } @Test - public void testIsEmpty() { + void testIsEmpty() { IntList list1 = new IntList(); IntList list2 = new IntList(1000); IntList list3 = new IntList(list1); @@ -320,7 +320,7 @@ public final class TestIntList { } @Test - public void testLastIndexOf() { + void testLastIndexOf() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -336,7 +336,7 @@ public final class TestIntList { } @Test - public void testRemove() { + void testRemove() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -358,7 +358,7 @@ public final class TestIntList { } @Test - public void testRemoveValue() { + void testRemoveValue() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -374,7 +374,7 @@ public final class TestIntList { } @Test - public void testRemoveAll() { + void testRemoveAll() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -411,7 +411,7 @@ public final class TestIntList { } @Test - public void testRetainAll() { + void testRetainAll() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -447,7 +447,7 @@ public final class TestIntList { } @Test - public void testSet() { + void testSet() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -461,7 +461,7 @@ public final class TestIntList { } @Test - public void testSize() { + void testSize() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { @@ -477,7 +477,7 @@ public final class TestIntList { } @Test - public void testToArray() { + void testToArray() { IntList list = new IntList(); for (int j = 0; j < 1000; j++) { diff --git a/src/testcases/org/apache/poi/util/TestIntegerField.java b/src/testcases/org/apache/poi/util/TestIntegerField.java index 517216dbf3..96740ce464 100644 --- a/src/testcases/org/apache/poi/util/TestIntegerField.java +++ b/src/testcases/org/apache/poi/util/TestIntegerField.java @@ -33,7 +33,7 @@ public final class TestIntegerField { private static final int[] _test_array = {Integer.MIN_VALUE, -1, 0, 1, Integer.MAX_VALUE}; @Test - public void testConstructors() { + void testConstructors() { assertThrows(ArrayIndexOutOfBoundsException.class, () -> new IntegerField(-1)); IntegerField field = new IntegerField(2); @@ -62,7 +62,7 @@ public final class TestIntegerField { } @Test - public void testSet() { + void testSet() { IntegerField field = new IntegerField(0); byte[] array = new byte[ 4 ]; @@ -80,7 +80,7 @@ public final class TestIntegerField { } @Test - public void testReadFromBytes() { + void testReadFromBytes() { IntegerField field1 = new IntegerField(1); byte[] array = new byte[ 4 ]; @@ -97,7 +97,7 @@ public final class TestIntegerField { } @Test - public void testReadFromStream() throws IOException { + void testReadFromStream() throws IOException { IntegerField field = new IntegerField(0); byte[] buffer = new byte[ _test_array.length * 4 ]; @@ -116,7 +116,7 @@ public final class TestIntegerField { } @Test - public void testWriteToBytes() { + void testWriteToBytes() { IntegerField field = new IntegerField(0); byte[] array = new byte[ 4 ]; diff --git a/src/testcases/org/apache/poi/util/TestLittleEndian.java b/src/testcases/org/apache/poi/util/TestLittleEndian.java index 30d3a8e96e..268dba5621 100644 --- a/src/testcases/org/apache/poi/util/TestLittleEndian.java +++ b/src/testcases/org/apache/poi/util/TestLittleEndian.java @@ -37,7 +37,7 @@ public final class TestLittleEndian { * test the getShort() method */ @Test - public void testGetShort() { + void testGetShort() { byte[] testdata = new byte[ LittleEndianConsts.SHORT_SIZE + 1 ]; testdata[0] = 0x01; @@ -52,7 +52,7 @@ public final class TestLittleEndian { } @Test - public void testGetUShort() { + void testGetUShort() { byte[] testdata = { (byte) 0x01, (byte) 0xFF, @@ -99,7 +99,7 @@ public final class TestLittleEndian { * test the getDouble() method */ @Test - public void testGetDouble() { + void testGetDouble() { assertEquals(_doubles[0], LittleEndian.getDouble(_double_array, 0), 0.000001 ); assertEquals(_doubles[1], LittleEndian.getDouble( _double_array, LittleEndianConsts.DOUBLE_SIZE), 0.000001); assertTrue(Double.isNaN(LittleEndian.getDouble(_nan_double_array, 0))); @@ -116,7 +116,7 @@ public final class TestLittleEndian { * test the getInt() method */ @Test - public void testGetInt() { + void testGetInt() { // reading 4 byte data from a 5 byte buffer byte[] testdata = { (byte) 0x01, @@ -134,7 +134,7 @@ public final class TestLittleEndian { * test the getLong method */ @Test - public void testGetLong() { + void testGetLong() { // reading 8 byte values from a 9 byte buffer byte[] testdata = { @@ -157,7 +157,7 @@ public final class TestLittleEndian { * test the PutShort method */ @Test - public void testPutShort() { + void testPutShort() { byte[] expected = new byte[ LittleEndianConsts.SHORT_SIZE + 1 ]; expected[0] = 0x01; @@ -178,7 +178,7 @@ public final class TestLittleEndian { * test the putInt method */ @Test - public void testPutInt() { + void testPutInt() { // writing 4 byte data to a 5 byte buffer byte[] expected = { (byte) 0x01, @@ -199,7 +199,7 @@ public final class TestLittleEndian { * test the putDouble methods */ @Test - public void testPutDouble() { + void testPutDouble() { byte[] received = new byte[ LittleEndianConsts.DOUBLE_SIZE + 1 ]; LittleEndian.putDouble(received, 0, _doubles[0]); @@ -216,7 +216,7 @@ public final class TestLittleEndian { * test the putLong method */ @Test - public void testPutLong() { + void testPutLong() { // writing 8 byte values to a 9 byte buffer byte[] expected = { (byte) 0x01, @@ -253,7 +253,7 @@ public final class TestLittleEndian { * test the readShort method */ @Test - public void testReadShort() throws IOException { + void testReadShort() throws IOException { short expected_value = 0x0201; InputStream stream = new ByteArrayInputStream(_good_array); int count = 0; @@ -277,7 +277,7 @@ public final class TestLittleEndian { * test the readInt method */ @Test - public void testReadInt() throws IOException { + void testReadInt() throws IOException { int expected_value = 0x02010201; InputStream stream = new ByteArrayInputStream(_good_array); int count = 0; @@ -300,7 +300,7 @@ public final class TestLittleEndian { * test the readLong method */ @Test - public void testReadLong() throws IOException { + void testReadLong() throws IOException { long expected_value = 0x0201020102010201L; InputStream stream = new ByteArrayInputStream(_good_array); int count = 0; @@ -320,7 +320,7 @@ public final class TestLittleEndian { } @Test - public void testReadFromStream() throws IOException { + void testReadFromStream() throws IOException { int actual; actual = LittleEndian.readUShort(new ByteArrayInputStream(new byte[] { 5, -128, })); assertEquals(32773, actual); @@ -333,7 +333,7 @@ public final class TestLittleEndian { } @Test - public void testUnsignedByteToInt() { + void testUnsignedByteToInt() { assertEquals(255, LittleEndian.ubyteToInt((byte)255)); } @@ -350,7 +350,7 @@ public final class TestLittleEndian { } @Test - public void testUnsignedShort() { + void testUnsignedShort() { assertEquals(0xffff, LittleEndian.getUShort(new byte[] { (byte)0xff, (byte)0xff }, 0)); } } diff --git a/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java b/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java index 36af4524e9..dfeff3cc04 100644 --- a/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java +++ b/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; public final class TestLittleEndianStreams { @Test - public void testRead() throws IOException { + void testRead() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (LittleEndianOutputStream leo = new LittleEndianOutputStream(baos)) { leo.writeInt(12345678); @@ -64,7 +64,7 @@ public final class TestLittleEndianStreams { * array. */ @Test - public void testReadFully() { + void testReadFully() { byte[] srcBuf = HexRead.readFromString("99 88 77 66 55 44 33"); LittleEndianInput lei = new LittleEndianByteArrayInputStream(srcBuf); @@ -84,7 +84,7 @@ public final class TestLittleEndianStreams { } @Test - public void testBufferOverrun() { + void testBufferOverrun() { byte[] srcBuf = HexRead.readFromString("99 88 77"); LittleEndianInput lei = new LittleEndianByteArrayInputStream(srcBuf); @@ -97,7 +97,7 @@ public final class TestLittleEndianStreams { } @Test - public void testBufferOverrunStartOffset() { + void testBufferOverrunStartOffset() { byte[] srcBuf = HexRead.readFromString("99 88 77 88 99"); LittleEndianInput lei = new LittleEndianByteArrayInputStream(srcBuf, 2); @@ -107,7 +107,7 @@ public final class TestLittleEndianStreams { } @Test - public void testBufferOverrunStartOffset2() { + void testBufferOverrunStartOffset2() { byte[] srcBuf = HexRead.readFromString("99 88 77 88 99"); LittleEndianInput lei = new LittleEndianByteArrayInputStream(srcBuf, 2, 2); diff --git a/src/testcases/org/apache/poi/util/TestLongField.java b/src/testcases/org/apache/poi/util/TestLongField.java index 952af51bb3..164c6ceb01 100644 --- a/src/testcases/org/apache/poi/util/TestLongField.java +++ b/src/testcases/org/apache/poi/util/TestLongField.java @@ -37,7 +37,7 @@ public final class TestLongField { }; @Test - public void testConstructors() { + void testConstructors() { assertThrows(ArrayIndexOutOfBoundsException.class, () -> new LongField(-1)); LongField field1 = new LongField(2); @@ -73,7 +73,7 @@ public final class TestLongField { } @Test - public void testSet() { + void testSet() { LongField field = new LongField(0); byte[] array = new byte[ 8 ]; @@ -95,7 +95,7 @@ public final class TestLongField { } @Test - public void testReadFromBytes() { + void testReadFromBytes() { LongField field = new LongField(1); byte[] array = new byte[ 8 ]; @@ -121,7 +121,7 @@ public final class TestLongField { } @Test - public void testReadFromStream() throws IOException { + void testReadFromStream() throws IOException { LongField field = new LongField(0); byte[] buffer = new byte[ _test_array.length * 8 ]; @@ -144,7 +144,7 @@ public final class TestLongField { } @Test - public void testWriteToBytes() { + void testWriteToBytes() { LongField field = new LongField(0); byte[] array = new byte[ 8 ]; diff --git a/src/testcases/org/apache/poi/util/TestPOILogFactory.java b/src/testcases/org/apache/poi/util/TestPOILogFactory.java index a4580bb04a..9fa8fe8271 100644 --- a/src/testcases/org/apache/poi/util/TestPOILogFactory.java +++ b/src/testcases/org/apache/poi/util/TestPOILogFactory.java @@ -26,7 +26,7 @@ public final class TestPOILogFactory { * test log creation */ @Test - public void testLog() { + void testLog() { //NKB Testing only that logging classes use gives no exception // Since logging can be disabled, no checking of logging // output is done. diff --git a/src/testcases/org/apache/poi/util/TestPOILogger.java b/src/testcases/org/apache/poi/util/TestPOILogger.java index d40d475ac7..4829ca2d36 100644 --- a/src/testcases/org/apache/poi/util/TestPOILogger.java +++ b/src/testcases/org/apache/poi/util/TestPOILogger.java @@ -35,7 +35,7 @@ public final class TestPOILogger implements POILogger { * Test different types of log output. */ @Test - public void testVariousLogTypes() throws Exception { + void testVariousLogTypes() throws Exception { String oldLCN = POILogFactory._loggerClassName; try { POILogFactory._loggerClassName = TestPOILogger.class.getName(); diff --git a/src/testcases/org/apache/poi/util/TestShortField.java b/src/testcases/org/apache/poi/util/TestShortField.java index 2ae0cb6ef0..73f22250ca 100644 --- a/src/testcases/org/apache/poi/util/TestShortField.java +++ b/src/testcases/org/apache/poi/util/TestShortField.java @@ -34,7 +34,7 @@ public final class TestShortField { private static final short[] _test_array = {Short.MIN_VALUE, -1, 0, 1, Short.MAX_VALUE}; @Test - public void testConstructors() { + void testConstructors() { assertThrows(ArrayIndexOutOfBoundsException.class, () -> new ShortField(-1)); ShortField field = new ShortField(2); @@ -61,7 +61,7 @@ public final class TestShortField { } @Test - public void testSet() { + void testSet() { ShortField field = new ShortField(0); byte[] array = new byte[ 2 ]; @@ -77,7 +77,7 @@ public final class TestShortField { } @Test - public void testReadFromBytes() { + void testReadFromBytes() { ShortField field1 = new ShortField(1); byte[] array = new byte[ 2 ]; @@ -94,7 +94,7 @@ public final class TestShortField { } @Test - public void testReadFromStream() throws IOException { + void testReadFromStream() throws IOException { ShortField field = new ShortField(0); byte[] buffer = new byte[ _test_array.length * 2 ]; @@ -113,7 +113,7 @@ public final class TestShortField { } @Test - public void testWriteToBytes() { + void testWriteToBytes() { ShortField field = new ShortField(0); byte[] array = new byte[ 2 ]; diff --git a/src/testcases/org/apache/poi/util/TestStringCodepointsIterable.java b/src/testcases/org/apache/poi/util/TestStringCodepointsIterable.java index 7152ec6cef..62e45c8c0d 100644 --- a/src/testcases/org/apache/poi/util/TestStringCodepointsIterable.java +++ b/src/testcases/org/apache/poi/util/TestStringCodepointsIterable.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; public class TestStringCodepointsIterable { @Test - public void testIterable() { + void testIterable() { final String unicodeSurrogates = "\uD835\uDF4A\uD835\uDF4B\uD835\uDF4C\uD835\uDF4D\uD835\uDF4E" + "abcdef123456"; StringCodepointsIterable sci = new StringCodepointsIterable(unicodeSurrogates); diff --git a/src/testcases/org/apache/poi/util/TestStringUtil.java b/src/testcases/org/apache/poi/util/TestStringUtil.java index a03ab6a127..f3ba2c5a52 100644 --- a/src/testcases/org/apache/poi/util/TestStringUtil.java +++ b/src/testcases/org/apache/poi/util/TestStringUtil.java @@ -36,7 +36,7 @@ public class TestStringUtil { * test getFromUnicodeHigh for symbols with code below and more 127 */ @Test - public void testGetFromUnicodeHighSymbolsWithCodesMoreThan127() { + void testGetFromUnicodeHighSymbolsWithCodesMoreThan127() { byte[] test_data = new byte[]{0x22, 0x04, 0x35, 0x04, 0x41, 0x04, @@ -54,7 +54,7 @@ public class TestStringUtil { } @Test - public void testPutCompressedUnicode() { + void testPutCompressedUnicode() { byte[] output = new byte[100]; byte[] expected_output = { @@ -81,7 +81,7 @@ public class TestStringUtil { } @Test - public void testPutUncompressedUnicode() { + void testPutUncompressedUnicode() { byte[] output = new byte[100]; String input = "Hello World"; byte[] expected_output = { diff --git a/src/testcases/org/apache/poi/util/TestTempFile.java b/src/testcases/org/apache/poi/util/TestTempFile.java index 8ed0e837c1..97b2c62985 100644 --- a/src/testcases/org/apache/poi/util/TestTempFile.java +++ b/src/testcases/org/apache/poi/util/TestTempFile.java @@ -86,7 +86,7 @@ public class TestTempFile { } @Test - public void testCreateTempFile() throws IOException + void testCreateTempFile() throws IOException { File tempFile = TempFile.createTempFile("test", ".txt"); FileOutputStream fos = new FileOutputStream(tempFile); @@ -110,7 +110,7 @@ public class TestTempFile { } @Test - public void testCreateTempDirectory() throws IOException + void testCreateTempDirectory() throws IOException { File tempDir = TempFile.createTempDirectory("testDir"); assertTrue(tempDir.exists()); @@ -124,7 +124,7 @@ public class TestTempFile { } @Test - public void testSetTempFileCreationStrategy() throws IOException { + void testSetTempFileCreationStrategy() throws IOException { TempFile.setTempFileCreationStrategy(new DefaultTempFileCreationStrategy()); // Should be able to create two tempfiles with same prefix and suffix diff --git a/src/testcases/org/apache/poi/util/TestXMLHelper.java b/src/testcases/org/apache/poi/util/TestXMLHelper.java index 478ba0dbe0..2b23fffca8 100644 --- a/src/testcases/org/apache/poi/util/TestXMLHelper.java +++ b/src/testcases/org/apache/poi/util/TestXMLHelper.java @@ -43,7 +43,7 @@ import org.xml.sax.XMLReader; public class TestXMLHelper { @Test - public void testDocumentBuilder() throws Exception { + void testDocumentBuilder() throws Exception { DocumentBuilder documentBuilder = XMLHelper.newDocumentBuilder(); assertNotSame(documentBuilder, XMLHelper.newDocumentBuilder()); assertTrue(documentBuilder.isNamespaceAware()); @@ -52,7 +52,7 @@ public class TestXMLHelper { } @Test - public void testCreatingManyDocumentBuilders() throws Exception { + void testCreatingManyDocumentBuilders() throws Exception { int limit = 1000; ArrayList<CompletableFuture<DocumentBuilder>> futures = new ArrayList<>(); for (int i = 0; i < limit; i++) { @@ -68,7 +68,7 @@ public class TestXMLHelper { } @Test - public void testDocumentBuilderFactory() throws Exception { + void testDocumentBuilderFactory() throws Exception { try { DocumentBuilderFactory dbf = XMLHelper.getDocumentBuilderFactory(); assertTrue(dbf.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)); @@ -81,7 +81,7 @@ public class TestXMLHelper { } @Test - public void testXMLReader() throws Exception { + void testXMLReader() throws Exception { XMLReader reader = XMLHelper.newXMLReader(); assertNotSame(reader, XMLHelper.newXMLReader()); try { @@ -100,7 +100,7 @@ public class TestXMLHelper { } @Test - public void testCreatingManyXMLReaders() throws Exception { + void testCreatingManyXMLReaders() throws Exception { int limit = 1000; ArrayList<CompletableFuture<XMLReader>> futures = new ArrayList<>(); for (int i = 0; i < limit; i++) { @@ -134,7 +134,7 @@ public class TestXMLHelper { * test that newXMLInputFactory returns a factory with sensible defaults */ @Test - public void testNewXMLInputFactory() { + void testNewXMLInputFactory() { XMLInputFactory factory = XMLHelper.newXMLInputFactory(); assertTrue((boolean)factory.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)); assertFalse((boolean)factory.getProperty(XMLInputFactory.IS_VALIDATING)); @@ -146,7 +146,7 @@ public class TestXMLHelper { * test that newXMLOutputFactory returns a factory with sensible defaults */ @Test - public void testNewXMLOutputFactory() { + void testNewXMLOutputFactory() { XMLOutputFactory factory = XMLHelper.newXMLOutputFactory(); assertTrue((boolean)factory.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES)); } @@ -155,7 +155,7 @@ public class TestXMLHelper { * test that newXMLEventFactory returns a factory */ @Test - public void testNewXMLEventFactory() { + void testNewXMLEventFactory() { assertNotNull(XMLHelper.newXMLEventFactory()); } } |