Skip to content

Commit

Permalink
Enable all tests in newly added datatype test (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilgreenbird authored Jan 3, 2019
1 parent a1e56f2 commit b18c44e
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class KatmaiDataTypesTest extends AbstractTest {
final static String escapedProcName = AbstractSQLGenerator.escapeIdentifier(procName);

enum SQLType {
date("yyyy-mm-dd", 0, java.sql.Types.DATE, "Date"),
date("yyyy-mm-dd", 0, java.sql.Types.DATE, "java.sql.Date"),

time("hh:mm:ss", 7, java.sql.Types.TIME, "java.sql.Time"),

Expand Down Expand Up @@ -1059,41 +1059,48 @@ enum TestValue {
}
};

@Test
public void testResultSetGetters() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {
for (TestValue value : TestValue.values())
value.sqlValue.verifyRSGetters(conn);
}
}

@Test
public void testResultSetUpdaters() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {
for (TestValue value : TestValue.values())
value.sqlValue.verifyRSUpdaters(conn);
}
}

@Test
public void testSetters() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString + ";sendTimeAsDateTime=true")) {
for (TestValue value : TestValue.values())
value.sqlValue.verifySetters(conn);
}
}

@Test
public void testCallableStatementGetters() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {
for (TestValue value : TestValue.values())
value.sqlValue.verifyCSGetters(conn);
}
}

@Test
public void testResultSetMetaData() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {
TestValue v[] = TestValue.values();
for (TestValue value : TestValue.values())
value.sqlValue.verifyResultSetMetaData(conn);
}
}

@Test
public void testParameterMetaData() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {
for (TestValue value : TestValue.values())
Expand All @@ -1104,6 +1111,7 @@ public void testParameterMetaData() throws Exception {
/*
* test CS.setObject(timestamp, TIME)/registerOutParam(TIME) with sendTimeAsDatetime
*/
@Test
public void testSendTimestampAsTimeAsDatetime() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString + ";sendTimeAsDatetime=true")) {
try (Statement stmt = conn.createStatement()) {
Expand Down Expand Up @@ -1142,6 +1150,7 @@ public void testSendTimestampAsTimeAsDatetime() throws Exception {
* test sending Timestamp to the server via an updater does not result in the same behavior as a setter wrt
* double-rounding of fractional seconds
*/
@Test
public void testDoubleRounding() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {

Expand Down Expand Up @@ -1209,6 +1218,7 @@ public void testDoubleRounding() throws Exception {
* year of an imperial era. See for more details:
* http://java.sun.com/javase/6/docs/technotes/guides/intl/calendar.doc.html
*/
@Test
public void testWithJapaneseImperialCalendar() throws Exception {
/*
* From http://java.sun.com/javase/6/docs/api/java/util/Locale.html : "Note: When you ask for a resource for a
Expand All @@ -1218,10 +1228,9 @@ public void testWithJapaneseImperialCalendar() throws Exception {
*/
Locale japaneseImperialLocale = new Locale("ja", "JP", "JP");
Calendar japaneseImperialCalendar = Calendar.getInstance(japaneseImperialLocale);

MessageFormat cal = new MessageFormat(TestResource.getResource("R_noJRESupport"));
assumeTrue(GregorianCalendar.class.isInstance(japaneseImperialCalendar),
cal.format(japaneseImperialLocale.toString()));
Object[] msgsArgs = {japaneseImperialLocale.toString()};
assumeTrue(GregorianCalendar.class.isInstance(japaneseImperialCalendar), cal.format(msgsArgs));

Locale defaultLocale = Locale.getDefault();
Locale.setDefault(japaneseImperialLocale);
Expand Down

0 comments on commit b18c44e

Please sign in to comment.