jhm         2004/02/20 04:24:04

  Modified:    src/testcases/org/apache/tools/ant ProjectTest.java
  Added:       src/etc/testcases/core duplicate-target2.xml
                        duplicate-target-imported.xml
  Log:
  Another testcase for double target-definition
  
  Revision  Changes    Path
  1.1                  ant/src/etc/testcases/core/duplicate-target2.xml
  
  Index: duplicate-target2.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project>
  
      <import file="duplicate-target-imported.xml"/>
  
      <target name="once">
          <echo>once from buildfile</echo>
      </target>
  </project>
  
  
  1.1                  ant/src/etc/testcases/core/duplicate-target-imported.xml
  
  Index: duplicate-target-imported.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project>
      <target name="once">
          <echo>once from imported</echo>
      </target>
  </project>
  
  
  1.23      +8 -2      ant/src/testcases/org/apache/tools/ant/ProjectTest.java
  
  Index: ProjectTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/ProjectTest.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ProjectTest.java  18 Feb 2004 08:17:15 -0000      1.22
  +++ ProjectTest.java  20 Feb 2004 12:24:04 -0000      1.23
  @@ -204,12 +204,18 @@
           
assertTrue(p.getTaskDefinitions().contains(org.apache.tools.ant.taskdefs.Echo.class));
       }
   
  -    // Bug in Ant 1.6/1.7 found by Dominique: there must no multiple
  -    // targets with the same name in a project.
       public void testDuplicateTargets() {
  +        // fail, because buildfile contains two targets with the same name
           BFT bft = new BFT("", "core/duplicate-target.xml");
           bft.expectBuildException("twice", "Duplicate target");
       }
  +
  +    public void testDuplicateTargetsImport() {
  +        // overriding target from imported buildfile is allowed
  +        BFT bft = new BFT("", "core/duplicate-target2.xml");
  +        bft.expectLog("once", "once from buildfile");
  +    }
  +
   
       private class DummyTaskPrivate extends Task {
           public DummyTaskPrivate() {}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to