1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-01 12:18:01 +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

@@ -8,7 +8,7 @@ import java.io.*;
/**
* Tests for the Encoding class.
*
* $Id: EncodingTest.java,v 1.1 2001/07/21 21:27:41 momjian Exp $
* $Id: EncodingTest.java,v 1.2 2001/09/23 04:11:14 momjian Exp $
*/
@@ -23,12 +23,12 @@ public class EncodingTest extends TestCase {
encoding = Encoding.getEncoding("UNICODE", null);
assertEquals("UTF", encoding.name().substring(0, 3).toUpperCase());
encoding = Encoding.getEncoding("SQL_ASCII", null);
assert(encoding.name().toUpperCase().indexOf("ASCII") != -1);
assertTrue(encoding.name().toUpperCase().indexOf("ASCII") != -1);
assertEquals("When encoding is unknown the default encoding should be used",
Encoding.defaultEncoding(),
Encoding.getEncoding("UNKNOWN", null));
encoding = Encoding.getEncoding("SQL_ASCII", "utf-8");
assert("Encoding passed in by the user should be preferred",
assertTrue("Encoding passed in by the user should be preferred",
encoding.name().toUpperCase().indexOf("UTF") != -1);
}