Skip to content

Commit

Permalink
Enable JDBC tests for NaN and infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Oct 8, 2014
1 parent ceee7be commit d2085fa
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,24 @@ public void testDuplicateColumnLabels()
public void testObjectTypes()
throws Exception
{
// TODO: enable these after the server is fixed
// String sql = "SELECT 123, 0.1, true, 'hello', 1.0 / 0.0, 0.0 / 0.0";
String sql = "SELECT 123, 0.1, true, 'hello'";
String sql = "SELECT 123, 0.1, true, 'hello', 1.0 / 0.0, 0.0 / 0.0";
try (ResultSet rs = statement.executeQuery(sql)) {
ResultSetMetaData metadata = rs.getMetaData();
// assertEquals(metadata.getColumnCount(), 6);
assertEquals(metadata.getColumnCount(), 4);
assertEquals(metadata.getColumnCount(), 6);
assertEquals(metadata.getColumnType(1), Types.BIGINT);
assertEquals(metadata.getColumnType(2), Types.DOUBLE);
assertEquals(metadata.getColumnType(3), Types.BOOLEAN);
assertEquals(metadata.getColumnType(4), Types.LONGNVARCHAR);
// assertEquals(metadata.getColumnType(5), Types.DOUBLE);
// assertEquals(metadata.getColumnType(6), Types.DOUBLE);
assertEquals(metadata.getColumnType(5), Types.DOUBLE);
assertEquals(metadata.getColumnType(6), Types.DOUBLE);

assertTrue(rs.next());
assertEquals(rs.getObject(1), 123L);
assertEquals(rs.getObject(2), 0.1d);
assertEquals(rs.getObject(3), true);
assertEquals(rs.getObject(4), "hello");
// assertEquals(rs.getObject(5), Double.POSITIVE_INFINITY);
// assertEquals(rs.getObject(6), Double.NaN);
assertEquals(rs.getObject(5), Double.POSITIVE_INFINITY);
assertEquals(rs.getObject(6), Double.NaN);
}
}

Expand Down

0 comments on commit d2085fa

Please sign in to comment.