aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
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 /org.aspectj.ajdt.core
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 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java34
1 files changed, 2 insertions, 32 deletions
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
index ea74c9c94..aa2e70861 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-import junit.framework.AssertionFailedError;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.ICommand;
@@ -45,8 +44,6 @@ import org.aspectj.util.FileUtil;
*/
public class Ajc {
- private static final String SANDBOX_NAME = "ajcSandbox";
-
private static final String TESTER_PATH =
".."+File.separator+"testing-client"+File.separator+"bin"
+ File.pathSeparator+".."+File.separator+"runtime" +File.separator+"bin"
@@ -183,7 +180,7 @@ public class Ajc {
try {
if (!isIncremental && shouldEmptySandbox) {
- createEmptySandbox();
+ sandbox = FileUtil.createEmptySandbox();
}
args = adjustToSandbox(args,!isIncremental);
MessageHandler holder = new MessageHandler();
@@ -256,7 +253,7 @@ public class Ajc {
* Get the sandbox directory used for the compilation.
*/
public File getSandboxDirectory() {
- if (sandbox == null) {createEmptySandbox();}
+ if (sandbox == null) {sandbox = FileUtil.createEmptySandbox();}
return sandbox;
}
@@ -282,33 +279,6 @@ public class Ajc {
return false;
}
- 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")) {
- 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();
- }
-
- FileUtil.deleteContents(sandboxRoot);
-
- try {
- sandbox = File.createTempFile("ajcTest",".tmp",sandboxRoot);
- sandbox.delete();
- sandbox.mkdir();
- } catch (IOException ioEx) {
- throw new AssertionFailedError("Unable to create sandbox directory for test");
- }
- }
-
/**
* Make every relative file name and dir be absolute under sandbox
* Add TESTER_PATH to classpath