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 6A60811F7C for ; Sun, 25 May 2014 18:53:22 +0000 (UTC) Received: (qmail 74214 invoked by uid 500); 25 May 2014 18:53:22 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 74160 invoked by uid 500); 25 May 2014 18:53:22 -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 74149 invoked by uid 99); 25 May 2014 18:53:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2014 18:53:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 048799A47CB; Sun, 25 May 2014 18:53:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bodewig@apache.org To: notifications@ant.apache.org Date: Sun, 25 May 2014 18:53:21 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: BUnzipTest was writing outside of ${output} Repository: ant Updated Branches: refs/heads/master 39ad231a2 -> 74d19d829 BUnzipTest was writing outside of ${output} Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/f0f1a3ca Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/f0f1a3ca Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/f0f1a3ca Branch: refs/heads/master Commit: f0f1a3ca00c4f8f355818c8ed56440df3cc004f8 Parents: 39ad231 Author: Stefan Bodewig Authored: Sun May 25 20:44:50 2014 +0200 Committer: Stefan Bodewig Committed: Sun May 25 20:44:50 2014 +0200 ---------------------------------------------------------------------- src/etc/testcases/taskdefs/bunzip2.xml | 27 ++++++++++---------- .../apache/tools/ant/taskdefs/BUnzip2Test.java | 13 +++++----- 2 files changed, 19 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/f0f1a3ca/src/etc/testcases/taskdefs/bunzip2.xml ---------------------------------------------------------------------- diff --git a/src/etc/testcases/taskdefs/bunzip2.xml b/src/etc/testcases/taskdefs/bunzip2.xml index 8da474b..8ae1758 100644 --- a/src/etc/testcases/taskdefs/bunzip2.xml +++ b/src/etc/testcases/taskdefs/bunzip2.xml @@ -16,33 +16,32 @@ limitations under the License. --> - + + + + + + + + - + - + - - - - - - - - - - + - \ No newline at end of file + http://git-wip-us.apache.org/repos/asf/ant/blob/f0f1a3ca/src/tests/junit/org/apache/tools/ant/taskdefs/BUnzip2Test.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/BUnzip2Test.java b/src/tests/junit/org/apache/tools/ant/taskdefs/BUnzip2Test.java index 60ba5a6..9ea9a4f 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/BUnzip2Test.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/BUnzip2Test.java @@ -18,6 +18,7 @@ package org.apache.tools.ant.taskdefs; +import java.io.File; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.FileUtilities; import org.junit.Before; @@ -32,18 +33,16 @@ public class BUnzip2Test { @Rule public BuildFileRule buildRule = new BuildFileRule(); + private File outputDir; + @Before public void setUp() { buildRule.configureProject("src/etc/testcases/taskdefs/bunzip2.xml"); + outputDir = new File(buildRule.getProject().getProperty("output")); buildRule.executeTarget("prepare"); } @Test - public void tearDown() { - buildRule.executeTarget("cleanup"); - } - - @Test public void testRealTest() throws java.io.IOException { testRealTest("realTest"); } @@ -56,8 +55,8 @@ public class BUnzip2Test { private void testRealTest(String target) throws java.io.IOException { buildRule.executeTarget(target); assertEquals("File content mismatch after bunzip2", - FileUtilities.getFileContents(buildRule.getProject().resolveFile("expected/asf-logo-huge.tar")), - FileUtilities.getFileContents(buildRule.getProject().resolveFile("asf-logo-huge.tar"))); + FileUtilities.getFileContents(new File(outputDir, "asf-logo-huge-from-gzip.tar")), + FileUtilities.getFileContents(new File(outputDir, "asf-logo-huge.tar"))); } @Test