diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-05-28 17:55:12 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-05-28 17:55:12 -0400 |
commit | 6dcdd23dd37ef12c87e71cf59ef01cd82432efe0 (patch) | |
tree | c8cfb5acb62c80f375bc37e7d4350382deea6a37 /jstests/noPassthroughWithMongod/rpc_protocols.js | |
parent | d4ac5673ea3f6cef4ce9dbcec90e31813997a528 (diff) | |
download | mongo-6dcdd23dd37ef12c87e71cf59ef01cd82432efe0.tar.gz |
SERVER-23971 Clang-Format code
Diffstat (limited to 'jstests/noPassthroughWithMongod/rpc_protocols.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/rpc_protocols.js | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/jstests/noPassthroughWithMongod/rpc_protocols.js b/jstests/noPassthroughWithMongod/rpc_protocols.js index 7e33c3986d3..9650d57e421 100644 --- a/jstests/noPassthroughWithMongod/rpc_protocols.js +++ b/jstests/noPassthroughWithMongod/rpc_protocols.js @@ -4,10 +4,7 @@ // startup using the "--rpcProtocols" command line option, or at runtime using the // "setClientRPCProtocols" method on the Mongo object. -var RPC_PROTOCOLS = { - OP_QUERY: "opQueryOnly", - OP_COMMAND: "opCommandOnly" -}; +var RPC_PROTOCOLS = {OP_QUERY: "opQueryOnly", OP_COMMAND: "opCommandOnly"}; (function() { "use strict"; @@ -28,50 +25,43 @@ var RPC_PROTOCOLS = { } // Test that --rpcProtocols=opQueryOnly forces OP_QUERY commands. - runInShell( - RPC_PROTOCOLS.OP_QUERY, - function() { - assert(db.getMongo().getClientRPCProtocols() === "opQueryOnly"); - db.getSiblingDB("test").rpcProtocols.find().comment("opQueryCommandLine").itcount(); - }); + runInShell(RPC_PROTOCOLS.OP_QUERY, function() { + assert(db.getMongo().getClientRPCProtocols() === "opQueryOnly"); + db.getSiblingDB("test").rpcProtocols.find().comment("opQueryCommandLine").itcount(); + }); var profileDoc = db.system.profile.findOne({"query.comment": "opQueryCommandLine"}); assert(profileDoc !== null); assert.eq(profileDoc.protocol, "op_query"); // Test that --rpcProtocols=opCommandOnly forces OP_COMMAND commands. - runInShell( - RPC_PROTOCOLS.OP_COMMAND, - function() { - assert(db.getMongo().getClientRPCProtocols() === "opCommandOnly"); - db.getSiblingDB("test").rpcProtocols.find().comment("opCommandCommandLine").itcount(); - }); + runInShell(RPC_PROTOCOLS.OP_COMMAND, function() { + assert(db.getMongo().getClientRPCProtocols() === "opCommandOnly"); + db.getSiblingDB("test").rpcProtocols.find().comment("opCommandCommandLine").itcount(); + }); profileDoc = db.system.profile.findOne({"query.comment": "opCommandCommandLine"}); assert(profileDoc !== null); assert.eq(profileDoc.protocol, "op_command"); // Test that .setClientRPCProtocols("opQueryOnly") forces OP_QUERY commands. We start the shell // in OP_COMMAND only mode, then switch it to OP_QUERY mode at runtime. - runInShell(RPC_PROTOCOLS.OP_COMMAND, - function() { - assert(db.getMongo().getClientRPCProtocols() === "opCommandOnly"); - db.getMongo().setClientRPCProtocols("opQueryOnly"); - assert(db.getMongo().getClientRPCProtocols() === "opQueryOnly"); - db.getSiblingDB("test").rpcProtocols.find().comment("opQueryRuntime").itcount(); - }); + runInShell(RPC_PROTOCOLS.OP_COMMAND, function() { + assert(db.getMongo().getClientRPCProtocols() === "opCommandOnly"); + db.getMongo().setClientRPCProtocols("opQueryOnly"); + assert(db.getMongo().getClientRPCProtocols() === "opQueryOnly"); + db.getSiblingDB("test").rpcProtocols.find().comment("opQueryRuntime").itcount(); + }); profileDoc = db.system.profile.findOne({"query.comment": "opQueryRuntime"}); assert(profileDoc !== null); assert.eq(profileDoc.protocol, "op_query"); // Test that .setClientRPCProtocols("opCommandOnly") forces OP_COMMAND commands. We start the // shell in OP_QUERY only mode, then switch it to OP_COMMAND mode at runtime. - runInShell( - RPC_PROTOCOLS.OP_QUERY, - function() { - assert(db.getMongo().getClientRPCProtocols() === "opQueryOnly"); - db.getMongo().setClientRPCProtocols("opCommandOnly"); - assert(db.getMongo().getClientRPCProtocols() === "opCommandOnly"); - db.getSiblingDB("test").rpcProtocols.find().comment("opCommandRuntime").itcount(); - }); + runInShell(RPC_PROTOCOLS.OP_QUERY, function() { + assert(db.getMongo().getClientRPCProtocols() === "opQueryOnly"); + db.getMongo().setClientRPCProtocols("opCommandOnly"); + assert(db.getMongo().getClientRPCProtocols() === "opCommandOnly"); + db.getSiblingDB("test").rpcProtocols.find().comment("opCommandRuntime").itcount(); + }); profileDoc = db.system.profile.findOne({"query.comment": "opCommandRuntime"}); assert(profileDoc !== null); assert.eq(profileDoc.protocol, "op_command"); |