You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2017/11/22 12:25:11 UTC
svn commit: r1816046 -
/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java
Author: centic
Date: Wed Nov 22 12:25:11 2017
New Revision: 1816046
URL: http://svn.apache.org/viewvc?rev=1816046&view=rev
Log:
Ensure that the tempdir exists when we use ImageIO in one of the tests
Modified:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java?rev=1816046&r1=1816045&r2=1816046&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java Wed Nov 22 12:25:11 2017
@@ -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 exte
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());
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org