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 JarTest.java
Date Thu, 23 Jan 2003 11:40:14 GMT
bodewig     2003/01/23 03:40:13

  Modified:    src/etc/testcases/taskdefs jar.xml
               src/testcases/org/apache/tools/ant/taskdefs JarTest.java
  Log:
  Add some tests
  
  Revision  Changes    Path
  1.7       +71 -0     jakarta-ant/src/etc/testcases/taskdefs/jar.xml
  
  Index: jar.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/jar.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jar.xml	17 Jan 2003 10:50:57 -0000	1.6
  +++ jar.xml	23 Jan 2003 11:40:13 -0000	1.7
  @@ -4,6 +4,7 @@
   
     <property name="tmp.jar" location="tmp.jar"/>
     <property name="tmp.dir" location="jartmp"/>
  +  <property name="tmp.zip" location="tmp.zip"/>
   
     <target name="test1">
       <jar/>
  @@ -94,9 +95,79 @@
       <unjar src="${tmp.jar}" dest="${tmp.dir}"/>
     </target>    
   
  +  <target name="testNoRecreateBasedirExcludesWithUpdate">
  +    <jar
  +         destfile="${tmp.jar}"
  +         basedir="."
  +         includes="j*.xml"
  +         excludes="java.xml"
  +         update="true"
  +    />
  +  </target>
  +
  +  <target name="testNoRecreateBasedirExcludesWithoutUpdate">
  +    <jar
  +         destfile="${tmp.jar}"
  +         basedir="."
  +         includes="j*.xml"
  +         excludes="java.xml"
  +    />
  +  </target>
  +
  +  <target name="makezip">
  +    <zip destfile="${tmp.zip}"
  +         basedir="." includes="j*.xml"/>
  +  </target>
  +
  +  <target name="testNoRecreateZipfilesetExcludesWithUpdate"
  +          depends="makezip">
  +    <jar destfile="${tmp.jar}"
  +         update="true">
  +      <zipfileset src="${tmp.zip}" excludes="java.xml"/>
  +    </jar>
  +  </target>
  +
  +  <target name="testNoRecreateZipfilesetExcludesWithoutUpdate"
  +          depends="makezip">
  +    <jar destfile="${tmp.jar}">
  +      <zipfileset src="${tmp.zip}" excludes="java.xml"/>
  +    </jar>
  +  </target>
  +
  +  <target name="testRecreateZipfilesetWithoutUpdateAdditionalFiles"
  +          depends="makezip">
  +    <jar destfile="${tmp.jar}">
  +      <zipfileset src="${tmp.zip}"/>
  +    </jar>
  +  </target>
  +
  +  <target name="testRecreateZipfilesetWithUpdateAdditionalFiles"
  +          depends="makezip">
  +    <jar destfile="${tmp.jar}"
  +         update="true">
  +      <zipfileset src="${tmp.zip}"/>
  +    </jar>
  +  </target>
  +
  +  <target name="testRecreateZipfilesetWithoutUpdateNewerFile"
  +          depends="makezip">
  +    <jar destfile="${tmp.jar}">
  +      <zipfileset src="${tmp.zip}" includes="jar.xml"/>
  +    </jar>
  +  </target>
  +
  +  <target name="testRecreateZipfilesetWithUpdateNewerFile"
  +          depends="makezip">
  +    <jar destfile="${tmp.jar}"
  +         update="true">
  +      <zipfileset src="${tmp.zip}" includes="jar.xml"/>
  +    </jar>
  +  </target>
  +
     <target name="cleanup">
       <delete file="${tmp.jar}" />
       <delete dir="${tmp.dir}"/>
  +    <delete file="${tmp.zip}" />
     </target>
   
   </project>
  
  
  
  1.13      +37 -0     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java
  
  Index: JarTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JarTest.java	22 Jan 2003 12:36:41 -0000	1.12
  +++ JarTest.java	23 Jan 2003 11:40:13 -0000	1.13
  @@ -163,4 +163,41 @@
                                           .resolveFile("jartmp/META-INF/MANIFEST.MF")));
           assertEquals(mf1, mf2);
       }
  +
  +    public void testNoRecreateBasedirExcludesWithUpdate() {
  +        testNoRecreate("testNoRecreateBasedirExcludesWithUpdate");
  +    }
  +
  +    public void testNoRecreateBasedirExcludesWithoutUpdate() {
  +        testNoRecreate("testNoRecreateBasedirExcludesWithoutUpdate");
  +    }
  +
  +    public void testNoRecreateZipfilesetExcludesWithUpdate() {
  +        testNoRecreate("testNoRecreateZipfilesetExcludesWithUpdate");
  +    }
  +
  +    public void testNoRecreateZipfilesetExcludesWithoutUpdate() {
  +        testNoRecreate("testNoRecreateZipfilesetExcludesWithoutUpdate");
  +    }
  +
  +    public void testRecreateZipfilesetWithoutUpdateAdditionalFiles() {
  +        testRecreate("test4",
  +                     "testRecreateZipfilesetWithoutUpdateAdditionalFiles");
  +    }
  +
  +    public void testRecreateZipfilesetWithUpdateAdditionalFiles() {
  +        testRecreate("test4",
  +                     "testRecreateZipfilesetWithUpdateAdditionalFiles");
  +    }
  +
  +    public void testRecreateZipfilesetWithoutUpdateNewerFile() {
  +        testRecreate("testRecreateNewerFileSetup",
  +                     "testRecreateZipfilesetWithoutUpdateNewerFile");
  +    }
  +
  +    public void testRecreateZipfilesetWithUpdateNewerFile() {
  +        testRecreate("testRecreateNewerFileSetup",
  +                     "testRecreateZipfilesetWithUpdateNewerFile");
  +    }
  +
   }
  
  
  

--
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