ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs ReplaceTest.java
Date Fri, 19 Jan 2001 15:04:16 GMT
bodewig     01/01/19 07:04:15

  Modified:    src/etc/testcases/taskdefs replace.xml
               src/main/org/apache/tools/ant/taskdefs Replace.java
               src/testcases/org/apache/tools/ant/taskdefs ReplaceTest.java
  Log:
  And token attribute of <replacefilter> must not be empty either.
  
  Revision  Changes    Path
  1.3       +18 -0     jakarta-ant/src/etc/testcases/taskdefs/replace.xml
  
  Index: replace.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/replace.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- replace.xml	2000/12/18 15:43:58	1.2
  +++ replace.xml	2001/01/19 15:04:08	1.3
  @@ -23,4 +23,22 @@
                token="dont_want_to_really_replace_something"/>
     </target>
   
  +  <target name="test6">
  +    <replace file="template.xml">
  +      <replacefilter />
  +    </replace>
  +  </target>
  +
  +  <target name="test7">
  +    <replace file="template.xml">
  +      <replacefilter token="" />
  +    </replace>
  +  </target>
  +
  +  <target name="test8">
  +    <replace file="template.xml">
  +      <replacefilter token="dont_want_to_really_replace_something" />
  +    </replace>
  +  </target>
  +
   </project>
  
  
  
  1.11      +5 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Replace.java
  
  Index: Replace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Replace.java	2001/01/19 14:55:54	1.10
  +++ Replace.java	2001/01/19 15:04:11	1.11
  @@ -107,6 +107,11 @@
                   throw new BuildException(message);
               }
   
  +            if ("".equals(token)) {
  +                String message ="The token attribute must not be an empty string.";
  +                throw new BuildException(message);
  +            }
  +
               //value and property are mutually exclusive attributes
               if ((value != null) && (property != null)) {
                   String message = "Either value or property " + "can be specified, but a
replacefilter " + "element cannot have both.";
  
  
  
  1.3       +8 -0      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/ReplaceTest.java
  
  Index: ReplaceTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/ReplaceTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReplaceTest.java	2001/01/03 14:18:49	1.2
  +++ ReplaceTest.java	2001/01/19 15:04:13	1.3
  @@ -87,4 +87,12 @@
           executeTarget("test5");
       }
   
  +    public void test6() { 
  +        expectBuildException("test6", "required argument not specified");
  +    }
  +
  +    public void test7() { 
  +        expectBuildException("test7", "empty token not allowed");
  +    }
  +
   }
  
  
  

Mime
View raw message