Browse Source

Add unfixed test for bug 64759 and make the ones fail which depend on manual opening of files in Microsoft Excel for verification

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884957 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_0_0
Dominik Stadler 3 years ago
parent
commit
42c4e7d89a

+ 1
- 0
src/integrationtest/org/apache/poi/stress/TestAllFiles.java View File

private static final Set<String> EXPECTED_FAILURES = unmodifiableHashSet( private static final Set<String> EXPECTED_FAILURES = unmodifiableHashSet(
// password protected files without known password // password protected files without known password
"spreadsheet/51832.xls", "spreadsheet/51832.xls",
"spreadsheet/64759.xlsx",
"document/PasswordProtected.doc", "document/PasswordProtected.doc",


// TODO: fails XMLExportTest, is this ok? // TODO: fails XMLExportTest, is this ok?

+ 15
- 0
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java View File

import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;


import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
// write to file for manual inspection // write to file for manual inspection
XSSFTestDataSamples.writeOut(wb, "bug 55752 for review"); XSSFTestDataSamples.writeOut(wb, "bug 55752 for review");
} }

fail("Test runs ok, but the resulting file is incorrectly formatted");
} }


@Test @Test
checkRows57423(wbBack.getSheetAt(0)); checkRows57423(wbBack.getSheetAt(0));


wbBack.close(); wbBack.close();

fail("Excel reports that the workbook is corrupt");
} }


private void checkRows57423(Sheet testSheet) throws IOException { private void checkRows57423(Sheet testSheet) throws IOException {
// LibreOffice doesn't complain when rows are not in ascending order // LibreOffice doesn't complain when rows are not in ascending order


wbBack.close(); wbBack.close();

fail("Excel reports that the workbook is corrupt, LibreOffice can read it");
} }
} }


} }


} }

@Test
public void testBug64759() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64759.xlsx")) {
Sheet cloned = wb.cloneSheet(0);
assertNotNull(cloned);
}
}
} }

BIN
test-data/spreadsheet/64759.xlsx View File


Loading…
Cancel
Save