Browse Source

Sonar fixes

JUnit5 test classes and methods should have default package visibility

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885281 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_0_0
Andreas Beeker 3 years ago
parent
commit
606a313c4c
100 changed files with 544 additions and 553 deletions
  1. BIN
      src/multimodule/poi/test9/module-info.class
  2. 66
    1
      src/multimodule/poi/test9/module-info.java
  3. 3
    2
      src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFRow.java
  4. 1
    2
      src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java
  5. 1
    1
      src/testcases/org/apache/poi/TestJDK12.java
  6. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherBSERecord.java
  7. 4
    4
      src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java
  8. 1
    1
      src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java
  9. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java
  10. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherClientAnchorRecord.java
  11. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherClientDataRecord.java
  12. 6
    6
      src/testcases/org/apache/poi/ddf/TestEscherContainerRecord.java
  13. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherDgRecord.java
  14. 4
    4
      src/testcases/org/apache/poi/ddf/TestEscherDggRecord.java
  15. 4
    4
      src/testcases/org/apache/poi/ddf/TestEscherDump.java
  16. 6
    6
      src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java
  17. 1
    1
      src/testcases/org/apache/poi/ddf/TestEscherProperty.java
  18. 1
    1
      src/testcases/org/apache/poi/ddf/TestEscherPropertyFactory.java
  19. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherSpRecord.java
  20. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherSpgrRecord.java
  21. 3
    3
      src/testcases/org/apache/poi/ddf/TestEscherSplitMenuColorsRecord.java
  22. 3
    3
      src/testcases/org/apache/poi/ddf/TestUnknownEscherRecord.java
  23. 1
    1
      src/testcases/org/apache/poi/hpsf/TestVariantSupport.java
  24. 0
    74
      src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java
  25. 4
    4
      src/testcases/org/apache/poi/hpsf/basic/TestBasic.java
  26. 5
    5
      src/testcases/org/apache/poi/hpsf/basic/TestClassID.java
  27. 3
    3
      src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java
  28. 3
    3
      src/testcases/org/apache/poi/hpsf/basic/TestHPSFBugs.java
  29. 7
    7
      src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java
  30. 1
    1
      src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java
  31. 3
    3
      src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java
  32. 8
    8
      src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java
  33. 1
    1
      src/testcases/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java
  34. 1
    1
      src/testcases/org/apache/poi/hssf/dev/TestBiffViewer.java
  35. 1
    1
      src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java
  36. 1
    1
      src/testcases/org/apache/poi/hssf/dev/TestReSave.java
  37. 1
    1
      src/testcases/org/apache/poi/hssf/dev/TestRecordLister.java
  38. 2
    2
      src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java
  39. 4
    4
      src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java
  40. 4
    4
      src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java
  41. 2
    2
      src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java
  42. 6
    6
      src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java
  43. 6
    6
      src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java
  44. 17
    17
      src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java
  45. 20
    20
      src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java
  46. 13
    13
      src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java
  47. 4
    4
      src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java
  48. 19
    19
      src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java
  49. 2
    2
      src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java
  50. 70
    70
      src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java
  51. 2
    2
      src/testcases/org/apache/poi/hssf/model/TestFormulaParserEval.java
  52. 10
    10
      src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java
  53. 15
    15
      src/testcases/org/apache/poi/hssf/model/TestHSSFAnchor.java
  54. 6
    6
      src/testcases/org/apache/poi/hssf/model/TestLinkTable.java
  55. 6
    6
      src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java
  56. 1
    1
      src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java
  57. 21
    21
      src/testcases/org/apache/poi/hssf/model/TestSheet.java
  58. 2
    2
      src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java
  59. 4
    4
      src/testcases/org/apache/poi/hssf/model/TestWorkbook.java
  60. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java
  61. 3
    3
      src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java
  62. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestBOFRecord.java
  63. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestBoolErrRecord.java
  64. 6
    6
      src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java
  65. 4
    4
      src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java
  66. 8
    8
      src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java
  67. 3
    3
      src/testcases/org/apache/poi/hssf/record/TestColumnInfoRecord.java
  68. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java
  69. 8
    8
      src/testcases/org/apache/poi/hssf/record/TestDConRefRecord.java
  70. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestDVALRecord.java
  71. 3
    3
      src/testcases/org/apache/poi/hssf/record/TestDrawingGroupRecord.java
  72. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java
  73. 5
    5
      src/testcases/org/apache/poi/hssf/record/TestEmbeddedObjectRefSubRecord.java
  74. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestEndSubRecord.java
  75. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java
  76. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestExtSSTRecord.java
  77. 4
    4
      src/testcases/org/apache/poi/hssf/record/TestExtendedFormatRecord.java
  78. 8
    8
      src/testcases/org/apache/poi/hssf/record/TestExternalNameRecord.java
  79. 3
    3
      src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java
  80. 5
    5
      src/testcases/org/apache/poi/hssf/record/TestFontRecord.java
  81. 6
    6
      src/testcases/org/apache/poi/hssf/record/TestFormulaRecord.java
  82. 3
    3
      src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java
  83. 15
    15
      src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java
  84. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java
  85. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java
  86. 4
    4
      src/testcases/org/apache/poi/hssf/record/TestLbsDataSubRecord.java
  87. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java
  88. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestNameCommentRecord.java
  89. 6
    6
      src/testcases/org/apache/poi/hssf/record/TestNameRecord.java
  90. 4
    4
      src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java
  91. 3
    3
      src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java
  92. 5
    5
      src/testcases/org/apache/poi/hssf/record/TestObjRecord.java
  93. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestPLVRecord.java
  94. 1
    1
      src/testcases/org/apache/poi/hssf/record/TestPaletteRecord.java
  95. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestPaneRecord.java
  96. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestRecalcIdRecord.java
  97. 5
    5
      src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java
  98. 4
    4
      src/testcases/org/apache/poi/hssf/record/TestRecordInputStream.java
  99. 2
    2
      src/testcases/org/apache/poi/hssf/record/TestSCLRecord.java
  100. 0
    0
      src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java

