From cfce0c42ef7ea5646104851159f30b63746aaf9f Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 11 Sep 2006 19:35:36 +0000 Subject: [PATCH] failing testcase for a combination of location and macrodef git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@442301 13f79535-47bb-0310-9956-ffa450edef68 --- src/etc/testcases/core/location.xml | 25 +++++++++++++++++++ .../org/apache/tools/ant/LocationTest.java | 17 ++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/etc/testcases/core/location.xml b/src/etc/testcases/core/location.xml index 80ae9d7ba..33608738b 100644 --- a/src/etc/testcases/core/location.xml +++ b/src/etc/testcases/core/location.xml @@ -35,4 +35,29 @@ + + + + + + + + + + + + + + + + + + + + Hello + + + \ No newline at end of file diff --git a/src/testcases/org/apache/tools/ant/LocationTest.java b/src/testcases/org/apache/tools/ant/LocationTest.java index 808c6f4f2..917f6598f 100644 --- a/src/testcases/org/apache/tools/ant/LocationTest.java +++ b/src/testcases/org/apache/tools/ant/LocationTest.java @@ -51,4 +51,19 @@ public class LocationTest extends BuildFileTest { assertFalse(c.getLocation() == Location.UNKNOWN_LOCATION); assertFalse(c.getLocation().getLineNumber() == 0); } -} \ No newline at end of file + + public void XtestMacrodefWrappedTask() { + executeTarget("testMacrodefWrappedTask"); + Echo e = (Echo) getProject().getReference("echo3"); + assertTrue(getLog().indexOf("Line: " + + (e.getLocation().getLineNumber() + 1)) + > -1); + } + + public static class EchoLocation extends Task { + public void execute() { + log("Line: " + getLocation().getLineNumber(), Project.MSG_INFO); + } + } +} +