ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r809976 - in /ant/core/trunk/src: etc/testcases/core/unknownelement.xml tests/junit/org/apache/tools/ant/UnknownElementTest.java
Date Tue, 01 Sep 2009 11:28:23 GMT
Author: bodewig
Date: Tue Sep  1 11:28:23 2009
New Revision: 809976

URL: http://svn.apache.org/viewvc?rev=809976&view=rev
Log:
failing test for PR 26917, not sure whether this is a bug

Modified:
    ant/core/trunk/src/etc/testcases/core/unknownelement.xml
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java

Modified: ant/core/trunk/src/etc/testcases/core/unknownelement.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/core/unknownelement.xml?rev=809976&r1=809975&r2=809976&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/core/unknownelement.xml (original)
+++ ant/core/trunk/src/etc/testcases/core/unknownelement.xml Tue Sep  1 11:28:23 2009
@@ -33,4 +33,7 @@
       <child/>
     </parent>
   </target>
+  <target name="echo">
+    <echo message="Hello, world!"/>
+  </target>
 </project>

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java?rev=809976&r1=809975&r2=809976&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java Tue Sep  1
11:28:23 2009
@@ -22,7 +22,6 @@
 import java.util.Iterator;
 import java.util.List;
 
-
 public class UnknownElementTest extends BuildFileTest {
     public void setUp() {
         configureProject("src/etc/testcases/core/unknownelement.xml");
@@ -32,6 +31,36 @@
         executeTarget("testMaybeConfigure");
     }
 
+    /**
+     * Not really a UnknownElement test but rather one of "what
+     * information is available in taskFinished".
+     * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=26197
+     */
+    public void XtestTaskFinishedEvent() {
+        getProject().addBuildListener(new BuildListener() {
+                public void buildStarted(BuildEvent event) {}
+                public void buildFinished(BuildEvent event) {}
+                public void targetStarted(BuildEvent event) {}
+                public void targetFinished(BuildEvent event) {}
+                public void taskStarted(BuildEvent event) {
+                    assertTaskProperties(event.getTask());
+                }
+                public void taskFinished(BuildEvent event) {
+                    assertTaskProperties(event.getTask());
+                }
+                public void messageLogged(BuildEvent event) {}
+                private void assertTaskProperties(Task ue) {
+                    assertNotNull(ue);
+                    assertTrue(ue instanceof UnknownElement);
+                    Task t = ((UnknownElement) ue).getTask();
+                    assertNotNull(t);
+                    assertEquals("org.apache.tools.ant.taskdefs.Echo",
+                                 t.getClass().getName());
+                }
+            });
+        executeTarget("echo");
+    }
+
     public static class Child extends Task {
         Parent parent;
         public void injectParent(Parent parent) {
@@ -51,7 +80,7 @@
         public void fromChild() {
             log("fromchild");
         }
-        
+
         public void execute() {
             for (Iterator i = children.iterator(); i.hasNext();) {
                 UnknownElement el = (UnknownElement) i.next();



Mime
View raw message