Sonar fixes

JUnit5 test classes and methods should have default package visibility

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885283 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2021-01-09 00:46:52 +00:00
parent 606a313c4c
commit a7d741fd17
207 changed files with 1259 additions and 1198 deletions

View File

@ -78,7 +78,7 @@ module org.apache.poi.ooxml {
exports org.apache.poi.poifs.crypt.dsig.services;
exports org.apache.poi.poifs.crypt.temp;
opens org.apache.poi.openxml4j.opc to org.apache.poi.poi;
opens org.apache.poi.openxml4j.opc to org.apache.poi.poi, org.junit.platform.commons;
/* optional dependencies for xml signatures - you need to add a require entry your module-info
@ -122,5 +122,66 @@ module org.apache.poi.ooxml {
exports org.apache.poi.xssf.usermodel.charts to org.junit.platform.commons;
exports org.apache.poi.xwpf to org.junit.platform.commons;
opens org.apache.poi.extractor.ooxml to org.junit.platform.commons;
opens org.apache.poi.openxml4j.opc.compliance to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.tests to org.junit.platform.commons;
opens org.apache.poi.sl.tests to org.junit.platform.commons;
opens org.apache.poi.sl.tests.draw to org.junit.platform.commons;
opens org.apache.poi.ss.tests to org.junit.platform.commons;
opens org.apache.poi.ss.tests.extractor to org.junit.platform.commons;
opens org.apache.poi.ss.tests.format to org.junit.platform.commons;
opens org.apache.poi.ss.tests.formula to org.junit.platform.commons;
opens org.apache.poi.ss.tests.formula.eval to org.junit.platform.commons;
opens org.apache.poi.ss.tests.formula.functions to org.junit.platform.commons;
opens org.apache.poi.ss.tests.usermodel to org.junit.platform.commons;
opens org.apache.poi.ss.tests.util to org.junit.platform.commons;
opens org.apache.poi.util.tests to org.junit.platform.commons;
opens org.apache.poi.xslf to org.junit.platform.commons;
opens org.apache.poi.xslf.extractor to org.junit.platform.commons;
opens org.apache.poi.xssf.io to org.junit.platform.commons;
opens org.apache.poi.xssf.usermodel.charts to org.junit.platform.commons;
opens org.apache.poi.xwpf to org.junit.platform.commons;
opens org.apache.poi.xwpf.extractor to org.junit.platform.commons;
opens org.apache.poi.xwpf.usermodel to org.junit.platform.commons;
opens org.apache.poi.xwpf.model to org.junit.platform.commons;
opens org.apache.poi.xdgf.extractor to org.junit.platform.commons;
opens org.apache.poi.xdgf.exceptions to org.junit.platform.commons;
opens org.apache.poi.xdgf.usermodel to org.junit.platform.commons;
opens org.apache.poi.xdgf.usermodel.section to org.junit.platform.commons;
opens org.apache.poi.xdgf.usermodel.section.geometry to org.junit.platform.commons;
opens org.apache.poi.xdgf.usermodel.shape to org.junit.platform.commons;
opens org.apache.poi.xdgf.usermodel.shape.exceptions to org.junit.platform.commons;
opens org.apache.poi.xdgf.xml to org.junit.platform.commons;
opens org.apache.poi.xdgf.util to org.junit.platform.commons;
opens org.apache.poi.xdgf.geom to org.junit.platform.commons;
opens org.apache.poi.ooxml to org.junit.platform.commons;
opens org.apache.poi.ooxml.dev to org.junit.platform.commons;
opens org.apache.poi.ooxml.extractor to org.junit.platform.commons;
opens org.apache.poi.ooxml.util to org.junit.platform.commons;
opens org.apache.poi.xddf.usermodel to org.junit.platform.commons;
opens org.apache.poi.xddf.usermodel.text to org.junit.platform.commons;
opens org.apache.poi.xddf.usermodel.chart to org.junit.platform.commons;
opens org.apache.poi.openxml4j.exceptions to org.junit.platform.commons;
opens org.apache.poi.openxml4j.opc.internal to org.junit.platform.commons;
opens org.apache.poi.openxml4j.opc.internal.marshallers to org.junit.platform.commons;
opens org.apache.poi.openxml4j.opc.internal.unmarshallers to org.junit.platform.commons;
opens org.apache.poi.openxml4j.util to org.junit.platform.commons;
opens org.apache.poi.xssf to org.junit.platform.commons;
opens org.apache.poi.xssf.extractor to org.junit.platform.commons;
opens org.apache.poi.xssf.eventusermodel to org.junit.platform.commons;
opens org.apache.poi.xssf.usermodel to org.junit.platform.commons;
opens org.apache.poi.xssf.usermodel.helpers to org.junit.platform.commons;
opens org.apache.poi.xssf.usermodel.extensions to org.junit.platform.commons;
opens org.apache.poi.xssf.binary to org.junit.platform.commons;
opens org.apache.poi.xssf.model to org.junit.platform.commons;
opens org.apache.poi.xssf.streaming to org.junit.platform.commons;
opens org.apache.poi.xssf.util to org.junit.platform.commons;
opens org.apache.poi.xslf.draw to org.junit.platform.commons;
opens org.apache.poi.xslf.usermodel to org.junit.platform.commons;
opens org.apache.poi.xslf.model to org.junit.platform.commons;
opens org.apache.poi.xslf.util to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.dsig to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.dsig.facets to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.dsig.services to org.junit.platform.commons;
opens org.apache.poi.poifs.crypt.temp to org.junit.platform.commons;
}

View File

@ -142,7 +142,7 @@ public class TestExtractorFactory {
@ParameterizedTest
@MethodSource("testFileData")
public void testFile(String testcase, File file, String extractor, int count) throws Exception {
void testFile(String testcase, File file, String extractor, int count) throws Exception {
try (POITextExtractor ext = createExtractor(file)) {
assertNotNull(ext);
testExtractor(ext, testcase, extractor, count);
@ -151,7 +151,7 @@ public class TestExtractorFactory {
@ParameterizedTest
@MethodSource("testScratchData")
public void testPOIFS(String testcase, File testFile, String extractor, int count) throws Exception {
void testPOIFS(String testcase, File testFile, String extractor, int count) throws Exception {
// test processing of InputStream
try (FileInputStream fis = new FileInputStream(testFile);
POIFSFileSystem poifs = new POIFSFileSystem(fis);
@ -163,7 +163,7 @@ public class TestExtractorFactory {
@ParameterizedTest
@MethodSource("testFileData")
public void testOOXML(String testcase, File testFile, String extractor, int count) throws Exception {
void testOOXML(String testcase, File testFile, String extractor, int count) throws Exception {
// test processing of InputStream
try (FileInputStream fis = new FileInputStream(testFile);
POITextExtractor ext = createExtractor(fis)) {
@ -174,7 +174,7 @@ public class TestExtractorFactory {
@ParameterizedTest
@MethodSource("testOOXMLData")
public void testPackage(String testcase, File testFile, String extractor, int count) throws Exception {
void testPackage(String testcase, File testFile, String extractor, int count) throws Exception {
try (final OPCPackage pkg = OPCPackage.open(testFile, PackageAccess.READ);
final POITextExtractor ext = xmlFactory.create(pkg)) {
assertNotNull(ext);
@ -184,13 +184,13 @@ public class TestExtractorFactory {
}
@Test
public void testFileInvalid() {
void testFileInvalid() {
IOException ex = assertThrows(IOException.class, () -> createExtractor(txt));
assertEquals("Can't create extractor - unsupported file type: UNKNOWN", ex.getMessage());
}
@Test
public void testInputStreamInvalid() throws IOException {
void testInputStreamInvalid() throws IOException {
try (FileInputStream fis = new FileInputStream(txt)) {
IOException ex = assertThrows(IOException.class, () -> createExtractor(fis));
assertTrue(ex.getMessage().contains(FileMagic.UNKNOWN.name()));
@ -198,7 +198,7 @@ public class TestExtractorFactory {
}
@Test
public void testPOIFSInvalid() {
void testPOIFSInvalid() {
// Not really an Extractor test, but we'll leave it to test POIFS reaction anyway ...
IOException ex = assertThrows(IOException.class, () -> new POIFSFileSystem(txt));
assertTrue(ex.getMessage().contains("Invalid header signature; read 0x3D20726F68747541, expected 0xE11AB1A1E011CFD0"));
@ -214,13 +214,13 @@ public class TestExtractorFactory {
}
}
@Test
public void testPackageInvalid() {
void testPackageInvalid() {
// Text
assertThrows(NotOfficeXmlFileException.class, () -> OPCPackage.open(txt, PackageAccess.READ));
}
@Test
public void testPreferEventBased() throws Exception {
void testPreferEventBased() throws Exception {
assertFalse(ExtractorFactory.getPreferEventExtractor());
assertFalse(ExtractorFactory.getThreadPrefersEventExtractors());
assertNull(ExtractorFactory.getAllThreadsPreferEventExtractors());
@ -300,7 +300,7 @@ public class TestExtractorFactory {
*/
@ParameterizedTest
@MethodSource("testEmbeddedData")
public void testEmbedded(String format, File file, String expected) throws Exception {
void testEmbedded(String format, File file, String expected) throws Exception {
int numWord = 0, numXls = 0, numPpt = 0, numMsg = 0, numWordX = 0;
try (final POIOLE2TextExtractor ext = (POIOLE2TextExtractor) createExtractor(file)) {
@ -417,7 +417,7 @@ public class TestExtractorFactory {
"spreadsheet/WithChartSheet.xlsx",
"spreadsheet/chart_sheet.xlsx"
})
public void testFileLeak(String file) {
void testFileLeak(String file) {
// run a number of files that might fail in order to catch
// leaked file resources when using file-leak-detector while
// running the test
@ -437,7 +437,7 @@ public class TestExtractorFactory {
}
@Test
public void testGetEmbeddedFromXMLExtractor() {
void testGetEmbeddedFromXMLExtractor() {
// currently not implemented
assertThrows(IllegalStateException.class, () -> ExtractorFactory.getEmbeddedDocsTextExtractors(null));
}
@ -446,7 +446,7 @@ public class TestExtractorFactory {
// When this happens, change this from @Test(expected=...) to @Test
// bug 45565: text within TextBoxes is extracted by ExcelExtractor and WordExtractor
@Test
public void test45565() throws Exception {
void test45565() throws Exception {
try (POITextExtractor extractor = ex("45565.xls")) {
String text = extractor.getText();
assertThrows(AssertionError.class, () -> {

View File

@ -42,7 +42,7 @@ import org.junit.jupiter.params.provider.CsvSource;
@SuppressWarnings("deprecation")
public class TestDetectAsOOXML {
@Test
public void testOpensProperly() throws IOException, InvalidFormatException {
void testOpensProperly() throws IOException, InvalidFormatException {
try (InputStream is = openSampleFileStream("sample.xlsx");
OPCPackage pkg = OPCPackage.open(is)) {
assertNotNull(pkg);
@ -51,7 +51,7 @@ public class TestDetectAsOOXML {
@ParameterizedTest
@CsvSource({"SampleSS.xlsx, OOXML", "SampleSS.xls, OLE2", "SampleSS.txt, UNKNOWN"})
public void testDetectAsPOIFS(String file, FileMagic fm) throws IOException {
void testDetectAsPOIFS(String file, FileMagic fm) throws IOException {
try (InputStream is = FileMagic.prepareToCheckMagic(openSampleFileStream(file))) {
FileMagic act = FileMagic.valueOf(is);
@ -63,7 +63,7 @@ public class TestDetectAsOOXML {
}
@Test
public void testFileCorruption() throws Exception {
void testFileCorruption() throws Exception {
// create test InputStream
byte[] testData = { 1, 2, 3 };
ByteArrayInputStream testInput = new ByteArrayInputStream(testData);

View File

@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
*/
public class TestEmbedded {
@Test
public void testExcel() throws Exception {
void testExcel() throws Exception {
POIXMLDocument doc = new XSSFWorkbook(
POIDataSamples.getSpreadSheetInstance().openResourceAsStream("ExcelWithAttachments.xlsm")
);
@ -45,7 +45,7 @@ public class TestEmbedded {
}
@Test
public void testWord() throws Exception {
void testWord() throws Exception {
POIXMLDocument doc = new XWPFDocument(
POIDataSamples.getDocumentInstance().openResourceAsStream("WordWithAttachments.docx")
);
@ -53,7 +53,7 @@ public class TestEmbedded {
}
@Test
public void testPowerPoint() throws Exception {
void testPowerPoint() throws Exception {
POIXMLDocument doc = new XSLFSlideShow(OPCPackage.open(
POIDataSamples.getSlideShowInstance().openResourceAsStream("PPTWithAttachments.pptm"))
);

View File

@ -177,22 +177,22 @@ public final class TestPOIXMLDocument {
}
@Test
public void testPPTX() throws Exception {
void testPPTX() throws Exception {
assertReadWrite(POIDataSamples.getSlideShowInstance(), "PPTWithAttachments.pptm");
}
@Test
public void testXLSX() throws Exception {
void testXLSX() throws Exception {
assertReadWrite(POIDataSamples.getSpreadSheetInstance(), "ExcelWithAttachments.xlsm");
}
@Test
public void testDOCX() throws Exception {
void testDOCX() throws Exception {
assertReadWrite(POIDataSamples.getDocumentInstance(), "WordWithAttachments.docx");
}
@Test
public void testRelationOrder() throws Exception {
void testRelationOrder() throws Exception {
POIDataSamples pds = POIDataSamples.getDocumentInstance();
try (InputStream is = pds.openResourceAsStream("WordWithAttachments.docx");
OPCPackage pkg = PackageHelper.open(is);
@ -207,7 +207,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void testGetNextPartNumber() throws Exception {
void testGetNextPartNumber() throws Exception {
POIDataSamples pds = POIDataSamples.getDocumentInstance();
try (InputStream is = pds.openResourceAsStream("WordWithAttachments.docx");
OPCPackage pkg = PackageHelper.open(is);
@ -237,7 +237,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void testCommitNullPart() throws IOException {
void testCommitNullPart() throws IOException {
POIXMLDocumentPart part = new POIXMLDocumentPart();
part.prepareForCommit();
part.commit();
@ -253,7 +253,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void testVSDX() throws Exception {
void testVSDX() throws Exception {
POIDataSamples pds = POIDataSamples.getDiagramInstance();
try (InputStream is = pds.openResourceAsStream("test.vsdx");
OPCPackage open = PackageHelper.open(is);
@ -264,7 +264,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void testVSDXPart() throws IOException {
void testVSDXPart() throws IOException {
POIDataSamples pds = POIDataSamples.getDiagramInstance();
try (InputStream is = pds.openResourceAsStream("test.vsdx");
OPCPackage open = PackageHelper.open(is)) {
@ -277,7 +277,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void testInvalidCoreRel() throws IOException {
void testInvalidCoreRel() throws IOException {
POIDataSamples pds = POIDataSamples.getDiagramInstance();
try (OPCPackage open = PackageHelper.open(pds.openResourceAsStream("test.vsdx"))) {
assertThrows(POIXMLException.class, () -> new POIXMLDocumentPart(open, "somethingillegal"));
@ -297,7 +297,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void testOSGIClassLoading() throws IOException {
void testOSGIClassLoading() throws IOException {
byte[] data;
try (InputStream is = POIDataSamples.getSlideShowInstance().openResourceAsStream("table_test.pptx")) {
data = IOUtils.toByteArray(is);

View File

@ -72,7 +72,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testWorkbookExtendedProperties() throws Exception {
void testWorkbookExtendedProperties() throws Exception {
XSSFWorkbook workbook = new XSSFWorkbook();
POIXMLProperties props = workbook.getProperties();
assertNotNull(props);
@ -114,7 +114,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testWorkbookExtendedPropertiesGettersSetters() throws Exception {
void testWorkbookExtendedPropertiesGettersSetters() throws Exception {
XSSFWorkbook workbook = new XSSFWorkbook();
POIXMLProperties props = workbook.getProperties();
assertNotNull(props);
@ -154,7 +154,7 @@ public final class TestPOIXMLProperties {
* Test usermodel API for setting custom properties
*/
@Test
public void testCustomProperties() throws Exception {
void testCustomProperties() throws Exception {
try (XSSFWorkbook wb1 = new XSSFWorkbook()) {
POIXMLProperties.CustomProperties customProps = wb1.getProperties().getCustomProperties();
@ -200,7 +200,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testDocumentProperties() {
void testDocumentProperties() {
String category = _coreProperties.getCategory();
assertEquals("test", category);
String contentStatus = "Draft";
@ -218,7 +218,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testTransitiveSetters() throws IOException {
void testTransitiveSetters() throws IOException {
XWPFDocument doc = new XWPFDocument();
CoreProperties cp = doc.getProperties().getCoreProperties();
@ -236,7 +236,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testGetSetRevision() {
void testGetSetRevision() {
String revision = _coreProperties.getRevision();
assertTrue(Integer.parseInt(revision) > 1, "Revision number is 1");
_coreProperties.setRevision("20");
@ -246,7 +246,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testLastModifiedByUserProperty() {
void testLastModifiedByUserProperty() {
String lastModifiedByUser = _coreProperties.getLastModifiedByUser();
assertEquals("Paolo Mottadelli", lastModifiedByUser);
_coreProperties.setLastModifiedByUser("Test User");
@ -268,7 +268,7 @@ public final class TestPOIXMLProperties {
@Disabled("Fails to add some of the thumbnails, needs more investigation")
@Test
public void testThumbnails() throws Exception {
void testThumbnails() throws Exception {
POIXMLProperties noThumbProps = sampleNoThumb.getProperties();
assertNotNull(_props.getThumbnailPart());
@ -308,7 +308,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testAddProperty() throws IOException {
void testAddProperty() throws IOException {
try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("documentProperties.docx")) {
POIXMLProperties.CustomProperties cps = doc.getProperties().getCustomProperties();
assertEquals(1, cps.getLastPid());
@ -320,7 +320,7 @@ public final class TestPOIXMLProperties {
}
@Test
public void testBug60977() throws IOException {
void testBug60977() throws IOException {
try (final XSSFWorkbook workbook = new XSSFWorkbook()) {
final Sheet sheet = workbook.createSheet("sheet");

View File

@ -85,7 +85,7 @@ public class TestTriggerCoverage {
@ParameterizedTest
@MethodSource("files")
public void testFile(File file) throws Exception {
void testFile(File file) throws Exception {
try (InputStream stream = new FileInputStream(file)) {
if (file.getName().endsWith(".docx")) {
try (XWPFDocument doc = new XWPFDocument(stream)) {

View File

@ -35,7 +35,7 @@ public final class TestXMLPropertiesTextExtractor {
private static final POIDataSamples _slSamples = POIDataSamples.getSlideShowInstance();
@Test
public void testGetFromMainExtractor() throws Exception {
void testGetFromMainExtractor() throws Exception {
OPCPackage pkg = PackageHelper.open(_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm"));
XSSFWorkbook wb = new XSSFWorkbook(pkg);
@ -59,7 +59,7 @@ public final class TestXMLPropertiesTextExtractor {
}
@Test
public void testCore() throws Exception {
void testCore() throws Exception {
OPCPackage pkg = PackageHelper.open(
_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm")
);
@ -79,7 +79,7 @@ public final class TestXMLPropertiesTextExtractor {
}
@Test
public void testExtended() throws Exception {
void testExtended() throws Exception {
OPCPackage pkg = OPCPackage.open(
_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm")
);
@ -101,7 +101,7 @@ public final class TestXMLPropertiesTextExtractor {
}
@Test
public void testCustom() throws Exception {
void testCustom() throws Exception {
OPCPackage pkg = OPCPackage.open(
_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm")
);
@ -125,7 +125,7 @@ public final class TestXMLPropertiesTextExtractor {
* dates can be null
*/
@Test
public void testWithSomeNulls() throws Exception {
void testWithSomeNulls() throws Exception {
OPCPackage pkg = OPCPackage.open(
_slSamples.openResourceAsStream("49386-null_dates.pptx")
);

View File

@ -51,7 +51,7 @@ public final class TestContentType {
*/
@ParameterizedTest
@ValueSource(strings = {"text/xml", "application/pgp-key", "application/vnd.hp-PCLXL", "application/vnd.lotus-1-2-3"})
public void testContentTypeValidation(String contentType) throws InvalidFormatException {
void testContentTypeValidation(String contentType) throws InvalidFormatException {
assertDoesNotThrow(() -> new ContentType(contentType));
}
@ -78,7 +78,7 @@ public final class TestContentType {
"text[/xml", "text]/xml", "text?/xml", "tex=t/xml",
"te{xt/xml", "tex}t/xml", "te xt/xml",
"text\u0009/xml", "text xml", " text/xml "})
public void testContentTypeValidationFailure(String contentType) {
void testContentTypeValidationFailure(String contentType) {
assertThrows(InvalidFormatException.class, () -> new ContentType(contentType),
"Must have fail for content type: '" + contentType + "' !");
}
@ -94,7 +94,7 @@ public final class TestContentType {
"text/xml;a=b;c=d", "text/xml;key1=param1;key2=param2",
"application/pgp-key;version=\"2\"",
"application/x-resqml+xml;version=2.0;type=obj_global2dCrs"})
public void testContentTypeParam(String contentType) {
void testContentTypeParam(String contentType) {
assertDoesNotThrow(() -> new ContentType(contentType));
}
@ -108,7 +108,7 @@ public final class TestContentType {
"mail/toto;titi = tata", // spaces not allowed
"text/\u0080" // characters above ASCII are not allowed
})
public void testContentTypeParameterFailure(String contentType) {
void testContentTypeParameterFailure(String contentType) {
assertThrows(InvalidFormatException.class, () -> new ContentType(contentType),
"Must have fail for content type: '" + contentType + "' !");
}
@ -120,7 +120,7 @@ public final class TestContentType {
*/
@ParameterizedTest
@ValueSource(strings = {"text/xml(comment)"})
public void testContentTypeCommentFailure(String contentType) {
void testContentTypeCommentFailure(String contentType) {
assertThrows(InvalidFormatException.class, () -> new ContentType(contentType),
"Must have fail for content type: '" + contentType + "' !");
}
@ -131,7 +131,7 @@ public final class TestContentType {
* (expected = InvalidFormatException.class)
*/
@Test
public void testFileWithContentTypeEntities() throws Exception {
void testFileWithContentTypeEntities() throws Exception {
try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("ContentTypeHasEntities.ooxml")) {
if (isOldXercesActive()) {
OPCPackage.open(is);
@ -146,7 +146,7 @@ public final class TestContentType {
* parameters on a content type
*/
@Test
public void testFileWithContentTypeParams() throws Exception {
void testFileWithContentTypeParams() throws Exception {
try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("ContentTypeHasParameters.ooxml");
OPCPackage p = OPCPackage.open(is)) {

View File

@ -38,7 +38,7 @@ public final class TestFileHelper {
* {@link File#getName()} instead of {@link FileHelper#getFilename(File)
*/
@Test
public void testGetDirectory() {
void testGetDirectory() {
TreeMap<String, String> expectedValue = new TreeMap<>();
expectedValue.put("/dir1/test.doc", "/dir1");
expectedValue.put("/dir1/dir2/test.doc.xml", "/dir1/dir2");

View File

@ -85,7 +85,7 @@ public final class TestListParts {
* List all parts of a package.
*/
@Test
public void testListParts() throws InvalidFormatException, IOException {
void testListParts() throws InvalidFormatException, IOException {
try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("sample.docx");
OPCPackage p = OPCPackage.open(is)) {

View File

@ -711,7 +711,7 @@ public final class TestPackage {
}
@Test
public void testZipEntityExpansionTerminates() {
void testZipEntityExpansionTerminates() {
IllegalStateException ex = assertThrows(
IllegalStateException.class,
() -> openXmlBombFile("poc-shared-strings.xlsx")
@ -720,7 +720,7 @@ public final class TestPackage {
}
@Test
public void testZipEntityExpansionSharedStringTableEvents() {
void testZipEntityExpansionSharedStringTableEvents() {
boolean before = ExtractorFactory.getThreadPrefersEventExtractors();
ExtractorFactory.setThreadPrefersEventExtractors(true);
try {
@ -736,7 +736,7 @@ public final class TestPackage {
@Test
public void testZipEntityExpansionExceedsMemory() {
void testZipEntityExpansionExceedsMemory() {
IOException ex = assertThrows(
IOException.class,
() -> openXmlBombFile("poc-xmlbomb.xlsx")
@ -746,7 +746,7 @@ public final class TestPackage {
}
@Test
public void testZipEntityExpansionExceedsMemory2() {
void testZipEntityExpansionExceedsMemory2() {
IOException ex = assertThrows(
IOException.class,
() -> openXmlBombFile("poc-xmlbomb-empty.xlsx")
@ -845,7 +845,7 @@ public final class TestPackage {
}
@Test
public void testConstructors() throws IOException {
void testConstructors() throws IOException {
// verify the various ways to construct a ZipSecureFile
File file = getSampleFile("sample.xlsx");
try (ZipSecureFile zipFile = new ZipSecureFile(file)) {
@ -858,7 +858,7 @@ public final class TestPackage {
}
@Test
public void testMaxTextSize() {
void testMaxTextSize() {
long before = ZipSecureFile.getMaxTextSize();
try {
ZipSecureFile.setMaxTextSize(12345);
@ -870,7 +870,7 @@ public final class TestPackage {
// bug 60128
@Test
public void testCorruptFile() {
void testCorruptFile() {
File file = getSampleFile("invalid.xlsx");
assertThrows(NotOfficeXmlFileException.class, () -> OPCPackage.open(file, PackageAccess.READ));
}
@ -881,7 +881,7 @@ public final class TestPackage {
// bug 61381
@Test
public void testTooShortFilterStreams() throws IOException {
void testTooShortFilterStreams() throws IOException {
for (String file : new String[]{"sample.xlsx","SampleSS.xls"}) {
for (CountingStream cs : new CountingStream[]{PushbackInputStream::new, BufferedInputStream::new}) {
try (InputStream is = cs.create(xlsSamples.openResourceAsStream(file), 2);
@ -893,7 +893,7 @@ public final class TestPackage {
}
@Test
public void testBug56479() throws Exception {
void testBug56479() throws Exception {
try (InputStream is = openSampleStream("dcterms_bug_56479.zip");
OPCPackage p = OPCPackage.open(is)) {
@ -933,7 +933,7 @@ public final class TestPackage {
}
@Test
public void testClosingStreamOnException() throws IOException {
void testClosingStreamOnException() throws IOException {
File tmp = File.createTempFile("poi-test-truncated-zip", "");
// create a corrupted zip file by truncating a valid zip file to the first 100 bytes
@ -959,34 +959,34 @@ public final class TestPackage {
* See bug #60128 for more
*/
@Test
public void testTidyStreamOnInvalidFile1() throws Exception {
void testTidyStreamOnInvalidFile1() throws Exception {
openInvalidFile("SampleSS.ods", false);
}
@Test
public void testTidyStreamOnInvalidFile2() throws Exception {
void testTidyStreamOnInvalidFile2() throws Exception {
openInvalidFile("SampleSS.ods", true);
}
@Test
public void testTidyStreamOnInvalidFile3() throws Exception {
void testTidyStreamOnInvalidFile3() throws Exception {
openInvalidFile("SampleSS.txt", false);
}
@Test
public void testTidyStreamOnInvalidFile4() throws Exception {
void testTidyStreamOnInvalidFile4() throws Exception {
openInvalidFile("SampleSS.txt", true);
}
@Test
public void testBug62592() throws Exception {
void testBug62592() throws Exception {
try (InputStream is = openSampleStream("62592.thmx")) {
assertThrows(InvalidFormatException.class, () -> OPCPackage.open(is));
}
}
@Test
public void testBug62592SequentialCallsToGetParts() throws Exception {
void testBug62592SequentialCallsToGetParts() throws Exception {
//make absolutely certain that sequential calls don't throw InvalidFormatExceptions
String originalFile = getSampleFileName("TestPackageCommon.docx");
try (OPCPackage p2 = OPCPackage.open(originalFile, PackageAccess.READ)) {
@ -996,7 +996,7 @@ public final class TestPackage {
}
@Test
public void testDoNotCloseStream() throws IOException {
void testDoNotCloseStream() throws IOException {
// up to JDK 10 we did use Mockito here, but OutputStream is
// an abstract class and fails mocking with some changes in JDK 11
// so we use a simple empty output stream implementation instead
@ -1047,7 +1047,7 @@ public final class TestPackage {
@SuppressWarnings("UnstableApiUsage")
@Test
public void testBug63029() throws Exception {
void testBug63029() throws Exception {
File testFile = getSampleFile("sample.docx");
File tmpFile = getOutputFile("Bug63029.docx");
Files.copy(testFile, tmpFile);

View File

@ -44,7 +44,7 @@ public final class TestPackageCoreProperties {
* Test package core properties getters.
*/
@Test
public void testGetProperties() throws Exception {
void testGetProperties() throws Exception {
// Open the package
@SuppressWarnings("resource")
OPCPackage p = OPCPackage.open(OpenXML4JTestDataSamples.openSampleStream("TestPackageCoreProperiesGetters.docx"));
@ -56,7 +56,7 @@ public final class TestPackageCoreProperties {
* Test package core properties setters.
*/
@Test
public void testSetProperties() throws Exception {
void testSetProperties() throws Exception {
String inputPath = OpenXML4JTestDataSamples.getSampleFileName("TestPackageCoreProperiesSetters.docx");
File outputFile = OpenXML4JTestDataSamples.getOutputFile("TestPackageCoreProperiesSettersOUTPUT.docx");
@ -151,7 +151,7 @@ public final class TestPackageCoreProperties {
}
@Test
public void testCoreProperties_bug51374() throws Exception {
void testCoreProperties_bug51374() throws Exception {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ROOT);
df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
String strDate = "2007-05-12T08:00:00Z";
@ -210,7 +210,7 @@ public final class TestPackageCoreProperties {
}
@Test
public void testGetPropertiesLO() throws Exception {
void testGetPropertiesLO() throws Exception {
// Open the package
OPCPackage pkg1 = OPCPackage.open(OpenXML4JTestDataSamples.openSampleStream("51444.xlsx"));
PackageProperties props1 = pkg1.getPackageProperties();
@ -228,7 +228,7 @@ public final class TestPackageCoreProperties {
}
@Test
public void testEntitiesInCoreProps_56164() throws Exception {
void testEntitiesInCoreProps_56164() throws Exception {
try (InputStream is = OpenXML4JTestDataSamples.openSampleStream("CorePropertiesHasEntities.ooxml");
OPCPackage p = OPCPackage.open(is)) {
@ -255,7 +255,7 @@ public final class TestPackageCoreProperties {
}
@Test
public void testListOfCustomProperties() throws Exception {
void testListOfCustomProperties() throws Exception {
File inp = POIDataSamples.getSpreadSheetInstance().getFile("ExcelWithAttachments.xlsm");
OPCPackage pkg = OPCPackage.open(inp, PackageAccess.READ);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
@ -272,7 +272,7 @@ public final class TestPackageCoreProperties {
}
@Test
public void testAlternateCorePropertyTimezones() throws Exception {
void testAlternateCorePropertyTimezones() throws Exception {
InputStream is = OpenXML4JTestDataSamples.openSampleStream("OPCCompliance_CoreProperties_AlternateTimezones.docx");
OPCPackage pkg = OPCPackage.open(is);
PackagePropertiesPart props = (PackagePropertiesPart)pkg.getPackageProperties();

View File

@ -27,7 +27,7 @@ public final class TestPackagePartName {
* Test method getExtension().
*/
@Test
public void testGetExtension() throws Exception{
void testGetExtension() throws Exception{
PackagePartName name1 = PackagingURIHelper.createPartName("/doc/props/document.xml");
PackagePartName name2 = PackagingURIHelper.createPartName("/root/document");
assertEquals("xml", name1.getExtension());

View File

@ -35,7 +35,7 @@ public final class TestPackageThumbnail {
* Test package addThumbnail() method.
*/
@Test
public void testSetProperties() throws Exception {
void testSetProperties() throws Exception {
String inputPath = OpenXML4JTestDataSamples.getSampleFileName("TestPackageThumbnail.docx");
String imagePath = OpenXML4JTestDataSamples.getSampleFileName("thumbnail.jpg");

View File

@ -30,7 +30,7 @@ public class TestPackagingURIHelper {
* Test relativizePartName() method.
*/
@Test
public void testRelativizeURI() throws Exception {
void testRelativizeURI() throws Exception {
URI uri1 = new URI("/word/document.xml");
URI uri2 = new URI("/word/media/image1.gif");
URI uri3 = new URI("/word/media/image1.gif#Sheet1!A1");
@ -79,7 +79,7 @@ public class TestPackagingURIHelper {
* Test createPartName(String, y)
*/
@Test
public void testCreatePartNameRelativeString()
void testCreatePartNameRelativeString()
throws InvalidFormatException {
PackagePartName partNameToValid = PackagingURIHelper
.createPartName("/word/media/image1.gif");
@ -100,7 +100,7 @@ public class TestPackagingURIHelper {
* Test createPartName(URI, y)
*/
@Test
public void testCreatePartNameRelativeURI() throws Exception {
void testCreatePartNameRelativeURI() throws Exception {
PackagePartName partNameToValid = PackagingURIHelper
.createPartName("/word/media/image1.gif");
@ -117,7 +117,7 @@ public class TestPackagingURIHelper {
}
@Test
public void testCreateURIFromString() throws Exception {
void testCreateURIFromString() throws Exception {
String[] href = {
"..\\\\\\cygwin\\home\\yegor\\.vim\\filetype.vim",
"..\\Program%20Files\\AGEIA%20Technologies\\v2.3.3\\NxCooking.dll",
@ -136,7 +136,7 @@ public class TestPackagingURIHelper {
}
@Test
public void test53734() throws Exception {
void test53734() throws Exception {
URI uri = PackagingURIHelper.toURI("javascript://");
// POI appends a trailing slash tpo avoid "Expected authority at index 13: javascript://"
// https://issues.apache.org/bugzilla/show_bug.cgi?id=53734

View File

@ -53,7 +53,7 @@ public class TestRelationships {
* really look also for not yet loaded parts.
*/
@Test
public void testLoadRelationships() throws Exception {
void testLoadRelationships() throws Exception {
InputStream is = openSampleStream("sample.xlsx");
try (OPCPackage pkg = OPCPackage.open(is)) {
logger.log(POILogger.DEBUG, "1: " + pkg);
@ -76,7 +76,7 @@ public class TestRelationships {
* type, then grab from within there by id
*/
@Test
public void testFetchFromCollection() throws Exception {
void testFetchFromCollection() throws Exception {
InputStream is = openSampleStream("ExcelWithHyperlinks.xlsx");
try (OPCPackage pkg = OPCPackage.open(is)) {
PackagePart sheet = pkg.getPart(
@ -119,7 +119,7 @@ public class TestRelationships {
* external hyperlinks. Check we can load these ok.
*/
@Test
public void testLoadExcelHyperlinkRelations() throws Exception {
void testLoadExcelHyperlinkRelations() throws Exception {
InputStream is = openSampleStream("ExcelWithHyperlinks.xlsx");
try (OPCPackage pkg = OPCPackage.open(is)) {
PackagePart sheet = pkg.getPart(
@ -155,7 +155,7 @@ public class TestRelationships {
* then still read them later
*/
@Test
public void testCreateExcelHyperlinkRelations() throws Exception {
void testCreateExcelHyperlinkRelations() throws Exception {
String filepath = OpenXML4JTestDataSamples.getSampleFileName("ExcelWithHyperlinks.xlsx");
OPCPackage pkg = OPCPackage.open(filepath, PackageAccess.READ_WRITE);
PackagePart sheet = pkg.getPart(
@ -227,7 +227,7 @@ public class TestRelationships {
}
@Test
public void testCreateRelationsFromScratch() throws Exception {
void testCreateRelationsFromScratch() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OPCPackage pkg = OPCPackage.create(baos);
@ -296,7 +296,7 @@ public class TestRelationships {
}
@Test
public void testTargetWithSpecialChars() throws Exception{
void testTargetWithSpecialChars() throws Exception{
OPCPackage pkg;
String filepath = OpenXML4JTestDataSamples.getSampleFileName("50154.xlsx");
@ -358,7 +358,7 @@ public class TestRelationships {
}
@Test
public void testSelfRelations_bug51187() throws Exception {
void testSelfRelations_bug51187() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PackageRelationship rel1;
try (OPCPackage pkg = OPCPackage.create(baos)) {
@ -394,7 +394,7 @@ public class TestRelationships {
}
@Test
public void testTrailingSpacesInURI_53282() throws Exception {
void testTrailingSpacesInURI_53282() throws Exception {
try (InputStream is = openSampleStream("53282.xlsx");
OPCPackage pkg1 = OPCPackage.open(is)) {
@ -423,7 +423,7 @@ public class TestRelationships {
}
@Test
public void testEntitiesInRels_56164() throws Exception {
void testEntitiesInRels_56164() throws Exception {
try (InputStream is = openSampleStream("PackageRelsHasEntities.ooxml");
OPCPackage p = OPCPackage.open(is)) {

View File

@ -80,7 +80,7 @@ import org.junit.jupiter.api.Test;
public final class TestOPCComplianceCoreProperties {
@Test
public void testCorePropertiesPart() {
void testCorePropertiesPart() {
OPCPackage pkg;
try {
InputStream is = openComplianceSampleStream("OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx");
@ -103,7 +103,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.1 rule.
*/
@Test
public void testOnlyOneCorePropertiesPart() throws Exception {
void testOnlyOneCorePropertiesPart() throws Exception {
// We have relaxed this check, so we can read the file anyway
assertDoesNotThrow(() -> {
try (InputStream is = openSampleStream("OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx");
@ -141,7 +141,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.1 rule.
*/
@Test
public void testOnlyOneCorePropertiesPart_AddRelationship() throws IOException, InvalidFormatException {
void testOnlyOneCorePropertiesPart_AddRelationship() throws IOException, InvalidFormatException {
try (InputStream is = openComplianceSampleStream("OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx")) {
OPCPackage pkg = OPCPackage.open(is);
URI partUri = createURI("/docProps/core2.xml");
@ -158,7 +158,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.1 rule.
*/
@Test
public void testOnlyOneCorePropertiesPart_AddPart() throws InvalidFormatException, IOException {
void testOnlyOneCorePropertiesPart_AddPart() throws InvalidFormatException, IOException {
String sampleFileName = "OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx";
try (OPCPackage pkg = OPCPackage.open(POIDataSamples.getOpenXML4JInstance().getFile(sampleFileName).getPath())) {
@ -175,7 +175,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.2 rule.
*/
@Test
public void testDoNotUseCompatibilityMarkup() throws IOException {
void testDoNotUseCompatibilityMarkup() throws IOException {
String msg = extractInvalidFormatMessage("DoNotUseCompatibilityMarkupFAIL.docx");
assertEquals("OPC Compliance error [M4.2]: A format consumer shall consider the use of the Markup Compatibility namespace to be an error.", msg);
}
@ -184,7 +184,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.3 rule.
*/
@Test
public void testDCTermsNamespaceLimitedUse() throws IOException {
void testDCTermsNamespaceLimitedUse() throws IOException {
String msg = extractInvalidFormatMessage("DCTermsNamespaceLimitedUseFAIL.docx");
assertEquals("OPC Compliance error [M4.3]: Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.", msg);
}
@ -193,7 +193,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.4 rule.
*/
@Test
public void testUnauthorizedXMLLangAttribute() throws IOException {
void testUnauthorizedXMLLangAttribute() throws IOException {
String msg = extractInvalidFormatMessage("UnauthorizedXMLLangAttributeFAIL.docx");
assertEquals("OPC Compliance error [M4.4]: Producers shall not create a document element that contains the xml:lang attribute. Consumers shall consider a document element that violates this constraint to be an error.", msg);
}
@ -202,7 +202,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.5 rule.
*/
@Test
public void testLimitedXSITypeAttribute_NotPresent() throws IOException {
void testLimitedXSITypeAttribute_NotPresent() throws IOException {
String msg = extractInvalidFormatMessage("LimitedXSITypeAttribute_NotPresentFAIL.docx");
assertEquals("The element 'created' must have the 'xsi:type' attribute present !", msg);
}
@ -211,7 +211,7 @@ public final class TestOPCComplianceCoreProperties {
* Test M4.5 rule.
*/
@Test
public void testLimitedXSITypeAttribute_PresentWithUnauthorizedValue() throws IOException {
void testLimitedXSITypeAttribute_PresentWithUnauthorizedValue() throws IOException {
String msg = extractInvalidFormatMessage("LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx");
assertEquals("The element 'modified' must have the 'xsi:type' attribute with the value 'dcterms:W3CDTF', but had 'W3CDTF' !", msg);
}
@ -221,7 +221,7 @@ public final class TestOPCComplianceCoreProperties {
* saving into a new stream
*/
@Test
public void testNoCoreProperties_saveNew() throws Exception {
void testNoCoreProperties_saveNew() throws Exception {
String sampleFileName = "OPCCompliance_NoCoreProperties.xlsx";
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@ -267,7 +267,7 @@ public final class TestOPCComplianceCoreProperties {
* from a temp-file, saving in-place
*/
@Test
public void testNoCoreProperties_saveInPlace() throws Exception {
void testNoCoreProperties_saveInPlace() throws Exception {
String sampleFileName = "OPCCompliance_NoCoreProperties.xlsx";
// Copy this into a temp file, so we can play with it

View File

@ -66,7 +66,7 @@ public class TestOPCCompliancePackageModel {
* [M1.11]
*/
@Test
public void testPartNameDerivationAdditionFailure() throws InvalidFormatException, IOException {
void testPartNameDerivationAdditionFailure() throws InvalidFormatException, IOException {
try (OPCPackage pkg = OPCPackage.create(TESTFILE)) {
PackagePartName name = PackagingURIHelper.createPartName("/word/document.xml");
PackagePartName nameDerived = PackagingURIHelper.createPartName("/word/document.xml/image1.gif");
@ -85,7 +85,7 @@ public class TestOPCCompliancePackageModel {
* [M1.11]
*/
@Test
public void testPartNameDerivationReadingFailure() {
void testPartNameDerivationReadingFailure() {
String filename = "OPCCompliance_DerivedPartNameFAIL.docx";
assertThrows(InvalidFormatException.class, () ->
OPCPackage.open(POIDataSamples.getOpenXML4JInstance().openResourceAsStream(filename)),
@ -100,7 +100,7 @@ public class TestOPCCompliancePackageModel {
* part names.
*/
@Test
public void testAddPackageAlreadyAddFailure() throws Exception {
void testAddPackageAlreadyAddFailure() throws Exception {
try (OPCPackage pkg = OPCPackage.create(TESTFILE)) {
PackagePartName name1 = PackagingURIHelper.createPartName("/word/document.xml");
PackagePartName name2 = PackagingURIHelper.createPartName("/word/document.xml");
@ -120,7 +120,7 @@ public class TestOPCCompliancePackageModel {
* part names.
*/
@Test
public void testAddPackageAlreadyAddFailure2() throws Exception {
void testAddPackageAlreadyAddFailure2() throws Exception {
try (OPCPackage pkg = OPCPackage.create(TESTFILE)) {
PackagePartName partName = PackagingURIHelper.createPartName("/word/document.xml");
pkg.createPart(partName, ContentTypes.XML);
@ -141,7 +141,7 @@ public class TestOPCCompliancePackageModel {
* relationship as invalid.
*/
@Test
public void testAddRelationshipRelationshipsPartFailure() throws IOException, InvalidFormatException {
void testAddRelationshipRelationshipsPartFailure() throws IOException, InvalidFormatException {
try (OPCPackage pkg = OPCPackage.create(TESTFILE)) {
PackagePartName name1 = PackagingURIHelper.createPartName("/test/_rels/document.xml.rels");

View File

@ -91,7 +91,7 @@ public final class TestOPCCompliancePartName {
* A segment shall not contain percent-encoded unreserved characters. [M1.8]
*/
@Test
public void testInvalidPartNames() {
void testInvalidPartNames() {
String[] invalidNames = { "/", "/xml./doc.xml", "[Content_Types].xml", "//xml/." };
for (String s : invalidNames) {
URI uri = null;
@ -109,7 +109,7 @@ public final class TestOPCCompliancePartName {
* Test some common valid names.
*/
@Test
public void testValidPartNames() throws URISyntaxException {
void testValidPartNames() throws URISyntaxException {
String[] validNames = { "/xml/item1.xml", "/document.xml", "/a/%D1%86.xml" };
for (String s : validNames) {
assertTrue(isValidPartName(new URI(s)), "This part name SHOULD be valid: " + s);
@ -120,7 +120,7 @@ public final class TestOPCCompliancePartName {
* A part name shall not be empty. [M1.1]
*/
@Test
public void testEmptyPartNameFailure() {
void testEmptyPartNameFailure() {
assertThrows(InvalidFormatException.class, () -> createPartName(new URI("")),
"A part name shall not be empty. [M1.1]");
}
@ -133,7 +133,7 @@ public final class TestOPCCompliancePartName {
* A segment shall include at least one non-dot character. [M1.10]
*/
@Test
public void testPartNameWithInvalidSegmentsFailure() throws URISyntaxException {
void testPartNameWithInvalidSegmentsFailure() throws URISyntaxException {
String[] invalidNames = { "//document.xml", "//word/document.xml",
"/word//document.rels", "/word//rels//document.rels",
"/xml./doc.xml", "/document.", "/./document.xml",
@ -148,7 +148,7 @@ public final class TestOPCCompliancePartName {
* [M1.6].
*/
@Test
public void testPartNameWithNonPCharCharacters() throws URISyntaxException {
void testPartNameWithNonPCharCharacters() throws URISyntaxException {
String[] validNames = { "/doc&.xml" };
for (String s : validNames) {
assertTrue(isValidPartName(new URI(s)),
@ -160,7 +160,7 @@ public final class TestOPCCompliancePartName {
* A segment shall not contain percent-encoded unreserved characters [M1.8].
*/
@Test
public void testPartNameWithUnreservedEncodedCharactersFailure() throws URISyntaxException {
void testPartNameWithUnreservedEncodedCharactersFailure() throws URISyntaxException {
String[] invalidNames = { "/a/docum%65nt.xml" };
for (String s : invalidNames) {
assertFalse(isValidPartName(new URI(s)), "A segment shall not contain percent-encoded unreserved characters [M1.8] : " + s);
@ -171,7 +171,7 @@ public final class TestOPCCompliancePartName {
* A part name shall start with a forward slash ('/') character. [M1.4]
*/
@Test
public void testPartNameStartsWithAForwardSlashFailure() {
void testPartNameStartsWithAForwardSlashFailure() {
assertThrows(InvalidFormatException.class, () -> createPartName(new URI("document.xml")),
"A part name shall start with a forward slash ('/') character. [M1.4]");
}
@ -180,7 +180,7 @@ public final class TestOPCCompliancePartName {
* A part name shall not have a forward slash as the last character. [M1.5]
*/
@Test
public void testPartNameEndsWithAForwardSlashFailure() {
void testPartNameEndsWithAForwardSlashFailure() {
assertThrows(InvalidFormatException.class, () -> createPartName(new URI("/document.xml/")),
"A part name shall not have a forward slash as the last character. [M1.5]");
}
@ -190,7 +190,7 @@ public final class TestOPCCompliancePartName {
* case-insensitive ASCII strings. [M1.12]
*/
@Test
public void testPartNameComparaison() throws Exception {
void testPartNameComparaison() throws Exception {
String[] partName1 = { "/word/document.xml", "/docProps/core.xml", "/rels/.rels" };
String[] partName2 = { "/WORD/DocUment.XML", "/docProps/core.xml", "/rels/.rels" };
for (int i = 0; i < partName1.length || i < partName2.length; ++i) {
@ -209,7 +209,7 @@ public final class TestOPCCompliancePartName {
* All the comparisons MUST FAIL !
*/
@Test
public void testPartNameComparaisonFailure() throws Exception {
void testPartNameComparaisonFailure() throws Exception {
String[] partName1 = { "/word/document.xml", "/docProps/core.xml", "/rels/.rels" };
String[] partName2 = { "/WORD/DocUment.XML2", "/docProp/core.xml", "/rels/rels" };
for (int i = 0; i < partName1.length || i < partName2.length; ++i) {

View File

@ -57,7 +57,7 @@ public final class TestContentTypeManager {
* Test the properties part content parsing.
*/
@Test
public void testContentType() throws Exception {
void testContentType() throws Exception {
String filepath = OpenXML4JTestDataSamples.getSampleFileName("sample.docx");
// Retrieves core properties part
@ -74,7 +74,7 @@ public final class TestContentTypeManager {
* Test the addition of several default and override content types.
*/
@Test
public void testContentTypeAddition() throws Exception {
void testContentTypeAddition() throws Exception {
ContentTypeManager ctm = new ZipContentTypeManager(null, null);
PackagePartName name1 = PackagingURIHelper.createPartName("/foo/foo.XML");
@ -98,7 +98,7 @@ public final class TestContentTypeManager {
* Test the addition then removal of content types.
*/
@Test
public void testContentTypeRemoval() throws Exception {
void testContentTypeRemoval() throws Exception {
ContentTypeManager ctm = new ZipContentTypeManager(null, null);
PackagePartName name1 = PackagingURIHelper.createPartName("/foo/foo.xml");
@ -128,7 +128,7 @@ public final class TestContentTypeManager {
*/
@Disabled
@Test
public void testContentTypeRemovalPackage() {
void testContentTypeRemovalPackage() {
// TODO
}

View File

@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class TestZipSecureFile {
@Test
public void testThresholdInputStream() throws Exception {
void testThresholdInputStream() throws Exception {
// This fails in Java 10 because our reflection injection of the ThresholdInputStream causes a
// ClassCastException in ZipFile now
// The relevant change in the JDK is http://hg.openjdk.java.net/jdk/jdk10/rev/85ea7e83af30#l5.66

View File

@ -29,7 +29,7 @@ public class TestSignatureConfig {
@Test
@Disabled("failing in automated builds, due to issues loading security classes")
public void testDigestAlgo() throws Exception {
void testDigestAlgo() throws Exception {
SignatureConfig sc = new SignatureConfig();
assertEquals(HashAlgorithm.sha256, sc.getDigestAlgo());
sc.setDigestAlgo(HashAlgorithm.sha1);
@ -37,7 +37,7 @@ public class TestSignatureConfig {
}
@Test
public void testHashOids() throws IOException {
void testHashOids() throws IOException {
final String[][] checks = {
{ "sha1", "MCEwCQYFKw4DAhoFAAQU" },
{ "sha224", "MC0wDQYJYIZIAWUDBAIEBQAEHA==" },

View File

@ -395,7 +395,7 @@ public class TestSignatureInfo {
}
@Test
public void testSignSpreadsheet() throws Exception {
void testSignSpreadsheet() throws Exception {
String testFile = "hello-world-unsigned.xlsx";
try (OPCPackage pkg = OPCPackage.open(copy(testdata.getFile(testFile)), PackageAccess.READ_WRITE)) {
sign(pkg);
@ -412,7 +412,7 @@ public class TestSignatureInfo {
}
@Test
public void testManipulation() throws Exception {
void testManipulation() throws Exception {
// sign & validate
String testFile = "hello-world-unsigned.xlsx";
try (OPCPackage pkg = OPCPackage.open(copy(testdata.getFile(testFile)), PackageAccess.READ_WRITE)) {
@ -439,7 +439,7 @@ public class TestSignatureInfo {
}
@Test
public void testSignSpreadsheetWithSignatureInfo() throws Exception {
void testSignSpreadsheetWithSignatureInfo() throws Exception {
initKeyPair();
String testFile = "hello-world-unsigned.xlsx";
try (OPCPackage pkg = OPCPackage.open(copy(testdata.getFile(testFile)), PackageAccess.READ_WRITE)) {
@ -462,7 +462,7 @@ public class TestSignatureInfo {
}
@Test
public void testSignEnvelopingDocument() throws Exception {
void testSignEnvelopingDocument() throws Exception {
String testFile = "hello-world-unsigned.xlsx";
File sigCopy = testdata.getFile(testFile);
ByteArrayOutputStream bos = new ByteArrayOutputStream(50000);
@ -662,7 +662,7 @@ public class TestSignatureInfo {
}
@Test
public void testCertChain() throws Exception {
void testCertChain() throws Exception {
final boolean isIBM = System.getProperty("java.vendor").contains("IBM");
KeyStore keystore = KeyStore.getInstance("PKCS12");
@ -711,7 +711,7 @@ public class TestSignatureInfo {
}
@Test
public void testNonSha1() throws Exception {
void testNonSha1() throws Exception {
String testFile = "hello-world-unsigned.xlsx";
initKeyPair();
@ -764,7 +764,7 @@ public class TestSignatureInfo {
}
@Test
public void testMultiSign() throws Exception {
void testMultiSign() throws Exception {
cal = LocaleUtil.getLocaleCalendar(LocaleUtil.TIMEZONE_UTC);
cal.clear();
cal.setTimeZone(LocaleUtil.TIMEZONE_UTC);
@ -846,7 +846,7 @@ public class TestSignatureInfo {
}
@Test
public void testRetrieveCertificate() throws InvalidFormatException, IOException {
void testRetrieveCertificate() throws InvalidFormatException, IOException {
SignatureConfig sic = new SignatureConfig();
final File file = testdata.getFile("PPT2016withComment.pptx");
try (final OPCPackage pkg = OPCPackage.open(file, PackageAccess.READ)) {
@ -871,7 +871,7 @@ public class TestSignatureInfo {
}
@Test
public void testSignatureImage() throws Exception {
void testSignatureImage() throws Exception {
initKeyPair();
List<Supplier<SignatureLine>> lines = Arrays.asList(XSSFSignatureLine::new, XWPFSignatureLine::new);

View File

@ -75,7 +75,7 @@ public class TestAgileEncryptionParameters {
@ParameterizedTest
@MethodSource("data")
public void testAgileEncryptionModes(CipherAlgorithm ca, HashAlgorithm ha, ChainingMode cm) throws Exception {
void testAgileEncryptionModes(CipherAlgorithm ca, HashAlgorithm ha, ChainingMode cm) throws Exception {
int maxKeyLen = Cipher.getMaxAllowedKeyLength(ca.jceId);
assumeTrue(maxKeyLen >= ca.defaultKeySize, "Please install JCE Unlimited Strength Jurisdiction Policy files");

View File

@ -153,7 +153,7 @@ public class TestDecryptor {
}
@Test
public void test58616() throws IOException, GeneralSecurityException {
void test58616() throws IOException, GeneralSecurityException {
try (InputStream is = POIDataSamples.getSpreadSheetInstance().openResourceAsStream("58616.xlsx");
POIFSFileSystem pfs = new POIFSFileSystem(is)) {
EncryptionInfo info = new EncryptionInfo(pfs);

View File

@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
public class TestEncryptionInfo {
@Test
public void testEncryptionInfo() throws IOException {
void testEncryptionInfo() throws IOException {
POIFSFileSystem fs = new POIFSFileSystem(POIDataSamples.getPOIFSInstance().openResourceAsStream("protect.xlsx"));
EncryptionInfo info = new EncryptionInfo(fs);
@ -49,7 +49,7 @@ public class TestEncryptionInfo {
}
@Test
public void testEncryptionInfoSHA512() throws Exception {
void testEncryptionInfoSHA512() throws Exception {
POIFSFileSystem fs = new POIFSFileSystem(POIDataSamples.getPOIFSInstance().openResourceAsStream("protected_sha512.xlsx"));
EncryptionInfo info = new EncryptionInfo(fs);

View File

@ -64,18 +64,18 @@ public class TestDrawPictureShape {
}
@Test
public void testResizeHSLF() throws IOException {
void testResizeHSLF() throws IOException {
assumeFalse(xslfOnly);
testResize("pictures.ppt");
}
@Test
public void testResizeXSLF() throws IOException {
void testResizeXSLF() throws IOException {
testResize("shapes.pptx");
}
public void testResize(String file) throws IOException {
void testResize(String file) throws IOException {
SlideShow<?,?> ss = openSampleDocument(file);
Slide<?,?> slide = ss.getSlides().get(0);

View File

@ -105,7 +105,7 @@ public final class TestWorkbookFactory {
}
@Test
public void testCreateNative() throws Exception {
void testCreateNative() throws Exception {
// POIFS -> hssf
try (Workbook wb = WorkbookFactory.create(
new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream(xls))
@ -132,7 +132,7 @@ public final class TestWorkbookFactory {
}
@Test
public void testCreateReadOnly() throws Exception {
void testCreateReadOnly() throws Exception {
// POIFS -> hssf
try (Workbook wb = WorkbookFactory.create(HSSFTestDataSamples.getSampleFile(xls), null, true)) {
assertNotNull(wb);
@ -154,7 +154,7 @@ public final class TestWorkbookFactory {
* InputStream, then creating what's required.
*/
@Test
public void testCreateGeneric() throws Exception {
void testCreateGeneric() throws Exception {
// InputStream -> either
try (Workbook wb = WorkbookFactory.create(HSSFTestDataSamples.openSampleFileStream(xls))) {
assertNotNull(wb);
@ -208,7 +208,7 @@ public final class TestWorkbookFactory {
*/
@ParameterizedTest
@MethodSource("workbookPass")
public void testCreateWithPasswordFromStream(String file, String pass, boolean fails, Class<? extends Workbook> clazz) throws Exception {
void testCreateWithPasswordFromStream(String file, String pass, boolean fails, Class<? extends Workbook> clazz) throws Exception {
try (InputStream is = HSSFTestDataSamples.openSampleFileStream(file)) {
if (fails) {
assertThrows(EncryptedDocumentException.class, () -> WorkbookFactory.create(is, pass),
@ -227,7 +227,7 @@ public final class TestWorkbookFactory {
*/
@ParameterizedTest
@MethodSource("workbookPass")
public void testCreateWithPasswordFromFile(String fileName, String pass, boolean fails, Class<? extends Workbook> clazz) throws Exception {
void testCreateWithPasswordFromFile(String fileName, String pass, boolean fails, Class<? extends Workbook> clazz) throws Exception {
File file = HSSFTestDataSamples.getSampleFile(fileName);
if (fails) {
assertThrows(EncryptedDocumentException.class, () -> WorkbookFactory.create(file, pass),
@ -245,7 +245,7 @@ public final class TestWorkbookFactory {
* Check that a helpful exception is given on an empty input stream
*/
@Test
public void testEmptyInputStream() {
void testEmptyInputStream() {
InputStream emptyStream = new ByteArrayInputStream(new byte[0]);
assertThrows(EmptyFileException.class, () -> WorkbookFactory.create(emptyStream));
}
@ -254,7 +254,7 @@ public final class TestWorkbookFactory {
* Check that a helpful exception is given on an empty file
*/
@Test
public void testEmptyFile() throws Exception {
void testEmptyFile() throws Exception {
File emptyFile = TempFile.createTempFile("empty", ".poi");
assertThrows(EmptyFileException.class, () -> WorkbookFactory.create(emptyFile),
"Shouldn't be able to create for an empty file");
@ -265,7 +265,7 @@ public final class TestWorkbookFactory {
* Check that a helpful exception is raised on a non-existing file
*/
@Test
public void testNonExistingFile() {
void testNonExistingFile() {
File nonExistingFile = new File("notExistingFile");
assertFalse(nonExistingFile.exists());
assertThrows(FileNotFoundException.class, () -> WorkbookFactory.create(nonExistingFile, "password", true));
@ -276,7 +276,7 @@ public final class TestWorkbookFactory {
* to work for sub-classes of File too, eg JFileChooser
*/
@Test
public void testFileSubclass() throws Exception {
void testFileSubclass() throws Exception {
File normalXLS = HSSFTestDataSamples.getSampleFile(xls);
File normalXLSX = HSSFTestDataSamples.getSampleFile(xlsx);
File altXLS = new TestFile(normalXLS.getAbsolutePath());
@ -307,7 +307,7 @@ public final class TestWorkbookFactory {
* Check that the overloaded file methods which take passwords work properly
*/
@Test
public void testCreateEmpty() throws Exception {
void testCreateEmpty() throws Exception {
Workbook wb = WorkbookFactory.create(false);
assertTrue(wb instanceof HSSFWorkbook);
closeOrRevert(wb);
@ -319,7 +319,7 @@ public final class TestWorkbookFactory {
@Test
@SuppressForbidden("test code")
public void testOpenManyHSSF() throws Exception {
void testOpenManyHSSF() throws Exception {
final int size = 1000;
ExecutorService executorService = Executors.newFixedThreadPool(10);
ArrayList<Future<Boolean>> futures = new ArrayList<>(size);
@ -332,7 +332,7 @@ public final class TestWorkbookFactory {
}
@Test
public void testInvalidFormatException() throws IOException {
void testInvalidFormatException() throws IOException {
String filename = "OPCCompliance_DerivedPartNameFAIL.docx";
try (InputStream is = POIDataSamples.getOpenXML4JInstance().openResourceAsStream(filename)) {
assertThrows(IOException.class, () -> WorkbookFactory.create(is));

View File

@ -119,7 +119,7 @@ public class TestEmbeddedExtractor {
@Test
public void testNPE() throws IOException {
void testNPE() throws IOException {
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("angelo.edu_content_files_19555-nsse-2011-multiyear-benchmark.xls");
EmbeddedExtractor ee = new EmbeddedExtractor();

View File

@ -85,7 +85,7 @@ public class TestCellFormatPart {
}
@Test
public void testGeneralFormat() throws IOException {
void testGeneralFormat() throws IOException {
runFormatTests("GeneralFormatTests.xlsx", cell -> {
assertNotNull(cell);
switch (CellFormat.ultimateType(cell)) {
@ -100,12 +100,12 @@ public class TestCellFormatPart {
}
@Test
public void testNumberFormat() throws IOException {
void testNumberFormat() throws IOException {
runFormatTests("NumberFormatTests.xlsx", Cell::getNumericCellValue);
}
@Test
public void testNumberApproxFormat() throws IOException {
void testNumberApproxFormat() throws IOException {
runFormatTests("NumberFormatApproxTests.xlsx", new CellValue() {
@Override
public Object getValue(Cell cell) {
@ -125,7 +125,7 @@ public class TestCellFormatPart {
}
@Test
public void testDateFormat() throws IOException {
void testDateFormat() throws IOException {
TimeZone tz = LocaleUtil.getUserTimeZone();
LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CET"));
try {
@ -136,19 +136,19 @@ public class TestCellFormatPart {
}
@Test
public void testElapsedFormat() throws IOException {
void testElapsedFormat() throws IOException {
runFormatTests("ElapsedFormatTests.xlsx", Cell::getNumericCellValue);
}
@Test
public void testTextFormat() throws IOException {
void testTextFormat() throws IOException {
runFormatTests("TextFormatTests.xlsx", cell ->
(CellFormat.ultimateType(cell) == CellType.BOOLEAN) ? cell.getBooleanCellValue() : cell.getStringCellValue()
);
}
@Test
public void testConditions() throws IOException {
void testConditions() throws IOException {
runFormatTests("FormatConditionTests.xlsx", Cell::getNumericCellValue);
}

View File

@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test;
public class TestFormulaParser {
@Test
public void testHSSFFailsForOver65536() {
void testHSSFFailsForOver65536() {
FormulaParsingWorkbook workbook = HSSFEvaluationWorkbook.create(new HSSFWorkbook());
assertThrows(FormulaParseException.class, () ->
FormulaParser.parse("Sheet1!1:65537", workbook, FormulaType.CELL, 0));
@ -73,17 +73,17 @@ public class TestFormulaParser {
}
@Test
public void testHSSFPassCase() {
void testHSSFPassCase() {
checkHSSFFormula("Sheet1!1:65536");
}
@Test
public void testXSSFWorksForOver65536() {
void testXSSFWorksForOver65536() {
checkXSSFFormula("Sheet1!1:65537");
}
@Test
public void testXSSFFailCase() {
void testXSSFFailCase() {
FormulaParsingWorkbook workbook = XSSFEvaluationWorkbook.create(new XSSFWorkbook());
assertThrows(FormulaParseException.class, () ->
FormulaParser.parse("Sheet1!1:1048577", workbook, FormulaType.CELL, 0), "one more than max rows");
@ -91,7 +91,7 @@ public class TestFormulaParser {
// copied from org.apache.poi.hssf.model.TestFormulaParser
@Test
public void testMacroFunction() throws Exception {
void testMacroFunction() throws Exception {
// testNames.xlsm contains a VB function called 'myFunc'
final String testFile = "testNames.xlsm";
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook(testFile)) {
@ -144,7 +144,7 @@ public class TestFormulaParser {
}
@Test
public void testParserErrors() throws Exception {
void testParserErrors() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("testNames.xlsm")) {
XSSFEvaluationWorkbook workbook = XSSFEvaluationWorkbook.create(wb);
@ -172,7 +172,7 @@ public class TestFormulaParser {
// trivial case for bug 60219: FormulaParser can't parse external references when sheet name is quoted
@Test
public void testParseExternalReferencesWithUnquotedSheetName() throws Exception {
void testParseExternalReferencesWithUnquotedSheetName() throws Exception {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFEvaluationWorkbook fpwb = XSSFEvaluationWorkbook.create(wb);
Ptg[] ptgs = FormulaParser.parse("[1]Sheet1!A1", fpwb, FormulaType.CELL, -1);
@ -189,7 +189,7 @@ public class TestFormulaParser {
// bug 60219: FormulaParser can't parse external references when sheet name is quoted
@Test
public void testParseExternalReferencesWithQuotedSheetName() throws Exception {
void testParseExternalReferencesWithQuotedSheetName() throws Exception {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFEvaluationWorkbook fpwb = XSSFEvaluationWorkbook.create(wb);
Ptg[] ptgs = FormulaParser.parse("'[1]Sheet 1'!A1", fpwb, FormulaType.CELL, -1);
@ -206,7 +206,7 @@ public class TestFormulaParser {
// bug 60260
@Test
public void testUnicodeSheetName() {
void testUnicodeSheetName() {
checkFormula("'Sheet\u30FB1'!A1:A6");
}
}

View File

@ -48,7 +48,7 @@ public class TestStructuredReferences {
* Test the regular expression used in INDIRECT() evaluation to recognize structured references
*/
@Test
public void testTableExpressionSyntax() {
void testTableExpressionSyntax() {
assertTrue(Table.isStructuredReference.matcher("abc[col1]").matches(), "Valid structured reference syntax didn't match expression");
assertTrue(Table.isStructuredReference.matcher("_abc[col1]").matches(), "Valid structured reference syntax didn't match expression");
assertTrue(Table.isStructuredReference.matcher("_[col1]").matches(), "Valid structured reference syntax didn't match expression");
@ -62,7 +62,7 @@ public class TestStructuredReferences {
}
@Test
public void testTableFormulas() throws Exception {
void testTableFormulas() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
final FormulaEvaluator eval = new XSSFFormulaEvaluator(wb);

View File

@ -65,7 +65,7 @@ public class CountifsTests {
* Basic call
*/
@Test
public void testCallFunction() {
void testCallFunction() {
Sheet sheet = workbook.createSheet("test");
Row row1 = sheet.createRow(0);
Cell cellA1 = row1.createCell(0, CellType.FORMULA);
@ -88,7 +88,7 @@ public class CountifsTests {
* Test argument count check
*/
@Test
public void testCallFunction_invalidArgs() {
void testCallFunction_invalidArgs() {
Sheet sheet = workbook.createSheet("test");
Row row1 = sheet.createRow(0);
Cell cellA1 = row1.createCell(0, CellType.FORMULA);
@ -110,7 +110,7 @@ public class CountifsTests {
* the bug returned the wrong count, this verifies the fix
*/
@Test
public void testBug56822() {
void testBug56822() {
workbook = XSSFTestDataSamples.openSampleWorkbook("56822-Countifs.xlsx");
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
Cell cell = SheetUtil.getCell(workbook.getSheetAt(0), 0, 3);

View File

@ -40,7 +40,7 @@ public final class TestProper {
private FormulaEvaluator evaluator;
@Test
public void testValidHSSF() {
void testValidHSSF() {
HSSFWorkbook wb = new HSSFWorkbook();
evaluator = new HSSFFormulaEvaluator(wb);
@ -48,7 +48,7 @@ public final class TestProper {
}
@Test
public void testValidXSSF() {
void testValidXSSF() {
XSSFWorkbook wb = new XSSFWorkbook();
evaluator = new XSSFFormulaEvaluator(wb);
@ -99,7 +99,7 @@ public final class TestProper {
}
@Test
public void test() {
void test() {
checkProper("", "");
checkProper("a", "A");
checkProper("abc", "Abc");
@ -118,7 +118,7 @@ public final class TestProper {
}
@Test
public void testMicroBenchmark() {
void testMicroBenchmark() {
ValueEval strArg = new StringEval("some longer text that needs a number of replacements to check for runtime of different implementations");
// long start = System.currentTimeMillis();
for(int i = 0;i < 300000;i++) {

View File

@ -39,7 +39,7 @@ public class TestSumifsXSSF {
* handle null cell predicate
*/
@Test
public void testBug60858() throws IOException {
void testBug60858() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("bug60858.xlsx")) {
FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator();

View File

@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test;
public class TestVlookup {
@Test
public void testFullColumnAreaRef61841() throws IOException {
void testFullColumnAreaRef61841() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("VLookupFullColumn.xlsx")) {
FormulaEvaluator feval = wb.getCreationHelper().createFormulaEvaluator();
feval.evaluateAll();

View File

@ -45,7 +45,7 @@ public abstract class BaseTestXCell extends BaseTestCell {
}
@Test
public void testXmlEncoding() throws IOException {
void testXmlEncoding() throws IOException {
Workbook wb1 = _testDataProvider.createWorkbook();
Sheet sh = wb1.createSheet();
Row row = sh.createRow(0);

View File

@ -66,7 +66,7 @@ public class ConditionalFormattingEvalTest {
}
@Test
public void testFormattingEvaluation() {
void testFormattingEvaluation() {
sheet = wb.getSheet("Products1");
getRulesFor(12, 1);
@ -142,7 +142,7 @@ public class ConditionalFormattingEvalTest {
}
@Test
public void testFormattingOnUndefinedCell() {
void testFormattingOnUndefinedCell() {
wb = XSSFTestDataSamples.openSampleWorkbook("conditional_formatting_with_formula_on_second_sheet.xlsx");
formulaEval = new XSSFFormulaEvaluator(wb);
cfe = new ConditionalFormattingEvaluator(wb, formulaEval);
@ -154,7 +154,7 @@ public class ConditionalFormattingEvalTest {
}
@Test
public void testRepeatedEval() {
void testRepeatedEval() {
wb = XSSFTestDataSamples.openSampleWorkbook("test_conditional_formatting.xlsx");
formulaEval = new XSSFFormulaEvaluator(wb);
cfe = new ConditionalFormattingEvaluator(wb, formulaEval);
@ -167,7 +167,7 @@ public class ConditionalFormattingEvalTest {
}
@Test
public void testCellValueIsWrongType() {
void testCellValueIsWrongType() {
wb = XSSFTestDataSamples.openSampleWorkbook("conditional_formatting_cell_is.xlsx");
formulaEval = new XSSFFormulaEvaluator(wb);
cfe = new ConditionalFormattingEvaluator(wb, formulaEval);
@ -178,7 +178,7 @@ public class ConditionalFormattingEvalTest {
}
@Test
public void testRangeCondition() {
void testRangeCondition() {
wb = XSSFTestDataSamples.openSampleWorkbook("conditional_formatting_multiple_ranges.xlsx");
formulaEval = new XSSFFormulaEvaluator(wb);
cfe = new ConditionalFormattingEvaluator(wb, formulaEval);

View File

@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
public class TestIdentifierManager {
@Test
public void testBasic()
void testBasic()
{
IdentifierManager manager = new IdentifierManager(0L,100L);
assertEquals(101L,manager.getRemainingIdentifiers());
@ -39,7 +39,7 @@ public class TestIdentifierManager {
}
@Test
public void testLongLimits() {
void testLongLimits() {
long min = IdentifierManager.MIN_ID;
long max = IdentifierManager.MAX_ID;
IdentifierManager manager = new IdentifierManager(min,max);
@ -53,7 +53,7 @@ public class TestIdentifierManager {
}
@Test
public void testReserve() {
void testReserve() {
IdentifierManager manager1 = new IdentifierManager(10L, 30L);
assertEquals(12L, manager1.reserve(12L));
long reserve = manager1.reserve(12L);
@ -73,7 +73,7 @@ public class TestIdentifierManager {
}
@Test
public void testReserveNew() {
void testReserveNew() {
IdentifierManager manager = new IdentifierManager(10L,12L);
assertSame(10L,manager.reserveNew());
assertSame(11L,manager.reserveNew());
@ -82,7 +82,7 @@ public class TestIdentifierManager {
}
@Test
public void testRelease() {
void testRelease() {
IdentifierManager manager = new IdentifierManager(10L,20L);
assertEquals(10L,manager.reserve(10L));
assertEquals(11L,manager.reserve(11L));

View File

@ -32,7 +32,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.*;
public class TestNecessaryOOXMLClasses {
@Test
public void testProblemClasses() {
void testProblemClasses() {
CTXYAdjustHandle ctxyAdjustHandle = CTXYAdjustHandle.Factory.newInstance();
assertNotNull(ctxyAdjustHandle);
CTPolarAdjustHandle ctPolarAdjustHandle = CTPolarAdjustHandle.Factory.newInstance();

View File

@ -41,7 +41,7 @@ public class TestXDDFColor {
private static final String XMLNS = "xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"/>";
@Test
public void testSchemeColor() throws IOException {
void testSchemeColor() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFTheme theme = ppt.createSlide().getTheme();
@ -72,7 +72,7 @@ public class TestXDDFColor {
}
@Test
public void testPreset() {
void testPreset() {
CTColor xml = CTColor.Factory.newInstance();
xml.addNewPrstClr().setVal(STPresetColorVal.AQUAMARINE);
XDDFColor color = XDDFColor.forColorContainer(xml);
@ -83,7 +83,7 @@ public class TestXDDFColor {
}
@Test
public void testSystemDefined() {
void testSystemDefined() {
CTColor xml = CTColor.Factory.newInstance();
CTSystemColor sys = xml.addNewSysClr();
sys.setVal(STSystemColorVal.CAPTION_TEXT);
@ -99,7 +99,7 @@ public class TestXDDFColor {
}
@Test
public void testRgbBinary() {
void testRgbBinary() {
CTColor xml = CTColor.Factory.newInstance();
CTSRgbColor color = xml.addNewSrgbClr();
byte[] bs = new byte[]{-1, -1, -1};
@ -114,7 +114,7 @@ public class TestXDDFColor {
}
@Test
public void testRgbPercent() {
void testRgbPercent() {
CTColor xml = CTColor.Factory.newInstance();
CTScRgbColor color = xml.addNewScrgbClr();
color.setR(0);

View File

@ -28,7 +28,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace;
public class TestXDDFChart {
@Test
public void testConstruct() {
void testConstruct() {
// minimal test to cause ooxml-lite to include all the classes in poi-ooxml-lite
XDDFChart xddfChart = newXDDFChart();
@ -37,7 +37,7 @@ public class TestXDDFChart {
}
@Test
public void testSetExternalId() {
void testSetExternalId() {
XDDFChart xddfChart = newXDDFChart();
CTChartSpace ctChartSpace = xddfChart.getCTChartSpace();

View File

@ -140,7 +140,7 @@ public class TestXDDFChartRemoveSeries {
* This used to corrupt the workbook but the returned <code>List</code> is unmodifiable.
*/
@Test
public void testRemoveSeries0() {
void testRemoveSeries0() {
procName = "testRemoveSeries0";
fileName = procName + ".xlsx";
@ -157,7 +157,7 @@ public class TestXDDFChartRemoveSeries {
* This will not corrupt the workbook.
*/
@Test
public void testBugFixRemoveSeries0() {
void testBugFixRemoveSeries0() {
procName = "testBugFixRemoveSeries0";
fileName = procName + ".xlsx";
@ -171,7 +171,7 @@ public class TestXDDFChartRemoveSeries {
* This will not corrupt the workbook.
*/
@Test
public void testBugFixRemoveSeries1() {
void testBugFixRemoveSeries1() {
procName = "testBugFixRemoveSeries1";
fileName = procName + ".xlsx";
@ -183,7 +183,7 @@ public class TestXDDFChartRemoveSeries {
* Do not remove any series from the chart.
*/
@Test
public void testDontRemoveSeries() {
void testDontRemoveSeries() {
procName = "testDontRemoveSeries";
fileName = procName + ".xlsx";
}

View File

@ -48,7 +48,7 @@ public class TestXDDFDataSourcesFactory {
};
@Test
public void testNumericArrayDataSource() {
void testNumericArrayDataSource() {
Double[] doubles = new Double[]{1.0, 2.0, 3.0, 4.0, 5.0};
XDDFDataSource<Double> doubleDataSource = XDDFDataSourcesFactory.fromArray(doubles, null);
assertTrue(doubleDataSource.isNumeric());
@ -57,7 +57,7 @@ public class TestXDDFDataSourcesFactory {
}
@Test
public void testStringArrayDataSource() {
void testStringArrayDataSource() {
String[] strings = new String[]{"one", "two", "three", "four", "five"};
XDDFDataSource<String> stringDataSource = XDDFDataSourcesFactory.fromArray(strings, null);
assertFalse(stringDataSource.isNumeric());
@ -66,7 +66,7 @@ public class TestXDDFDataSourcesFactory {
}
@Test
public void testNumericCellDataSource() {
void testNumericCellDataSource() {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, numericCells).build();
CellRangeAddress numCellRange = CellRangeAddress.valueOf("A2:E2");
@ -81,7 +81,7 @@ public class TestXDDFDataSourcesFactory {
}
@Test
public void testStringCellDataSource() {
void testStringCellDataSource() {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, stringCells).build();
CellRangeAddress numCellRange = CellRangeAddress.valueOf("A2:E2");
@ -95,7 +95,7 @@ public class TestXDDFDataSourcesFactory {
}
@Test
public void testMixedCellDataSource() {
void testMixedCellDataSource() {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, mixedCells).build();
CellRangeAddress mixedCellRange = CellRangeAddress.valueOf("A1:F1");
@ -114,7 +114,7 @@ public class TestXDDFDataSourcesFactory {
}
@Test
public void testIOBExceptionOnInvalidIndex() {
void testIOBExceptionOnInvalidIndex() {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = (XSSFSheet) new SheetBuilder(wb, numericCells).build();
CellRangeAddress rangeAddress = CellRangeAddress.valueOf("A2:E2");

View File

@ -29,7 +29,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties;
public class TestXDDFTextBodyProperties {
@Test
public void testProperties() throws IOException {
void testProperties() throws IOException {
XDDFTextBody text = new XDDFTextBody(null);
text.initialize();
XDDFBodyProperties body = text.getBodyProperties();

View File

@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
public class TestXDDFTextRun {
@Test
public void testTextRunPropertiesInSlide() throws IOException {
void testTextRunPropertiesInSlide() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
XSLFTextShape sh = slide.createAutoShape();
@ -87,7 +87,7 @@ public class TestXDDFTextRun {
}
@Test
public void testTextRunPropertiesInSheet() throws IOException {
void testTextRunPropertiesInSheet() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = wb.createSheet();
XSSFDrawing drawing = sheet.createDrawingPatriarch();
@ -139,7 +139,7 @@ public class TestXDDFTextRun {
}
@Test
public void testDefaultRunProperties() throws IOException {
void testDefaultRunProperties() throws IOException {
// bug #63290
POIDataSamples pds = POIDataSamples.getSlideShowInstance();
try (InputStream is = pds.openResourceAsStream("bug63290.pptx");

View File

@ -50,7 +50,7 @@ public class TestXDGFVisioExtractor {
}
@Test
public void testGetSimpleText() throws IOException {
void testGetSimpleText() throws IOException {
new XDGFVisioExtractor(xml).close();
new XDGFVisioExtractor(pkg).close();
@ -68,7 +68,7 @@ public class TestXDGFVisioExtractor {
//the point of this is to trigger the addition of
//some common visio classes -- ConnectsType
@Test
public void testVisioConnects() throws IOException {
void testVisioConnects() throws IOException {
InputStream is = SAMPLES.openResourceAsStream("60489.vsdx");
XmlVisioDocument document = new XmlVisioDocument(is);
is.close();
@ -86,7 +86,7 @@ public class TestXDGFVisioExtractor {
* at org.apache.poi.xdgf.usermodel.section.geometry.GeometryRowFactory.load
*/
@Test
public void testPolylineTo() throws IOException {
void testPolylineTo() throws IOException {
InputStream is = SAMPLES.openResourceAsStream("60973.vsdx");
XmlVisioDocument document = new XmlVisioDocument(is);
is.close();

View File

@ -42,7 +42,7 @@ public class CombinedIteratorTest {
}
@Test
public void testNullMaster() {
void testNullMaster() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
@ -54,7 +54,7 @@ public class CombinedIteratorTest {
}
@Test
public void testNoMatchesBaseFirst() {
void testNoMatchesBaseFirst() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
@ -71,7 +71,7 @@ public class CombinedIteratorTest {
}
@Test
public void testNoMatchesMasterFirst() {
void testNoMatchesMasterFirst() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(4L, "B4");
@ -88,7 +88,7 @@ public class CombinedIteratorTest {
}
@Test
public void testInterleaved1() {
void testInterleaved1() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
@ -105,7 +105,7 @@ public class CombinedIteratorTest {
}
@Test
public void testInterleaved2() {
void testInterleaved2() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
@ -124,7 +124,7 @@ public class CombinedIteratorTest {
}
@Test
public void testAllMatching() {
void testAllMatching() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
@ -141,7 +141,7 @@ public class CombinedIteratorTest {
}
@Test
public void testAllMatching2() {
void testAllMatching2() {
SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");

View File

@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
public class TestNecessaryOOXMLClasses {
@Test
public void testProblemClasses() {
void testProblemClasses() {
List<Supplier<XmlObject>> sup = Arrays.asList(
org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderSize.Factory::newInstance,
org.openxmlformats.schemas.presentationml.x2006.main.CTHeaderFooter.Factory::newInstance

View File

@ -558,7 +558,7 @@ public class TestXSLFBugs {
* that image10.foo isn't between image1.foo and image2.foo
*/
@Test
public void test57552() throws Exception {
void test57552() throws Exception {
XMLSlideShow ss = new XMLSlideShow();
for (String s : new String[]{"Slide1", "Slide2"}) {
ss.createSlide().createTextBox().setText(s);
@ -888,7 +888,7 @@ public class TestXSLFBugs {
}
@Test
public void test60810() throws IOException {
void test60810() throws IOException {
XMLSlideShow ppt = openSampleDocument("60810.pptx");
for (XSLFSlide slide : ppt.getSlides()) {
XSLFNotes notesSlide = ppt.getNotesSlide(slide);
@ -899,7 +899,7 @@ public class TestXSLFBugs {
}
@Test
public void test60042() throws IOException {
void test60042() throws IOException {
try (XMLSlideShow ppt = openSampleDocument("60042.pptx")) {
ppt.removeSlide(0);
ppt.createSlide();
@ -908,7 +908,7 @@ public class TestXSLFBugs {
}
@Test
public void test61515() throws IOException {
void test61515() throws IOException {
try (XMLSlideShow ppt = openSampleDocument("61515.pptx")) {
ppt.removeSlide(0);
assertEquals(1, ppt.createSlide().getRelations().size());
@ -921,7 +921,7 @@ public class TestXSLFBugs {
}
@Test
public void testAptia() throws IOException {
void testAptia() throws IOException {
try (XMLSlideShow ppt = openSampleDocument("aptia.pptx");
XMLSlideShow saved = XSLFTestDataSamples.writeOutAndReadBack(ppt)) {
assertEquals(ppt.getSlides().size(), saved.getSlides().size());
@ -930,7 +930,7 @@ public class TestXSLFBugs {
@Disabled
@Test
public void testDivinoRevelado() throws IOException {
void testDivinoRevelado() throws IOException {
try (XMLSlideShow ppt = openSampleDocument("Divino_Revelado.pptx");
XMLSlideShow saved = XSLFTestDataSamples.writeOutAndReadBack(ppt)) {
assertEquals(ppt.getSlides().size(), saved.getSlides().size());

View File

@ -57,7 +57,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testContainsMainContentType() throws Exception {
void testContainsMainContentType() throws Exception {
boolean found = false;
for(PackagePart part : pack.getParts()) {
if(part.getContentType().equals(XSLFRelation.MAIN.getContentType())) {
@ -68,7 +68,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testOpen() throws IOException, OpenXML4JException, XmlException {
void testOpen() throws IOException, OpenXML4JException, XmlException {
// With the finalized uri, should be fine
XSLFSlideShow xml = new XSLFSlideShow(pack);
// Check the core
@ -82,7 +82,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testSlideBasics() throws IOException, OpenXML4JException, XmlException {
void testSlideBasics() throws IOException, OpenXML4JException, XmlException {
XSLFSlideShow xml = new XSLFSlideShow(pack);
// Should have 1 master
@ -119,7 +119,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testMetadataBasics() throws IOException, OpenXML4JException, XmlException {
void testMetadataBasics() throws IOException, OpenXML4JException, XmlException {
XSLFSlideShow xml = new XSLFSlideShow(pack);
assertNotNull(xml.getProperties().getCoreProperties());
@ -138,7 +138,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testMasterBackground() throws IOException {
void testMasterBackground() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFBackground b = ppt.getSlideMasters().get(0).getBackground();
b.setFillColor(Color.RED);

View File

@ -46,7 +46,7 @@ public class TestXSLFPowerPointExtractor {
* Get text out of the simple file
*/
@Test
public void testGetSimpleText() throws IOException {
void testGetSimpleText() throws IOException {
try (XMLSlideShow xmlA = openPPTX("sample.pptx");
SlideShowExtractor<XSLFShape, XSLFTextParagraph> extractor = new SlideShowExtractor<>(xmlA)) {
@ -158,7 +158,7 @@ public class TestXSLFPowerPointExtractor {
}
@Test
public void testGetComments() throws IOException {
void testGetComments() throws IOException {
try (XMLSlideShow xml = openPPTX("45545_Comment.pptx");
SlideShowExtractor<XSLFShape, XSLFTextParagraph> extractor = new SlideShowExtractor<>(xml)) {
extractor.setCommentsByDefault(true);
@ -176,7 +176,7 @@ public class TestXSLFPowerPointExtractor {
}
@Test
public void testGetMasterText() throws Exception {
void testGetMasterText() throws Exception {
try (XMLSlideShow xml = openPPTX("WithMaster.pptx");
SlideShowExtractor<XSLFShape, XSLFTextParagraph> extractor = new SlideShowExtractor<>(xml)) {
extractor.setSlidesByDefault(true);
@ -213,7 +213,7 @@ public class TestXSLFPowerPointExtractor {
}
@Test
public void testTable() throws Exception {
void testTable() throws Exception {
try (XMLSlideShow xml = openPPTX("present1.pptx");
SlideShowExtractor<XSLFShape, XSLFTextParagraph> extractor = new SlideShowExtractor<>(xml)) {
@ -231,7 +231,7 @@ public class TestXSLFPowerPointExtractor {
* well as from the normal file
*/
@Test
public void testDifferentSubformats() throws Exception {
void testDifferentSubformats() throws Exception {
String[] extensions = new String[] {
"pptx", "pptm", "ppsm", "ppsx", "thmx",
// "xps" - Doesn't have a core document
@ -260,7 +260,7 @@ public class TestXSLFPowerPointExtractor {
}
@Test
public void test45541() throws IOException {
void test45541() throws IOException {
// extract text from a powerpoint that has a header in the notes-element
final File headerFile = slTests.getFile("45541_Header.pptx");
//noinspection rawtypes

View File

@ -56,7 +56,7 @@ public class TestXMLSlideShow extends BaseTestSlideShow<XSLFShape, XSLFTextParag
}
@Test
public void testContainsMainContentType() throws Exception {
void testContainsMainContentType() throws Exception {
boolean found = false;
for (PackagePart part : pack.getParts()) {
if (part.getContentType().equals(XSLFRelation.MAIN.getContentType())) {
@ -67,7 +67,7 @@ public class TestXMLSlideShow extends BaseTestSlideShow<XSLFShape, XSLFTextParag
}
@Test
public void testOpen() throws Exception {
void testOpen() throws Exception {
// With the finalised uri, should be fine
XMLSlideShow xml = new XMLSlideShow(pack);
// Check the core
@ -82,7 +82,7 @@ public class TestXMLSlideShow extends BaseTestSlideShow<XSLFShape, XSLFTextParag
@SuppressWarnings("deprecation")
@Test
public void testSlideBasics() throws IOException {
void testSlideBasics() throws IOException {
XMLSlideShow xml = new XMLSlideShow(pack);
// Should have 1 master
@ -126,7 +126,7 @@ public class TestXMLSlideShow extends BaseTestSlideShow<XSLFShape, XSLFTextParag
}
@Test
public void testMetadataBasics() throws IOException {
void testMetadataBasics() throws IOException {
XMLSlideShow xml = new XMLSlideShow(pack);
assertNotNull(xml.getProperties().getCoreProperties());
@ -143,7 +143,7 @@ public class TestXMLSlideShow extends BaseTestSlideShow<XSLFShape, XSLFTextParag
}
@Test
public void testComments() throws Exception {
void testComments() throws Exception {
// Default sample file has none
XMLSlideShow xml = new XMLSlideShow(pack);

View File

@ -38,7 +38,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STTextUnderlineType;
public class TestXSLFAutoShape {
@Test
public void testTextBodyProperies() throws IOException {
void testTextBodyProperies() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
@ -113,7 +113,7 @@ public class TestXSLFAutoShape {
}
@Test
public void testTextParagraph() throws IOException {
void testTextParagraph() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
assertTrue(slide.getShapes().isEmpty());
@ -216,7 +216,7 @@ public class TestXSLFAutoShape {
}
@Test
public void testTextRun() throws IOException {
void testTextRun() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
@ -290,7 +290,7 @@ public class TestXSLFAutoShape {
}
@Test
public void testShapeType() throws IOException {
void testShapeType() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();

View File

@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.*;
public class TestXSLFBackground {
@Test
public void testNoFillBackground() throws IOException {
void testNoFillBackground() throws IOException {
XMLSlideShow pptx = new XMLSlideShow();
XSLFSlide slide = pptx.createSlide();
@ -48,7 +48,7 @@ public class TestXSLFBackground {
}
@Test
public void testSolidFillBackground() throws IOException {
void testSolidFillBackground() throws IOException {
XMLSlideShow pptx = new XMLSlideShow();
XSLFSlide slide = pptx.createSlide();
@ -72,7 +72,7 @@ public class TestXSLFBackground {
}
@Test
public void testBlipFillBackground() throws IOException {
void testBlipFillBackground() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("pptx2svg.pptx");
XSLFSlide slide = pptx.getSlides().get(0);
@ -114,7 +114,7 @@ public class TestXSLFBackground {
}
@Test
public void testGradFillBackground() throws IOException {
void testGradFillBackground() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("themes.pptx");
XSLFSlide slide = pptx.getSlides().get(9);

View File

@ -63,7 +63,7 @@ import org.junit.jupiter.api.Test;
*/
public class TestXSLFChart {
@Test
public void testFillPieChartTemplate() throws IOException {
void testFillPieChartTemplate() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("pie-chart.pptx");
XSLFChart chart = findChart(pptx.getSlides().get(0));
List<XDDFChartData> data = findChartData(chart);
@ -78,7 +78,7 @@ public class TestXSLFChart {
}
@Test
public void testFillBarChartTemplate() throws IOException {
void testFillBarChartTemplate() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("bar-chart.pptx");
XSLFSlide slide = pptx.getSlides().get(0);
// duplicate slide and chart before applying "destructive" tests to it
@ -103,7 +103,7 @@ public class TestXSLFChart {
}
@Test
public void testFillLineChartTemplate() throws IOException {
void testFillLineChartTemplate() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("line-chart.pptx");
XSLFChart chart = findChart(pptx.getSlides().get(0));
List<XDDFChartData> data = findChartData(chart);
@ -118,7 +118,7 @@ public class TestXSLFChart {
}
@Test
public void testFillRadarChartTemplate() throws IOException {
void testFillRadarChartTemplate() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("radar-chart.pptx");
XSLFChart chart = findChart(pptx.getSlides().get(0));
List<XDDFChartData> data = findChartData(chart);
@ -133,7 +133,7 @@ public class TestXSLFChart {
}
@Test
public void testFillScatterChartTemplate() throws IOException {
void testFillScatterChartTemplate() throws IOException {
XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("scatter-chart.pptx");
XSLFChart chart = findChart(pptx.getSlides().get(0));
List<XDDFChartData> data = findChartData(chart);

View File

@ -35,7 +35,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STSystemColorVal;
public class TestXSLFColor {
@Test
public void testGetters() {
void testGetters() {
CTColor xml = CTColor.Factory.newInstance();
CTSRgbColor c = xml.addNewSrgbClr();
c.setVal(new byte[]{(byte)0xFF, 0, 0});
@ -96,7 +96,7 @@ public class TestXSLFColor {
}
@Test
public void testHSL() {
void testHSL() {
CTColor xml = CTColor.Factory.newInstance();
CTHslColor c = xml.addNewHslClr();
c.setHue2(14400000);
@ -108,7 +108,7 @@ public class TestXSLFColor {
}
@Test
public void testSRgb() {
void testSRgb() {
CTColor xml = CTColor.Factory.newInstance();
xml.addNewSrgbClr().setVal(new byte[]{ (byte)0xFF, (byte)0xFF, 0});
@ -117,7 +117,7 @@ public class TestXSLFColor {
}
@Test
public void testSchemeColor() throws IOException {
void testSchemeColor() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSheet slide = ppt.createSlide();
XSLFTheme theme = slide.getTheme();
@ -145,7 +145,7 @@ public class TestXSLFColor {
}
@Test
public void testPresetColor() {
void testPresetColor() {
CTColor xml = CTColor.Factory.newInstance();
xml.addNewPrstClr().setVal(STPresetColorVal.AQUAMARINE);
XSLFColor color = new XSLFColor(xml, null, null, null);
@ -169,7 +169,7 @@ public class TestXSLFColor {
}
@Test
public void testSys() {
void testSys() {
CTColor xml = CTColor.Factory.newInstance();
CTSystemColor sys = xml.addNewSysClr();
sys.setVal(STSystemColorVal.CAPTION_TEXT);

View File

@ -41,7 +41,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector;
public class TestXSLFConnectorShape {
@Test
public void testLineDecorations() throws IOException {
void testLineDecorations() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
@ -122,7 +122,7 @@ public class TestXSLFConnectorShape {
}
@Test
public void testAddConnector() throws IOException {
void testAddConnector() throws IOException {
try (XMLSlideShow pptx = new XMLSlideShow()) {
XSLFSlide slide = pptx.createSlide();

View File

@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestXSLFFreeformShape {
@Test
public void testSetPath() throws IOException {
void testSetPath() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
XSLFFreeformShape shape1 = slide.createFreeform();
@ -63,7 +63,7 @@ public class TestXSLFFreeformShape {
}
@Test
public void testZeroWidth() throws IOException {
void testZeroWidth() throws IOException {
// see #61633
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();

View File

@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
public class TestXSLFGroupShape {
@Test
public void testCreateShapes() throws Exception {
void testCreateShapes() throws Exception {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
@ -87,7 +87,7 @@ public class TestXSLFGroupShape {
}
@Test
public void testRemoveShapes() throws Exception {
void testRemoveShapes() throws Exception {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();

View File

@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
public class TestXSLFHyperlink {
@Test
public void testRead() throws IOException{
void testRead() throws IOException{
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx");
XSLFSlide slide = ppt.getSlides().get(4);
@ -61,7 +61,7 @@ public class TestXSLFHyperlink {
}
@Test
public void testCreate() throws IOException, InvalidFormatException {
void testCreate() throws IOException, InvalidFormatException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide1 = ppt.createSlide();
XSLFSlide slide2 = ppt.createSlide();

View File

@ -49,7 +49,7 @@ public class TestXSLFPictureShape {
private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance();
@Test
public void testCreate() throws Exception {
void testCreate() throws Exception {
XMLSlideShow ppt1 = new XMLSlideShow();
assertEquals(0, ppt1.getPictureData().size());
byte[] data1 = new byte[100];
@ -86,7 +86,7 @@ public class TestXSLFPictureShape {
}
@Test
public void testCreateMultiplePictures() throws Exception {
void testCreateMultiplePictures() throws Exception {
XMLSlideShow ppt1 = new XMLSlideShow();
XSLFSlide slide1 = ppt1.createSlide();
XSLFGroupShape group1 = slide1.createGroup();
@ -139,7 +139,7 @@ public class TestXSLFPictureShape {
}
@Test
public void testImageCaching() throws Exception {
void testImageCaching() throws Exception {
XMLSlideShow ppt = new XMLSlideShow();
byte[] img1 = new byte[]{1,2,3};
byte[] img2 = new byte[]{3,4,5};
@ -160,7 +160,7 @@ public class TestXSLFPictureShape {
}
@Test
public void testMerge() throws Exception {
void testMerge() throws Exception {
XMLSlideShow ppt1 = new XMLSlideShow();
byte[] data1 = new byte[100];
XSLFPictureData pdata1 = ppt1.addPicture(data1, PictureType.JPEG);
@ -241,7 +241,7 @@ public class TestXSLFPictureShape {
}
@Test
public void testTiffImageBug59742() throws Exception {
void testTiffImageBug59742() throws Exception {
XMLSlideShow slideShow = new XMLSlideShow();
final InputStream tiffStream = _slTests.openResourceAsStream("testtiff.tif");
final byte[] pictureData = IOUtils.toByteArray(tiffStream);

View File

@ -30,7 +30,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STTextUnderlineType;
public class TestXSLFShape {
@Test
public void testReadTextShapes() throws IOException {
void testReadTextShapes() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx");
List<XSLFSlide> slides = ppt.getSlides();
@ -84,7 +84,7 @@ public class TestXSLFShape {
}
@Test
public void testProblemFile() throws IOException {
void testProblemFile() throws IOException {
try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("ececapstonespring2012.pptx")) {
List<XSLFSlide> slides = ppt.getSlides();
assertEquals(24, slides.size());
@ -92,7 +92,7 @@ public class TestXSLFShape {
}
@Test
public void testCreateShapes() throws IOException {
void testCreateShapes() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
assertTrue(slide.getShapes().isEmpty());

View File

@ -50,7 +50,7 @@ public class TestXSLFShapeContainer {
}
@Test
public void testSheet() throws IOException {
void testSheet() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSheet sheet = ppt.createSlide();
verifyContainer(sheet);

View File

@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
public class TestXSLFSheet {
@Test
public void testCreateShapes() throws IOException {
void testCreateShapes() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
assertTrue(slide.getShapes().isEmpty());

View File

@ -50,7 +50,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType;
public class TestXSLFSimpleShape {
@Test
public void testLineStyles() throws IOException {
void testLineStyles() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
@ -141,7 +141,7 @@ public class TestXSLFSimpleShape {
}
@Test
public void testFill() throws IOException {
void testFill() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
@ -167,7 +167,7 @@ public class TestXSLFSimpleShape {
}
@Test
public void testDefaultProperties() throws IOException {
void testDefaultProperties() throws IOException {
try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx")) {
XSLFSlide slide6 = ppt.getSlides().get(5);
List<XSLFShape> shapes = slide6.getShapes();
@ -236,7 +236,7 @@ public class TestXSLFSimpleShape {
}
@Test
public void testAnchor() throws IOException {
void testAnchor() throws IOException {
try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx")) {
List<XSLFSlide> slide = ppt.getSlides();
@ -270,7 +270,7 @@ public class TestXSLFSimpleShape {
@SuppressWarnings({"unused", "deprecation"})
@Test
public void testShadowEffects() throws IOException{
void testShadowEffects() throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
CTStyleMatrix styleMatrix = slide.getTheme().getXmlObject().getThemeElements().getFmtScheme();
@ -283,7 +283,7 @@ public class TestXSLFSimpleShape {
}
@Test
public void testValidGeometry() throws Exception {
void testValidGeometry() throws Exception {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
@ -305,7 +305,7 @@ public class TestXSLFSimpleShape {
}
@Test
public void testArrayStoreException() throws Exception {
void testArrayStoreException() throws Exception {
File tmpDir = new File("build/tmp/");
// fix maven build errors

View File

@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
public class TestXSLFSlide {
@Test
public void testReadShapes() throws IOException {
void testReadShapes() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx");
List<XSLFSlide> slides = ppt.getSlides();
@ -107,7 +107,7 @@ public class TestXSLFSlide {
}
@Test
public void testCreateSlide() throws IOException {
void testCreateSlide() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
assertEquals(0, ppt.getSlides().size());
@ -122,7 +122,7 @@ public class TestXSLFSlide {
}
@Test
public void testImportContent() throws IOException {
void testImportContent() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XMLSlideShow src = XSLFTestDataSamples.openSampleDocument("themes.pptx");
@ -180,7 +180,7 @@ public class TestXSLFSlide {
}
@Test
public void testMergeSlides() throws IOException {
void testMergeSlides() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
String[] pptx = {"shapes.pptx", "themes.pptx", "layouts.pptx", "backgrounds.pptx"};
@ -197,7 +197,7 @@ public class TestXSLFSlide {
}
@Test
public void testCreateChart() throws IOException {
void testCreateChart() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
XSLFChart chart = ppt.createChart();

View File

@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
*/
public class TestXSLFSlideShow {
@Test
public void testCreateSlide() throws IOException {
void testCreateSlide() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
assertEquals(0, ppt.getSlides().size());
@ -62,7 +62,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testRemoveSlide() throws IOException {
void testRemoveSlide() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
assertEquals(0, ppt.getSlides().size());
@ -87,7 +87,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testDimension() throws IOException {
void testDimension() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
Dimension sz = ppt.getPageSize();
assertEquals(720, sz.width);
@ -100,7 +100,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testSlideMasters() throws IOException {
void testSlideMasters() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
List<XSLFSlideMaster> masters = ppt.getSlideMasters();
assertEquals(1, masters.size());
@ -111,7 +111,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testSlideLayout() throws IOException {
void testSlideLayout() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
List<XSLFSlideMaster> masters = ppt.getSlideMasters();
assertEquals(1, masters.size());
@ -125,7 +125,7 @@ public class TestXSLFSlideShow {
}
@Test
public void testSlideLayoutNames() throws IOException {
void testSlideLayoutNames() throws IOException {
final String[] names = {
"Blank", "Title Only", "Section Header", "Picture with Caption", "Title and Content"
, "Title Slide", "Title and Vertical Text", "Vertical Title and Text", "Comparison"

View File

@ -47,7 +47,7 @@ public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory {
"The unit test needs to be updated by deleting the expected exception code. Status and close any related bugs.";
@Test
public void testFactoryFromFile() {
void testFactoryFromFile() {
// Remove thrown.* when bug 58779 is resolved
// In the mean time, this function will modify SampleShow.pptx on disk.
AssertionError ex = assertThrows(AssertionError.class, () -> testFactoryFromFile(filename),
@ -56,12 +56,12 @@ public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory {
}
@Test
public void testFactoryFromStream() throws Exception {
void testFactoryFromStream() throws Exception {
testFactoryFromStream(filename);
}
@Test
public void testFactoryFromNative() {
void testFactoryFromNative() {
// Remove thrown.* when unit test for XSLF SlideShowFactory.create(OPCPackage) is implemented
UnsupportedOperationException ex = assertThrows(UnsupportedOperationException.class,
() -> testFactoryFromNative(filename), removeExpectedExceptionMsg
@ -70,19 +70,19 @@ public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory {
}
@Test
public void testFactoryFromProtectedFile() throws Exception {
void testFactoryFromProtectedFile() throws Exception {
File pFile = createProtected();
testFactoryFromProtectedFile(pFile.getAbsolutePath(), password);
}
@Test
public void testFactoryFromProtectedStream() throws Exception {
void testFactoryFromProtectedStream() throws Exception {
File pFile = createProtected();
testFactoryFromProtectedStream(pFile.getAbsolutePath(), password);
}
@Test
public void testFactoryFromProtectedNative() throws Exception {
void testFactoryFromProtectedNative() throws Exception {
File pFile = createProtected();
testFactoryFromProtectedNative(pFile.getAbsolutePath(), password);
}

View File

@ -50,7 +50,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFra
public class TestXSLFTable {
@Test
public void testResize() throws Exception {
void testResize() throws Exception {
String[][] data = getDummyData(20);
final int maxHeight = 400;
@ -159,7 +159,7 @@ public class TestXSLFTable {
@Test
public void testRead() throws IOException {
void testRead() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx");
XSLFSlide slide = ppt.getSlides().get(3);
@ -201,7 +201,7 @@ public class TestXSLFTable {
}
@Test
public void testCreate() throws IOException {
void testCreate() throws IOException {
XMLSlideShow ppt1 = new XMLSlideShow();
XSLFSlide slide = ppt1.createSlide();

View File

@ -61,7 +61,7 @@ public class TestXSLFTableRow {
}
@Test
public void testHeight() {
void testHeight() {
final double h = 10.0;
row.setHeight(h);
assertEquals(h, row.getHeight(), 1e-16);
@ -76,7 +76,7 @@ public class TestXSLFTableRow {
}
@Test
public void testIterator() {
void testIterator() {
int i = 0;
for (XSLFTableCell cell : row) {
i++;

View File

@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
public class TestXSLFTableStyles {
@Test
public void testRead() throws IOException {
void testRead() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFTableStyles tblStyles = ppt.getTableStyles();
assertNotNull(tblStyles);

View File

@ -31,7 +31,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties
public class TestXSLFTextBox {
@Test
public void testPlaceholder() throws IOException {
void testPlaceholder() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
@ -50,7 +50,7 @@ public class TestXSLFTextBox {
* text box inherits default text proeprties from presentation.xml
*/
@Test
public void testDefaultTextStyle() throws IOException {
void testDefaultTextStyle() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();

View File

@ -65,7 +65,7 @@ public class TestXSLFTextParagraph {
}
@Test
public void testWrappingWidth() throws IOException {
void testWrappingWidth() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
XSLFTextShape sh = slide.createAutoShape();
@ -158,7 +158,7 @@ public class TestXSLFTextParagraph {
* This test requires that the Arial font is available and will run only on windows
*/
@Test
public void testBreakLines() throws IOException {
void testBreakLines() throws IOException {
String os = System.getProperty("os.name");
assumeTrue((os != null && os.contains("Windows")), "Skipping testBreakLines(), it is executed only on Windows machines");
@ -250,7 +250,7 @@ public class TestXSLFTextParagraph {
}
@Test
public void testThemeInheritance() throws IOException {
void testThemeInheritance() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("prProps.pptx");
List<XSLFShape> shapes = ppt.getSlides().get(0).getShapes();
XSLFTextShape sh1 = (XSLFTextShape)shapes.get(0);
@ -266,7 +266,7 @@ public class TestXSLFTextParagraph {
}
@Test
public void testParagraphProperties() throws IOException {
void testParagraphProperties() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
XSLFTextShape sh = slide.createAutoShape();
@ -365,7 +365,7 @@ public class TestXSLFTextParagraph {
}
@Test
public void testLineBreak() throws IOException {
void testLineBreak() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
XSLFTextShape sh = slide.createAutoShape();

View File

@ -42,7 +42,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
public class TestXSLFTextRun {
@Test
public void testRunProperties() throws IOException {
void testRunProperties() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
XSLFTextShape sh = slide.createAutoShape();
@ -87,7 +87,7 @@ public class TestXSLFTextRun {
}
@Test
public void testUnicodeSurrogates() throws Exception {
void testUnicodeSurrogates() throws Exception {
final String unicodeSurrogates = "\uD835\uDF4A\uD835\uDF4B\uD835\uDF4C\uD835\uDF4D\uD835\uDF4E"
+ "\uD835\uDF4F\uD835\uDF50\uD835\uDF51\uD835\uDF52\uD835\uDF53\uD835\uDF54\uD835"
+ "\uDF55\uD835\uDF56\uD835\uDF57\uD835\uDF58\uD835\uDF59\uD835\uDF5A\uD835\uDF5B"
@ -109,7 +109,7 @@ public class TestXSLFTextRun {
}
@Test
public void testCopyNullFontSize() throws IOException {
void testCopyNullFontSize() throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {
XSLFSlide slide = ppt.createSlide();
XSLFTextShape sh = slide.createAutoShape();
@ -125,7 +125,7 @@ public class TestXSLFTextRun {
}
@Test
public void testDefaultRunProperties() throws IOException {
void testDefaultRunProperties() throws IOException {
// bug #63290
POIDataSamples pds = POIDataSamples.getSlideShowInstance();
try (InputStream is = pds.openResourceAsStream("bug63290.pptx");

View File

@ -65,7 +65,7 @@ public class TestXSLFTextShape {
}
@Test
public void testLayouts() throws IOException {
void testLayouts() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("layouts.pptx");
List<XSLFSlide> slide = ppt.getSlides();
@ -663,7 +663,7 @@ public class TestXSLFTextShape {
}
@Test
public void testTitleStyles() throws IOException {
void testTitleStyles() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlideMaster master = ppt.getSlideMasters().get(0);
@ -746,7 +746,7 @@ public class TestXSLFTextShape {
}
@Test
public void testBodyStyles() throws IOException {
void testBodyStyles() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlideMaster master = ppt.getSlideMasters().get(0);

View File

@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
*/
public class TestXSLFTheme {
@Test
public void testRead(){
void testRead(){
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("themes.pptx");
List<XSLFSlide> slides = ppt.getSlides();

View File

@ -27,7 +27,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetData;
public class TestNecessaryOOXMLClasses {
@Test
public void testProblemClasses() {
void testProblemClasses() {
CTRow row = CTRow.Factory.newInstance();
CTSheetData sheetData = CTSheetData.Factory.newInstance();
// need to get the inner class that implements the row list class loaded

View File

@ -43,7 +43,7 @@ public class TestSheetProtection {
}
@Test
public void testShouldReadWorkbookProtection() throws IOException {
void testShouldReadWorkbookProtection() throws IOException {
assertFalse(sheet.isAutoFilterLocked());
assertFalse(sheet.isDeleteColumnsLocked());
assertFalse(sheet.isDeleteRowsLocked());
@ -84,7 +84,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteAutoFilter() {
void testWriteAutoFilter() {
assertFalse(sheet.isAutoFilterLocked());
sheet.lockAutoFilter(true);
assertFalse(sheet.isAutoFilterLocked());
@ -95,7 +95,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteDeleteColumns() {
void testWriteDeleteColumns() {
assertFalse(sheet.isDeleteColumnsLocked());
sheet.lockDeleteColumns(true);
assertFalse(sheet.isDeleteColumnsLocked());
@ -106,7 +106,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteDeleteRows() {
void testWriteDeleteRows() {
assertFalse(sheet.isDeleteRowsLocked());
sheet.lockDeleteRows(true);
assertFalse(sheet.isDeleteRowsLocked());
@ -117,7 +117,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteFormatCells() {
void testWriteFormatCells() {
assertFalse(sheet.isFormatCellsLocked());
sheet.lockFormatCells(true);
assertFalse(sheet.isFormatCellsLocked());
@ -128,7 +128,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteFormatColumns() {
void testWriteFormatColumns() {
assertFalse(sheet.isFormatColumnsLocked());
sheet.lockFormatColumns(true);
assertFalse(sheet.isFormatColumnsLocked());
@ -139,7 +139,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteFormatRows() {
void testWriteFormatRows() {
assertFalse(sheet.isFormatRowsLocked());
sheet.lockFormatRows(true);
assertFalse(sheet.isFormatRowsLocked());
@ -150,7 +150,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteInsertColumns() {
void testWriteInsertColumns() {
assertFalse(sheet.isInsertColumnsLocked());
sheet.lockInsertColumns(true);
assertFalse(sheet.isInsertColumnsLocked());
@ -161,7 +161,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteInsertHyperlinks() {
void testWriteInsertHyperlinks() {
assertFalse(sheet.isInsertHyperlinksLocked());
sheet.lockInsertHyperlinks(true);
assertFalse(sheet.isInsertHyperlinksLocked());
@ -172,7 +172,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteInsertRows() {
void testWriteInsertRows() {
assertFalse(sheet.isInsertRowsLocked());
sheet.lockInsertRows(true);
assertFalse(sheet.isInsertRowsLocked());
@ -183,7 +183,7 @@ public class TestSheetProtection {
}
@Test
public void testWritePivotTables() {
void testWritePivotTables() {
assertFalse(sheet.isPivotTablesLocked());
sheet.lockPivotTables(true);
assertFalse(sheet.isPivotTablesLocked());
@ -194,7 +194,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteSort() {
void testWriteSort() {
assertFalse(sheet.isSortLocked());
sheet.lockSort(true);
assertFalse(sheet.isSortLocked());
@ -205,7 +205,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteObjects() {
void testWriteObjects() {
assertFalse(sheet.isObjectsLocked());
sheet.lockObjects(true);
assertFalse(sheet.isObjectsLocked());
@ -216,7 +216,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteScenarios() {
void testWriteScenarios() {
assertFalse(sheet.isScenariosLocked());
sheet.lockScenarios(true);
assertFalse(sheet.isScenariosLocked());
@ -227,7 +227,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteSelectLockedCells() {
void testWriteSelectLockedCells() {
assertFalse(sheet.isSelectLockedCellsLocked());
sheet.lockSelectLockedCells(true);
assertFalse(sheet.isSelectLockedCellsLocked());
@ -238,7 +238,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteSelectUnlockedCells() {
void testWriteSelectUnlockedCells() {
assertFalse(sheet.isSelectUnlockedCellsLocked());
sheet.lockSelectUnlockedCells(true);
assertFalse(sheet.isSelectUnlockedCellsLocked());
@ -249,7 +249,7 @@ public class TestSheetProtection {
}
@Test
public void testWriteSelectEnableLocking() throws IOException {
void testWriteSelectEnableLocking() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("sheetProtection_allLocked.xlsx")) {
sheet = workbook.getSheetAt(0);

View File

@ -169,7 +169,7 @@ public class TestWorkbookProtection {
@SuppressWarnings("resource")
@Test
public void testHashPassword() throws Exception {
void testHashPassword() throws Exception {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
wb.lockRevision();
wb.setRevisionsPassword("test", HashAlgorithm.sha1);
@ -184,7 +184,7 @@ public class TestWorkbookProtection {
@SuppressWarnings("resource")
@Test
public void testIntegration() throws Exception {
void testIntegration() throws Exception {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
wb.createSheet("Testing purpose sheet");
assertFalse(wb.isRevisionLocked());
@ -201,7 +201,7 @@ public class TestWorkbookProtection {
}
@Test
public void testEncryptDecrypt() throws Exception {
void testEncryptDecrypt() throws Exception {
final String password = "abc123";
final String sheetName = "TestSheet1";
final String cellValue = "customZipEntrySource";

View File

@ -49,20 +49,20 @@ public class TestXSSFCloneSheet extends BaseTestCloneSheet {
}
@Test
public void testCloneSheetIntStringValidName() {
void testCloneSheetIntStringValidName() {
XSSFSheet cloned = wb.cloneSheet(0, OTHER_SHEET_NAME);
assertEquals(OTHER_SHEET_NAME, cloned.getSheetName());
assertEquals(2, wb.getNumberOfSheets());
}
@Test
public void testCloneSheetIntStringInvalidName() {
void testCloneSheetIntStringInvalidName() {
assertThrows(IllegalArgumentException.class, () -> wb.cloneSheet(0, VALID_SHEET_NAME));
assertEquals(1, wb.getNumberOfSheets());
}
@Test
public void test60512() throws IOException {
void test60512() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60512.xlsm");
assertEquals(1, wb.getNumberOfSheets());
@ -79,7 +79,7 @@ public class TestXSSFCloneSheet extends BaseTestCloneSheet {
}
@Test
public void test61605() throws IOException {
void test61605() throws IOException {
try (Workbook template_wb = XSSFTestDataSamples.openSampleWorkbook("61605.xlsx")) {
Sheet template_sh = template_wb.getSheetAt(0);
assertNotNull(template_sh);

View File

@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestXSSFOffset {
@Test
public void testOffsetWithEmpty23Arguments() throws IOException {
void testOffsetWithEmpty23Arguments() throws IOException {
try (Workbook workbook = new XSSFWorkbook()) {
Cell cell = workbook.createSheet().createRow(0).createCell(0);
cell.setCellFormula("OFFSET(B1,,)");

View File

@ -60,7 +60,7 @@ public class XSSFMemoryLeakTests {
}
@Test
public void testWriteRow() throws IOException {
void testWriteRow() throws IOException {
final XSSFWorkbook wb = new XSSFWorkbook();
final XSSFSheet sheet1 = wb.createSheet("Sheet1");
final XSSFRow row = sheet1.createRow(0);
@ -83,7 +83,7 @@ public class XSSFMemoryLeakTests {
}
@Test
public void testRemoveCellFromRow() throws IOException {
void testRemoveCellFromRow() throws IOException {
final XSSFWorkbook wb = new XSSFWorkbook();
final XSSFSheet sheet1 = wb.createSheet("Sheet1");
final XSSFRow rowToCheck = sheet1.createRow(0);
@ -102,7 +102,7 @@ public class XSSFMemoryLeakTests {
}
@Test
public void testRemove2CellsFromRow() throws IOException {
void testRemove2CellsFromRow() throws IOException {
final XSSFWorkbook wb = new XSSFWorkbook();
final XSSFSheet sheet1 = wb.createSheet("Sheet1");
final XSSFRow rowToCheck = sheet1.createRow(0);
@ -126,7 +126,7 @@ public class XSSFMemoryLeakTests {
}
@Test
public void testRemoveRowFromSheet() throws IOException {
void testRemoveRowFromSheet() throws IOException {
final XSSFWorkbook wb1 = new XSSFWorkbook();
final XSSFSheet sheetToCheck = wb1.createSheet("Sheet1");
references.add(sheetToCheck);
@ -146,14 +146,14 @@ public class XSSFMemoryLeakTests {
}
@Test
public void testFileLeak() {
void testFileLeak() {
File file = XSSFTestDataSamples.getSampleFile("xlsx-corrupted.xlsx");
verifier.addObject(file);
assertThrows(POIXMLException.class, () -> new XSSFWorkbook(file), "Should catch exception as the file is corrupted");
}
@Test
public void testFileLeak2() throws IOException, InvalidFormatException {
void testFileLeak2() throws IOException, InvalidFormatException {
File file = XSSFTestDataSamples.getSampleFile("xlsx-corrupted.xlsx");
verifier.addObject(file);
try (OPCPackage pkg = OPCPackage.open(file)) {

View File

@ -31,7 +31,7 @@ public class TestXSSFBSharedStringsTable {
private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance();
@Test
public void testBasic() throws Exception {
void testBasic() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("51519.xlsb"))) {
List<PackagePart> parts = pkg.getPartsByName(Pattern.compile("/xl/sharedStrings.bin"));
assertEquals(1, parts.size());

View File

@ -33,7 +33,7 @@ public class TestXSSFBSheetHyperlinkManager {
private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance();
@Test
public void testBasic() throws Exception {
void testBasic() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("hyperlink.xlsb"))) {
XSSFBReader reader = new XSSFBReader(pkg);
XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) reader.getSheetsData();

View File

@ -41,7 +41,7 @@ public final class TestReadOnlySharedStringsTable {
private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance();
@Test
public void testParse() throws Exception {
void testParse() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) {
List<PackagePart> parts = pkg.getPartsByName(Pattern.compile("/xl/sharedStrings.xml"));
assertEquals(1, parts.size());
@ -64,7 +64,7 @@ public final class TestReadOnlySharedStringsTable {
//51519
@Test
public void testPhoneticRuns() throws Exception {
void testPhoneticRuns() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("51519.xlsx"))) {
List < PackagePart > parts = pkg.getPartsByName(Pattern.compile("/xl/sharedStrings.xml"));
assertEquals(1, parts.size());
@ -85,7 +85,7 @@ public final class TestReadOnlySharedStringsTable {
}
@Test
public void testEmptySSTOnPackageObtainedViaWorkbook() throws Exception {
void testEmptySSTOnPackageObtainedViaWorkbook() throws Exception {
XSSFWorkbook wb = new XSSFWorkbook(_ssTests.openResourceAsStream("noSharedStringTable.xlsx"));
OPCPackage pkg = wb.getPackage();
assertEmptySST(pkg);
@ -93,7 +93,7 @@ public final class TestReadOnlySharedStringsTable {
}
@Test
public void testEmptySSTOnPackageDirect() throws Exception {
void testEmptySSTOnPackageDirect() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("noSharedStringTable.xlsx"))) {
assertEmptySST(pkg);
}

View File

@ -39,7 +39,7 @@ public class TestXSSFBReader {
private static POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance();
@Test
public void testBasic() throws Exception {
void testBasic() throws Exception {
List<String> sheetTexts = getSheets("testVarious.xlsb");
assertEquals(1, sheetTexts.size());
@ -94,7 +94,7 @@ public class TestXSSFBReader {
}
@Test
public void testComments() throws Exception {
void testComments() throws Exception {
List<String> sheetTexts = getSheets("comments.xlsb");
String xsxml = sheetTexts.get(0);
assertContains(xsxml,
@ -119,7 +119,7 @@ public class TestXSSFBReader {
}
@Test
public void testAbsPath() throws Exception {
void testAbsPath() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("testVarious.xlsb"))) {
XSSFBReader r = new XSSFBReader(pkg);
assertEquals("C:\\Users\\tallison\\Desktop\\working\\xlsb\\", r.getAbsPathMetadata());
@ -158,7 +158,7 @@ public class TestXSSFBReader {
}
@Test
public void testDate() throws Exception {
void testDate() throws Exception {
List<String> sheets = getSheets("date.xlsb");
assertEquals(1, sheets.size());
assertContains(sheets.get(0), "1/12/13");

View File

@ -55,7 +55,7 @@ public final class TestXSSFReader {
private static final POIDataSamples _ssTests = POIDataSamples.getSpreadSheetInstance();
@Test
public void testGetBits() throws Exception {
void testGetBits() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) {
XSSFReader r = new XSSFReader(pkg);
@ -70,7 +70,7 @@ public final class TestXSSFReader {
}
@Test
public void testStyles() throws Exception {
void testStyles() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) {
XSSFReader r = new XSSFReader(pkg);
@ -88,7 +88,7 @@ public final class TestXSSFReader {
}
@Test
public void testStrings() throws Exception {
void testStrings() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) {
XSSFReader r = new XSSFReader(pkg);
@ -99,7 +99,7 @@ public final class TestXSSFReader {
}
@Test
public void testSheets() throws Exception {
void testSheets() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("SampleSS.xlsx"))) {
XSSFReader r = new XSSFReader(pkg);
@ -133,7 +133,7 @@ public final class TestXSSFReader {
* (as they are defined in the workbook.xml)
*/
@Test
public void testOrderOfSheets() throws Exception {
void testOrderOfSheets() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("reordered_sheets.xlsx"))) {
XSSFReader r = new XSSFReader(pkg);
@ -155,7 +155,7 @@ public final class TestXSSFReader {
}
@Test
public void testComments() throws Exception {
void testComments() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("comments.xlsx")) {
XSSFReader r = new XSSFReader(pkg);
XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) r.getSheetsData();
@ -184,7 +184,7 @@ public final class TestXSSFReader {
* XSSFReader method
*/
@Test
public void test50119() throws Exception {
void test50119() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("WithChartSheet.xlsx")) {
XSSFReader r = new XSSFReader(pkg);
XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) r.getSheetsData();
@ -200,7 +200,7 @@ public final class TestXSSFReader {
* Test text extraction from text box using getShapes()
*/
@Test
public void testShapes() throws Exception {
void testShapes() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("WithTextBox.xlsx")) {
XSSFReader r = new XSSFReader(pkg);
XSSFReader.SheetIterator it = (XSSFReader.SheetIterator) r.getSheetsData();
@ -230,7 +230,7 @@ public final class TestXSSFReader {
}
@Test
public void testBug57914() throws Exception {
void testBug57914() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("57914.xlsx")) {
// for now expect this to fail, when we fix 57699, this one should fail so we know we should adjust
// this test as well
@ -253,7 +253,7 @@ public final class TestXSSFReader {
* the openpyxl library
*/
@Test
public void test58747() throws Exception {
void test58747() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("58747.xlsx")) {
ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg);
assertNotNull(strings);
@ -275,7 +275,7 @@ public final class TestXSSFReader {
* 60825
*/
@Test
public void testSheetWithNoRelationshipId() throws Exception {
void testSheetWithNoRelationshipId() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("60825.xlsx")) {
ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg);
assertNotNull(strings);
@ -302,7 +302,7 @@ public final class TestXSSFReader {
* &lt;sheet name="Sheet6" sheetId="4" r:id="rId6"/&gt;
*/
@Test
public void test61034() throws Exception {
void test61034() throws Exception {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("61034.xlsx")) {
XSSFReader reader = new XSSFReader(pkg);
XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData();
@ -319,7 +319,7 @@ public final class TestXSSFReader {
@Test
@Disabled("until we fix issue https://bz.apache.org/bugzilla/show_bug.cgi?id=61701")
public void test61701() throws Exception {
void test61701() throws Exception {
try(Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("simple-table-named-range.xlsx")) {
Name name = workbook.getName("total");
System.out.println("workbook.getName(\"total\").getSheetName() returned: " + name.getSheetName());
@ -327,7 +327,7 @@ public final class TestXSSFReader {
}
@Test
public void test64420() throws Exception {
void test64420() throws Exception {
try (OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream("64420.xlsm"))) {
XSSFReader reader = new XSSFReader(pkg);

View File

@ -43,7 +43,7 @@ public class TestXSSFBEventBasedExcelExtractor {
* Get text out of the simple file
*/
@Test
public void testGetSimpleText() throws Exception {
void testGetSimpleText() throws Exception {
// a very simple file
try (XSSFEventBasedExcelExtractor extractor = getExtractor("sample.xlsb")) {
extractor.setIncludeCellComments(true);
@ -87,7 +87,7 @@ public class TestXSSFBEventBasedExcelExtractor {
* Test text extraction from text box using getShapes()
*/
@Test
public void testShapes() throws Exception {
void testShapes() throws Exception {
try (XSSFEventBasedExcelExtractor ooxmlExtractor = getExtractor("WithTextBox.xlsb")) {
String text = ooxmlExtractor.getText();
assertContains(text, "Line 1");
@ -97,7 +97,7 @@ public class TestXSSFBEventBasedExcelExtractor {
}
@Test
public void testBeta() throws Exception {
void testBeta() throws Exception {
try (XSSFEventBasedExcelExtractor extractor = getExtractor("Simple.xlsb")) {
extractor.setIncludeCellComments(true);
String text = extractor.getText();
@ -107,7 +107,7 @@ public class TestXSSFBEventBasedExcelExtractor {
}
@Test
public void test62815() throws Exception {
void test62815() throws Exception {
//test file based on http://oss.sheetjs.com/test_files/RkNumber.xlsb
try (XSSFEventBasedExcelExtractor extractor = getExtractor("62815.xlsb")) {
extractor.setIncludeCellComments(true);

View File

@ -48,7 +48,7 @@ public class TestXSSFEventBasedExcelExtractor {
* Get text out of the simple file
*/
@Test
public void testGetSimpleText() throws Exception {
void testGetSimpleText() throws Exception {
// a very simple file
XSSFEventBasedExcelExtractor extractor = getExtractor("sample.xlsx");
extractor.getText();
@ -109,7 +109,7 @@ public class TestXSSFEventBasedExcelExtractor {
}
@Test
public void testGetComplexText() throws Exception {
void testGetComplexText() throws Exception {
// A fairly complex file
XSSFEventBasedExcelExtractor extractor = getExtractor("AverageTaxRates.xlsx");
extractor.getText();
@ -127,7 +127,7 @@ public class TestXSSFEventBasedExcelExtractor {
}
@Test
public void testInlineStrings() throws Exception {
void testInlineStrings() throws Exception {
XSSFEventBasedExcelExtractor extractor = getExtractor("InlineStrings.xlsx");
extractor.setFormulasNotResults(true);
String text = extractor.getText();
@ -157,7 +157,7 @@ public class TestXSSFEventBasedExcelExtractor {
* the same file, just saved as xls and xlsx
*/
@Test
public void testComparedToOLE2() throws Exception {
void testComparedToOLE2() throws Exception {
// A fairly simple file - ooxml
XSSFEventBasedExcelExtractor ooxmlExtractor = getExtractor("SampleSS.xlsx");
@ -180,7 +180,7 @@ public class TestXSSFEventBasedExcelExtractor {
/** Test text extraction from text box using getShapes() */
@Test
public void testShapes() throws Exception{
void testShapes() throws Exception{
try (XSSFEventBasedExcelExtractor ooxmlExtractor = getExtractor("WithTextBox.xlsx")) {
String text = ooxmlExtractor.getText();
@ -195,7 +195,7 @@ public class TestXSSFEventBasedExcelExtractor {
* non-event-based XSSFExcelExtractor.
*/
@Test
public void testUnstyledNumbersComparedToNonEventBasedExtractor()
void testUnstyledNumbersComparedToNonEventBasedExtractor()
throws Exception {
String expectedOutput = "Sheet1\n99.99\n";
@ -216,7 +216,7 @@ public class TestXSSFEventBasedExcelExtractor {
* non-event-based XSSFExcelExtractor.
*/
@Test
public void testHeadersAndFootersComparedToNonEventBasedExtractor()
void testHeadersAndFootersComparedToNonEventBasedExtractor()
throws Exception {
String expectedOutputWithHeadersAndFooters =
@ -254,7 +254,7 @@ public class TestXSSFEventBasedExcelExtractor {
* XSSFExcelExtractor.
*/
@Test
public void testCommentsComparedToNonEventBasedExtractor()
void testCommentsComparedToNonEventBasedExtractor()
throws Exception {
String expectedOutputWithoutComments =
@ -303,7 +303,7 @@ public class TestXSSFEventBasedExcelExtractor {
}
@Test
public void testFile56278_normal() throws Exception {
void testFile56278_normal() throws Exception {
// first with normal Text Extractor
try (POIXMLTextExtractor extractor = new XSSFExcelExtractor(
XSSFTestDataSamples.openSampleWorkbook("56278.xlsx"))) {
@ -312,7 +312,7 @@ public class TestXSSFEventBasedExcelExtractor {
}
@Test
public void testFile56278_event() throws Exception {
void testFile56278_event() throws Exception {
// then with event based one
try (POIXMLTextExtractor extractor = getExtractor("56278.xlsx")) {
assertNotNull(extractor.getText());
@ -320,7 +320,7 @@ public class TestXSSFEventBasedExcelExtractor {
}
@Test
public void test59021() throws Exception {
void test59021() throws Exception {
XSSFEventBasedExcelExtractor ex =
new XSSFEventBasedExcelExtractor(
XSSFTestDataSamples.openSamplePackage("59021.xlsx"));
@ -331,7 +331,7 @@ public class TestXSSFEventBasedExcelExtractor {
}
@Test
public void test51519() throws Exception {
void test51519() throws Exception {
//default behavior: include phonetic runs
XSSFEventBasedExcelExtractor ex =
new XSSFEventBasedExcelExtractor(

View File

@ -49,7 +49,7 @@ public class TestXSSFExcelExtractor {
* Get text out of the simple file
*/
@Test
public void testGetSimpleText() throws IOException {
void testGetSimpleText() throws IOException {
// a very simple file
XSSFExcelExtractor extractor = getExtractor("sample.xlsx");
@ -109,7 +109,7 @@ public class TestXSSFExcelExtractor {
}
@Test
public void testGetComplexText() throws IOException {
void testGetComplexText() throws IOException {
// A fairly complex file
XSSFExcelExtractor extractor = getExtractor("AverageTaxRates.xlsx");
@ -131,7 +131,7 @@ public class TestXSSFExcelExtractor {
* the same file, just saved as xls and xlsx
*/
@Test
public void testComparedToOLE2() throws IOException {
void testComparedToOLE2() throws IOException {
// A fairly simple file - ooxml
XSSFExcelExtractor ooxmlExtractor = getExtractor("SampleSS.xlsx");
@ -160,7 +160,7 @@ public class TestXSSFExcelExtractor {
* From bug #45540
*/
@Test
public void testHeaderFooter() throws IOException {
void testHeaderFooter() throws IOException {
String[] files = new String[] {
"45540_classic_Header.xlsx", "45540_form_Header.xlsx",
"45540_classic_Footer.xlsx", "45540_form_Footer.xlsx",
@ -180,7 +180,7 @@ public class TestXSSFExcelExtractor {
* From bug #45544
*/
@Test
public void testComments() throws IOException {
void testComments() throws IOException {
XSSFExcelExtractor extractor = getExtractor("45544.xlsx");
String text = extractor.getText();
@ -198,7 +198,7 @@ public class TestXSSFExcelExtractor {
}
@Test
public void testInlineStrings() throws IOException {
void testInlineStrings() throws IOException {
XSSFExcelExtractor extractor = getExtractor("InlineStrings.xlsx");
extractor.setFormulasNotResults(true);
String text = extractor.getText();
@ -226,7 +226,7 @@ public class TestXSSFExcelExtractor {
* Simple test for text box text
*/
@Test
public void testTextBoxes() throws IOException {
void testTextBoxes() throws IOException {
try (XSSFExcelExtractor extractor = getExtractor("WithTextBox.xlsx")) {
extractor.setFormulasNotResults(true);
String text = extractor.getText();
@ -237,7 +237,7 @@ public class TestXSSFExcelExtractor {
}
@Test
public void testPhoneticRuns() throws Exception {
void testPhoneticRuns() throws Exception {
try (XSSFExcelExtractor extractor = getExtractor("51519.xlsx")) {
String text = extractor.getText();
assertContains(text, "\u8C4A\u7530");

View File

@ -56,7 +56,7 @@ import org.xml.sax.SAXParseException;
public final class TestXSSFExportToXML {
@Test
public void testExportToXML() throws Exception {
void testExportToXML() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx")) {
boolean found = false;
@ -103,7 +103,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testExportToXMLInverseOrder() throws Exception {
void testExportToXMLInverseOrder() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples
.openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx")) {
@ -151,7 +151,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testXPathOrdering() throws IOException {
void testXPathOrdering() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples
.openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx")) {
@ -175,7 +175,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testMultiTable() throws Exception {
void testMultiTable() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples
.openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) {
@ -220,7 +220,7 @@ public final class TestXSSFExportToXML {
@Test
@Disabled(value="Fails, but I don't know if it is ok or not...")
public void testExportToXMLSingleAttributeNamespace() throws Exception {
void testExportToXMLSingleAttributeNamespace() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMapping-singleattributenamespace.xlsx")) {
for (XSSFMap map : wb.getCustomXMLMappings()) {
@ -233,7 +233,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void test55850ComplexXmlExport() throws Exception {
void test55850ComplexXmlExport() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55850.xlsx")) {
boolean found = false;
@ -277,7 +277,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testFormulaCells_Bugzilla_55927() throws Exception {
void testFormulaCells_Bugzilla_55927() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55927.xlsx")) {
boolean found = false;
@ -312,7 +312,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testFormulaCells_Bugzilla_55926() throws Exception {
void testFormulaCells_Bugzilla_55926() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55926.xlsx")) {
boolean found = false;
@ -351,7 +351,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testXmlExportIgnoresEmptyCells_Bugzilla_55924() throws Exception {
void testXmlExportIgnoresEmptyCells_Bugzilla_55924() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55924.xlsx")) {
boolean found = false;
@ -387,7 +387,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testXmlExportSchemaWithXSAllTag_Bugzilla_56169() throws Exception {
void testXmlExportSchemaWithXSAllTag_Bugzilla_56169() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56169.xlsx")) {
for (XSSFMap map : wb.getCustomXMLMappings()) {
@ -424,7 +424,7 @@ public final class TestXSSFExportToXML {
@SuppressWarnings("EqualsWithItself")
@Test
public void testXmlExportCompare_Bug_55923() throws Exception {
void testXmlExportCompare_Bug_55923() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) {
boolean found = false;
@ -455,7 +455,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testXmlExportSchemaOrderingBug_Bugzilla_55923() throws Exception {
void testXmlExportSchemaOrderingBug_Bugzilla_55923() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) {
boolean found = false;
@ -509,7 +509,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testExportDataTypes() throws Exception {
void testExportDataTypes() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) {
Sheet sheet = wb.getSheetAt(0);
@ -565,7 +565,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testValidateFalse() throws Exception {
void testValidateFalse() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55923.xlsx")) {
boolean found = false;
for (POIXMLDocumentPart p : wb.getRelations()) {
@ -596,7 +596,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testRefElementsInXmlSchema_Bugzilla_56730() throws Exception {
void testRefElementsInXmlSchema_Bugzilla_56730() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56730.xlsx")) {
boolean found = false;
@ -631,7 +631,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testBug59026() throws Exception {
void testBug59026() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("59026.xlsx")) {
Collection<XSSFMap> mappings = wb.getCustomXMLMappings();
assertTrue(mappings.size() > 0);
@ -646,7 +646,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testExportTableWithNonMappedColumn_Bugzilla_61281() throws Exception {
void testExportTableWithNonMappedColumn_Bugzilla_61281() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("61281.xlsx")) {
for (XSSFMap map : wb.getCustomXMLMappings()) {
XSSFExportToXml exporter = new XSSFExportToXml(map);
@ -660,7 +660,7 @@ public final class TestXSSFExportToXML {
}
@Test
public void testXXEInSchema() throws Exception {
void testXXEInSchema() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("xxe_in_schema.xlsx")) {
for (XSSFMap map : wb.getCustomXMLMappings()) {
XSSFExportToXml exporter = new XSSFExportToXml(map);

View File

@ -45,7 +45,7 @@ import org.xml.sax.SAXException;
public class TestXSSFImportFromXML {
@Test
public void testImportFromXML() throws IOException, XPathExpressionException, SAXException{
void testImportFromXML() throws IOException, XPathExpressionException, SAXException{
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx")) {
String name = "name";
String teacher = "teacher";
@ -89,7 +89,7 @@ public class TestXSSFImportFromXML {
@Timeout(value = 60, unit = SECONDS)
@Test
public void testMultiTable() throws IOException, XPathExpressionException, SAXException{
void testMultiTable() throws IOException, XPathExpressionException, SAXException{
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings-complex-type.xlsx")) {
String cellC6 = "c6";
String cellC7 = "c7";
@ -139,7 +139,7 @@ public class TestXSSFImportFromXML {
@Test
public void testSingleAttributeCellWithNamespace() throws IOException, XPathExpressionException, SAXException{
void testSingleAttributeCellWithNamespace() throws IOException, XPathExpressionException, SAXException{
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMapping-singleattributenamespace.xlsx")) {
int id = 1;
String displayName = "dispName";
@ -166,7 +166,7 @@ public class TestXSSFImportFromXML {
}
@Test
public void testOptionalFields_Bugzilla_55864() throws IOException, XPathExpressionException, SAXException {
void testOptionalFields_Bugzilla_55864() throws IOException, XPathExpressionException, SAXException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55864.xlsx")) {
String testXML = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
"<PersonInfoRoot>" +
@ -204,7 +204,7 @@ public class TestXSSFImportFromXML {
}
@Test
public void testOptionalFields_Bugzilla_57890() throws IOException, ParseException, XPathExpressionException, SAXException {
void testOptionalFields_Bugzilla_57890() throws IOException, ParseException, XPathExpressionException, SAXException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57890.xlsx");
String testXML = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<TestInfoRoot>"

View File

@ -36,7 +36,7 @@ public class TestLoadSaveXSSF {
private static final POIDataSamples _ssSamples = POIDataSamples.getSpreadSheetInstance();
@Test
public void testLoadSample() throws Exception {
void testLoadSample() throws Exception {
try (XSSFWorkbook workbook = new XSSFWorkbook(_ssSamples.openResourceAsStream("sample.xlsx"))) {
assertEquals(3, workbook.getNumberOfSheets());
assertEquals("Sheet1", workbook.getSheetName(0));
@ -51,7 +51,7 @@ public class TestLoadSaveXSSF {
}
@Test
public void testLoadStyles() throws Exception {
void testLoadStyles() throws Exception {
try (XSSFWorkbook workbook = new XSSFWorkbook(_ssSamples.openResourceAsStream("styles.xlsx"))) {
Sheet sheet = workbook.getSheetAt(0);
Row row = sheet.getRow(0);
@ -62,7 +62,7 @@ public class TestLoadSaveXSSF {
}
@Test
public void testLoadPictures() throws Exception {
void testLoadPictures() throws Exception {
try (XSSFWorkbook workbook = new XSSFWorkbook(_ssSamples.openResourceAsStream("picture.xlsx"))) {
List<XSSFPictureData> pictures = workbook.getAllPictures();
assertEquals(1, pictures.size());

View File

@ -32,7 +32,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCalcCell;
public final class TestCalculationChain {
@Test
public void test46535() throws IOException {
void test46535() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("46535.xlsx")) {
CalculationChain chain = wb.getCalculationChain();

View File

@ -35,7 +35,7 @@ import org.w3c.dom.Node;
*/
public final class TestMapInfo {
@Test
public void testMapInfoExists() throws IOException {
void testMapInfoExists() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx")) {
MapInfo mapInfo = null;

View File

@ -45,7 +45,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst;
*/
public final class TestSharedStringsTable {
@Test
public void testCreateNew() {
void testCreateNew() {
SharedStringsTable sst = new SharedStringsTable();
CTRst st;
@ -115,7 +115,7 @@ public final class TestSharedStringsTable {
}
@Test
public void testCreateUsingRichTextStrings() {
void testCreateUsingRichTextStrings() {
SharedStringsTable sst = new SharedStringsTable();
// Check defaults
@ -182,7 +182,7 @@ public final class TestSharedStringsTable {
}
@Test
public void testReadWrite() throws IOException {
void testReadWrite() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("sample.xlsx");
SharedStringsTable sst1 = wb1.getSharedStringSource();
@ -208,7 +208,7 @@ public final class TestSharedStringsTable {
* A specific sequence of strings can result in broken CDATA section in sharedStrings.xml file.
*/
@Test
public void testBug48936() throws IOException {
void testBug48936() throws IOException {
Workbook w1 = new XSSFWorkbook();
Sheet s = w1.createSheet();
int i = 0;

View File

@ -47,7 +47,7 @@ public final class TestStylesTable {
}
@Test
public void testCreateNew() {
void testCreateNew() {
StylesTable st = new StylesTable();
// Check defaults
@ -58,7 +58,7 @@ public final class TestStylesTable {
}
@Test
public void testCreateSaveLoad() throws IOException {
void testCreateSaveLoad() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
StylesTable st = wb.getStylesSource();
@ -79,7 +79,7 @@ public final class TestStylesTable {
}
@Test
public void testLoadExisting() throws IOException {
void testLoadExisting() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile)) {
assertNotNull(workbook.getStylesSource());
@ -92,7 +92,7 @@ public final class TestStylesTable {
}
@Test
public void testLoadSaveLoad() throws IOException {
void testLoadSaveLoad() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile)) {
assertNotNull(workbook.getStylesSource());
@ -316,7 +316,7 @@ public final class TestStylesTable {
}
@Test
public void testLoadWithAlternateContent() throws IOException {
void testLoadWithAlternateContent() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("style-alternate-content.xlsx")) {
assertNotNull(workbook.getStylesSource());
@ -328,7 +328,7 @@ public final class TestStylesTable {
}
@Test
public void testReplaceStyle() throws IOException {
void testReplaceStyle() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("style-alternate-content.xlsx")) {
assertNotNull(workbook.getStylesSource());

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