creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1625248 - /creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/document/impl/guesser/BinaryGuesserTest.java
Date Tue, 16 Sep 2014 11:44:52 GMT
Author: sebb
Date: Tue Sep 16 11:44:52 2014
New Revision: 1625248

URL: http://svn.apache.org/r1625248
Log:
Show details of what happens on different platforms

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=1625248&r1=1625247&r2=1625248&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 11:44:52 2014
@@ -101,8 +101,16 @@ public class BinaryGuesserTest {
     @Test
     public void realBinaryContent() {
         // This test is not accurate on all platforms
-        if (System.getProperty("file.encoding").startsWith("ANSI")) {
-            assertTrue(BinaryGuesser.isBinary(new FileDocument(new File("src/test/resources/binaries/Image-png.not"))));
+        final String encoding = System.getProperty("file.encoding");
+        final boolean isBinary = BinaryGuesser.isBinary(new FileDocument(new File("src/test/resources/binaries/Image-png.not")));
+        if (encoding.startsWith("ANSI")) {
+            assertTrue(isBinary);
+        } else {
+            if (isBinary) {
+                System.out.println("BinaryGuesserTest.realBinaryContent() succeeded when
using encoding "+encoding);
+            } else {
+                System.err.println("BinaryGuesserTest.realBinaryContent() failed when using
encoding "+encoding);
+            }
         }
     }
 



Mime
View raw message