Test PR 2#2
Open
dekimir wants to merge 3 commits into
Open
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
Owner
Author
|
/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copy of trinodb#26259