Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A67D7118DB for ; Mon, 7 Apr 2014 01:54:03 +0000 (UTC) Received: (qmail 40181 invoked by uid 500); 7 Apr 2014 01:54:02 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 40148 invoked by uid 500); 7 Apr 2014 01:54:02 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 40141 invoked by uid 99); 7 Apr 2014 01:54:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2014 01:54:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2014 01:53:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6832523888D7 for ; Mon, 7 Apr 2014 01:53:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1585372 [1/2] - in /ant/core/trunk/src: etc/testcases/taskdefs/ etc/testcases/taskdefs/exec/ etc/testcases/taskdefs/fixcrlf/ etc/testcases/taskdefs/optional/ tests/junit/org/apache/tools/ant/taskdefs/ tests/junit/org/apache/tools/ant/taskd... Date: Mon, 07 Apr 2014 01:53:28 -0000 To: notifications@ant.apache.org From: antoine@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140407015329.6832523888D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: antoine Date: Mon Apr 7 01:53:27 2014 New Revision: 1585372 URL: http://svn.apache.org/r1585372 Log: creating temporary directory with a unique name Modified: ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml ant/core/trunk/src/etc/testcases/taskdefs/property.xml ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml ant/core/trunk/src/etc/testcases/taskdefs/replace.xml ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml ant/core/trunk/src/etc/testcases/taskdefs/sync.xml ant/core/trunk/src/etc/testcases/taskdefs/war.xml ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestListenerTest.java Modified: ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml Mon Apr 7 01:53:27 2014 @@ -16,56 +16,54 @@ limitations under the License. --> - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + - + + + + + + + + + + + + + + + + + - - - - Modified: ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml Mon Apr 7 01:53:27 2014 @@ -16,18 +16,17 @@ limitations under the License. --> - - - + - - + + + - + @@ -40,84 +39,84 @@ - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + Q - + @@ -125,112 +124,112 @@ - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + + - - + + - + - - + + - - + - - + - - + - - + + @@ -239,8 +238,8 @@ - - + + @@ -248,8 +247,8 @@ - - + + @@ -257,8 +256,8 @@ - - + + @@ -266,8 +265,8 @@ - - + + @@ -275,8 +274,8 @@ - - + + @@ -284,8 +283,8 @@ - - + + @@ -293,8 +292,8 @@ - - + + @@ -302,8 +301,8 @@ - - + + @@ -312,13 +311,13 @@ - - Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml Mon Apr 7 01:53:27 2014 @@ -18,116 +18,116 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml Mon Apr 7 01:53:27 2014 @@ -17,17 +17,18 @@ --> + + + + + + - - - - - @@ -91,11 +92,12 @@ - + @@ -112,12 +114,11 @@ - - + - + @@ -132,11 +133,11 @@ - + - + @@ -150,12 +151,12 @@ - + - + @@ -169,7 +170,7 @@ - + import junit.framework.*; @@ -210,7 +211,7 @@ - + @@ -248,7 +249,7 @@ - + import junit.framework.*; public class A extends TestCase { @@ -278,12 +279,12 @@ - + - + @@ -295,12 +296,12 @@ - + - + @@ -311,12 +312,12 @@ - + - + @@ -326,7 +327,7 @@ - + public class T1 extends junit.framework.TestCase { public void testOK() {} Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml Mon Apr 7 01:53:27 2014 @@ -16,138 +16,139 @@ limitations under the License. --> - + - - + + + + + + + + - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - - - - - + + - + - - - + + + - - + + - + - - - + + + - - + + - + - - + + - + - - + + - + - - + + - @@ -155,24 +156,24 @@ - - + + - - - + + - @@ -180,7 +181,7 @@ - + Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml Mon Apr 7 01:53:27 2014 @@ -18,7 +18,13 @@ - + + + + + + + @@ -29,7 +35,7 @@ @@ -43,14 +49,14 @@ - + @@ -91,11 +97,11 @@ value="8" pattern="MMdd"/> - + - + foo=3 @@ -103,11 +109,11 @@ - + - + Modified: ant/core/trunk/src/etc/testcases/taskdefs/property.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/property.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/property.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/property.xml Mon Apr 7 01:53:27 2014 @@ -18,13 +18,14 @@ - - + - - + + + + @@ -70,8 +71,7 @@ - - <?xml version="1.0" encoding="UTF-8"?> + <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties version="1.0"> <comment> @@ -85,7 +85,7 @@ - + Modified: ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml Mon Apr 7 01:53:27 2014 @@ -17,60 +17,57 @@ --> - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Modified: ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml Mon Apr 7 01:53:27 2014 @@ -17,16 +17,13 @@ --> - - - - + - + - + - + Modified: ant/core/trunk/src/etc/testcases/taskdefs/replace.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/replace.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/replace.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/replace.xml Mon Apr 7 01:53:27 2014 @@ -18,7 +18,12 @@ - + + + + + + @@ -64,29 +69,26 @@ - - - - + + + + - - + + - - Hello, world! + + Hello, world! - + - - - - Modified: ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml Mon Apr 7 01:53:27 2014 @@ -17,11 +17,16 @@ --> - - - - - + + + + + + + + + + @@ -45,27 +50,14 @@ storepass="apacheant"/> - - - - - - - - + - - - - - - This build is for use with Ant's test cases Modified: ant/core/trunk/src/etc/testcases/taskdefs/sync.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/sync.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/sync.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/sync.xml Mon Apr 7 01:53:27 2014 @@ -16,24 +16,21 @@ limitations under the License. --> - + - - This file must be used from a test case - - - - - - - - - + + + + - + + This file must be used from a test case + + + @@ -41,7 +38,7 @@ - + @@ -51,7 +48,7 @@ - + @@ -64,7 +61,7 @@ - + @@ -77,7 +74,7 @@ - + @@ -88,7 +85,7 @@ - + @@ -96,7 +93,7 @@ - + - + @@ -115,7 +112,7 @@ - + @@ -128,7 +125,7 @@ - + Modified: ant/core/trunk/src/etc/testcases/taskdefs/war.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/war.xml?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/war.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/war.xml Mon Apr 7 01:53:27 2014 @@ -17,25 +17,23 @@ --> - + + + + + + - - - - - + - + - + - - - Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java Mon Apr 7 01:53:27 2014 @@ -52,20 +52,13 @@ public class ExecTaskTest extends BuildF configureProject(BUILD_FILE); } - public void tearDown() { - if (logFile != null && logFile.exists()) { - getProject().setProperty("logFile", logFile.getAbsolutePath()); - } - executeTarget("cleanup"); - } - public void testspawn() { - project.executeTarget("init"); + project.executeTarget("setUp"); if (project.getProperty("test.can.run") == null) { return; } myBuild = new MonitoredBuild(new File(System.getProperty("root"), BUILD_FILE), "spawn"); - logFile = FILE_UTILS.createTempFile("spawn", "log", project.getBaseDir(), false, false); + logFile = FILE_UTILS.createTempFile("spawn", "log", getOutputDir(), false, false); // this is guaranteed by FileUtils#createTempFile assertTrue("log file not existing", !logFile.exists()); // make the spawned process run 4 seconds Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java Mon Apr 7 01:53:27 2014 @@ -40,10 +40,6 @@ public class FixCrLfTest extends BuildFi configureProject("src/etc/testcases/taskdefs/fixcrlf/build.xml"); } - public void tearDown() { - executeTarget("cleanup"); - } - public void test1() throws IOException { executeTarget("test1"); } Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java Mon Apr 7 01:53:27 2014 @@ -35,6 +35,7 @@ public class PropertyTest extends BuildF public void setUp() { configureProject("src/etc/testcases/taskdefs/property.xml"); + project.executeTarget("setUp"); } public void test1() { Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java Mon Apr 7 01:53:27 2014 @@ -21,6 +21,7 @@ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.util.FileUtils; +import java.io.File; import java.io.IOException; /** @@ -39,11 +40,7 @@ public class RecorderTest extends BuildF public void setUp() { configureProject("src/etc/testcases/taskdefs/recorder.xml"); - executeTarget("prepare"); - } - - public void tearDown() { - executeTarget("cleanup"); + executeTarget("setUp"); } public void testNoAppend() throws IOException { @@ -51,8 +48,8 @@ public class RecorderTest extends BuildF assertTrue(FILE_UTILS .contentEquals(project.resolveFile(REC_IN + "rectest1.result"), - project.resolveFile(REC_DIR - + "rectest1.log"), true)); + new File(getOutputDir(), + "rectest1.log"), true)); } public void testAppend() throws IOException { @@ -60,8 +57,8 @@ public class RecorderTest extends BuildF assertTrue(FILE_UTILS .contentEquals(project.resolveFile(REC_IN + "rectest2.result"), - project.resolveFile(REC_DIR - + "rectest2.log"), true)); + new File(getOutputDir(), + "rectest2.log"), true)); } public void testRestart() throws IOException { @@ -69,8 +66,7 @@ public class RecorderTest extends BuildF assertTrue(FILE_UTILS .contentEquals(project.resolveFile(REC_IN + "rectest3.result"), - project.resolveFile(REC_DIR - + "rectest3.log"), true)); + new File(getOutputDir(), "rectest3.log"), true)); } public void testDeleteRestart() throws IOException { @@ -78,8 +74,8 @@ public class RecorderTest extends BuildF assertTrue(FILE_UTILS .contentEquals(project.resolveFile(REC_IN + "rectest4.result"), - project.resolveFile(REC_DIR - + "rectest4.log"), true)); + new File(getOutputDir(), + "rectest4.log"), true)); } public void testSubBuild() throws IOException { @@ -87,13 +83,11 @@ public class RecorderTest extends BuildF assertTrue(FILE_UTILS .contentEquals(project.resolveFile(REC_IN + "rectest5.result"), - project.resolveFile(REC_DIR - + "rectest5.log"), true)); + new File(getOutputDir(), "rectest5.log"), true)); assertTrue(FILE_UTILS .contentEquals(project.resolveFile(REC_IN + "rectest6.result"), - project.resolveFile(REC_DIR - + "rectest6.log"), true)); + new File(getOutputDir(), "rectest6.log"), true)); } Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java Mon Apr 7 01:53:27 2014 @@ -34,6 +34,7 @@ public class ReplaceTest extends BuildFi public void setUp() { configureProject("src/etc/testcases/taskdefs/replace.xml"); + project.executeTarget("setUp"); } public void test1() { @@ -70,32 +71,26 @@ public class ReplaceTest extends BuildFi public void test9() throws IOException { executeTarget("test9"); - String tmpdir = project.getProperty("tmp.dir"); - assertEqualContent(new File(tmpdir, "result.txt"), - new File(tmpdir, "output.txt")); + assertEqualContent(new File(getOutputDir(), "result.txt"), + new File(getOutputDir(), "output.txt")); } public void testNoPreserveLastModified() throws Exception { executeTarget("lastModifiedSetup"); - String tmpdir = project.getProperty("tmp.dir"); - 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("tmp.dir"); - 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()); } - public void tearDown() { - executeTarget("cleanup"); - } public void assertEqualContent(File expect, File result) throws AssertionFailedError, IOException { if (!result.exists()) { Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java Mon Apr 7 01:53:27 2014 @@ -40,10 +40,6 @@ public class SignJarTest extends BuildFi configureProject("src/etc/testcases/taskdefs/signjar.xml"); } - public void tearDown() { - executeTarget("clean"); - } - /** * check for being offline * @return true if the system property "offline" is "true" @@ -108,7 +104,7 @@ public class SignJarTest extends BuildFi } /** - * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=50081 + * @see bug 50081 */ public void testSignUnnormalizedJar() throws Exception { executeTarget("jar"); Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java Mon Apr 7 01:53:27 2014 @@ -30,10 +30,6 @@ public class SyncTest extends BuildFileT configureProject("src/etc/testcases/taskdefs/sync.xml"); } - public void tearDown() { - executeTarget("cleanup"); - } - public void testSimpleCopy() { executeTarget("simplecopy"); String d = getProject().getProperty("dest") + "/a/b/c/d"; Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java Mon Apr 7 01:53:27 2014 @@ -38,16 +38,12 @@ public class WarTest extends BuildFileTe configureProject(TEST_BUILD_FILE); } - public void tearDown() { - executeTarget("clean"); - } - /** * Test direct dependency removal */ public void testLibRefs() { executeTarget("testlibrefs"); - File f = getProject().resolveFile("working/WEB-INF/lib/war.xml"); + File f = new File(getOutputDir(), "WEB-INF/lib/war.xml"); assertTrue("File has been put into lib", f.exists()); } } Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java Mon Apr 7 01:53:27 2014 @@ -33,14 +33,6 @@ import org.apache.tools.ant.taskdefs.opt * @since Ant 1.5 */ public class JspcTest extends BuildFileTest { - /** - * Description of the Field - */ - private File baseDir; - /** - * Description of the Field - */ - private File outDir; /** * Description of the Field @@ -63,16 +55,6 @@ public class JspcTest extends BuildFileT */ public void setUp() { configureProject(TASKDEFS_DIR + "jspc.xml"); - baseDir = new File(System.getProperty("root"), TASKDEFS_DIR); - outDir = new File(baseDir, "jsp/java"); - } - - - /** - * The teardown method for JUnit - */ - public void tearDown() { - executeTarget("cleanup"); } @@ -180,7 +162,7 @@ public class JspcTest extends BuildFileT * @return The OutputFile value */ protected File getOutputFile(String subpath) { - return new File(outDir, subpath); + return new File(getOutputDir(), subpath); } /** Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java Mon Apr 7 01:53:27 2014 @@ -43,7 +43,8 @@ public class PropertyFileTest extends Bu * The JUnit setup method */ public void setUp() throws Exception { - destroyTempFiles(); + configureProject(projectFilePath); + executeTarget("setUp"); initTestPropFile(); initBuildPropFile(); configureProject(projectFilePath); @@ -51,13 +52,6 @@ public class PropertyFileTest extends Bu } - /** - * The JUnit tearDown method - */ - public void tearDown() { - destroyTempFiles(); - } - public void testNonExistingFile() { PropertyFile props = new PropertyFile(); props.setProject( getProject() ); @@ -129,33 +123,10 @@ public class PropertyFileTest extends Bu executeTarget("bugDemo2"); assertEquals("5", project.getProperty("foo")); } -/* - public void testDirect() throws Exception { - PropertyFile pf = new PropertyFile(); - pf.setProject(project); - pf.setFile(new File(System.getProperty("root"), testPropsFilePath)); - PropertyFile.Entry entry = pf.createEntry(); - - entry.setKey("date"); - entry.setValue("123"); - PropertyFile.Entry.Type type = new PropertyFile.Entry.Type(); - type.setValue("date"); - entry.setType(type); - - entry.setPattern("yyyy/MM/dd"); - - PropertyFile.Entry.Operation operation = new PropertyFile.Entry.Operation(); - operation.setValue("+"); - pf.execute(); - - Properties props = getTestProperties(); - assertEquals("yeehaw", props.getProperty("date")); - } -*/ private Properties getTestProperties() throws Exception { Properties testProps = new Properties(); - FileInputStream propsFile = new FileInputStream(new File(System.getProperty("root"), testPropsFilePath)); + FileInputStream propsFile = new FileInputStream(new File(getOutputDir(), testPropsFilePath)); testProps.load(propsFile); propsFile.close(); return testProps; @@ -169,7 +140,7 @@ public class PropertyFileTest extends Bu testProps.put(EMAIL_KEY, EMAIL); testProps.put("existing.prop", "37"); - FileOutputStream fos = new FileOutputStream(new File(System.getProperty("root"), testPropsFilePath)); + FileOutputStream fos = new FileOutputStream(new File(getOutputDir(), testPropsFilePath)); testProps.store(fos, "defaults"); fos.close(); } @@ -185,26 +156,12 @@ public class PropertyFileTest extends Bu buildProps.put(AGE_KEY, NEW_AGE); buildProps.put(DATE_KEY, NEW_DATE); - FileOutputStream fos = new FileOutputStream(new File(System.getProperty("root"), buildPropsFilePath)); + FileOutputStream fos = new FileOutputStream(new File(getOutputDir(), buildPropsFilePath)); buildProps.store(fos, null); fos.close(); } - private void destroyTempFiles() { - File tempFile = new File(System.getProperty("root"), testPropsFilePath); - tempFile.delete(); - tempFile = null; - - tempFile = new File(System.getProperty("root"), buildPropsFilePath); - tempFile.delete(); - tempFile = null; - - tempFile = new File(System.getProperty("root"), valueDoesNotGetOverwrittenPropsFilePath); - tempFile.delete(); - tempFile = null; - } - private static final String @@ -212,13 +169,13 @@ public class PropertyFileTest extends Bu testPropertyFile = "propertyfile.test.properties", testPropertyFileKey = "test.propertyfile", - testPropsFilePath = "src/etc/testcases/taskdefs/optional/" + testPropertyFile, + testPropsFilePath = testPropertyFile, valueDoesNotGetOverwrittenPropertyFile = "overwrite.test.properties", valueDoesNotGetOverwrittenPropertyFileKey = "overwrite.test.propertyfile", - valueDoesNotGetOverwrittenPropsFilePath = "src/etc/testcases/taskdefs/optional/" + valueDoesNotGetOverwrittenPropertyFile, + valueDoesNotGetOverwrittenPropsFilePath = valueDoesNotGetOverwrittenPropertyFile, - buildPropsFilePath = "src/etc/testcases/taskdefs/optional/propertyfile.build.properties", + buildPropsFilePath = "propertyfile.build.properties", FNAME = "Bruce", NEW_FNAME = "Clark", Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff ============================================================================== --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java Mon Apr 7 01:53:27 2014 @@ -40,10 +40,6 @@ public class JUnitReportTest extends Bui configureProject("src/etc/testcases/taskdefs/optional/junitreport.xml"); } - protected void tearDown() { - executeTarget("clean"); - } - /** * Verifies that no empty junit-noframes.html is generated when frames * output is selected via the default. @@ -51,15 +47,14 @@ public class JUnitReportTest extends Bui */ public void testNoFileJUnitNoFrames() { executeTarget("reports1"); - if (new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html").exists()) + if (new File(getOutputDir(), "html/junit-noframes.html").exists()) { fail("No file junit-noframes.html expected"); } } public void assertIndexCreated() { - if (!new File(System.getProperty("root"), - "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html").exists()) { + if (!new File(getOutputDir(), "html/index.html").exists()) { fail("No file index file found"); } @@ -98,8 +93,7 @@ public class JUnitReportTest extends Bui expectReportWithText("testStackTraceLineBreaks", null); FileReader r = null; try { - r = new FileReader(new File(System.getProperty("root"), - "src/etc/testcases/taskdefs/optional/junitreport/test/html/sampleproject/coins/0_CoinTest.html")); + r = new FileReader(new File(getOutputDir(), "html/sampleproject/coins/0_CoinTest.html")); String report = FileUtils.readFully(r); assertTrue("output must contain
:\n" + report, report.indexOf("junit.framework.AssertionFailedError: DOEG
") @@ -116,7 +110,7 @@ public class JUnitReportTest extends Bui // Bugzilla Report 38477 public void testSpecialSignsInSrcPath() throws Exception { executeTarget("testSpecialSignsInSrcPath"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); + File reportFile = new File(getOutputDir(), "html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); @@ -129,7 +123,7 @@ public class JUnitReportTest extends Bui public void testSpecialSignsInHtmlPath() throws Exception { executeTarget("testSpecialSignsInHtmlPath"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html"); + File reportFile = new File(getOutputDir(), "html# $%\u00A7&-!report/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); @@ -143,7 +137,7 @@ public class JUnitReportTest extends Bui //Bugzilla Report 39708 public void testWithStyleFromDir() throws Exception { executeTarget("testWithStyleFromDir"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); + File reportFile = new File(getOutputDir(), "html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); @@ -157,7 +151,7 @@ public class JUnitReportTest extends Bui //Bugzilla Report 40021 public void testNoFrames() throws Exception { executeTarget("testNoFrames"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html"); + File reportFile = new File(getOutputDir(), "html/junit-noframes.html"); // tests one the file object assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); @@ -170,7 +164,7 @@ public class JUnitReportTest extends Bui //Bugzilla Report 39708 public void testWithStyleFromDirAndXslImport() throws Exception { executeTarget("testWithStyleFromDirAndXslImport"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); + File reportFile = new File(getOutputDir(), "html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); @@ -183,7 +177,7 @@ public class JUnitReportTest extends Bui public void testWithStyleFromClasspath() throws Exception { executeTarget("testWithStyleFromClasspath"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); + File reportFile = new File(getOutputDir(), "html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); @@ -196,7 +190,7 @@ public class JUnitReportTest extends Bui public void testWithParams() throws Exception { expectLogContaining("testWithParams", "key1=value1,key2=value2"); - File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); + File reportFile = new File(getOutputDir(), "html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() );