diff options
author | aclement <aclement> | 2005-11-08 14:51:06 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-08 14:51:06 +0000 |
commit | ae53e0442c32cdb4d37d46a74c2eed0fb8f795d3 (patch) | |
tree | c52018d7a8fc1e81ec3ff1295ed71fb2158cef8f /ajde/testsrc | |
parent | d9757d7c41bf2661455422ce3234e4794c9f533e (diff) | |
download | aspectj-ae53e0442c32cdb4d37d46a74c2eed0fb8f795d3.tar.gz aspectj-ae53e0442c32cdb4d37d46a74c2eed0fb8f795d3.zip |
patch from helen to ensure the tests tidy up after themselves.
Diffstat (limited to 'ajde/testsrc')
-rw-r--r-- | ajde/testsrc/org/aspectj/ajde/ShowWeaveMessagesTestCase.java | 1 | ||||
-rw-r--r-- | ajde/testsrc/org/aspectj/ajde/SymbolFileGenerationTest.java | 30 |
2 files changed, 27 insertions, 4 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/ShowWeaveMessagesTestCase.java b/ajde/testsrc/org/aspectj/ajde/ShowWeaveMessagesTestCase.java index 30465bda2..258ff96dc 100644 --- a/ajde/testsrc/org/aspectj/ajde/ShowWeaveMessagesTestCase.java +++ b/ajde/testsrc/org/aspectj/ajde/ShowWeaveMessagesTestCase.java @@ -93,6 +93,7 @@ public class ShowWeaveMessagesTestCase extends AjdeTestCase { protected void tearDown() throws Exception { super.tearDown(); FileUtil.deleteContents(openFile(binDir)); + openFile(binDir).delete(); File rogueSymFile = new File(currTestDataPath + File.separatorChar + "Empty.ajsym"); if (rogueSymFile.exists()) rogueSymFile.delete(); } diff --git a/ajde/testsrc/org/aspectj/ajde/SymbolFileGenerationTest.java b/ajde/testsrc/org/aspectj/ajde/SymbolFileGenerationTest.java index 100ed2f66..f4b8c5814 100644 --- a/ajde/testsrc/org/aspectj/ajde/SymbolFileGenerationTest.java +++ b/ajde/testsrc/org/aspectj/ajde/SymbolFileGenerationTest.java @@ -14,8 +14,10 @@ package org.aspectj.ajde; import java.io.File; +import java.io.FileFilter; import org.aspectj.tools.ajc.AjcTestCase; +import org.aspectj.util.FileUtil; /** * @author Mik Kersten @@ -24,15 +26,35 @@ public class SymbolFileGenerationTest extends AjcTestCase { private static final String DIR = "../ajde/testdata/examples/coverage"; protected File dir = new File(DIR); - protected File configFile = new File(DIR + "/coverage.lst"); - protected File esymFile = new File(DIR + "/ModelCoverage.ajesym"); - protected File outDir = new File(DIR + "/bin"); - protected File crossRefsFile = new File(outDir.getAbsolutePath() + "/build.ajsym"); + protected File configFile = new File(DIR + "/coverage.lst"); + protected File esymFile, outDir, crossRefsFile; protected void setUp() throws Exception { super.setUp(); + esymFile = new File(DIR + "/ModelCoverage.ajesym"); + outDir = new File(DIR + "/bin"); + crossRefsFile = new File(outDir.getAbsolutePath() + "/build.ajsym"); } + protected void tearDown() throws Exception { + super.tearDown(); + + FileUtil.deleteContents(new File(DIR),ajesymResourceFileFilter); + FileUtil.deleteContents(new File(DIR + "/pkg"),ajesymResourceFileFilter); + + FileUtil.deleteContents(new File(DIR + "/bin")); + (new File(DIR + "/bin")).delete(); + + } + + public FileFilter ajesymResourceFileFilter = + new FileFilter() { + public boolean accept(File pathname) { + String name = pathname.getName().toLowerCase(); + return name.endsWith(".ajesym"); + } + }; + public void testCrossRefsFileGeneration() { if (crossRefsFile.exists()) assertTrue(crossRefsFile.delete()); if (esymFile.exists()) assertTrue(esymFile.delete()); |