[libpostgresql-jdbc-java] 10/19: patch to indicate why test cases failed from Oliver Jowett

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


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

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

commit 8b63d1e8e3fc8ca9808925c0e0869ddfe22966af
Author: Dave Cramer <davec at fastcrypt.com>
Date:   Fri Dec 12 18:37:06 2003 +0000

    patch to indicate why test cases failed from Oliver Jowett
---
 .../test/jdbc2/DatabaseMetaDataTest.java           | 42 +++++++++++-----------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java b/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
index 6001f1c..f96dbd8 100644
--- a/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
+++ b/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
@@ -52,28 +52,28 @@ public class DatabaseMetaDataTest extends TestCase
 			ResultSet rs = dbmd.getTables( null, null, "testmetadat%", new String[] {"TABLE"});
 			assertTrue( rs.next() );
 			String tableName = rs.getString("TABLE_NAME");
-			assertTrue( tableName.equals("testmetadata") );
+			assertEquals( "testmetadata", tableName );
 			String tableType = rs.getString("TABLE_TYPE");
-			assertTrue( tableType.equals("TABLE") );
+			assertEquals( "TABLE", tableType );
             //There should only be one row returned 
             assertTrue( "getTables() returned too many rows", rs.next() == false);
 			rs.close();
 
 			rs = dbmd.getColumns("", "", "test%", "%" );
 			assertTrue( rs.next() );
-			assertTrue( rs.getString("TABLE_NAME").equals("testmetadata") );
-			assertTrue( rs.getString("COLUMN_NAME").equals("id") );
-			assertTrue( rs.getInt("DATA_TYPE") == java.sql.Types.INTEGER );
+			assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
+			assertEquals( "id", rs.getString("COLUMN_NAME") );
+			assertEquals( java.sql.Types.INTEGER, rs.getInt("DATA_TYPE") );
 
 			assertTrue( rs.next() );
-			assertTrue( rs.getString("TABLE_NAME").equals("testmetadata") );
-			assertTrue( rs.getString("COLUMN_NAME").equals("name") );
-			assertTrue( rs.getInt("DATA_TYPE") == java.sql.Types.VARCHAR );
+			assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
+			assertEquals( "name", rs.getString("COLUMN_NAME") );
+			assertEquals( java.sql.Types.VARCHAR, rs.getInt("DATA_TYPE") );
 
 			assertTrue( rs.next() );
-			assertTrue( rs.getString("TABLE_NAME").equals("testmetadata") );
-			assertTrue( rs.getString("COLUMN_NAME").equals("updated") );
-			assertTrue( rs.getInt("DATA_TYPE") == java.sql.Types.TIMESTAMP );
+			assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
+			assertEquals( "updated", rs.getString("COLUMN_NAME") );
+			assertEquals( java.sql.Types.TIMESTAMP, rs.getInt("DATA_TYPE") );
 
 		}
 		catch (SQLException ex)
@@ -102,13 +102,13 @@ public class DatabaseMetaDataTest extends TestCase
 			{
 
 				String pkTableName = rs.getString( "PKTABLE_NAME" );
-				assertTrue ( pkTableName.equals("vv") );
+				assertEquals ( "vv", pkTableName );
 
 				String pkColumnName = rs.getString( "PKCOLUMN_NAME" );
 				assertTrue( pkColumnName.equals("a") || pkColumnName.equals("b"));
 
 				String fkTableName = rs.getString( "FKTABLE_NAME" );
-				assertTrue( fkTableName.equals( "ww" ) );
+				assertEquals( "ww", fkTableName );
 
 				String fkColumnName = rs.getString( "FKCOLUMN_NAME" );
 				assertTrue( fkColumnName.equals( "m" ) || fkColumnName.equals( "n" ) ) ;
@@ -121,10 +121,10 @@ public class DatabaseMetaDataTest extends TestCase
 				}
 
 				String pkName = rs.getString( "PK_NAME" );
-				assertTrue( pkName.equals("vv_pkey") );
+				assertEquals( "vv_pkey", pkName );
 
 				int keySeq = rs.getInt( "KEY_SEQ" );
-				assertTrue( keySeq == j );
+				assertEquals( j, keySeq );
 			}
 
 
@@ -233,10 +233,10 @@ public class DatabaseMetaDataTest extends TestCase
 				assertTrue ( pkTableName.equals("people") || pkTableName.equals("policy") );
 
 				String pkColumnName = rs.getString( "PKCOLUMN_NAME" );
-				assertTrue( pkColumnName.equals("id") );
+				assertEquals( "id", pkColumnName );
 
 				String fkTableName = rs.getString( "FKTABLE_NAME" );
-				assertTrue( fkTableName.equals( "users" ) );
+				assertEquals( "users", fkTableName );
 
 				String fkColumnName = rs.getString( "FKCOLUMN_NAME" );
 				assertTrue( fkColumnName.equals( "people_id" ) || fkColumnName.equals( "policy_id" ) ) ;
@@ -256,11 +256,11 @@ public class DatabaseMetaDataTest extends TestCase
 			// this is hacky, but it will serve the purpose
 			assertTrue ( rs.next() );
 
-			assertTrue( rs.getString( "PKTABLE_NAME" ).equals( "people" ) );
-			assertTrue( rs.getString( "PKCOLUMN_NAME" ).equals( "id" ) );
+			assertEquals( "people", rs.getString( "PKTABLE_NAME" ) );
+			assertEquals( "id", rs.getString( "PKCOLUMN_NAME" ) );
 
-			assertTrue( rs.getString( "FKTABLE_NAME" ).equals( "users" ) );
-			assertTrue( rs.getString( "FKCOLUMN_NAME" ).equals( "people_id" ) );
+			assertEquals( "users", rs.getString( "FKTABLE_NAME" ) );
+			assertEquals( "people_id", rs.getString( "FKCOLUMN_NAME" ) );
 
 			assertTrue( rs.getString( "FK_NAME" ).startsWith( "people" ) );
 

-- 
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