View Issue Details

IDProjectCategoryView StatusLast Update
0006744SymmetricDSImprovementpublic2025-03-11 20:35
Reporterpbelov Assigned Topbelov  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.15.0 
Target Version3.15.14Fixed in Version3.15.14 
Summary0006744: Mock DB classes and re-tool MsSql2000 and MsSql2008DdlReaderTest
DescriptionMock database source classes and re-tool unit tests for MsSql2000DdlReaderTest and MsSql2008DdlReaderTest

Currently both of these unit tests are failing to to two factors:
* A recent change to read in custom User-Defied Types on MS SQL Server
* A very brittle nature of Mokito-based stubs and inability to effectively deal with a circular dependency Platform->DdlReader->Platform.

A solution is to abstract-away database communication and mock all queries from a single place:
the new MockDbDataSource class
Steps To Reproducerun .gradlew test from ./symmetric-ds/symmetric-assemble
Additional InformationCheck out jOOQ tools, specifically the https://github.com/jOOQ/jOOQ/blob/main/jOOQ/src/main/java/org/jooq/tools/jdbc/MockResultSet.java
Tagsquality engineering

Activities

pbelov

2025-03-07 18:20

manager   ~0002655

Merged PR https://github.com/JumpMind/symmetric-ds/pull/231

pbelov

2025-03-11 20:35

manager   ~0002663

Included in the 3.15.14 release

Related Changesets

SymmetricDS: 3.15 ad753180

2025-03-07 18:19:20

pbelov


Committer: GitHub Details Diff
0006744 New MockDbDataSource to mock queries + SQL Server unit tests. (0000231)

0006744 New MockDbDataSource to mock queries + SQL Server unit tests
Affected Issues
0006744
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/EmptyResultSet.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockDbConnection.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockDbDataSource.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockDbMetaData.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockDbPreparedStatement.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockDbStatement.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockDbUtils.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/mock/MockResultSet.java Diff File
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/mssql/MsSql2000DdlReaderTest.java Diff File
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/mssql/MsSql2008DdlReaderTest.java Diff File

Issue History

Date Modified Username Field Change
2025-03-06 21:10 pbelov New Issue
2025-03-06 21:10 pbelov Status new => assigned
2025-03-06 21:10 pbelov Assigned To => pbelov
2025-03-06 21:41 pbelov Tag Attached: quality engineering
2025-03-06 22:01 pbelov Additional Information Updated View Revisions
2025-03-07 18:20 pbelov Status assigned => resolved
2025-03-07 18:20 pbelov Resolution open => fixed
2025-03-07 18:20 pbelov Note Added: 0002655
2025-03-07 19:00 pbelov Changeset attached => SymmetricDS 3.15 ad753180
2025-03-11 20:35 pbelov Status resolved => closed
2025-03-11 20:35 pbelov Note Added: 0002663