summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/test/legacy28/jstests/tool/exportimport3.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/test/legacy28/jstests/tool/exportimport3.js')
-rw-r--r--src/mongo/gotools/test/legacy28/jstests/tool/exportimport3.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mongo/gotools/test/legacy28/jstests/tool/exportimport3.js b/src/mongo/gotools/test/legacy28/jstests/tool/exportimport3.js
new file mode 100644
index 00000000000..4f0fdd46609
--- /dev/null
+++ b/src/mongo/gotools/test/legacy28/jstests/tool/exportimport3.js
@@ -0,0 +1,28 @@
+// exportimport3.js
+
+
+t = new ToolTest( "exportimport3" );
+
+c = t.startDB( "foo" );
+assert.eq( 0 , c.count() , "setup1" );
+c.save({a:1})
+c.save({a:2})
+c.save({a:3})
+c.save({a:4})
+c.save({a:5})
+
+assert.eq( 5 , c.count() , "setup2" );
+
+
+t.runTool( "export" , "--jsonArray" , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
+
+c.drop();
+assert.eq( 0 , c.count() , "after drop" , "-d" , t.baseName , "-c" , "foo" );;
+
+t.runTool( "import" , "--jsonArray" , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
+
+assert.soon( "c.findOne()" , "no data after sleep" );
+assert.eq( 5 , c.count() , "after restore 2" );
+
+
+t.stop();