ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r802490 - in /ant/sandbox/antlibs/compress/trunk/src/tests/antunit: arfileset-test.xml cpiofileset-test.xml tarfileset-test.xml zipfileset-test.xml
Date Sun, 09 Aug 2009 05:42:44 GMT
Author: bodewig
Date: Sun Aug  9 05:42:44 2009
New Revision: 802490

URL: http://svn.apache.org/viewvc?rev=802490&view=rev
Log:
some real tests for filesets

Modified:
    ant/sandbox/antlibs/compress/trunk/src/tests/antunit/arfileset-test.xml
    ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpiofileset-test.xml
    ant/sandbox/antlibs/compress/trunk/src/tests/antunit/tarfileset-test.xml
    ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zipfileset-test.xml

Modified: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/arfileset-test.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/tests/antunit/arfileset-test.xml?rev=802490&r1=802489&r2=802490&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/tests/antunit/arfileset-test.xml (original)
+++ ant/sandbox/antlibs/compress/trunk/src/tests/antunit/arfileset-test.xml Sun Aug  9 05:42:44
2009
@@ -20,6 +20,11 @@
          xmlns:cmp="antlib:org.apache.ant.compress">
   <import file="antunit-base.xml"/>
 
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+    <mkdir dir="${input}"/>
+  </target>
+
   <target name="testMissingArchive">
     <mkdir dir="${output}"/>
     <au:expectfailure expectedMessage="The archive foo.ar doesn't exist">
@@ -36,4 +41,30 @@
     </copy>
   </target>
 
+  <target name="testArSource" depends="setUp">
+    <copy todir="${output}">
+      <cmp:arfileset src="../resources/asf-logo.gif.ar"
+                      includes="*.gif"/>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
+
+  <target name="fails-testUncompressSource" depends="setUp">
+    <gzip destfile="${input}/asf-logo.gif.ar.gz"
+          src="../resources/asf-logo.gif.ar"/>
+    <copy todir="${output}">
+      <cmp:arfileset includes="*.gif">
+        <gzipresource>
+          <file file="${input}/asf-logo.gif.ar.gz"/>
+        </gzipresource>
+      </cmp:arfileset>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
 </project>

Modified: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpiofileset-test.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpiofileset-test.xml?rev=802490&r1=802489&r2=802490&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpiofileset-test.xml (original)
+++ ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpiofileset-test.xml Sun Aug  9 05:42:44
2009
@@ -20,6 +20,11 @@
          xmlns:cmp="antlib:org.apache.ant.compress">
   <import file="antunit-base.xml"/>
 
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+    <mkdir dir="${input}"/>
+  </target>
+
   <target name="testMissingArchive">
     <mkdir dir="${output}"/>
     <au:expectfailure expectedMessage="The archive foo.cpio doesn't exist">
@@ -36,4 +41,30 @@
     </copy>
   </target>
 
+  <target name="testCpioSource" depends="setUp">
+    <copy todir="${output}">
+      <cmp:cpiofileset src="../resources/asf-logo.gif.cpio"
+                      includes="*.gif"/>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
+
+  <target name="testUncompressSource" depends="setUp">
+    <gzip destfile="${input}/asf-logo.gif.cpio.gz"
+          src="../resources/asf-logo.gif.cpio"/>
+    <copy todir="${output}">
+      <cmp:cpiofileset includes="*.gif">
+        <gzipresource>
+          <file file="${input}/asf-logo.gif.cpio.gz"/>
+        </gzipresource>
+      </cmp:cpiofileset>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
 </project>

Modified: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/tarfileset-test.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/tests/antunit/tarfileset-test.xml?rev=802490&r1=802489&r2=802490&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/tests/antunit/tarfileset-test.xml (original)
+++ ant/sandbox/antlibs/compress/trunk/src/tests/antunit/tarfileset-test.xml Sun Aug  9 05:42:44
2009
@@ -20,6 +20,11 @@
          xmlns:cmp="antlib:org.apache.ant.compress">
   <import file="antunit-base.xml"/>
 
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+    <mkdir dir="${input}"/>
+  </target>
+
   <target name="testMissingArchive">
     <mkdir dir="${output}"/>
     <au:expectfailure expectedMessage="The archive foo.tar doesn't exist">
@@ -36,4 +41,30 @@
     </copy>
   </target>
 
+  <target name="testTarSource" depends="setUp">
+    <copy todir="${output}">
+      <cmp:tarfileset src="../resources/asf-logo.gif.tar"
+                      includes="*.gif"/>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
+
+  <target name="testUncompressSource" depends="setUp">
+    <gzip destfile="${input}/asf-logo.gif.tar.gz"
+          src="../resources/asf-logo.gif.tar"/>
+    <copy todir="${output}">
+      <cmp:tarfileset includes="*.gif">
+        <gzipresource>
+          <file file="${input}/asf-logo.gif.tar.gz"/>
+        </gzipresource>
+      </cmp:tarfileset>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
 </project>

Modified: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zipfileset-test.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zipfileset-test.xml?rev=802490&r1=802489&r2=802490&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zipfileset-test.xml (original)
+++ ant/sandbox/antlibs/compress/trunk/src/tests/antunit/zipfileset-test.xml Sun Aug  9 05:42:44
2009
@@ -20,6 +20,11 @@
          xmlns:cmp="antlib:org.apache.ant.compress">
   <import file="antunit-base.xml"/>
 
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+    <mkdir dir="${input}"/>
+  </target>
+
   <target name="test-refid-modify">
     <fileset id="modify-refid-1"
              dir="${basedir}"
@@ -66,8 +71,7 @@
     </au:expectfailure>
   </target>
 
-  <target name="testMissingArchive">
-    <mkdir dir="${output}"/>
+  <target name="testMissingArchive" depends="setUp">
     <au:expectfailure expectedMessage="The archive foo.zip doesn't exist">
       <copy todir="${output}">
         <cmp:zipfileset src="foo.zip"/>
@@ -75,11 +79,36 @@
     </au:expectfailure>
   </target>
 
-  <target name="testMissingArchiveDoesntMatter">
-    <mkdir dir="${output}"/>
+  <target name="testMissingArchiveDoesntMatter" depends="setUp">
     <copy todir="${output}">
       <cmp:zipfileset src="foo.zip" errorOnMissingArchive="false"/>
     </copy>
   </target>
 
+  <target name="testZipSource" depends="setUp">
+    <copy todir="${output}">
+      <cmp:zipfileset src="../resources/asf-logo.gif.zip"
+                      includes="*.gif"/>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
+
+  <target name="testUncompressSource" depends="setUp">
+    <gzip destfile="${input}/asf-logo.gif.zip.gz"
+          src="../resources/asf-logo.gif.zip"/>
+    <copy todir="${output}">
+      <cmp:zipfileset includes="*.gif">
+        <gzipresource>
+          <file file="${input}/asf-logo.gif.zip.gz"/>
+        </gzipresource>
+      </cmp:zipfileset>
+    </copy>
+    <au:assertFilesMatch
+       actual="${output}/asf-logo.gif"
+       expected="../resources/asf-logo.gif"
+       />
+  </target>
 </project>



Mime
View raw message