From cc3ec72734fc442499cca60df957c4ef6749c4c3 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Fri, 1 Nov 2013 16:04:44 +0100 Subject: Remove hardcoded target/trash from test cases Buck does not create a target directory for the build output, this is Maven specific and the project unit tests should not rely on it. Instead follow the pattern used by org.eclipse.jgit.test which is to create a temporary directory in the system temporary folder, and configure the Maven surefire plugin to use the target directory. Change-Id: Iebe5093332343a90f51080614e083aac0d29c26d --- .../src/org/eclipse/jgit/util/FSJava7Test.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'org.eclipse.jgit.java7.test/src/org/eclipse/jgit') diff --git a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/FSJava7Test.java b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/FSJava7Test.java index d735bd3ce5..4b5fe5979e 100644 --- a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/FSJava7Test.java +++ b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/util/FSJava7Test.java @@ -58,13 +58,13 @@ import org.junit.Before; import org.junit.Test; public class FSJava7Test { - - private final File trash = new File(new File("target"), "trash"); + private File trash; @Before public void setUp() throws Exception { - FileUtils.delete(trash, FileUtils.RECURSIVE | FileUtils.RETRY | FileUtils.SKIP_MISSING); - assertTrue(trash.mkdirs()); + trash = File.createTempFile("tmp_", ""); + trash.delete(); + assertTrue("mkdir " + trash, trash.mkdir()); } @After -- cgit v1.2.3