diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-01-02 21:00:18 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-01-02 21:00:18 +0000 |
commit | 620b8d2c5c9b990f04d2c8583f2ab342f5468712 (patch) | |
tree | 0ce8e0ada736cec0c54028293e8460b755650648 /src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java | |
parent | 6658a0b6645cbb835f3a430f3dc76f66d25ef74d (diff) | |
download | poi-620b8d2c5c9b990f04d2c8583f2ab342f5468712.tar.gz poi-620b8d2c5c9b990f04d2c8583f2ab342f5468712.zip |
Sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885035 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java')
-rw-r--r-- | src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java index 91325fee38..0838857f80 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java @@ -107,38 +107,33 @@ public abstract class BaseTestBugzillaIssues { * open resulting file in Excel to check results! * @param num the number of strings to generate */ - public final void bug15375(int num) throws IOException { + @Test + public final void bug15375_2() throws IOException { try (Workbook wb1 = _testDataProvider.createWorkbook()) { Sheet sheet = wb1.createSheet(); CreationHelper factory = wb1.getCreationHelper(); - for (int i = 0; i < num; i++) { - String tmp1 = "Test1" + i; - String tmp2 = "Test2" + i; - String tmp3 = "Test3" + i; + final int num = wb1 instanceof HSSFWorkbook ? 6000 : 1000; + for (int i = 0; i < num; i++) { Row row = sheet.createRow(i); Cell cell = row.createCell(0); - cell.setCellValue(factory.createRichTextString(tmp1)); + cell.setCellValue(factory.createRichTextString("Test1" + i)); cell = row.createCell(1); - cell.setCellValue(factory.createRichTextString(tmp2)); + cell.setCellValue(factory.createRichTextString("Test2" + i)); cell = row.createCell(2); - cell.setCellValue(factory.createRichTextString(tmp3)); + cell.setCellValue(factory.createRichTextString("Test3" + i)); } try (Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1)) { sheet = wb2.getSheetAt(0); for (int i = 0; i < num; i++) { - String tmp1 = "Test1" + i; - String tmp2 = "Test2" + i; - String tmp3 = "Test3" + i; - Row row = sheet.getRow(i); - assertEquals(tmp1, row.getCell(0).getStringCellValue()); - assertEquals(tmp2, row.getCell(1).getStringCellValue()); - assertEquals(tmp3, row.getCell(2).getStringCellValue()); + assertEquals("Test1" + i, row.getCell(0).getStringCellValue()); + assertEquals("Test2" + i, row.getCell(1).getStringCellValue()); + assertEquals("Test3" + i, row.getCell(2).getStringCellValue()); } } } |