commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r934112 - in /commons/proper/io/trunk/src/test/org/apache/commons/io: ./ comparator/ filefilter/ output/
Date Wed, 14 Apr 2010 18:50:29 GMT
Author: sebb
Date: Wed Apr 14 18:50:28 2010
New Revision: 934112

URL: http://svn.apache.org/viewvc?rev=934112&view=rev
Log:
assertTrue(actual==expected) => assertEquals(expected, actual)
Gives more info in failure cases

Modified:
    commons/proper/io/trunk/src/test/org/apache/commons/io/CopyUtilsTest.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsCopyTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/output/StringBuilderWriterTest.java

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/CopyUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/CopyUtilsTest.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/CopyUtilsTest.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/CopyUtilsTest.java Wed Apr 14 18:50:28
2010
@@ -104,7 +104,7 @@ public class CopyUtilsTest extends FileB
 
         int count = CopyUtils.copy(in, out);
         
-        assertTrue("Not all bytes were read", in.available() == 0);
+        assertEquals("Not all bytes were read", 0, in.available());
         assertEquals("Sizes differ", inData.length, baout.size());
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
         assertEquals(inData.length, count);
@@ -121,7 +121,7 @@ public class CopyUtilsTest extends FileB
         CopyUtils.copy(in, writer);
         writer.flush();
 
-        assertTrue("Not all bytes were read", in.available() == 0);
+        assertEquals("Not all bytes were read", 0, in.available());
         assertEquals("Sizes differ", inData.length, baout.size());
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
     }

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java Wed Apr
14 18:50:28 2010
@@ -642,7 +642,7 @@ public class FileUtilsTestCase extends F
         
         FileUtils.copyFile(testFile1, destination);
         assertTrue("Check Exist", destination.exists());
-        assertTrue("Check Full copy", destination.length() == testFile1Size);
+        assertEquals("Check Full copy", testFile1Size, destination.length());
         /* disabled: Thread.sleep doesn't work reliantly for this case
         assertTrue("Check last modified date preserved", 
             testFile1.lastModified() == destination.lastModified());*/  
@@ -660,7 +660,7 @@ public class FileUtilsTestCase extends F
         System.out.println("COPIED:  " + new java.util.Date());
 
         assertTrue("Check Exist", destination.exists());
-        assertTrue("Check Full copy", destination.length() == largeFile.length());
+        assertEquals("Check Full copy", largeFile.length(), destination.length());
     }
 
     public void testCopyFile2() throws Exception {
@@ -672,7 +672,7 @@ public class FileUtilsTestCase extends F
         
         FileUtils.copyFile(testFile1, destination);
         assertTrue("Check Exist", destination.exists());
-        assertTrue("Check Full copy", destination.length() == testFile2Size);
+        assertEquals("Check Full copy", testFile2Size, destination.length());
         /* disabled: Thread.sleep doesn't work reliably for this case
         assertTrue("Check last modified date preserved", 
             testFile1.lastModified() == destination.lastModified());*/
@@ -700,7 +700,7 @@ public class FileUtilsTestCase extends F
         
         FileUtils.copyFile(testFile1, destination, false);
         assertTrue("Check Exist", destination.exists());
-        assertTrue("Check Full copy", destination.length() == testFile2Size);
+        assertEquals("Check Full copy", testFile2Size, destination.length());
         /* disabled: Thread.sleep doesn't work reliantly for this case
         assertTrue("Check last modified date modified", 
             testFile1.lastModified() != destination.lastModified());*/    
@@ -905,7 +905,7 @@ public class FileUtilsTestCase extends F
         
         FileUtils.copyFileToDirectory(testFile1, directory);
         assertTrue("Check Exist", destination.exists());
-        assertTrue("Check Full copy", destination.length() == testFile1Size);
+        assertEquals("Check Full copy", testFile1Size, destination.length());
         /* disabled: Thread.sleep doesn't work reliantly for this case
         assertTrue("Check last modified date preserved", 
             testFile1.lastModified() == destination.lastModified());*/
@@ -930,7 +930,7 @@ public class FileUtilsTestCase extends F
         
         FileUtils.copyFileToDirectory(testFile1, directory);
         assertTrue("Check Exist", destination.exists());
-        assertTrue("Check Full copy", destination.length() == testFile2Size);
+        assertEquals("Check Full copy", testFile2Size, destination.length());
         /* disabled: Thread.sleep doesn't work reliantly for this case
         assertTrue("Check last modified date preserved", 
             testFile1.lastModified() == destination.lastModified());*/    

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsCopyTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsCopyTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsCopyTestCase.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsCopyTestCase.java Wed Apr
14 18:50:28 2010
@@ -84,7 +84,7 @@ public class IOUtilsCopyTestCase extends
 
         int count = IOUtils.copy(in, out);
         
-        assertTrue("Not all bytes were read", in.available() == 0);
+        assertEquals("Not all bytes were read", 0, in.available());
         assertEquals("Sizes differ", inData.length, baout.size());
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
         assertEquals(inData.length,count);
@@ -137,7 +137,7 @@ public class IOUtilsCopyTestCase extends
         out.off();
         writer.flush();
 
-        assertTrue("Not all bytes were read", in.available() == 0);
+        assertEquals("Not all bytes were read", 0, in.available());
         assertEquals("Sizes differ", inData.length, baout.size());
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
     }
