From 655c24dcb5ee809e30669efd92c11e28c50f0114 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Mon, 19 Nov 2018 18:00:42 +0000 Subject: Remove/Minimize references to Scratchpad module from other modules git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846931 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/BaseIntegrationTest.java | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/integrationtest') diff --git a/src/integrationtest/org/apache/poi/BaseIntegrationTest.java b/src/integrationtest/org/apache/poi/BaseIntegrationTest.java index 291618f680..304794b231 100644 --- a/src/integrationtest/org/apache/poi/BaseIntegrationTest.java +++ b/src/integrationtest/org/apache/poi/BaseIntegrationTest.java @@ -16,17 +16,24 @@ ==================================================================== */ package org.apache.poi; -import org.apache.poi.hslf.exceptions.OldPowerPointFormatException; -import org.apache.poi.hssf.OldExcelFormatException; -import org.apache.poi.hwpf.OldWordFileFormatException; -import org.apache.poi.poifs.filesystem.OfficeXmlFileException; -import org.apache.poi.stress.*; -import org.junit.Assume; +import static org.junit.Assert.assertNotNull; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; import java.util.zip.ZipException; -import static org.junit.Assert.assertNotNull; +import org.apache.poi.poifs.filesystem.OfficeXmlFileException; +import org.apache.poi.stress.FileHandler; +import org.apache.poi.stress.HSLFFileHandler; +import org.apache.poi.stress.HSSFFileHandler; +import org.apache.poi.stress.HWPFFileHandler; +import org.apache.poi.stress.XSLFFileHandler; +import org.apache.poi.stress.XSSFFileHandler; +import org.apache.poi.stress.XWPFFileHandler; +import org.junit.Assume; public class BaseIntegrationTest { private final File rootDir; @@ -53,12 +60,13 @@ public class BaseIntegrationTest { // use XWPF instead of HWPF and XSSF instead of HSSF as the file seems to have the wrong extension handleWrongExtension(inputFile, e); - } catch (OldWordFileFormatException | OldExcelFormatException | OldPowerPointFormatException e) { - // at least perform extracting tests on these old files } catch (OldFileFormatException e) { - // Not even text extraction is supported for these: handler.handleExtracting(inputFile); - //noinspection ConstantConditions - Assume.assumeFalse("File " + file + " excluded because it is unsupported old Excel format", true); + if (e.getClass().equals(OldFileFormatException.class)) { + // Not even text extraction is supported for these: handler.handleExtracting(inputFile); + //noinspection ConstantConditions + Assume.assumeFalse("File " + file + " excluded because it is unsupported old Excel format", true); + } + // otherwise try at least to perform extracting tests on these old files } catch (EncryptedDocumentException e) { // Do not try to read encrypted files //noinspection ConstantConditions -- cgit v1.2.3