diff options
author | Dominik Stadler <centic@apache.org> | 2020-09-25 19:39:45 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2020-09-25 19:39:45 +0000 |
commit | ceae0d0903e95dbf0c9e70a7e154513232e529c9 (patch) | |
tree | 5a7fecea7d9ece824d9a5a7d146f8801ce0fd4e4 /src/integrationtest/org/apache/poi | |
parent | 7c0327c8b101fcd093aae5a83b37a99f0809ffd1 (diff) | |
download | poi-ceae0d0903e95dbf0c9e70a7e154513232e529c9.tar.gz poi-ceae0d0903e95dbf0c9e70a7e154513232e529c9.zip |
Fix IDE warnings, add more assertion-output
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882025 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/integrationtest/org/apache/poi')
3 files changed, 8 insertions, 11 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java index dbbbea66a7..d01b0a3cba 100644 --- a/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java @@ -33,7 +33,6 @@ import java.util.Set; import org.apache.poi.examples.hpsf.CopyCompare; import org.apache.poi.hpsf.DocumentSummaryInformation; import org.apache.poi.hpsf.HPSFPropertiesOnlyDocument; -import org.apache.poi.hpsf.MarkUnsupportedException; import org.apache.poi.hpsf.PropertySet; import org.apache.poi.hpsf.SummaryInformation; import org.apache.poi.poifs.filesystem.DirectoryNode; @@ -85,7 +84,7 @@ public class HPSFFileHandler extends POIFSFileHandler { handlePOIDocument(hpsf); } - private static boolean hasPropertyStream(POIFSFileSystem poifs, String streamName) throws IOException, MarkUnsupportedException { + private static boolean hasPropertyStream(POIFSFileSystem poifs, String streamName) throws IOException { DirectoryNode root = poifs.getRoot(); if (!root.hasEntry(streamName)) { return false; @@ -121,7 +120,7 @@ public class HPSFFileHandler extends POIFSFileHandler { @Test @SuppressWarnings("java:S2699") public void test() throws Exception { - String path = "test-data/hpsf/Test0313rur.adm"; + String path = "test-data/diagram/44501.vsd"; try (InputStream stream = new FileInputStream(path)) { handleFile(stream, path); } diff --git a/src/integrationtest/org/apache/poi/stress/OPCFileHandler.java b/src/integrationtest/org/apache/poi/stress/OPCFileHandler.java index fe0d547ebb..59c352c129 100644 --- a/src/integrationtest/org/apache/poi/stress/OPCFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/OPCFileHandler.java @@ -43,7 +43,7 @@ public class OPCFileHandler extends AbstractFileHandler { assertEquals(ContentTypes.CORE_PROPERTIES_PART, part.getContentType()); } if (part.getPartName().toString().equals("/word/document.xml")) { - assertTrue("Expected one of " + XWPFRelation.MACRO_DOCUMENT + ", " + XWPFRelation.DOCUMENT + ", " + XWPFRelation.TEMPLATE + + assertTrue("Expected one of " + XWPFRelation.MACRO_DOCUMENT + ", " + XWPFRelation.DOCUMENT + ", " + XWPFRelation.TEMPLATE + ", but had " + part.getContentType(), XWPFRelation.DOCUMENT.getContentType().equals(part.getContentType()) || XWPFRelation.MACRO_DOCUMENT.getContentType().equals(part.getContentType()) || @@ -54,9 +54,9 @@ public class OPCFileHandler extends AbstractFileHandler { } } } - + @Override - public void handleExtracting(File file) throws Exception { + public void handleExtracting(File file) { // text-extraction is not possible currently for these types of files } @@ -68,7 +68,7 @@ public class OPCFileHandler extends AbstractFileHandler { try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) { handleFile(stream, file.getPath()); } - + handleExtracting(file); } } diff --git a/src/integrationtest/org/apache/poi/stress/XSLFFileHandler.java b/src/integrationtest/org/apache/poi/stress/XSLFFileHandler.java index fa4d038682..78515f450a 100644 --- a/src/integrationtest/org/apache/poi/stress/XSLFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/XSLFFileHandler.java @@ -52,9 +52,7 @@ public class XSLFFileHandler extends SlideShowHandler { // additionally try the other getText() methods - - //noinspection rawtypes - try (SlideShowExtractor extractor = (SlideShowExtractor) ExtractorFactory.createExtractor(file)) { + try (SlideShowExtractor<?,?> extractor = (SlideShowExtractor<?, ?>) ExtractorFactory.createExtractor(file)) { assertNotNull(extractor); extractor.setSlidesByDefault(true); extractor.setNotesByDefault(true); @@ -81,4 +79,4 @@ public class XSLFFileHandler extends SlideShowHandler { handleExtracting(file); } -}
\ No newline at end of file +} |