commit | c9a15ae0cda90799680dbddb7b7bfa90559b0a40 | [log] [tgz] |
---|---|---|
author | Sebastian Bazley <sebb@apache.org> | Tue Sep 16 13:14:53 2014 +0000 |
committer | Sebastian Bazley <sebb@apache.org> | Tue Sep 16 13:14:53 2014 +0000 |
tree | c6638543e3ae373f4cda6866ce0b1de9983080a3 | |
parent | 268427769391d71d589013489aa78498fd67bf06 [diff] |
Detect missing second file git-svn-id: https://svn.apache.org/repos/asf/creadur/rat/trunk@1625272 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java b/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java index 10c1bf0..cc87c4f 100644 --- a/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java +++ b/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java
@@ -80,6 +80,7 @@ // 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 @@ } 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));