BIN
src/multimodule/poi/test9/module-info.class View File


+ 66
- 1
src/multimodule/poi/test9/module-info.java View File

@@ -107,8 +107,73 @@ module org.apache.poi.poi {
requires org.junit.jupiter.api;
requires org.junit.jupiter.params;

exports org.apache.poi.hpsf.basic to org.junit.platform.commons;
exports org.apache.poi.hssf.record.pivot to org.junit.platform.commons;

opens org.apache.poi to org.junit.platform.commons;
opens org.apache.poi.common to org.junit.platform.commons;
opens org.apache.poi.common.usermodel to org.junit.platform.commons;
opens org.apache.poi.common.usermodel.fonts to org.junit.platform.commons;
opens org.apache.poi.ddf to org.junit.platform.commons;
opens org.apache.poi.extractor to org.junit.platform.commons;
opens org.apache.poi.hpsf to org.junit.platform.commons;
opens org.apache.poi.hpsf.basic to org.junit.platform.commons;
opens org.apache.poi.hssf.record.pivot to org.junit.platform.commons;
opens org.apache.poi.hpsf.extractor to org.junit.platform.commons;
opens org.apache.poi.hpsf.wellknown to org.junit.platform.commons;
opens org.apache.poi.hssf to org.junit.platform.commons;
opens org.apache.poi.hssf.dev to org.junit.platform.commons;
opens org.apache.poi.hssf.eventmodel to org.junit.platform.commons;
opens org.apache.poi.hssf.eventusermodel to org.junit.platform.commons;
opens org.apache.poi.hssf.eventusermodel.dummyrecord to org.junit.platform.commons;
opens org.apache.poi.hssf.extractor to org.junit.platform.commons;
opens org.apache.poi.hssf.model to org.junit.platform.commons;
opens org.apache.poi.hssf.record to org.junit.platform.commons;
opens org.apache.poi.hssf.record.aggregates to org.junit.platform.commons;
opens org.apache.poi.hssf.record.cf to org.junit.platform.commons;
opens org.apache.poi.hssf.record.chart to org.junit.platform.commons;
opens org.apache.poi.hssf.record.common to org.junit.platform.commons;
opens org.apache.poi.hssf.record.cont to org.junit.platform.commons;
opens org.apache.poi.hssf.record.crypto to org.junit.platform.commons;
opens org.apache.poi.hssf.record.pivot to org.junit.platform.commons;
opens org.apache.poi.hssf.record.pivottable to org.junit.platform.commons;
opens org.apache.poi.hssf.usermodel to org.junit.platform.commons;
opens org.apache.poi.hssf.usermodel.helpers to org.junit.platform.commons;
opens org.apache.poi.hssf.util to org.junit.platform.commons;
opens org.apache.poi.poifs.common to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.agile to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.binaryrc4 to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.cryptoapi to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.standard to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.xor to org.junit.platform.commons;
opens org.apache.poi.poifs.dev to org.junit.platform.commons;
opens org.apache.poi.poifs.eventfilesystem to org.junit.platform.commons;
opens org.apache.poi.poifs.filesystem to org.junit.platform.commons;
opens org.apache.poi.poifs.macros to org.junit.platform.commons;
opens org.apache.poi.poifs.nio to org.junit.platform.commons;
opens org.apache.poi.poifs.property to org.junit.platform.commons;
opens org.apache.poi.poifs.storage to org.junit.platform.commons;
opens org.apache.poi.sl.draw to org.junit.platform.commons;
opens org.apache.poi.sl.draw.geom to org.junit.platform.commons;
opens org.apache.poi.sl.extractor to org.junit.platform.commons;
opens org.apache.poi.sl.image to org.junit.platform.commons;
opens org.apache.poi.sl.usermodel to org.junit.platform.commons;
opens org.apache.poi.ss to org.junit.platform.commons;
opens org.apache.poi.ss.extractor to org.junit.platform.commons;
opens org.apache.poi.ss.format to org.junit.platform.commons;
opens org.apache.poi.ss.formula to org.junit.platform.commons;
opens org.apache.poi.ss.formula.atp to org.junit.platform.commons;
opens org.apache.poi.ss.formula.constant to org.junit.platform.commons;
opens org.apache.poi.ss.formula.eval to org.junit.platform.commons;
opens org.apache.poi.ss.formula.eval.forked to org.junit.platform.commons;
opens org.apache.poi.ss.formula.function to org.junit.platform.commons;
opens org.apache.poi.ss.formula.functions to org.junit.platform.commons;
opens org.apache.poi.ss.formula.ptg to org.junit.platform.commons;
opens org.apache.poi.ss.formula.udf to org.junit.platform.commons;
opens org.apache.poi.ss.usermodel to org.junit.platform.commons;
opens org.apache.poi.ss.usermodel.helpers to org.junit.platform.commons;
opens org.apache.poi.ss.util to org.junit.platform.commons;
opens org.apache.poi.ss.util.cellwalk to org.junit.platform.commons;
opens org.apache.poi.util to org.junit.platform.commons;
opens org.apache.poi.wp.usermodel to org.junit.platform.commons;
}

