-
Notifications
You must be signed in to change notification settings - Fork 0
Test PR 2 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Test PR 2 #2
Conversation
- implemented additional timestamp with precision data type for ExasolClient
- added correspondent tests for timestamp with precision data type
- implemented additional timestamp with local time zone data type for ExasolClient
- implemented special addRoundTrip method with additional column expression parameter for the predicate to fix the test predicate assumption
- all timestamp with timezone tests use input literal timestamp string, which is interpreted as a JVM timestamp string ("America/Bahia_Banderas") but expected literal strings are interpreted as UTC strings. Therefore the difference between these timestamps is 6 hours (with DST) or 5 (without DST); for some historical values, like 1970 for example, the difference can be 7, which is expected behaviour for timestamp with local time zone
- removed mapper classes and moved the logic to ExasolClient, based on the PR suggesions
- removed unnecessary javadocs
- improved javadocs and comments for testing timestamp with time zone by explaining why only jvm time zone is currently used for testing timestamp with time zone
- removed using * import in ExasolClient based on the PR suggestions
- removed TestExasolTimestampMapping and moved testing timestamp and timestamp with timezone to TestExasolTypeMapping, based on the PR suggestions
- defined test methods as package-private, based on the PR suggestions
|
/suggest-unit-tests |
|
Based on the changes you've made, you have added valuable unit tests for timestamp and timestamp with time zone handling, which is great. However, there are a few more areas where additional tests could provide further coverage:
Here’s an example of additional tests you might consider adding: @Test
void testTimestampBoundaryValues() {
testTimestamp("TIMESTAMP '0001-01-01 00:00:00.000000'");
testTimestamp("TIMESTAMP '9999-12-31 23:59:59.999999'");
}
@Test
void testTimestampWithTimeZoneBoundaryValues() {
testTimestampWithTimeZone("TIMESTAMP '0001-01-01 00:00:00.000000'");
testTimestampWithTimeZone("TIMESTAMP '9999-12-31 23:59:59.999999'");
}
@Test
void testNullTimestamp() {
Session session = Session.builder(getSession()).build();
SqlDataTypeTest.create()
.addRoundTrip("timestamp", "NULL", createTimestampType(3), "CAST(NULL AS TIMESTAMP)")
.execute(getQueryRunner(), session, exasolCreateAndInsert(TEST_SCHEMA + "." + "test_null_timestamp"));
}
@Test
void testNullTimestampWithTimeZone() {
Session session = Session.builder(getSession()).build();
SqlDataTypeTest.create()
.addRoundTrip("timestamp with time zone", "NULL", createTimestampWithTimeZoneType(3), "CAST(NULL AS TIMESTAMP WITH TIME ZONE)")
.execute(getQueryRunner(), session, exasolCreateAndInsert(TEST_SCHEMA + "." + "test_null_timestamp_with_timezone"));
}These additional tests will help ensure that your changes are robust and handle a wide range of scenarios. |
Copy of trinodb#26259