diff options
author | Dominik Stadler <centic@apache.org> | 2017-11-22 12:25:11 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-11-22 12:25:11 +0000 |
commit | e93f78cd13fabed6ed0e2cf4a6bae07ed526b3e7 (patch) | |
tree | 8d1122d66a54f1334139f3ba7f5feef97d314af2 /src/scratchpad | |
parent | caf7173f4a77a473109a99c76f5fcf9abe1a756f (diff) | |
download | poi-e93f78cd13fabed6ed0e2cf4a6bae07ed526b3e7.tar.gz poi-e93f78cd13fabed6ed0e2cf4a6bae07ed526b3e7.zip |
Ensure that the tempdir exists when we use ImageIO in one of the tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java b/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java index 9b48b2322a..902dffc956 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java @@ -19,6 +19,7 @@ package org.apache.poi.hwpf; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; +import java.io.File; import java.util.List; import javax.imageio.ImageIO; @@ -57,6 +58,11 @@ public final class TestHWPFPictures extends TestCase { imgBFile = "simple_image.png"; imgCFile = "vector_image.emf"; imgDFile = "GaiaTestImg.png"; + + // we use ImageIO in one of the tests here so we should ensure that the temporary directory is created correctly + File tempDir = new File(System.getProperty("java.io.tmpdir")); + assertTrue("Could not create temporary directory " + tempDir.getAbsolutePath() + ": " + tempDir.exists() + "/" + tempDir.isDirectory(), + tempDir.exists() || tempDir.mkdirs()); } /** |