aboutsummaryrefslogtreecommitdiffstats
path: root/taskdefs
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-10-29 09:25:05 +0000
committerwisberg <wisberg>2003-10-29 09:25:05 +0000
commitd8d01e83e3f1a618b5e79e3311d6a47bb842aea0 (patch)
tree65c47b3aa5d4394186624660425436733e27d9a9 /taskdefs
parented96631f11efc4895a90a68f86f0e75eef8e9e2d (diff)
downloadaspectj-d8d01e83e3f1a618b5e79e3311d6a47bb842aea0.tar.gz
aspectj-d8d01e83e3f1a618b5e79e3311d6a47bb842aea0.zip
clean up tests not using a destination directory
Diffstat (limited to 'taskdefs')
-rw-r--r--taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
index 3186e8df4..194ba64bd 100644
--- a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
+++ b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
@@ -48,6 +48,8 @@ public class AjcTaskTest extends TestCase {
private static final String aspectjtoolsJar;
private static final String testdataDir;
private static final StringBuffer MESSAGES = new StringBuffer();
+ /** accept writable .class files */
+ private static FileFilter PICK_CLASS_FILES;
static {
tempDir = new File("IncrementalAjcTaskTest-temp");
@@ -68,6 +70,15 @@ public class AjcTaskTest extends TestCase {
} else {
testdataDir = null;
}
+ PICK_CLASS_FILES = new FileFilter() {
+ public boolean accept(File file) {
+ return ((null != file)
+ && file.isFile()
+ && file.canWrite()
+ && file.getPath().endsWith(".class"));
+ }
+
+ };
}
/**
@@ -118,6 +129,13 @@ public class AjcTaskTest extends TestCase {
if ((null != tempDir) && tempDir.exists()) {
FileUtil.deleteContents(tempDir);
tempDir.delete();
+ // when tempDir not used...
+ if (null != testdataDir) {
+ File dataDir = new File(testdataDir);
+ if (dataDir.canRead()) {
+ FileUtil.deleteContents(dataDir, PICK_CLASS_FILES, false);
+ }
+ }
}
}
private static final File getTempDir() {