Created
July 5, 2013 17:09
-
-
Save trishagee/5935904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MongoClientURISpecification extends Specification { | |
def 'should correctly parse different write concerns'() { | |
expect: | |
uri.getOptions().getWriteConcern() == writeConcern; | |
where: | |
uri | writeConcern | |
new MongoClientURI('mongodb://localhost') | WriteConcern.ACKNOWLEDGED | |
new MongoClientURI('mongodb://localhost/?safe=true') | WriteConcern.ACKNOWLEDGED | |
new MongoClientURI('mongodb://localhost/?safe=false') | WriteConcern.UNACKNOWLEDGED | |
new MongoClientURI('mongodb://localhost/?wTimeout=5') | new WriteConcern(1, 5, false, false) | |
new MongoClientURI('mongodb://localhost/?fsync=true') | new WriteConcern(1, 0, true, false) | |
new MongoClientURI('mongodb://localhost/?j=true') | new WriteConcern(1, 0, false, true) | |
new MongoClientURI('mongodb://localhost/?w=2&wtimeout=5&fsync=true&j=true') | new WriteConcern(2, 5, true, true) | |
new MongoClientURI('mongodb://localhost/?w=majority&wtimeout=5&fsync=true&j=true') | new WriteConcern('majority', 5, true, true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment