From 5bb2570155bb38bd8434d0e1769714cf473fa853 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Thu, 14 Jan 2010 19:23:13 +0000 Subject: [PATCH] avoid creating unnecessary temp files, tighten up usage of temp files in unit tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@899364 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java | 2 +- .../java/org/apache/poi/xwpf/usermodel/XWPFDocument.java | 3 ++- .../org/apache/poi/xssf/TestWorkbookProtection.java | 3 ++- .../org/apache/poi/xwpf/TestDocumentProtection.java | 3 ++- .../org/apache/poi/hpsf/basic/TestWriteWellKnown.java | 5 +++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index e05e57ec11..20aeadb50f 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -266,7 +266,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, IterableTests HPSF's high-level writing functionality for the well-known property @@ -374,7 +375,7 @@ public class TestWriteWellKnown extends TestCase { /* Write the POI filesystem to a (temporary) file doc2 * and close the latter. */ - final File doc2 = File.createTempFile("POI_HPSF_Test.", ".tmp"); + final File doc2 = TempFile.createTempFile("POI_HPSF_Test.", ".tmp"); doc2.deleteOnExit(); OutputStream out = new FileOutputStream(doc2); poifs.writeFilesystem(out); @@ -503,7 +504,7 @@ public class TestWriteWellKnown extends TestCase { /* *
  • Write the POI filesystem to a (temporary) file doc3 * and close the latter. */ - final File doc3 = File.createTempFile("POI_HPSF_Test.", ".tmp"); + final File doc3 = TempFile.createTempFile("POI_HPSF_Test.", ".tmp"); doc3.deleteOnExit(); out = new FileOutputStream(doc3); poifs.writeFilesystem(out); -- 2.39.5