+ 3
- 2
src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFRow.java View File

@@ -42,12 +42,13 @@ public final class TestSXSSFRow extends BaseTestXRow {

@Override
@Disabled("see <https://bz.apache.org/bugzilla/show_bug.cgi?id=62030#c1>") @Test
public void testCellShiftingRight(){
protected void testCellShiftingRight(){
// Remove when SXSSFRow.shiftCellsRight() is implemented.
}

@Override
@Disabled("see <https://bz.apache.org/bugzilla/show_bug.cgi?id=62030#c1>") @Test
public void testCellShiftingLeft(){
protected void testCellShiftingLeft(){
// Remove when SXSSFRow.shiftCellsLeft() is implemented.
}


+ 1
- 2
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java View File

@@ -36,8 +36,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows {
}

@Override
@Test
public void testShiftRowBreaks() {
protected void testShiftRowBreaks() {
// disabled test from superclass
// TODO - support shifting of page breaks
}

+ 1
- 1
src/testcases/org/apache/poi/TestJDK12.java View File

@@ -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();

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherBSERecord.java View File

@@ -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" +

+ 4
- 4
src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java View File

@@ -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());

+ 1
- 1
src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java View File

@@ -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" +

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java View File

@@ -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" +

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherClientAnchorRecord.java View File

@@ -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" +

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherClientDataRecord.java View File

@@ -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" +

+ 6
- 6
src/testcases/org/apache/poi/ddf/TestEscherContainerRecord.java View File

@@ -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());

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherDgRecord.java View File

@@ -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" +

+ 4
- 4
src/testcases/org/apache/poi/ddf/TestEscherDggRecord.java View File

@@ -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());

+ 4
- 4
src/testcases/org/apache/poi/ddf/TestEscherDump.java View File

@@ -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();

+ 6
- 6
src/testcases/org/apache/poi/ddf/TestEscherOptRecord.java View File

@@ -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());

