[libpostgresql-jdbc-java] 07/12: Ugggh, compiling is not the same as working. Junit's assertEquals converts things to strings which doesn't work for arrays. Use Arrays.equals instead.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:20:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL8_2_507
in repository libpostgresql-jdbc-java.

commit 42bd941bfa9cf6b10b67a7febf5d13fb59c63f90
Author: Kris Jurka <books at ejurka.com>
Date:   Wed Nov 14 03:17:59 2007 +0000

    Ugggh, compiling is not the same as working.  Junit's assertEquals
    converts things to strings which doesn't work for arrays.  Use
    Arrays.equals instead.
---
 org/postgresql/test/jdbc2/UpdateableResultTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/org/postgresql/test/jdbc2/UpdateableResultTest.java b/org/postgresql/test/jdbc2/UpdateableResultTest.java
index d87080e..86b56f7 100644
--- a/org/postgresql/test/jdbc2/UpdateableResultTest.java
+++ b/org/postgresql/test/jdbc2/UpdateableResultTest.java
@@ -256,21 +256,21 @@ public class UpdateableResultTest extends TestCase
         assertEquals(2, rs.getInt(1));
         assertEquals(string, rs.getString(2));
         assertEquals(string, rs.getString(3));
-        assertEquals(bytes, rs.getBytes(4));
+        assertTrue(Arrays.equals(bytes, rs.getBytes(4)));
 
         rs.refreshRow();
 
         assertEquals(2, rs.getInt(1));
         assertEquals(string, rs.getString(2));
         assertEquals(string, rs.getString(3));
-        assertEquals(bytes, rs.getBytes(4));
+        assertTrue(Arrays.equals(bytes, rs.getBytes(4)));
 
         rs.next();
 
         assertEquals(3, rs.getInt(1));
         assertEquals(string, rs.getString(2));
         assertEquals(string, rs.getString(3));
-        assertEquals(bytes, rs.getBytes(4));
+        assertTrue(Arrays.equals(bytes, rs.getBytes(4)));
         
         rs.close();
         stmt.close();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list