Skip to content

Commit 793de89

Browse files
committed
Keep unit tests' temporary directories around
Now that we use SciJava common's TestUtils, the temporary directories are guaranteed to be in the target/ directory. So let's keep them around for further inspection after tests ran. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 47ff85a commit 793de89

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/test/java/org/scijava/plugins/scripting/java/JavaEngineTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public void minimalProjectFromPOM() throws Exception {
9797
assertTrue(jar.exists());
9898

9999
System.gc();
100-
assertTrue(FileUtils.deleteRecursively(dir));
101100
}
102101

103102
@Test
@@ -134,7 +133,6 @@ public void minimalProjectFromSource() throws Exception {
134133
assertTrue(jar.exists());
135134

136135
System.gc();
137-
assertTrue(FileUtils.deleteRecursively(dir));
138136
}
139137

140138
@Test

src/test/java/org/scijava/plugins/scripting/java/MakeJarTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import java.util.jar.JarFile;
4545

4646
import org.junit.Test;
47+
import org.scijava.test.TestUtils;
4748
import org.scijava.util.FileUtils;
4849
import org.scijava.util.IteratorPlus;
4950

@@ -53,7 +54,8 @@ public void testSingle() throws Exception {
5354
final StringWriter writer = new StringWriter();
5455
final JavaEngine engine = new JavaEngine();
5556
final File file = FileUtils.urlToFile(getClass().getResource("/Dummy.java"));
56-
final File output = File.createTempFile("jar-test-", ".jar");
57+
final File tmpDir = TestUtils.createTemporaryDirectory("jar-test-");
58+
final File output = new File(tmpDir, "test.jar");
5759
engine.makeJar(file, false, output, writer);
5860
assertJarEntries(output, "META-INF/MANIFEST.MF",
5961
"META-INF/maven/net.imagej/Dummy/pom.xml", "Dummy.class");

0 commit comments

Comments
 (0)