+ 1
- 1
src/testcases/org/apache/poi/ddf/TestEscherProperty.java View File

@@ -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());

+ 1
- 1
src/testcases/org/apache/poi/ddf/TestEscherPropertyFactory.java View File

@@ -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

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherSpRecord.java View File

@@ -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" +

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherSpgrRecord.java View File

@@ -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" +

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestEscherSplitMenuColorsRecord.java View File

@@ -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" +

+ 3
- 3
src/testcases/org/apache/poi/ddf/TestUnknownEscherRecord.java View File

@@ -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 );

+ 1
- 1
src/testcases/org/apache/poi/hpsf/TestVariantSupport.java View File

@@ -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"+

+ 0
- 74
src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java View File

@@ -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);
}
}

}

+ 4
- 4
src/testcases/org/apache/poi/hpsf/basic/TestBasic.java View File

@@ -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();

+ 5
- 5
src/testcases/org/apache/poi/hpsf/basic/TestClassID.java View File

@@ -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());
}

+ 3
- 3
src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java View File

@@ -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;

+ 3
- 3
src/testcases/org/apache/poi/hpsf/basic/TestHPSFBugs.java View File

@@ -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();

+ 7
- 7
src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java View File

@@ -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) {

+ 1
- 1
src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java View File

@@ -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));

+ 3
- 3
src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java View File

@@ -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;

+ 8
- 8
src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java View File

@@ -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);

+ 1
- 1
src/testcases/org/apache/poi/hssf/dev/BaseTestIteratingXLS.java View File

@@ -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);

+ 1
- 1
src/testcases/org/apache/poi/hssf/dev/TestBiffViewer.java View File

@@ -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"));
// }

+ 1
- 1
src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java View File

@@ -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();

+ 1
- 1
src/testcases/org/apache/poi/hssf/dev/TestReSave.java View File

@@ -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";

+ 1
- 1
src/testcases/org/apache/poi/hssf/dev/TestRecordLister.java View File

@@ -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();

+ 2
- 2
src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java View File

@@ -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();

+ 4
- 4
src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java View File

@@ -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);

+ 4
- 4
src/testcases/org/apache/poi/hssf/eventusermodel/TestEventWorkbookBuilder.java View File

@@ -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());

+ 2
- 2
src/testcases/org/apache/poi/hssf/eventusermodel/TestFormatTrackingHSSFListener.java View File

@@ -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"
};

+ 6
- 6
src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java View File

@@ -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 {

+ 6
- 6
src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java View File

@@ -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 =

+ 17
- 17
src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java View File

@@ -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);

+ 20
- 20
src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java View File

@@ -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)) {

+ 13
- 13
src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java View File

@@ -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"+

+ 4
- 4
src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java View File

@@ -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 );

+ 19
- 19
src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java View File

@@ -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();

+ 2
- 2
src/testcases/org/apache/poi/hssf/model/TestEscherRecordFactory.java View File

@@ -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);

+ 70
- 70
src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java View File

@@ -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");

+ 2
- 2
src/testcases/org/apache/poi/hssf/model/TestFormulaParserEval.java View File

@@ -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();

