You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/03/28 16:07:18 UTC
svn commit: r759479 -
/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Author: sebb
Date: Sat Mar 28 15:07:17 2009
New Revision: 759479
URL: http://svn.apache.org/viewvc?rev=759479&view=rev
Log:
Check that archive entries copy the correct number of bytes
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java?rev=759479&r1=759478&r2=759479&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java (original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java Sat Mar 28 15:07:17 2009
@@ -228,12 +228,17 @@
+ entry.getName());
outfile.getParentFile().mkdirs();
OutputStream out = new FileOutputStream(outfile);
+ long copied=0;
try {
- IOUtils.copy(in, out);
+ copied=IOUtils.copy(in, out);
} finally {
out.close();
}
+ if (entry.getSize() != -1) {// some test cases don't set the size
+ assertEquals(entry.getSize(), copied);
+ }
+
if (!outfile.exists()) {
fail("extraction failed: " + entry.getName());
}