From fd8b1539123f608370b40a09e43764c0bcbb479d Mon Sep 17 00:00:00 2001 From: Dave Cramer Date: Fri, 14 Jun 2002 14:01:36 +0000 Subject: [PATCH] added empty result set testing --- .../postgresql/test/jdbc2/ResultSetTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/ResultSetTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/ResultSetTest.java index 2c556bfb2d..49af9e5ce9 100644 --- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/ResultSetTest.java +++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/ResultSetTest.java @@ -63,4 +63,24 @@ public class ResultSetTest extends TestCase stmt.close(); } + public void testEmptyResult() + { + try + { + Statement stmt = con.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT * FROM testrs where id=100"); + rs.beforeFirst(); + rs.afterLast(); + assertTrue(!rs.first()); + assertTrue(!rs.last()); + assertTrue(!rs.next()); + + + } + catch ( Exception ex ) + { + fail( ex.getMessage() ); + } + + } } -- 2.40.0