Add JUnit bug regression coverage for FX ResultSet and Statement execution - #2888
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2888 +/- ##
============================================
+ Coverage 59.70% 60.77% +1.07%
- Complexity 4852 4917 +65
============================================
Files 151 151
Lines 34936 34936
Branches 5837 5837
============================================
+ Hits 20860 21234 +374
+ Misses 11301 10880 -421
- Partials 2775 2822 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request migrates bug regression tests from FX (legacy test framework) to JUnit for Statement and ResultSet functionality. The PR adds comprehensive test coverage for 37 historical bugs (24 in StatementTest, 13 in ResultSetTest) that were previously only validated in the FX test suite.
Changes:
- Added nested
BugRegressionTestsclass to StatementTest.java with 19 test methods covering Statement, PreparedStatement, and CallableStatement execution bugs - Added nested
BugRegressionTestsclass to ResultSetTest.java with 13 test methods covering ResultSet navigation, updates, and cursor behavior bugs - Each test is tagged with corresponding bug IDs (VSTS, SQL Bug, Product Studio) for traceability
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| StatementTest.java | Adds 1,240 lines of bug regression tests covering execution paths, batch operations, cursor variations, timeout handling, and SQL state validation for Statement/PreparedStatement/CallableStatement |
| ResultSetTest.java | Adds 775 lines of bug regression tests covering scrollable navigation, insertRow/updateRow operations, cursor downgrades, holdability, and stream refetch scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…crosoft/mssql-jdbc into user/anagarg/missing-fx-tests
…tion comments accordingly.
Summary
This PR migrates all FX bug regression tests related to ResultSet behavior and Statement / PreparedStatement / CallableStatement execution into JUnit, achieving 100% coverage with exact FX pattern fidelity.
The test suite now fully validates 24 execution/batching/cursor FX tests and 13 ResultSet-specific FX bugs, ensuring long-term regression safety and correctness.
What’s Covered
These tests cover all execution paths across Statement, PreparedStatement, and CallableStatement, including cursor variations, close behavior, and holdability. They also validate batch execution, rollback handling, and connection stability, along with maxRows behavior across dynamic and static cursors. Timeout recovery, re-execution, error propagation, and SQLState validation are fully exercised.
The ResultSet test coverage includes scrollable navigation edge cases, empty ResultSet behavior, and correct sequencing of insertRow() and updateRow() operations. It also validates long table name handling (127 characters), cursor downgrade and holdability bugs, stream refetch after partial consumption, CallableStatement ResultSet correctness, and proper exception propagation during cleanup.
Key Characteristics
Result
All 37 FX bug regression scenarios are now validated via JUnit with no gaps found.