ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs AntTest.java
Date Fri, 10 Oct 2003 13:17:34 GMT
bodewig     2003/10/10 06:17:34

  Modified:    src/etc/testcases/taskdefs ant.xml
               src/testcases/org/apache/tools/ant/taskdefs AntTest.java
  Added:       src/etc/testcases/taskdefs bar.properties foo.properties
  Log:
  Tests for PR 23601
  
  Revision  Changes    Path
  1.13      +7 -0      ant/src/etc/testcases/taskdefs/ant.xml
  
  Index: ant.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/ant.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ant.xml	10 Sep 2003 13:57:19 -0000	1.12
  +++ ant.xml	10 Oct 2003 13:17:34 -0000	1.13
  @@ -185,4 +185,11 @@
       <ant antfile="ant.topleveltest.xml"/>
     </target>
   
  +  <target name="multiple-property-file-children">
  +    <ant target="dummy" antfile="ant.xml">
  +      <property file="foo.properties"/>
  +      <property file="bar.properties"/>
  +    </ant>
  +  </target>
  +
   </project>
  
  
  
  1.1                  ant/src/etc/testcases/taskdefs/bar.properties
  
  Index: bar.properties
  ===================================================================
  bar=Bar
  
  
  
  1.1                  ant/src/etc/testcases/taskdefs/foo.properties
  
  Index: foo.properties
  ===================================================================
  foo=Foo
  
  
  
  1.20      +28 -1     ant/src/testcases/org/apache/tools/ant/taskdefs/AntTest.java
  
  Index: AntTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/AntTest.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AntTest.java	10 Sep 2003 13:57:20 -0000	1.19
  +++ AntTest.java	10 Oct 2003 13:17:34 -0000	1.20
  @@ -314,6 +314,26 @@
           expectLog("topleveltarget", "Hello world");
       }
       
  +    public void testMultiplePropertyFileChildren() {
  +        PropertyChecker pcBar = new PropertyChecker("bar",
  +                                                    new String[] {null, "Bar"});
  +        PropertyChecker pcFoo = new PropertyChecker("foo",
  +                                                    new String[] {null, "Foo"});
  +        project.addBuildListener(pcBar);
  +        project.addBuildListener(pcFoo);
  +        executeTarget("multiple-property-file-children");
  +        AssertionFailedError aeBar = pcBar.getError();
  +        if (aeBar != null) {
  +            throw aeBar;
  +        }
  +        AssertionFailedError aeFoo = pcFoo.getError();
  +        if (aeFoo != null) {
  +            throw aeFoo;
  +        }
  +        project.removeBuildListener(pcBar);
  +        project.removeBuildListener(pcFoo);
  +    }
  +
       private class BasedirChecker implements BuildListener {
           private String[] expectedBasedirs;
           private int calls = 0;
  @@ -472,6 +492,7 @@
           private String key;
           private int calls = 0;
           private AssertionFailedError error;
  +        private String message = "";
   
           PropertyChecker(String key, String[] values) {
               this.key = key;
  @@ -489,6 +510,12 @@
               if (event.getTarget().getName().equals("")) {
                   return;
               }
  +            message += ", " + event.getTarget().getName();
  +            if (calls >= expectedValues.length) {
  +                error = new AssertionFailedError("Unexpected invocation of"
  +                                                 + " target " + message);
  +            }
  +            
               if (error == null) {
                   try {
                       assertEquals(expectedValues[calls++],
  
  
  

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


Mime
View raw message