From ee35ccda7fb8d60788fc00eb5d99f32857cae8d1 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 16 Sep 2017 08:20:38 +0000 Subject: [PATCH] Add .git as excluded dir for integration-tests and add a local test for XSSFBFileHandler to be able to manually test single files quickly git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808504 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/TestAllFiles.java | 2 +- .../apache/poi/stress/XSSFBFileHandler.java | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/integrationtest/org/apache/poi/TestAllFiles.java b/src/integrationtest/org/apache/poi/TestAllFiles.java index b84257d13e..e3469da9cb 100644 --- a/src/integrationtest/org/apache/poi/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/TestAllFiles.java @@ -91,7 +91,7 @@ import org.junit.runners.Parameterized.Parameters; public class TestAllFiles { private static final File ROOT_DIR = new File("test-data"); - static final String[] SCAN_EXCLUDES = new String[] { "**/.svn/**", "lost+found" }; + static final String[] SCAN_EXCLUDES = new String[] { "**/.svn/**", "lost+found", "**/.git/**" }; private static final Map FILE_PASSWORD; diff --git a/src/integrationtest/org/apache/poi/stress/XSSFBFileHandler.java b/src/integrationtest/org/apache/poi/stress/XSSFBFileHandler.java index 6bf099f4ac..fd58c12e80 100644 --- a/src/integrationtest/org/apache/poi/stress/XSSFBFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/XSSFBFileHandler.java @@ -16,11 +16,7 @@ ==================================================================== */ package org.apache.poi.stress; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackageAccess; @@ -28,6 +24,7 @@ import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.XLSBUnsupportedException; import org.apache.poi.xssf.extractor.XSSFBEventBasedExcelExtractor; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Test; public class XSSFBFileHandler extends AbstractFileHandler { @@ -85,4 +82,16 @@ public class XSSFBFileHandler extends AbstractFileHandler { throw new RuntimeException("Should have gotten some text."); } } + + @Test + public void testLocal() throws Exception { + File file = new File("test-data/spreadsheet/Simple.xlsb"); + FileInputStream stream = new FileInputStream(file); + try { + handleFile(stream, file.getPath()); + } finally { + stream.close(); + } + handleExtracting(file); + } } -- 2.39.5