@@ -173,7 +173,7 @@ public class IOUtilsCopyTestCase extends
         out.off();
         writer.flush();
 
-        assertTrue("Not all bytes were read", in.available() == 0);
+        assertEquals("Not all bytes were read", 0, in.available());
         byte[] bytes = baout.toByteArray();
         bytes = new String(bytes, "UTF8").getBytes("US-ASCII");
         assertTrue("Content differs", Arrays.equals(inData, bytes));
@@ -209,7 +209,7 @@ public class IOUtilsCopyTestCase extends
         out.off();
         writer.flush();
 
-        assertTrue("Not all bytes were read", in.available() == 0);
+        assertEquals("Not all bytes were read", 0, in.available());
         assertEquals("Sizes differ", inData.length, baout.size());
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
     }

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/IOUtilsTestCase.java Wed Apr 14
18:50:28 2010
@@ -129,9 +129,8 @@ public class IOUtilsTestCase extends Fil
         try {
             String out = IOUtils.toString( fin );
             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", FILE_SIZE, out.length() );
         } finally {
             fin.close();
         }
@@ -144,9 +143,7 @@ public class IOUtilsTestCase extends Fil
         try {
             String out = IOUtils.toString( fin );
             assertNotNull( out );
-            assertTrue( "Wrong output size: out.length()=" +
-                        out.length() + "!=" + FILE_SIZE,
-                        out.length() == FILE_SIZE );
+            assertEquals( "Wrong output size", FILE_SIZE, out.length());
         } finally {
             fin.close();
         }
