ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Length.java
Date Tue, 11 Jan 2005 15:36:21 GMT
mbenson     2005/01/11 07:36:21

  Modified:    src/etc/testcases/taskdefs length.xml
               src/testcases/org/apache/tools/ant/taskdefs LengthTest.java
               src/main/org/apache/tools/ant/taskdefs Length.java
  Log:
  Oops, used setProperty() instead of setNewProperty().
  Thanks to Jan for the example on the userlist reminding me of my error.  ;)
  
  Revision  Changes    Path
  1.3       +12 -0     ant/src/etc/testcases/taskdefs/length.xml
  
  Index: length.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/length.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- length.xml	7 Jan 2005 00:36:04 -0000	1.2
  +++ length.xml	11 Jan 2005 15:36:20 -0000	1.3
  @@ -104,6 +104,18 @@
       <length string="foo" file="${ant.file}" />
     </target>
   
  +  <target name="testImmutable">
  +    <length string="foo" property="length.string" />
  +    <length string="foobar" property="length.string" />
  +    <fail>
  +      <condition>
  +        <not>
  +          <equals arg1="3" arg2="${length.string}" />
  +        </not>
  +      </condition>
  +    </fail>
  +  </target>
  +
     <target name="cleanup">
       <delete dir="${dir}" />
     </target>
  
  
  
  1.4       +4 -0      ant/src/testcases/org/apache/tools/ant/taskdefs/LengthTest.java
  
  Index: LengthTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/LengthTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LengthTest.java	7 Jan 2005 00:36:04 -0000	1.3
  +++ LengthTest.java	11 Jan 2005 15:36:21 -0000	1.4
  @@ -67,4 +67,8 @@
               "should fail", "string length function only");
       }
   
  +    public void testImmutable() {
  +        executeTarget("testImmutable");
  +    }
  +
   }
  
  
  
  1.5       +2 -1      ant/src/main/org/apache/tools/ant/taskdefs/Length.java
  
  Index: Length.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Length.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Length.java	7 Jan 2005 17:56:49 -0000	1.4
  +++ Length.java	11 Jan 2005 15:36:21 -0000	1.5
  @@ -190,7 +190,8 @@
   
       private class PropertyOutputStream extends ByteArrayOutputStream {
           public void close() {
  -            getProject().setProperty(property, new String(toByteArray()).trim());
  +            getProject().setNewProperty(
  +                property, new String(toByteArray()).trim());
           }
       }
   
  
  
  

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


Mime
View raw message