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/testcases/org/apache/tools/ant/taskdefs ChecksumTest.java
Date Wed, 08 Dec 2004 18:00:53 GMT
mbenson     2004/12/08 10:00:53

  Modified:    src/etc/testcases/taskdefs checksum.xml
               src/testcases/org/apache/tools/ant/taskdefs
                        ChecksumTest.java
  Log:
  Address Windows CVS client line ending conversion incompatibility issue.
  
  Revision  Changes    Path
  1.10      +24 -4     ant/src/etc/testcases/taskdefs/checksum.xml
  
  Index: checksum.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/checksum.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- checksum.xml	7 Dec 2004 21:46:18 -0000	1.9
  +++ checksum.xml	8 Dec 2004 18:00:53 -0000	1.10
  @@ -1,6 +1,26 @@
   <?xml version="1.0"?>
   <project default="cleanup" basedir=".">
   
  +  <macrodef name="compare">
  +    <attribute name="expected" />
  +    <attribute name="output" />
  +    <sequential>
  +      <loadfile property="expected" srcfile="@{expected}">
  +        <filterchain><striplinebreaks /></filterchain>
  +      </loadfile>
  +      <loadfile property="output" srcfile="@{output}">
  +        <filterchain><striplinebreaks /></filterchain>
  +      </loadfile>
  +      <fail message="${output} not = ${expected}">
  +        <condition>
  +          <not>
  +            <equals arg1="${output}" arg2="${expected}" />
  +          </not>
  +        </condition>
  +      </fail>
  +    </sequential>
  +  </macrodef>
  +
     <target name="cleanup">
       <delete file="../asf-logo.gif.MD5" />
       <delete file="../asf-logo.gif.md5" />
  @@ -20,22 +40,22 @@
   
     <target name="createMd5">
       <checksum file="../asf-logo.gif" fileext=".MD5" />
  -    <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.MD5" />
  +    <compare expected="expected/asf-logo.gif.md5" output="../asf-logo.gif.MD5" />
     </target>
   
     <target name="createMD5SUMformat">
       <checksum file="../asf-logo.gif" format="MD5SUM" fileext=".MD5SUM" />
  -    <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.MD5SUM" />
  +    <compare expected="expected/asf-logo.gif.md5sum" output="../asf-logo.gif.MD5SUM"
/>
     </target>
   
     <target name="createSVFformat">
       <checksum file="../asf-logo.gif" format="SVF" fileext=".SVF" />
  -    <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.SVF" />
  +    <compare expected="expected/asf-logo.gif.svf" output="../asf-logo.gif.SVF" />
     </target>
   
     <target name="createPattern">
       <checksum file="../asf-logo.gif" pattern="foo{0}bar" fileext=".PATTERN" />
  -    <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.PATTERN" />
  +    <compare expected="expected/asf-logo.gif.pattern" output="../asf-logo.gif.PATTERN"
/>
     </target>
   
     <target name="setProperty">
  
  
  
  1.13      +1 -9      ant/src/testcases/org/apache/tools/ant/taskdefs/ChecksumTest.java
  
  Index: ChecksumTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ChecksumTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ChecksumTest.java	8 Sep 2004 14:29:16 -0000	1.12
  +++ ChecksumTest.java	8 Dec 2004 18:00:53 -0000	1.13
  @@ -43,29 +43,21 @@
       public void testCreateMd5() throws IOException {
           FileUtils fileUtils = FileUtils.newFileUtils();
           executeTarget("createMd5");
  -        assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo.gif.md5"),
  -                                           project.resolveFile("../asf-logo.gif.MD5")));
       }
   
       public void testCreateMD5SUMformat() throws IOException {
           FileUtils fileUtils = FileUtils.newFileUtils();
           executeTarget("createMD5SUMformat");
  -        assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo.gif.md5sum"),
  -                                           project.resolveFile("../asf-logo.gif.MD5SUM")));
       }
       
       public void testCreateSVFformat() throws IOException {
           FileUtils fileUtils = FileUtils.newFileUtils();
           executeTarget("createSVFformat");
  -        assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo.gif.svf"),
  -                                           project.resolveFile("../asf-logo.gif.SVF")));
       }
       
       public void testCreatePattern() throws IOException {
           FileUtils fileUtils = FileUtils.newFileUtils();
           executeTarget("createPattern");
  -        assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo.gif.pattern"),
  -                                           project.resolveFile("../asf-logo.gif.PATTERN")));
       }
   
       public void testSetProperty() {
  
  
  

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


Mime
View raw message