summaryrefslogtreecommitdiffstats
path: root/ajdoc/testsrc
diff options
context:
space:
mode:
authormwebster <mwebster>2006-06-15 10:44:04 +0000
committermwebster <mwebster>2006-06-15 10:44:04 +0000
commitf4cd0bfb01911ae5f8aaf4a114fac0b921806f50 (patch)
treec45056525294f586ad537eea4d63526a36d29c6d /ajdoc/testsrc
parentb28c0d22c0658239710c17315c30178202a33bc0 (diff)
downloadaspectj-f4cd0bfb01911ae5f8aaf4a114fac0b921806f50.tar.gz
aspectj-f4cd0bfb01911ae5f8aaf4a114fac0b921806f50.zip
Make sandbox directories unique among workspaces e.g. c:\temp\ajcSandbox\org.aspectj\ajcTes1234.tmp
Diffstat (limited to 'ajdoc/testsrc')
-rw-r--r--ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTestCase.java39
1 files changed, 3 insertions, 36 deletions
diff --git a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTestCase.java b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTestCase.java
index 3b79bdb1e..521604645 100644
--- a/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTestCase.java
+++ b/ajdoc/testsrc/org/aspectj/tools/ajdoc/AjdocTestCase.java
@@ -13,6 +13,8 @@ package org.aspectj.tools.ajdoc;
import java.io.File;
import java.io.IOException;
+import org.aspectj.util.FileUtil;
+
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
@@ -25,7 +27,6 @@ public class AjdocTestCase extends TestCase{
public final static String testdataSrcDir = "../ajdoc/testdata";
protected static File sandboxDir;
- private static final String SANDBOX_NAME = "ajcSandbox";
private String docOutdir, projectDir;
@@ -34,7 +35,7 @@ public class AjdocTestCase extends TestCase{
docOutdir = null;
projectDir = null;
// Create a sandbox in which to work
- createEmptySandbox();
+ sandboxDir = FileUtil.createEmptySandbox();
// create the ajdocworkdingdir in the sandbox
Main.setOutputWorkingDir(getWorkingDir().getAbsolutePath());
}
@@ -45,40 +46,6 @@ public class AjdocTestCase extends TestCase{
Main.resetOutputWorkingDir();
}
- // Taken from AjdeInteractionTestbed
- private void createEmptySandbox() {
- String os = System.getProperty("os.name");
- File tempDir = null;
- // AMC - I did this rather than use the JDK default as I hate having to go look
- // in c:\documents and settings\......... for the results of a failed test.
- if (os.startsWith("Windows")) {
- //Alex: try D first since NTFS on mine while FAT leads to failure..
- tempDir = new File("D:\\temp");
- if (!tempDir.exists()) {
- tempDir = new File("C:\\temp");
- if (!tempDir.exists()) {
- tempDir.mkdir();
- }
- }
- } else {
- tempDir = new File("/tmp");
- }
- File sandboxRoot = new File(tempDir,SANDBOX_NAME);
- if (!sandboxRoot.exists()) {
- sandboxRoot.mkdir();
- }
-
- org.aspectj.util.FileUtil.deleteContents(sandboxRoot);
-
- try {
- sandboxDir = File.createTempFile("ajcTest",".tmp",sandboxRoot);
- sandboxDir.delete();
- sandboxDir.mkdir();
- } catch (IOException ioEx) {
- throw new AssertionFailedError("Unable to create sandbox directory for test");
- }
- }
-
/**
* Fill in the working directory with the project files and
* create a doc top level directory in which to generate