0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

start of SyncClusterConnection tests

This commit is contained in:
Eliot Horowitz 2010-02-28 20:40:36 -05:00
parent 63b5f7e470
commit c85b784793
2 changed files with 23 additions and 1 deletions

11
jstests/sharding/sync1.js Normal file
View File

@ -0,0 +1,11 @@
test = new SyncCCTest( "sync1" )
t = test.conn.getDB( "test" ).sync1
t.save( { x : 1 } )
assert.eq( 1 , t.find().itcount() , "A1" );
t.save( { x : 2 } )
assert.eq( 1 , t.find().itcount() , "A2" );
test.stop();

View File

@ -633,7 +633,18 @@ allocatePorts = function( n ) {
SyncCCTest = function( testName ){
this._connections = [];
for ( var i=0; i<3; i++ ){
this._connections.push( startMongodTest( 30000 + i , testName + i ) );
}
this.url = this._connections.map( function(z){ return z.name; } ).join( "," );
print( this.url );
}
SyncCCTest.prototype.stop = function(){
for ( var i=0; i<this._connections.length; i++){
stopMongod( 30000 + i );
}
}