Skip to content

Enhance Code Coverage - #2875

Merged
Muskan Gupta (muskan124947) merged 12 commits into
mainfrom
users/muskgupta/codeCoverage
Feb 5, 2026
Merged

Enhance Code Coverage#2875
Muskan Gupta (muskan124947) merged 12 commits into
mainfrom
users/muskgupta/codeCoverage

Conversation

@muskan124947

@muskan124947 Muskan Gupta (muskan124947) commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Enhanced code coverage for below classes:

  • SQLServerCallableStatement
  • SQLServerDatabaseMetadata
  • SQLServerPreparedStatement

@codecov

codecov Bot commented Jan 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.36%. Comparing base (19d385f) to head (c29efcf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2875      +/-   ##
============================================
+ Coverage     59.23%   60.36%   +1.12%     
- Complexity     4797     4878      +81     
============================================
  Files           151      151              
  Lines         34781    34781              
  Branches       5829     5829              
============================================
+ Hits          20604    20995     +391     
+ Misses        11380    10962     -418     
- Partials       2797     2824      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Removed the test for supportsSharding method, which checked JDBC 4.3 version and UnsupportedOperationException.
@muskan124947

Copy link
Copy Markdown
Contributor Author

/azp run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds extensive unit tests to improve code coverage for SQLServerPreparedStatement, SQLServerDatabaseMetaData, and SQLServerCallableStatement, with a focus on Azure DW branches, batch/bulk-copy behavior, and a wide range of callable parameter getter/setter APIs.

Changes:

  • PreparedStatementTest: Adds tests for null SQL in prepareStatement, bulk-copy batch edge cases (empty batches, column count mismatches, unsupported Azure DW types), SQL parsing around dots/comments, and batch execution error handling, including OUT/INOUT parameter validation.
  • DatabaseMetaDataTest: Adds Azure DW-focused tests for getIndexInfo, getColumns, getFunctionColumns, and foreign key-related APIs, including column/type mapping validation and empty-result behavior.
  • CallableStatementTest: Adds broad coverage for time/date getters and setters (with/without Calendar), deprecated getBigDecimal overloads, stream/LOB setters, setObject and registerOutParameter SQLType overloads, uniqueidentifier handling, and unsupported URL/RowId getters/setters.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java New tests exercise bulk-copy batch edge cases, Azure DW unsupported types, SQL parsing with schema/table dots and comments, and batch exception behavior; also adds an OUT-parameter-in-batch validation test, but unintentionally removes the assertFalse static import required by existing tests.
src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java Adds Azure DW coverage for getIndexInfo, getColumns, function metadata, and foreign-key-related APIs, including reflection-based manipulation of internal mappings and checks for column/type alignment and empty-result handling.
src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java Extends callable statement coverage across time/date APIs, numeric precision/scale handling, TVP/structured parameters, various stream and LOB setters, SQLType-based setObject/registerOutParameter overloads, uniqueidentifier support, and “not supported” URL/RowId paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Refactor test documentation for clarity and remove line references.
Refactor comments for clarity in exception handling tests.
@muskan124947

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@muskan124947

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@muskan124947
Muskan Gupta (muskan124947) merged commit afbcb2a into main Feb 5, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Closed/Merged PRs in MSSQL JDBC Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed/Merged PRs

Development

Successfully merging this pull request may close these issues.

5 participants