[JAVA-2848] Testing framework should auto-detect the correct connection string if none is provided Created: 02/May/18  Updated: 28/Oct/23  Resolved: 03/May/18

Status: Closed
Project: Java Driver
Component/s: Test Coverage
Affects Version/s: None
Fix Version/s: 3.8.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It's annoying to have to specify a different org.mongodb.test.uri system property every time you want to test against a replica set, especially when executing single tests in an IDE. This could be made easier by having the testing framework (if no system property is provided) interrogate the server running at localhost:27017 to determine whether it's a replica set member, and if it is then change the default URI to mongodb://localhost/?replicaSet=<setName from isMaster response>.



 Comments   
Comment by Githook User [ 03/May/18 ]

Author:

{'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin', 'username': 'jyemin'}

Message: JAVA-2848: Make it easier to run tests with a replica set

If no org.mongodb.test.uri system property is provided,
try to figure out what it should be by interrogating the server at the
default host and port. If a setName is found in the response to an
isMaster command, make the uri "mongodb://localhost?/replicaSet=<setName>"
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2f4346122ba76b19f044b6012baee767ed91ff42

Generated at Thu Feb 08 08:58:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.