Commit d89ad56
Add JDBC spec integration tests with fake service record-replay (#1212)
## Summary
- Add 6 new fake service integration test classes (40 tests total) to
close critical JDBC spec coverage gaps
- All tests use the existing WireMock-based record-replay infrastructure
in SEA mode
- Tests are recorded against production and verified in replay mode (no
token needed for CI)
- WireMock stub recordings are committed alongside the test code
## Coverage Analysis
### Before (Baseline)
| Metric | Value |
|--------|-------|
| Total Applicable JDBC Methods | 328 |
| Methods with Integration Tests | 44 |
| **Integration Test Coverage** | **13.4%** |
### After (This PR)
| Metric | Value |
|--------|-------|
| Total Applicable JDBC Methods | 328 |
| Methods with Integration Tests | ~70 |
| **Integration Test Coverage** | **~21.3%** |
### New Methods Covered
| Category | New Methods Tested |
|----------|-------------------|
| **Statement** | `getResultSet()`, `getUpdateCount()`,
`getMoreResults()`, `addBatch(String)`, `executeBatch()`, `clearBatch()`
|
| **PreparedStatement** | `addBatch()`, `executeBatch()`,
`clearBatch()`, method mismatch rejection for `execute(String)`,
`executeQuery(String)`, `executeUpdate(String)` |
| **ResultSet** | `isBeforeFirst()`, `isFirst()`, `getRow()`,
`getType()`, `getConcurrency()`, `getFetchSize()`, `setFetchSize(int)`,
`getFetchDirection()` |
| **Connection** | `isClosed()`, `isValid(int)`, `getCatalog()`,
`getSchema()` |
| **Configuration** | `NonRowcountQueryPrefixes` behavior for
`execute()` and `executeQuery()` with DML |
## Test plan
- [x] All 40 tests pass in RECORD mode against production (e2-dogfood)
- [x] All 40 tests pass in REPLAY mode (no network calls, no token
needed)
- [x] Compilation succeeds with `mvn test-compile`
- [ ] Verify existing fake service tests still pass in replay mode
NO_CHANGELOG=true
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent dd52cc5 commit d89ad56
811 files changed
Lines changed: 31770 additions & 5 deletions
File tree
- docs
- src/test
- java/com/databricks/jdbc
- api/impl
- integration/fakeservice/tests
- resources
- cloudfetchapi
- errorhandlingintegrationtests
- testexecutequery_withdelete_throwssqlexception/mappings
- testexecutequery_withinsert_throwssqlexception/mappings
- testexecutequery_withupdate_throwssqlexception/mappings
- executionintegrationtests
- testexecute_deletestatement_getresultsetreturnsnull/mappings
- testexecute_insertstatement_getresultsetreturnsnull/mappings
- testexecute_selectquery_getresultsetreturnsresultset/mappings
- testexecute_updatestatement_getresultsetreturnsnull/mappings
- testgetmoreresults_advancespastresult/mappings
- testgetresultset_afterexecutequery/mappings
- testpreparedstatementbatch_clearbatch/mappings
- testpreparedstatementbatch_multipleinserts/mappings
- teststatementbatch_clearbatch/mappings
- teststatementbatch_mixeddmloperations/mappings
- teststatementbatch_multipleinserts/mappings
- nonrowcountqueryprefixesintegrationtests
- testconfigured_caseinsensitive/mappings
- testconfigured_deletereturnsresultset/mappings
- testconfigured_executequerysucceedswithinsert/mappings
- testconfigured_insertreturnsresultset/mappings
- testconfigured_multipleprefixes/mappings
- testconfigured_selectstillreturnsresultset/mappings
- testconfigured_updatereturnsresultset/mappings
- testdefault_insertreturnsnoresultset/mappings
- resultsetintegrationtests
- testfetchdirection_forwardonly/mappings
- testfetchsize_defaultstozero/mappings
- testgetrow_tracksposition/mappings
- testisafterlast_afterexhausted/mappings
- testisfirst_onfirstrow/mappings
- testnextreturnsfalse_afterexhausted/mappings
- testresultsetconcurrency_readonly/mappings
- testresultsettype_forwardonly/mappings
- testsetfetchsize_acceptedwithwarning/mappings
- sqlexecapi
- connectionintegrationtests
- testgetcatalog_returnsnonnull/mappings
- testgetschema_returnsnonnull/mappings
- testisclosed_newconnection/mappings
- testisvalid_activeconnection/mappings
- errorhandlingintegrationtests
- testexecutequery_withdelete_throwssqlexception/mappings
- testexecutequery_withinsert_throwssqlexception/mappings
- testexecutequery_withupdate_throwssqlexception/mappings
- testexecuteupdate_withselect_throwssqlexception/mappings
- testpreparedstatement_statementmethodswithsql_throwexception/mappings
- executionintegrationtests
- testexecute_deletestatement_getresultsetreturnsnull/mappings
- testexecute_insertstatement_getresultsetreturnsnull/mappings
- testexecute_selectquery_getresultsetreturnsresultset/mappings
- testexecute_updatestatement_getresultsetreturnsnull/mappings
- testgetmoreresults_advancespastresult/mappings
- testgetresultset_afterexecutequery/mappings
- testgetupdatecount_afterexecuteupdate/mappings
- testpreparedstatementbatch_clearbatch/mappings
- testpreparedstatementbatch_multipleinserts/mappings
- teststatementbatch_clearbatch/mappings
- teststatementbatch_emptybatch/mappings
- teststatementbatch_mixeddmloperations/mappings
- teststatementbatch_multipleinserts/mappings
- nonrowcountqueryprefixesintegrationtests
- testconfigured_caseinsensitive/mappings
- testconfigured_deletereturnsresultset/mappings
- testconfigured_executequerysucceedswithinsert/mappings
- testconfigured_insertreturnsresultset/mappings
- testconfigured_multipleprefixes/mappings
- testconfigured_selectstillreturnsresultset/mappings
- testconfigured_updatereturnsresultset/mappings
- testdefault_insertreturnsnoresultset/mappings
- resultsetintegrationtests
- testfetchdirection_forwardonly/mappings
- testfetchsize_defaultstozero/mappings
- testgetrow_tracksposition/mappings
- testisfirst_onfirstrow/mappings
- testnextreturnsfalse_afterexhausted/mappings
- testresultsetconcurrency_readonly/mappings
- testresultsettype_forwardonly/mappings
- testsetfetchsize_acceptedwithwarning/mappings
- thriftserverapi
- connectionintegrationtests
- testgetcatalog_returnsnonnull/mappings
- testgetschema_returnsnonnull/mappings
- testisclosed_newconnection/mappings
- testisvalid_activeconnection/mappings
- errorhandlingintegrationtests
- testexecutequery_withdelete_throwssqlexception/mappings
- testexecutequery_withinsert_throwssqlexception/mappings
- testexecutequery_withupdate_throwssqlexception/mappings
- testexecuteupdate_withselect_throwssqlexception/mappings
- testpreparedstatement_statementmethodswithsql_throwexception/mappings
- executionintegrationtests
- testexecute_deletestatement_getresultsetreturnsnull/mappings
- testexecute_insertstatement_getresultsetreturnsnull/mappings
- testexecute_selectquery_getresultsetreturnsresultset/mappings
- testexecute_updatestatement_getresultsetreturnsnull/mappings
- testgetmoreresults_advancespastresult/mappings
- testgetresultset_afterexecutequery/mappings
- testgetupdatecount_afterexecuteupdate/mappings
- testpreparedstatementbatch_clearbatch/mappings
- testpreparedstatementbatch_multipleinserts/mappings
- teststatementbatch_clearbatch/mappings
- teststatementbatch_emptybatch/mappings
- teststatementbatch_mixeddmloperations/mappings
- teststatementbatch_multipleinserts/mappings
- nonrowcountqueryprefixesintegrationtests
- testconfigured_caseinsensitive/mappings
- testconfigured_deletereturnsresultset/mappings
- testconfigured_executequerysucceedswithinsert/mappings
- testconfigured_insertreturnsresultset/mappings
- testconfigured_multipleprefixes/mappings
- testconfigured_selectstillreturnsresultset/mappings
- testconfigured_updatereturnsresultset/mappings
- testdefault_insertreturnsnoresultset/mappings
- resultsetintegrationtests
- testfetchdirection_forwardonly/mappings
- testfetchsize_defaultstozero/mappings
- testgetrow_tracksposition/mappings
- testisfirst_onfirstrow/mappings
- testnextreturnsfalse_afterexhausted/mappings
- testresultsetconcurrency_readonly/mappings
- testresultsettype_forwardonly/mappings
- testsetfetchsize_acceptedwithwarning/mappings
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1303 | 1303 | | |
1304 | 1304 | | |
1305 | 1305 | | |
1306 | | - | |
| 1306 | + | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
85 | 130 | | |
86 | 131 | | |
87 | 132 | | |
| |||
src/test/java/com/databricks/jdbc/integration/fakeservice/tests/ErrorHandlingIntegrationTests.java
Lines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
139 | 230 | | |
0 commit comments