@@ -218,9 +215,8 @@ public class IOUtilsTestCase extends Fil
         try {
             byte[] out = IOUtils.toByteArray( fin );
             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", FILE_SIZE, out.length );
             assertEqualContent( out, m_testFile );
         } finally {
             fin.close();
@@ -233,9 +229,8 @@ public class IOUtilsTestCase extends Fil
             InputStream in = IOUtils.toBufferedInputStream(fin);
             byte[] out = IOUtils.toByteArray(in);
             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", FILE_SIZE, out.length );
             assertEqualContent(out, m_testFile);
         } finally {
             fin.close();
@@ -374,9 +369,8 @@ public class IOUtilsTestCase extends Fil
         try {
             char[] out = IOUtils.toCharArray( fin );
             assertNotNull( out );
-            assertTrue( "Not all chars were read", fin.available() == 0 );
-            assertTrue( "Wrong output size: out.length=" + out.length +
-                        "!=" + FILE_SIZE, out.length == FILE_SIZE );
+            assertEquals( "Not all chars were read", 0, fin.available());
+            assertEquals( "Wrong output size", FILE_SIZE, out.length );
             assertEqualContent( out, m_testFile );
         } finally {
             fin.close();
@@ -390,9 +384,8 @@ public class IOUtilsTestCase extends Fil
         try {
             char[] out = IOUtils.toCharArray( fin , "UTF-8" );
             assertNotNull( out );
-            assertTrue( "Not all chars were read", fin.available() == 0 );
-            assertTrue( "Wrong output size: out.length=" + out.length +
-                        "!=" + FILE_SIZE, out.length == FILE_SIZE );
+            assertEquals( "Not all chars were read", 0, fin.available());
+            assertEquals( "Wrong output size", FILE_SIZE, out.length);
             assertEqualContent( out, m_testFile );
         } finally {
             fin.close();
@@ -406,8 +399,7 @@ public class IOUtilsTestCase extends Fil
         try {
             char[] out = IOUtils.toCharArray( fr );
             assertNotNull( out );
-            assertTrue( "Wrong output size: out.length=" + out.length +
-                        "!=" + FILE_SIZE, out.length == FILE_SIZE );
+            assertEquals( "Wrong output size", FILE_SIZE, out.length);
             assertEqualContent( out, m_testFile );
         } finally {
             fr.close();

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
Wed Apr 14 18:50:28 2010
@@ -108,9 +108,9 @@ public abstract class ComparatorAbstract
         files[1] = moreFile;
         files[2] = lessFile;
         comparator.sort(files);
-        assertTrue("equal", files[0] == lessFile);
-        assertTrue("less",  files[1] == equalFile1);
-        assertTrue("more",  files[2] == moreFile);
+        assertEquals("equal", lessFile, files[0]);
+        assertEquals("less",  equalFile1, files[1]);
+        assertEquals("more",  moreFile, files[2]);
     }
 
     /**
@@ -122,9 +122,9 @@ public abstract class ComparatorAbstract
         files.add(moreFile);
         files.add(lessFile);
         comparator.sort(files);
-        assertTrue("equal", files.get(0) == lessFile);
-        assertTrue("less",  files.get(1) == equalFile1);
-        assertTrue("more",  files.get(2) == moreFile);
+        assertEquals("equal", lessFile, files.get(0));
+        assertEquals("less",  equalFile1, files.get(1));
+        assertEquals("more",  moreFile, files.get(2));
     }
 
     /**

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/CompositeFileComparatorTest.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
Wed Apr 14 18:50:28 2010
@@ -62,7 +62,7 @@ public class CompositeFileComparatorTest
         list.add(ExtensionFileComparator.EXTENSION_COMPARATOR);
         Comparator<File> c = new CompositeFileComparator(list);
 
-        assertTrue("equal", c.compare(equalFile1, equalFile2) == 0);
+        assertEquals("equal", 0, c.compare(equalFile1, equalFile2));
         assertTrue("less",  c.compare(lessFile, moreFile) < 0);
         assertTrue("more",  c.compare(moreFile, lessFile) > 0);
     }

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
Wed Apr 14 18:50:28 2010
@@ -59,18 +59,18 @@ public class FileFilterTestCase extends 
     public void assertFiltering(IOFileFilter filter, File file, boolean expected) throws
Exception {
         // Note. This only tests the (File, String) version if the parent of
         //       the File passed in is not null
-        assertTrue(
+        assertEquals(
             "Filter(File) " + filter.getClass().getName() + " not " + expected + " for "
+ file,
-            (filter.accept(file) == expected));
+            expected, filter.accept(file));
 
         if (file != null && file.getParentFile() != null) {
-            assertTrue(
+            assertEquals(
                 "Filter(File, String) " + filter.getClass().getName() + " not " + expected
+ " for " + file,
-                (filter.accept(file.getParentFile(), file.getName()) == expected));
+                expected, filter.accept(file.getParentFile(), file.getName()));
         } else if (file == null) {
-            assertTrue(
+            assertEquals(
                 "Filter(File, String) " + filter.getClass().getName() + " not " + expected
+ " for null",
-                filter.accept(file) == expected);
+                expected, filter.accept(file));
         }
     }
 

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
Wed Apr 14 18:50:28 2010
@@ -32,18 +32,18 @@ public abstract class IOFileFilterAbstra
   
   public boolean assertFileFiltering(final int testNumber, final IOFileFilter filter, final
File file, final boolean expected)
   throws Exception {
-    assertTrue(
+    assertEquals(
     "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected
+ " for " + file,
-    (filter.accept(file) == expected));
+    expected, filter.accept(file));
     return true; // return is irrelevant
   }
 
   public boolean assertFilenameFiltering(final int testNumber, final IOFileFilter filter,
final File file, final boolean expected)
   throws Exception {
     // Assumes file has parent and is not passed as null
-    assertTrue(
+      assertEquals(
     "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not
" + expected + " for " + file,
-    (filter.accept(file.getParentFile(), file.getName()) == expected));
+    expected, filter.accept(file.getParentFile(), file.getName()));
     return true; // return is irrelevant
   }
 
@@ -51,19 +51,19 @@ public abstract class IOFileFilterAbstra
   throws Exception {
     // Note. This only tests the (File, String) version if the parent of
     //       the File passed in is not null
-    assertTrue(
+      assertEquals(
     "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected
+ " for " + file,
-    (filter.accept(file) == expected));
+    expected, filter.accept(file));
 
     if (file != null && file.getParentFile() != null) {
-      assertTrue(
+        assertEquals(
       "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not
" + expected + " for " + file,
-      (filter.accept(file.getParentFile(), file.getName()) == expected));
+      expected, filter.accept(file.getParentFile(), file.getName()));
     } 
     else if (file == null) {
-      assertTrue(
+        assertEquals(
       "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not
" + expected + " for null",
-      filter.accept(file) == expected);
+      expected, filter.accept(file));
     }
   }
 

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
Wed Apr 14 18:50:28 2010
@@ -45,18 +45,18 @@ public class RegexFileFilterTestCase ext
     public void assertFiltering(IOFileFilter filter, File file, boolean expected) throws
Exception {
         // Note. This only tests the (File, String) version if the parent of
         //       the File passed in is not null
-        assertTrue(
+        assertEquals(
             "Filter(File) " + filter.getClass().getName() + " not " + expected + " for "
+ file,
-            (filter.accept(file) == expected));
+            expected, filter.accept(file));
 
         if (file != null && file.getParentFile() != null) {
-            assertTrue(
+            assertEquals(
                 "Filter(File, String) " + filter.getClass().getName() + " not " + expected
+ " for " + file,
-                (filter.accept(file.getParentFile(), file.getName()) == expected));
+                expected, filter.accept(file.getParentFile(), file.getName()));
         } else if (file == null) {
-            assertTrue(
+            assertEquals(
                 "Filter(File, String) " + filter.getClass().getName() + " not " + expected
+ " for null",
-                filter.accept(file) == expected);
+                expected, filter.accept(file));
         }
     }
 

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/output/DeferredFileOutputStreamTest.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
Wed Apr 14 18:50:28 2010
@@ -73,7 +73,7 @@ public class DeferredFileOutputStreamTes
         assertTrue(dfos.isInMemory());
 
         byte[] resultBytes = dfos.getData();
-        assertTrue(resultBytes.length == testBytes.length);
+        assertEquals(testBytes.length, resultBytes.length);
         assertTrue(Arrays.equals(resultBytes, testBytes));
     }
 
@@ -96,7 +96,7 @@ public class DeferredFileOutputStreamTes
         assertTrue(dfos.isInMemory());
 
         byte[] resultBytes = dfos.getData();
-        assertTrue(resultBytes.length == testBytes.length);
+        assertEquals(testBytes.length, resultBytes.length);
         assertTrue(Arrays.equals(resultBytes, testBytes));
     }
 
@@ -352,13 +352,13 @@ public class DeferredFileOutputStreamTes
         try
         {
             FileInputStream fis = new FileInputStream(testFile);
-            assertTrue(fis.available() == testBytes.length);
+            assertEquals(testBytes.length, fis.available());
 
             byte[] resultBytes = new byte[testBytes.length];
-            assertTrue(fis.read(resultBytes) == testBytes.length);
+            assertEquals(testBytes.length, fis.read(resultBytes));
 
             assertTrue(Arrays.equals(resultBytes, testBytes));
-            assertTrue(fis.read(resultBytes) == -1);
+            assertEquals(-1, fis.read(resultBytes));
 
             try
             {

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/output/StringBuilderWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/output/StringBuilderWriterTest.java?rev=934112&r1=934111&r2=934112&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/output/StringBuilderWriterTest.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/output/StringBuilderWriterTest.java
Wed Apr 14 18:50:28 2010
@@ -49,7 +49,7 @@ public class StringBuilderWriterTest ext
         StringBuilderWriter writer = new StringBuilderWriter(builder);
         writer.append("Bar");
         assertEquals("FooBar", writer.toString());
-        assertTrue(builder == writer.getBuilder());
+        assertEquals(builder, writer.getBuilder());
     }
 
     /** Test {@link StringBuilderWriter} constructor. */



Mime
View raw message