Commit 7588640
Add metadata, connection, statement and PreparedStatement integration tests (#1213)
## Summary
- Add 26 new fake service integration tests across 4 existing test
classes
- Tests cover metadata retrieval, connection management, statement
lifecycle, and PreparedStatement enhancements
- All tests use the existing WireMock-based record-replay infrastructure
in SEA mode
- Recorded against production and verified in replay mode (no token
needed for CI)
## Changes by test class
| Test Class | New Tests | Coverage Area |
|-----------|-----------|--------------|
| MetadataIntegrationTests | +10 | ResultSetMetaData (columnLabel,
typeName, precision, scale, displaySize, className, boolean properties,
signed, multiple data types), DatabaseMetaData.getTypeInfo(),
ParameterMetaData.getParameterCount() |
| ConnectionIntegrationTests | +7 | isClosed(), isValid(), getCatalog(),
getSchema(), getMetaData(), getWarnings()/clearWarnings(),
getClientInfo() |
| ExecutionIntegrationTests | +5 | Statement lifecycle:
close()/isClosed(), getConnection(), getMaxRows()/setMaxRows(),
getQueryTimeout()/setQueryTimeout(), getWarnings()/clearWarnings() |
| PreparedStatementIntegrationTests | +4 | clearParameters(), setNull()
with INT type, setObject() without SQL type, getMetaData() for SELECT |
## New JDBC methods covered
### ResultSetMetaData
- getColumnLabel(), getColumnTypeName(), getPrecision(), getScale()
- getColumnDisplaySize(), getColumnClassName()
- isAutoIncrement(), isSearchable(), isCurrency(), isReadOnly(),
isSigned()
### DatabaseMetaData
- getTypeInfo() - full type catalog
### ParameterMetaData
- getParameterCount()
### Connection
- isClosed(), isValid(int), getCatalog(), getSchema()
- getMetaData(), getWarnings(), clearWarnings(), getClientInfo()
### Statement
- close(), isClosed(), getConnection()
- getMaxRows(), setMaxRows(), getQueryTimeout(), setQueryTimeout()
- getWarnings(), clearWarnings()
### PreparedStatement
- clearParameters(), setNull() with INT, setObject() without type
- getMetaData() before execution
## Test plan
- [x] All 56 tests pass in REPLAY mode (no production access needed)
- [x] All tests compile successfully
- [x] WireMock recordings committed under src/test/resources/sqlexecapi/
and cloudfetchapi/
- [ ] Verify CI passes
## Updated Coverage
Including PR #1212
┌─────────────────────────────────────┬───────────────────┬──────────────────┐
│ │ Before (both PRs) │ After (both PRs) │
├─────────────────────────────────────┼───────────────────┼──────────────────┤
│ JDBC methods with integration tests │ ~44 / 328 │ ~96 / 328 │
├─────────────────────────────────────┼───────────────────┼──────────────────┤
│ Coverage % │ 13.4% │ ~29.3% │
└─────────────────────────────────────┴───────────────────┴──────────────────┘
NO_CHANGELOG=true
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent d89ad56 commit 7588640
308 files changed
Lines changed: 11133 additions & 10 deletions
File tree
- src/test
- java/com/databricks/jdbc/integration/fakeservice/tests
- resources
- cloudfetchapi
- metadataintegrationtests
- testresultsetmetadata_booleanproperties/mappings
- testresultsetmetadata_columnclassname/mappings
- testresultsetmetadata_columndisplaysize/mappings
- testresultsetmetadata_columnlabelandtypename/mappings
- testresultsetmetadata_precisionandscale/mappings
- testresultsetmetadata_signedproperty/mappings
- preparedstatementintegrationtests
- testclearparameters/mappings
- testpreparedstatement_getmetadata_forselect/mappings
- testsetnull_withinttype/mappings
- testsetobject_withoutsqltype/mappings
- sqlexecapi
- connectionintegrationtests
- testgetcatalog_returnsnonnull/mappings
- testgetclientinfo_returnsproperties/mappings
- testgetmetadata_returnsnonnull/mappings
- testgetschema_returnsnonnull/mappings
- testgetwarnings_andclearwarnings/mappings
- testisclosed_newconnection/mappings
- testisvalid_activeconnection/mappings
- executionintegrationtests
- teststatement_closeandisclosed/mappings
- teststatement_getconnection/mappings
- teststatement_maxrows/mappings
- teststatement_querytimeout/mappings
- teststatement_warnings/mappings
- metadataintegrationtests
- testgettypeinfo_returnstypecatalog/mappings
- testparametermetadata_getparametercount/mappings
- testparametermetadata_noparameters/mappings
- testresultsetmetadata_booleanproperties/mappings
- testresultsetmetadata_columnclassname/mappings
- testresultsetmetadata_columndisplaysize/mappings
- testresultsetmetadata_columnlabelandtypename/mappings
- testresultsetmetadata_multipledatatypes/mappings
- testresultsetmetadata_precisionandscale/mappings
- testresultsetmetadata_signedproperty/mappings
- preparedstatementintegrationtests
- testclearparameters/mappings
- testpreparedstatement_getmetadata_forselect/mappings
- testsetnull_withinttype/mappings
- testsetobject_withoutsqltype/mappings
- thriftserverapi
- connectionintegrationtests
- testgetcatalog_returnsnonnull/mappings
- testgetclientinfo_returnsproperties/mappings
- testgetmetadata_returnsnonnull/mappings
- testgetschema_returnsnonnull/mappings
- testgetwarnings_andclearwarnings/mappings
- testisclosed_newconnection/mappings
- testisvalid_activeconnection/mappings
- executionintegrationtests
- teststatement_closeandisclosed/mappings
- teststatement_getconnection/mappings
- teststatement_maxrows/mappings
- teststatement_querytimeout/mappings
- teststatement_warnings/mappings
- metadataintegrationtests
- testgettypeinfo_returnstypecatalog/mappings
- testparametermetadata_getparametercount/mappings
- testparametermetadata_noparameters/mappings
- testresultsetmetadata_booleanproperties/mappings
- testresultsetmetadata_columnclassname/mappings
- testresultsetmetadata_columndisplaysize/mappings
- testresultsetmetadata_columnlabelandtypename/mappings
- testresultsetmetadata_multipledatatypes/mappings
- testresultsetmetadata_precisionandscale/mappings
- testresultsetmetadata_signedproperty/mappings
- preparedstatementintegrationtests
- testclearparameters/mappings
- testpreparedstatement_getmetadata_forselect/mappings
- testsetnull_withinttype/mappings
- testsetobject_withoutsqltype/mappings
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
| |||
83 | 80 | | |
84 | 81 | | |
85 | 82 | | |
86 | | - | |
| 83 | + | |
87 | 84 | | |
88 | 85 | | |
89 | 86 | | |
| |||
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
130 | 162 | | |
131 | 163 | | |
132 | 164 | | |
| |||
Lines changed: 75 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
281 | 356 | | |
282 | 357 | | |
283 | 358 | | |
| |||
538 | 613 | | |
539 | 614 | | |
540 | 615 | | |
541 | | - | |
542 | | - | |
543 | 616 | | |
544 | 617 | | |
0 commit comments