ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r442301 - in /ant/core/trunk/src: etc/testcases/core/location.xml testcases/org/apache/tools/ant/LocationTest.java
Date Mon, 11 Sep 2006 19:35:37 GMT
Author: bodewig
Date: Mon Sep 11 12:35:36 2006
New Revision: 442301

URL: http://svn.apache.org/viewvc?view=rev&rev=442301
Log:
failing testcase for a combination of location and macrodef

Modified:
    ant/core/trunk/src/etc/testcases/core/location.xml
    ant/core/trunk/src/testcases/org/apache/tools/ant/LocationTest.java

Modified: ant/core/trunk/src/etc/testcases/core/location.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/core/location.xml?view=diff&rev=442301&r1=442300&r2=442301
==============================================================================
--- ant/core/trunk/src/etc/testcases/core/location.xml (original)
+++ ant/core/trunk/src/etc/testcases/core/location.xml Mon Sep 11 12:35:36 2006
@@ -35,4 +35,29 @@
     </condition>
   </target>
 
+  <target name="define">
+    <property name="testclasses"
+      location="../../../../build/testcases" />
+    <taskdef name="echoloc"
+      classname="org.apache.tools.ant.LocationTest$EchoLocation">
+      <classpath>
+        <pathelement location="${testclasses}" />
+        <pathelement path="${java.class.path}"/>
+      </classpath>
+    </taskdef>
+  </target>
+
+  <target name="macrodef" depends="define">
+    <macrodef name="echoloc2" backtrace="false">
+      <sequential>
+        <echoloc/>
+      </sequential>
+    </macrodef>
+  </target>
+
+  <target name="testMacrodefWrappedTask" depends="macrodef">
+    <echo id="echo3">Hello</echo>
+    <echoloc2/>
+  </target>
+
 </project>

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/LocationTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/LocationTest.java?view=diff&rev=442301&r1=442300&r2=442301
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/LocationTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/LocationTest.java Mon Sep 11 12:35:36
2006
@@ -51,4 +51,19 @@
         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);
+        }
+    }
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message