Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 49405 invoked from network); 9 May 2010 18:48:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 May 2010 18:48:17 -0000 Received: (qmail 59927 invoked by uid 500); 9 May 2010 18:48:17 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 59846 invoked by uid 500); 9 May 2010 18:48:16 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 59839 invoked by uid 99); 9 May 2010 18:48:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 May 2010 18:48:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 May 2010 18:48:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EC06623889DA; Sun, 9 May 2010 18:47:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r942577 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java Date: Sun, 09 May 2010 18:47:16 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100509184716.EC06623889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Sun May 9 18:47:16 2010 New Revision: 942577 URL: http://svn.apache.org/viewvc?rev=942577&view=rev Log: Handle archives containing directories Report actual missing entry 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=942577&r1=942576&r2=942577&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 Sun May 9 18:47:16 2010 @@ -289,15 +289,18 @@ public abstract class AbstractTestCase e while ((entry = in.getNextEntry()) != null) { File outfile = new File(result.getCanonicalPath() + "/result/" + entry.getName()); - outfile.getParentFile().mkdirs(); - OutputStream out = new FileOutputStream(outfile); long copied=0; - try { - copied=IOUtils.copy(in, out); - } finally { - out.close(); + if (entry.isDirectory()){ + outfile.mkdirs(); + } else { + outfile.getParentFile().mkdirs(); + OutputStream out = new FileOutputStream(outfile); + try { + copied=IOUtils.copy(in, out); + } finally { + out.close(); + } } - final long size = entry.getSize(); if (size != ArchiveEntry.SIZE_UNKNOWN) { assertEquals("Entry.size should equal bytes read.",size, copied); @@ -307,7 +310,7 @@ public abstract class AbstractTestCase e fail("extraction failed: " + entry.getName()); } if (expected != null && !expected.remove(getExpectedString(entry))) { - fail("unexpected entry: " + entry.getName()); + fail("unexpected entry: " + getExpectedString(entry)); } } in.close();