ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-ant/src/etc/testcases/taskdefs copy.xml
Date Sat, 08 Dec 2001 07:34:36 GMT
stevel      01/12/07 23:34:36

  Modified:    src/etc/testcases/taskdefs copy.xml
  Log:
  Added a test for time dependent copy -and the ability to override it.
  
  Revision  Changes    Path
  1.5       +33 -1     jakarta-ant/src/etc/testcases/taskdefs/copy.xml
  
  Index: copy.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/copy.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- copy.xml	2001/03/08 15:17:18	1.4
  +++ copy.xml	2001/12/08 07:34:36	1.5
  @@ -9,9 +9,41 @@
     <target name="test2">
       <copy file="copy.xml" todir="copytest1dir" overwrite="true"/>
     </target>
  - 
  +
  +  <target name="test3">
  +    <!-- create an empty file -->
  +    <touch file="copytest3.tmp"/>
  +    <!--wait -->
  +    <sleep seconds="4"/>
  +    <!-- copy a different file to two places --> 
  +    <copy file="copy.xml" tofile="copytest3a.tmp" overwrite="true"/>
  +    <copy file="copy.xml" tofile="copytest3b.tmp" overwrite="true"/>
  +    <!--wait -->
  +    <sleep seconds="4"/>
  +    <!-- copy an old file onto a newer file (should not work) -->
  +    <copy file="copytest3.tmp" tofile="copytest3b.tmp" />
  +    <!-- copy an older file onto a new one, should succeed -->
  +    <copy file="copytest3.tmp" tofile="copytest3c.tmp"
  +      overwrite="true"
  +      preservelastmodified="true" />
  +    <!-- copy a newer file onto an older one (should work) -->
  +    <copy file="copytest3a.tmp" tofile="copytest3.tmp" 
  +      preservelastmodified="true" />
  +    <!-- expected state :
  +      3a.tmp==3.tmp==copy.xml
  +      timeof(3a.tmp)==timeof(3.tmp)==now()-4
  +      sizeof(3c)==0
  +      timeof(3c.tmp)<timeof(3a.tmp);
  +      3b.tmp==copy.xml
  +    -->
  +  </target>
  +  
     <target name="cleanup"> 
       <delete file="copytest1.tmp"/>
  +    <delete file="copytest3.tmp"/>
  +    <delete file="copytest3a.tmp"/>
  +    <delete file="copytest3b.tmp"/>
  +    <delete file="copytest3c.tmp"/>
       <delete dir="copytest1dir"/>
     </target>
   
  
  
  

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


Mime
View raw message