Return-Path: X-Original-To: apmail-creadur-commits-archive@www.apache.org Delivered-To: apmail-creadur-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A154111D78 for ; Tue, 16 Sep 2014 13:15:17 +0000 (UTC) Received: (qmail 20725 invoked by uid 500); 16 Sep 2014 13:15:17 -0000 Delivered-To: apmail-creadur-commits-archive@creadur.apache.org Received: (qmail 20697 invoked by uid 500); 16 Sep 2014 13:15:17 -0000 Mailing-List: contact commits-help@creadur.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@creadur.apache.org Delivered-To: mailing list commits@creadur.apache.org Received: (qmail 20688 invoked by uid 99); 16 Sep 2014 13:15:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2014 13:15:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Tue, 16 Sep 2014 13:14:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 330EB238899C; Tue, 16 Sep 2014 13:14:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1625272 - /creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java Date: Tue, 16 Sep 2014 13:14:54 -0000 To: commits@creadur.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140916131454.330EB238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Tue Sep 16 13:14:53 2014 New Revision: 1625272 URL: http://svn.apache.org/r1625272 Log: Detect missing second file Modified: creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java Modified: creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java?rev=1625272&r1=1625271&r2=1625272&view=diff ============================================================================== --- creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java (original) +++ creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java Tue Sep 16 13:14:53 2014 @@ -80,6 +80,7 @@ public class BinaryGuesserTest { // if we get here, the UTF-16 encoded file didn't throw // any exception, try the UTF-8 encoded one r.close(); + r = null; // ensure we detect failure to read second file doc = new FileDocument(new File("src/test/resources/binaries/UTF8_with_signature.xml")); r = doc.reader(); r.read(dummy); @@ -88,6 +89,8 @@ public class BinaryGuesserTest { } catch (IOException e) { if (r!= null) { r.close(); + } else { + throw e; // could not open the second file } r = null; assertTrue("Expected binary for "+ doc.getName(),BinaryGuesser.isBinary(doc));