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/tool | |
parent | d4ac5673ea3f6cef4ce9dbcec90e31813997a528 (diff) | |
download | mongo-6dcdd23dd37ef12c87e71cf59ef01cd82432efe0.tar.gz |
SERVER-23971 Clang-Format code
Diffstat (limited to 'jstests/tool')
-rw-r--r-- | jstests/tool/csvimport1.js | 3 | ||||
-rw-r--r-- | jstests/tool/dumprestore7.js | 15 | ||||
-rw-r--r-- | jstests/tool/dumprestore8.js | 5 | ||||
-rw-r--r-- | jstests/tool/dumprestoreWithNoOptions.js | 18 | ||||
-rw-r--r-- | jstests/tool/dumprestore_auth3.js | 20 | ||||
-rw-r--r-- | jstests/tool/dumprestore_excludecollections.js | 74 | ||||
-rw-r--r-- | jstests/tool/exportimport_bigarray.js | 5 | ||||
-rw-r--r-- | jstests/tool/tool_replset.js | 13 |
8 files changed, 59 insertions, 94 deletions
diff --git a/jstests/tool/csvimport1.js b/jstests/tool/csvimport1.js index 28258bbe37f..0bcdcc8e789 100644 --- a/jstests/tool/csvimport1.js +++ b/jstests/tool/csvimport1.js @@ -17,8 +17,7 @@ base.push({ }); base.push({ a: 3, - b: - " This line contains the empty string and has leading and trailing whitespace inside the quotes! ", + b: " This line contains the empty string and has leading and trailing whitespace inside the quotes! ", "c": "" }); base.push({a: 4, b: "", "c": "How are empty entries handled?"}); diff --git a/jstests/tool/dumprestore7.js b/jstests/tool/dumprestore7.js index 0598e73c0a8..9235dd9c450 100644 --- a/jstests/tool/dumprestore7.js +++ b/jstests/tool/dumprestore7.js @@ -48,14 +48,13 @@ step("try mongodump with $timestamp"); var data = MongoRunner.dataDir + "/dumprestore7-dump1/"; var query = "{\"ts\":{\"$gt\":{\"$timestamp\":{\"t\":" + time.ts.t + ",\"i\":" + time.ts.i + "}}}}"; -MongoRunner.runMongoTool("mongodump", - { - "host": "127.0.0.1:" + replTest.ports[0], - "db": "local", - "collection": "oplog.rs", - "query": query, - "out": data - }); +MongoRunner.runMongoTool("mongodump", { + "host": "127.0.0.1:" + replTest.ports[0], + "db": "local", + "collection": "oplog.rs", + "query": query, + "out": data +}); step("try mongorestore from $timestamp"); diff --git a/jstests/tool/dumprestore8.js b/jstests/tool/dumprestore8.js index 9cdae87df80..4e76e8bd60c 100644 --- a/jstests/tool/dumprestore8.js +++ b/jstests/tool/dumprestore8.js @@ -31,9 +31,8 @@ db.bar.ensureIndex({x: 1}); barDocCount = db.bar.count(); assert.gt(barDocCount, 0, "No documents inserted"); assert.lt(db.bar.count(), 1000, "Capped collection didn't evict documents"); -assert.eq(5, - db.foo.getIndexes().length + db.bar.getIndexes().length, - "Indexes weren't created right"); +assert.eq( + 5, db.foo.getIndexes().length + db.bar.getIndexes().length, "Indexes weren't created right"); // Full dump/restore diff --git a/jstests/tool/dumprestoreWithNoOptions.js b/jstests/tool/dumprestoreWithNoOptions.js index 1062abd1e94..a1782d3ff7c 100644 --- a/jstests/tool/dumprestoreWithNoOptions.js +++ b/jstests/tool/dumprestoreWithNoOptions.js @@ -24,11 +24,7 @@ db.dropDatabase(); var defaultFlags = {}; -var options = { - capped: true, - size: 4096, - autoIndexId: true -}; +var options = {capped: true, size: 4096, autoIndexId: true}; db.createCollection('capped', options); assert.eq(1, db.capped.getIndexes().length, "auto index not created"); var cappedOptions = db.capped.exists().options; @@ -58,11 +54,7 @@ assert.eq(defaultFlags, // Dump/restore single DB db.dropDatabase(); -var options = { - capped: true, - size: 4096, - autoIndexId: true -}; +var options = {capped: true, size: 4096, autoIndexId: true}; db.createCollection('capped', options); assert.eq(1, db.capped.getIndexes().length, "auto index not created"); var cappedOptions = db.capped.exists().options; @@ -92,11 +84,7 @@ assert.eq(defaultFlags, // Dump/restore single collection db.dropDatabase(); -var options = { - capped: true, - size: 4096, - autoIndexId: true -}; +var options = {capped: true, size: 4096, autoIndexId: true}; db.createCollection('capped', options); assert.eq(1, db.capped.getIndexes().length, "auto index not created"); var cappedOptions = db.capped.exists().options; diff --git a/jstests/tool/dumprestore_auth3.js b/jstests/tool/dumprestore_auth3.js index b59c5c1a951..8fb70d2a91b 100644 --- a/jstests/tool/dumprestore_auth3.js +++ b/jstests/tool/dumprestore_auth3.js @@ -4,9 +4,7 @@ // Runs the tool with the given name against the given mongod. function runTool(toolName, mongod, options) { - var opts = { - host: mongod.host - }; + var opts = {host: mongod.host}; Object.extend(opts, options); MongoRunner.runMongoTool(toolName, opts); } @@ -138,15 +136,13 @@ var dumpRestoreAuth3 = function(backup_role, restore_role) { jsTestLog("Restore foo database (and user data) with --drop so it overrides the changes made"); // Restore with --drop to override the changes to user data - runTool("mongorestore", - mongod, - { - dir: dumpDir + "foo/", - db: 'foo', - drop: "", - restoreDbUsersAndRoles: "", - writeConcern: "0" - }); + runTool("mongorestore", mongod, { + dir: dumpDir + "foo/", + db: 'foo', + drop: "", + restoreDbUsersAndRoles: "", + writeConcern: "0" + }); db = mongod.getDB('foo'); admindb = mongod.getDB('admin'); diff --git a/jstests/tool/dumprestore_excludecollections.js b/jstests/tool/dumprestore_excludecollections.js index 4563b8ffc03..c3f18065ce3 100644 --- a/jstests/tool/dumprestore_excludecollections.js +++ b/jstests/tool/dumprestore_excludecollections.js @@ -23,37 +23,35 @@ ret = MongoRunner.runMongoTool("mongodump", assert.neq(ret, 0, "mongodump started successfully with --excludeCollection but no --db option"); resetDbpath(dumpDir); -ret = MongoRunner.runMongoTool("mongodump", - { - out: dumpDir, - db: testBaseName, - collection: "foo", - excludeCollection: "test", - host: mongodSource.host - }); +ret = MongoRunner.runMongoTool("mongodump", { + out: dumpDir, + db: testBaseName, + collection: "foo", + excludeCollection: "test", + host: mongodSource.host +}); assert.neq(ret, 0, "mongodump started successfully with --excludeCollection and --collection"); resetDbpath(dumpDir); ret = MongoRunner.runMongoTool( "mongodump", {out: dumpDir, excludeCollectionsWithPrefix: "test", host: mongodSource.host}); -assert.neq(ret, - 0, - "mongodump started successfully with --excludeCollectionsWithPrefix but " + - "no --db option"); +assert.neq( + ret, + 0, + "mongodump started successfully with --excludeCollectionsWithPrefix but " + "no --db option"); resetDbpath(dumpDir); -ret = MongoRunner.runMongoTool("mongodump", - { - out: dumpDir, - db: testBaseName, - collection: "foo", - excludeCollectionsWithPrefix: "test", - host: mongodSource.host - }); -assert.neq(ret, - 0, - "mongodump started successfully with --excludeCollectionsWithPrefix and " + - "--collection"); +ret = MongoRunner.runMongoTool("mongodump", { + out: dumpDir, + db: testBaseName, + collection: "foo", + excludeCollectionsWithPrefix: "test", + host: mongodSource.host +}); +assert.neq( + ret, + 0, + "mongodump started successfully with --excludeCollectionsWithPrefix and " + "--collection"); jsTest.log("Testing proper behavior of collection exclusion"); resetDbpath(dumpDir); @@ -75,13 +73,12 @@ assert.eq(destDB.foo2.findOne().f, 2, "Wrong value in document"); destDB.dropDatabase(); resetDbpath(dumpDir); -ret = MongoRunner.runMongoTool("mongodump", - { - out: dumpDir, - db: testBaseName, - excludeCollectionsWithPrefix: "test", - host: mongodSource.host - }); +ret = MongoRunner.runMongoTool("mongodump", { + out: dumpDir, + db: testBaseName, + excludeCollectionsWithPrefix: "test", + host: mongodSource.host +}); ret = MongoRunner.runMongoTool("mongorestore", {dir: dumpDir, host: mongodDest.host}); assert.eq(ret, 0, "failed to run mongodump on expected successful call"); @@ -95,14 +92,13 @@ assert.eq(destDB.foo2.findOne().f, 2, "Wrong value in document"); destDB.dropDatabase(); resetDbpath(dumpDir); -ret = MongoRunner.runMongoTool("mongodump", - { - out: dumpDir, - db: testBaseName, - excludeCollection: "foo", - excludeCollectionsWithPrefix: "test", - host: mongodSource.host - }); +ret = MongoRunner.runMongoTool("mongodump", { + out: dumpDir, + db: testBaseName, + excludeCollection: "foo", + excludeCollectionsWithPrefix: "test", + host: mongodSource.host +}); ret = MongoRunner.runMongoTool("mongorestore", {dir: dumpDir, host: mongodDest.host}); assert.eq(ret, 0, "failed to run mongodump on expected successful call"); diff --git a/jstests/tool/exportimport_bigarray.js b/jstests/tool/exportimport_bigarray.js index 0b801699d1b..60642b6afb1 100644 --- a/jstests/tool/exportimport_bigarray.js +++ b/jstests/tool/exportimport_bigarray.js @@ -11,10 +11,7 @@ dst.drop(); // Calculate the number of documents it takes to get above 16MB (here using 20MB just to be safe) var bigString = new Array(1025).toString(); -var doc = { - _id: new ObjectId(), - x: bigString -}; +var doc = {_id: new ObjectId(), x: bigString}; var docSize = Object.bsonsize(doc); var numDocs = Math.floor(20 * 1024 * 1024 / docSize); diff --git a/jstests/tool/tool_replset.js b/jstests/tool/tool_replset.js index efe55b46605..3b0338a02d4 100644 --- a/jstests/tool/tool_replset.js +++ b/jstests/tool/tool_replset.js @@ -67,17 +67,8 @@ var x = master.getDB("foo").getCollection("bar").count(); assert.eq(x, 100, "mongoimport should have successfully imported the collection"); - var doc = { - _id: 5, - x: 17 - }; - var oplogEntry = { - ts: new Timestamp(), - "op": "i", - "ns": "foo.bar", - "o": doc, - "v": NumberInt(2) - }; + var doc = {_id: 5, x: 17}; + var oplogEntry = {ts: new Timestamp(), "op": "i", "ns": "foo.bar", "o": doc, "v": NumberInt(2)}; assert.writeOK(master.getDB("local").oplog.rs.insert(oplogEntry)); assert.eq(100, |