+ 10
- 10
src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java View File

@@ -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);


+ 15
- 15
src/testcases/org/apache/poi/hssf/model/TestHSSFAnchor.java View File

@@ -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());

+ 6
- 6
src/testcases/org/apache/poi/hssf/model/TestLinkTable.java View File

@@ -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());

+ 6
- 6
src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java View File

@@ -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);


+ 1
- 1
src/testcases/org/apache/poi/hssf/model/TestRowBlocksReader.java View File

@@ -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),

+ 21
- 21
src/testcases/org/apache/poi/hssf/model/TestSheet.java View File

@@ -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);

+ 2
- 2
src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java View File

@@ -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);

+ 4
- 4
src/testcases/org/apache/poi/hssf/model/TestWorkbook.java View File

@@ -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);


+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestArrayRecord.java View File

@@ -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");

+ 3
- 3
src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java View File

@@ -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);

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestBOFRecord.java View File

@@ -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);

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestBoolErrRecord.java View File

@@ -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

+ 6
- 6
src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java View File

@@ -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 # "));

+ 4
- 4
src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java View File

@@ -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,

+ 8
- 8
src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java View File

@@ -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)) {

+ 3
- 3
src/testcases/org/apache/poi/hssf/record/TestColumnInfoRecord.java View File

@@ -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);

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestCommonObjectDataSubRecord.java View File

@@ -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);

+ 8
- 8
src/testcases/org/apache/poi/hssf/record/TestDConRefRecord.java View File

@@ -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));

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestDVALRecord.java View File

@@ -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);

+ 3
- 3
src/testcases/org/apache/poi/hssf/record/TestDrawingGroupRecord.java View File

@@ -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 ) );

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestDrawingRecord.java View File

@@ -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();

+ 5
- 5
src/testcases/org/apache/poi/hssf/record/TestEmbeddedObjectRefSubRecord.java View File

@@ -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

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestEndSubRecord.java View File

@@ -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);

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java View File

@@ -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();

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestExtSSTRecord.java View File

@@ -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" +

+ 4
- 4
src/testcases/org/apache/poi/hssf/record/TestExtendedFormatRecord.java View File

@@ -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());


+ 8
- 8
src/testcases/org/apache/poi/hssf/record/TestExternalNameRecord.java View File

@@ -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[] {

+ 3
- 3
src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java View File

@@ -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);

+ 5
- 5
src/testcases/org/apache/poi/hssf/record/TestFontRecord.java View File

@@ -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

+ 6
- 6
src/testcases/org/apache/poi/hssf/record/TestFormulaRecord.java View File

@@ -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

+ 3
- 3
src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java View File

@@ -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();


+ 15
- 15
src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java View File

@@ -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());

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestInterfaceEndRecord.java View File

@@ -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

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java View File

@@ -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);

+ 4
- 4
src/testcases/org/apache/poi/hssf/record/TestLbsDataSubRecord.java View File

@@ -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

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java View File

@@ -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);

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestNameCommentRecord.java View File

@@ -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]");

+ 6
- 6
src/testcases/org/apache/poi/hssf/record/TestNameRecord.java View File

@@ -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());


+ 4
- 4
src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java View File

@@ -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.

+ 3
- 3
src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java View File

@@ -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();


+ 5
- 5
src/testcases/org/apache/poi/hssf/record/TestObjRecord.java View File

@@ -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 "

+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestPLVRecord.java View File

@@ -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)) {


+ 1
- 1
src/testcases/org/apache/poi/hssf/record/TestPaletteRecord.java View File

@@ -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

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestPaneRecord.java View File

@@ -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);

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestRecalcIdRecord.java View File

@@ -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

+ 5
- 5
src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java View File

@@ -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

+ 4
- 4
src/testcases/org/apache/poi/hssf/record/TestRecordInputStream.java View File

@@ -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));
}

+ 2
- 2
src/testcases/org/apache/poi/hssf/record/TestSCLRecord.java View File

@@ -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 );

+ 0
- 0
src/testcases/org/apache/poi/hssf/record/TestSSTDeserializer.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save