Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Merged
Prev Previous commit
Next Next commit
Try old IT test values
  • Loading branch information
whuffman36 committed Mar 4, 2025
commit 34c59dfb5416a2acf1f31c90f43aff6a8844464f

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of the modified integration tests exercise the non-ReadAPI path. Can you check if we have an existing integration test that exercise the read API path and augment the test to validate getArray on it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a new IT test to test the ReadAPI path. Turns out that path had not been tested yet, and so the expected responses for getDate() and getTime() were inaccurate. The ReadAPI path returns the Date and Time objects in local format instead of UTC format.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, it looks more like my local machine had a different local time than that of the VM running the kokoro, resulting in different dates and time objects. This has been resolved.

Original file line number Diff line number Diff line change
Expand Up @@ -3981,13 +3981,10 @@ public void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException
assertNotNull(rs.getBytes("BytesField"));
assertEquals(1, rs.getInt("IntegerField"));
assertEquals(1534680695123L, rs.getTimestamp("TimestampField").getTime());
assertEquals(
java.sql.Date.valueOf("2018-08-18").toLocalDate(), rs.getDate("DateField").toLocalDate());
assertEquals(java.sql.Date.valueOf("2018-08-19"), rs.getDate("DateField"));
assertTrue(rs.getDouble("FloatField") == 10.1d);
assertTrue(rs.getDouble("NumericField") == 100.0d);
assertEquals(
Time.valueOf(LocalTime.of(4, 11, 35, 123456)).toLocalTime(),
rs.getTime("TimeField").toLocalTime());
assertEquals(Time.valueOf(LocalTime.of(12, 11, 35, 123456)), rs.getTime("TimeField"));
assertEquals("2018-08-19T12:11:35.123456", rs.getString("DateTimeField"));
assertEquals("POINT(-122.35022 47.649154)", rs.getString("GeographyField"));
assertNotNull(rs.getBytes("BytesField_1"));
Expand Down