1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

The attached patch is my first run-through of the JDBC test suite. A

summary of changes:

 . removal of the tablename property from build.xml

 . addition of a dropTable method in JDBC2Tests and cleanups of many
methods in the same

 . all tests now use non-deprecated assertXYZ methods instead of the
deprecated assert method

 . failure in TimestampTest (testSetTimestamp) fixed. The failure is
because testSetTimestamp was inserting a timestamp with hour 7 but
checkTimeTest was expecting a timestamp with hour 8. AFAICS, there are
no issues wrt daylight savings time and timestamps being pushed in and
pulled out (but more explicit tests should be added in the future)

 . failure in TimeTest (testGetTime) fixed. Times to be inserted were
interpreted in the localtime zone but checking was done with the
assumption that the insertion was done in GMT.

 . formatting changes in a few of the source files (because I found
it convenient to have consistent formatting while working on them). The
formatting is consistent with the new format for java source files in
PostgreSQL.

Liam Stewart
This commit is contained in:
Bruce Momjian
2001-09-23 04:11:14 +00:00
parent c7bc0ddf76
commit b75814aee3
13 changed files with 669 additions and 717 deletions

View File

@ -6,7 +6,7 @@ import java.sql.*;
import java.math.BigDecimal;
/**
* $Id: JBuilderTest.java,v 1.2 2001/09/07 22:17:48 momjian Exp $
* $Id: JBuilderTest.java,v 1.3 2001/09/23 04:11:14 momjian Exp $
*
* Some simple tests to check that the required components needed for JBuilder
* stay working
@ -31,11 +31,8 @@ public class JBuilderTest extends TestCase {
// Tear down the fixture for this test case.
protected void tearDown() throws Exception {
Connection con = JDBC2Tests.openDB();
Statement stmt = con.createStatement();
stmt.executeUpdate("DROP TABLE test_c");
stmt.close();
JDBC2Tests.closeDB(con);
JDBC2Tests.dropTable(con, "test_c");
JDBC2Tests.closeDB(con);
}
/**
@ -47,7 +44,7 @@ public class JBuilderTest extends TestCase {
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select cost from test_c");
assert(rs!=null);
assertNotNull(rs);
while(rs.next()){
double bd = rs.getDouble(1);
@ -58,7 +55,7 @@ public class JBuilderTest extends TestCase {
JDBC2Tests.closeDB(con);
} catch(Exception ex) {
assert(ex.getMessage(),false);
fail(ex.getMessage());
}
}
}