You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/03/23 00:51:10 UTC

svn commit: r1304139 - in /commons/proper/io/trunk/src/test/java/org/apache/commons/io: FileUtilsTestCase.java IOUtilsTestCase.java

Author: sebb
Date: Thu Mar 22 23:51:09 2012
New Revision: 1304139

URL: http://svn.apache.org/viewvc?rev=1304139&view=rev
Log:
Don't use assertTrue for comparing equals

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java?rev=1304139&r1=1304138&r2=1304139&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Thu Mar 22 23:51:09 2012
@@ -1307,7 +1307,7 @@ public class FileUtilsTestCase extends F
         assertTrue(file2.delete());
         
         String contents = FileUtils.readFileToString(new File(filename), "UTF-8");
-        assertTrue("FileUtils.fileRead()", contents.equals("This is a test"));
+        assertEquals("FileUtils.fileRead()", "This is a test", contents);
 
     }
 

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java?rev=1304139&r1=1304138&r2=1304139&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java Thu Mar 22 23:51:09 2012
@@ -259,8 +259,8 @@ public class IOUtilsTestCase extends Fil
         try {
             byte[] out = IOUtils.toByteArray(fin, m_testFile.length());
             assertNotNull(out);
-            assertTrue("Not all bytes were read", fin.available() == 0);
-            assertTrue("Wrong output size: out.length=" + out.length + "!=" + FILE_SIZE, out.length == FILE_SIZE);
+            assertEquals("Not all bytes were read", 0, fin.available());
+            assertEquals("Wrong output size: out.length=" + out.length + "!=" + FILE_SIZE, FILE_SIZE, out.length);
             assertEqualContent(out, m_testFile);
         } finally {
             fin.close();
@@ -288,7 +288,7 @@ public class IOUtilsTestCase extends Fil
         try {
             byte[] out = IOUtils.toByteArray(fin, 0);
             assertNotNull("Out cannot be null", out);
-            assertTrue("Out length must be 0", out.length == 0);
+            assertEquals("Out length must be 0", 0, out.length);
         } finally {
             fin.close();
         }