creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
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 GMT
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));



Mime
View raw message