Skip to content

Commit

Permalink
Convert legacy retryable reads tests to unified format
Browse files Browse the repository at this point in the history
* Use "mapReduce" instead of "mapreduce" for the command name,
  as documented, and as expected by the tests.

JAVA-5344
  • Loading branch information
jyemin committed Mar 6, 2024
1 parent 03746fa commit 8563778
Show file tree
Hide file tree
Showing 98 changed files with 24,825 additions and 18,841 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private BsonDocument getCommand(@Nullable final ConnectionDescription descriptio
if (getDatabaseName() != null) {
outputDocument.put("db", new BsonString(getDatabaseName()));
}
BsonDocument commandDocument = new BsonDocument("mapreduce", new BsonString(namespace.getCollectionName()))
BsonDocument commandDocument = new BsonDocument("mapReduce", new BsonString(namespace.getCollectionName()))
.append("map", getMapFunction())
.append("reduce", getReduceFunction())
.append("out", outputDocument);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private CommandCreator getCommandCreator(final SessionContext sessionContext) {
}

private BsonDocument getCommand(final SessionContext sessionContext, final int maxWireVersion) {
BsonDocument commandDocument = new BsonDocument("mapreduce", new BsonString(namespace.getCollectionName()))
BsonDocument commandDocument = new BsonDocument("mapReduce", new BsonString(namespace.getCollectionName()))
.append("map", getMapFunction())
.append("reduce", getReduceFunction())
.append("out", new BsonDocument("inline", new BsonInt32(1)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class MapReduceToCollectionOperationSpecification extends OperationFunctionalSpe

when:
def operation = new MapReduceToCollectionOperation(getNamespace(), mapF, reduceF, out, WriteConcern.MAJORITY)
def expectedCommand = new BsonDocument('mapreduce', new BsonString(getCollectionName()))
def expectedCommand = new BsonDocument('mapReduce', new BsonString(getCollectionName()))
.append('map', mapF)
.append('reduce', reduceF)
.append('out', BsonDocument.parse('{replace: "outCollection"}'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction
when:
def operation = new MapReduceWithInlineResultsOperation<Document>(helper.namespace, new BsonJavaScript('function(){ }'),
new BsonJavaScript('function(key, values){ }'), bsonDocumentCodec)
def expectedCommand = new BsonDocument('mapreduce', new BsonString(helper.namespace.getCollectionName()))
def expectedCommand = new BsonDocument('mapReduce', new BsonString(helper.namespace.getCollectionName()))
.append('map', operation.getMapFunction())
.append('reduce', operation.getReduceFunction())
.append('out', new BsonDocument('inline', new BsonInt32(1)))
Expand Down Expand Up @@ -235,7 +235,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction
source.retain() >> source
source.getServerApi() >> null
def commandDocument = BsonDocument.parse('''
{ "mapreduce" : "coll",
{ "mapReduce" : "coll",
"map" : { "$code" : "function(){ }" },
"reduce" : { "$code" : "function(key, values){ }" },
"out" : { "inline" : 1 },
Expand Down Expand Up @@ -284,7 +284,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction
source.getConnection(_) >> { it[0].onResult(connection, null) }
source.retain() >> source
def commandDocument = BsonDocument.parse('''
{ "mapreduce" : "coll",
{ "mapReduce" : "coll",
"map" : { "$code" : "function(){ }" },
"reduce" : { "$code" : "function(key, values){ }" },
"out" : { "inline" : 1 },
Expand Down
178 changes: 0 additions & 178 deletions driver-core/src/test/resources/retryable-reads/README.rst

This file was deleted.

This file was deleted.

0 comments on commit 8563778

Please sign in to comment.