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

« back to all changes in this revision

Viewing changes to jstests/tool/exportimport2.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
// exportimport2.js
 
2
 
 
3
t = new ToolTest( "exportimport2" );
 
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
t.stop();
 
10
 
 
11
t.runTool( "export" , "--dbpath" , t.dbpath , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
 
12
 
 
13
resetDbpath( t.dbpath );
 
14
assert.eq( 0 , listFiles( t.dbpath ).length , "clear" );
 
15
 
 
16
t.runTool( "import" , "--dbpath" , t.dbpath , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" );
 
17
 
 
18
c = t.startDB( "foo" );
 
19
assert.soon( "c.findOne()" , "no data after startup" );
 
20
assert.eq( 1 , c.count() , "after restore 2" );
 
21
assert.eq( 22 , c.findOne().a , "after restore 2" );
 
22
 
 
23
t.stop();
 
24