~ubuntu-branches/ubuntu/trusty/mongodb/trusty-proposed

« back to all changes in this revision

Viewing changes to jstests/tool/exportimport1.js

  • Committer: Bazaar Package Importer
  • Author(s): Antonin Kral
  • Date: 2010-01-29 19:48:45 UTC
  • Revision ID: james.westby@ubuntu.com-20100129194845-8wbmkf626fwcavc9
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// exportimport1.js
 
2
 
 
3
t = new ToolTest( "exportimport1" );
 
4
 
 
5
c = t.startDB( "foo" );
 
6
assert.eq( 0 , c.count() , "setup1" );
 
7
c.save( { a : 22 } );
 
8
assert.eq( 1 , c.count() , "setup2" );
 
9
 
 
10
t.runTool( "export" , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
 
11
 
 
12
c.drop();
 
13
assert.eq( 0 , c.count() , "after drop" , "-d" , t.baseName , "-c" , "foo" );;
 
14
 
 
15
t.runTool( "import" , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
 
16
assert.soon( "c.findOne()" , "no data after sleep" );
 
17
assert.eq( 1 , c.count() , "after restore 2" );
 
18
assert.eq( 22 , c.findOne().a , "after restore 2" );
 
19
 
 
20
t.stop();