diff --git a/src/etc/testcases/taskdefs/optional/antlr/antlr.xml b/src/etc/testcases/taskdefs/optional/antlr/antlr.xml index 21d3f14c7..d015020d2 100644 --- a/src/etc/testcases/taskdefs/optional/antlr/antlr.xml +++ b/src/etc/testcases/taskdefs/optional/antlr/antlr.xml @@ -18,11 +18,10 @@ - + - - - + + @@ -30,17 +29,17 @@ - + - - + + - + @@ -52,20 +51,20 @@ - - - + + + - - + + - - - + + @@ -73,58 +72,58 @@ - - + + - + - - - - + + + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + diff --git a/src/etc/testcases/taskdefs/optional/replaceregexp.xml b/src/etc/testcases/taskdefs/optional/replaceregexp.xml index 3d4016865..3fa323a4a 100644 --- a/src/etc/testcases/taskdefs/optional/replaceregexp.xml +++ b/src/etc/testcases/taskdefs/optional/replaceregexp.xml @@ -16,68 +16,68 @@ limitations under the License. --> - - - This build file should only be run from within the testcase + + + + + + + - - + + This build file should only be run from within the testcase - - + + + - - + + - - + - + - - + + - - + + - - Hello, world! + Hello, world! + - + + - - - - - - diff --git a/src/etc/testcases/taskdefs/optional/xslt.xml b/src/etc/testcases/taskdefs/optional/xslt.xml index 5e6bf0cbf..d872ea8c3 100644 --- a/src/etc/testcases/taskdefs/optional/xslt.xml +++ b/src/etc/testcases/taskdefs/optional/xslt.xml @@ -16,14 +16,17 @@ limitations under the License. --> - - - - + + + + + + - - + + + @@ -32,13 +35,8 @@ - - - - - - - + @@ -50,8 +48,8 @@ location="xml/doc.dtd"/> - - + @@ -59,9 +57,9 @@ - + @@ -71,17 +69,17 @@ - + - + @@ -91,13 +89,13 @@ - + diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java index d886d8284..389b7673a 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java @@ -44,10 +44,6 @@ public class ANTLRTest extends BuildFileTest { configureProject(TASKDEFS_DIR + "antlr.xml"); } - public void tearDown() { - executeTarget("cleanup"); - } - public void test1() { expectBuildException("test1", "required argument, target, missing"); } @@ -99,8 +95,7 @@ public class ANTLRTest extends BuildFileTest { */ public void test10() { executeTarget("test10"); - File outputDirectory = new File(System.getProperty("root"), TASKDEFS_DIR + "antlr.tmp"); - String[] calcFiles = outputDirectory.list(new HTMLFilter()); + String[] calcFiles = getOutputDir().list(new HTMLFilter()); assertTrue(calcFiles.length > 0); } diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ReplaceRegExpTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ReplaceRegExpTest.java index fa84e9569..126acd1d9 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ReplaceRegExpTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ReplaceRegExpTest.java @@ -41,15 +41,11 @@ public class ReplaceRegExpTest extends BuildFileTest { configureProject(PROJECT_PATH + "/replaceregexp.xml"); } - public void tearDown() { - executeTarget("cleanup"); - } - public void testReplace() throws IOException { Properties original = new Properties(); FileInputStream propsFile = null; try { - propsFile = new FileInputStream(new File(System.getProperty("root"), PROJECT_PATH + "/replaceregexp.properties")); + propsFile = new FileInputStream(new File(project.getBaseDir() + "/replaceregexp.properties")); original.load(propsFile); } finally { if (propsFile != null) { @@ -64,7 +60,7 @@ public class ReplaceRegExpTest extends BuildFileTest { Properties after = new Properties(); try { - propsFile = new FileInputStream(new File(System.getProperty("root"), PROJECT_PATH + "/test.properties")); + propsFile = new FileInputStream(new File(getOutputDir(), "test.properties")); after.load(propsFile); } finally { if (propsFile != null) { @@ -79,7 +75,7 @@ public class ReplaceRegExpTest extends BuildFileTest { // inspired by bug 22541 public void testDirectoryDateDoesNotChange() { executeTarget("touchDirectory"); - File myFile = new File(System.getProperty("root"), PROJECT_PATH + "/" + getProject().getProperty("tmpregexp")); + File myFile = getOutputDir(); long timeStampBefore = myFile.lastModified(); executeTarget("testDirectoryDateDoesNotChange"); long timeStampAfter = myFile.lastModified(); @@ -90,34 +86,32 @@ public class ReplaceRegExpTest extends BuildFileTest { executeTarget("testDontAddNewline1"); assertTrue("Files match", FILE_UTILS - .contentEquals(new File(System.getProperty("root"), PROJECT_PATH + "/test.properties"), - new File(System.getProperty("root"), PROJECT_PATH + "/replaceregexp2.result.properties"))); + .contentEquals(new File(getOutputDir(), "test.properties"), + new File(getProjectDir(), "replaceregexp2.result.properties"))); } public void testDontAddNewline2() throws IOException { executeTarget("testDontAddNewline2"); assertTrue("Files match", FILE_UTILS - .contentEquals(new File(System.getProperty("root"), PROJECT_PATH + "/test.properties"), - new File(System.getProperty("root"), PROJECT_PATH + "/replaceregexp2.result.properties"))); + .contentEquals(new File(getOutputDir(), "test.properties"), + new File(getProjectDir(), "replaceregexp2.result.properties"))); } public void testNoPreserveLastModified() throws Exception { executeTarget("lastModifiedSetup"); - String tmpdir = project.getProperty("tmpregexp"); - long ts1 = new File(tmpdir, "test.txt").lastModified(); + long ts1 = new File(getOutputDir(), "test.txt").lastModified(); Thread.sleep(3000); executeTarget("testNoPreserve"); - assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified()); + assertTrue(ts1 < new File(getOutputDir(), "test.txt").lastModified()); } public void testPreserveLastModified() throws Exception { executeTarget("lastModifiedSetup"); - String tmpdir = project.getProperty("tmpregexp"); - long ts1 = new File(tmpdir, "test.txt").lastModified(); + long ts1 = new File(getOutputDir(), "test.txt").lastModified(); Thread.sleep(3000); executeTarget("testPreserve"); - assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified()); + assertTrue(ts1 == new File(getOutputDir(), "test.txt").lastModified()); } }// ReplaceRegExpTest diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java index 6b23848b0..a23afd4ca 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java @@ -50,14 +50,6 @@ public class XsltTest extends BuildFileTest { } - /** - * The teardown method for JUnit - */ - public void tearDown() { - executeTarget("teardown"); - } - - /** * A unit test for JUnit @@ -79,16 +71,6 @@ public class XsltTest extends BuildFileTest { executeTarget("testOutputProperty"); } - /* Only runs if xalan.jar is in CP (not incl. Sun's JRE repackaging): - public void testFactory() throws Exception { - executeTarget("testFactory"); - } - - public void testAttribute() throws Exception { - executeTarget("testAttribute"); - } - */ - public void testXMLWithEntitiesInNonAsciiPath() throws Exception { executeTarget("testXMLWithEntitiesInNonAsciiPath"); }