You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2007/05/18 10:46:51 UTC
svn commit: r539315 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
Author: kahatlen
Date: Fri May 18 01:46:50 2007
New Revision: 539315
URL: http://svn.apache.org/viewvc?view=rev&rev=539315
Log:
Make JDBC.assertFullResultSet() work on empty result sets.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java?view=diff&rev=539315&r1=539314&r2=539315
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java Fri May 18 01:46:50 2007
@@ -725,9 +725,13 @@
int rows;
ResultSetMetaData rsmd = rs.getMetaData();
- // Assert that we have the right number of columns.
- Assert.assertEquals("Unexpected column count:",
- expectedRows[0].length, rsmd.getColumnCount());
+ // Assert that we have the right number of columns. If we expect an
+ // empty result set, the expected column count is unknown, so don't
+ // check.
+ if (expectedRows.length > 0) {
+ Assert.assertEquals("Unexpected column count:",
+ expectedRows[0].length, rsmd.getColumnCount());
+ }
for (rows = 0; rs.next(); rows++)
{