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 2016/05/29 21:33:33 UTC

svn commit: r1746060 - /poi/trunk/src/testcases/org/apache/poi/util/TestTempFile.java

Author: centic
Date: Sun May 29 21:33:33 2016
New Revision: 1746060

URL: http://svn.apache.org/viewvc?rev=1746060&view=rev
Log:
Remove the created temporary directory after the test again

Modified:
    poi/trunk/src/testcases/org/apache/poi/util/TestTempFile.java

Modified: poi/trunk/src/testcases/org/apache/poi/util/TestTempFile.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/util/TestTempFile.java?rev=1746060&r1=1746059&r2=1746060&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/util/TestTempFile.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/util/TestTempFile.java Sun May 29 21:33:33 2016
@@ -26,6 +26,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
 
+import org.apache.poi.poifs.dev.TestPOIFSDump;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -47,7 +48,7 @@ public class TestTempFile {
     }
 
     @After
-    public void tearDown() {
+    public void tearDown() throws IOException {
         String[] files = tempDir.list();
         // can have the "poifiles" subdir
         if(files.length == 1) {
@@ -58,6 +59,9 @@ public class TestTempFile {
             assertEquals("Had: " + Arrays.toString(files), 0, files.length);
         }
 
+        // remove the directory after the tests
+        TestPOIFSDump.deleteDirectory(tempDir);
+
         if(previousTempDir == null) {
             System.clearProperty(TempFile.JAVA_IO_TMPDIR);
         } else {
@@ -66,8 +70,7 @@ public class TestTempFile {
     }
 
     @Test
-    public void testCreateTempFile()
-            throws Exception
+    public void testCreateTempFile() throws Exception
     {
         File tempFile = TempFile.createTempFile("test", ".txt");
         FileOutputStream fos = new FileOutputStream(tempFile);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org