diff options
author | Benety Goh <benety@mongodb.com> | 2016-07-20 11:30:03 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-07-26 21:21:40 -0400 |
commit | 44eabe39a7208706c3a31e9483fd5218e40fb967 (patch) | |
tree | 58b0a5e13a8e485e4efaacdd1cd8cda8c06a1451 /src/mongo/db/repl/database_cloner_test.cpp | |
parent | 8dd8bdf4dcb990ccb31ee753eb5b1afa10071e14 (diff) | |
download | mongo-44eabe39a7208706c3a31e9483fd5218e40fb967.tar.gz |
SERVER-25281 renamed CollectionCloner and DatabaseCloner lifecycle functions
Diffstat (limited to 'src/mongo/db/repl/database_cloner_test.cpp')
-rw-r--r-- | src/mongo/db/repl/database_cloner_test.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/mongo/db/repl/database_cloner_test.cpp b/src/mongo/db/repl/database_cloner_test.cpp index 254c87206e7..77516249d51 100644 --- a/src/mongo/db/repl/database_cloner_test.cpp +++ b/src/mongo/db/repl/database_cloner_test.cpp @@ -187,7 +187,7 @@ TEST_F(DatabaseClonerTest, ClonerLifeCycle) { } TEST_F(DatabaseClonerTest, FirstRemoteCommandWithoutFilter) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); auto net = getNet(); executor::NetworkInterfaceMock::InNetworkGuard guard(net); @@ -218,7 +218,7 @@ TEST_F(DatabaseClonerTest, FirstRemoteCommandWithFilter) { stdx::placeholders::_1, stdx::placeholders::_2), stdx::bind(&DatabaseClonerTest::setStatus, this, stdx::placeholders::_1))); - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); auto net = getNet(); executor::NetworkInterfaceMock::InNetworkGuard guard(net); @@ -236,7 +236,7 @@ TEST_F(DatabaseClonerTest, FirstRemoteCommandWithFilter) { } TEST_F(DatabaseClonerTest, InvalidListCollectionsFilter) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); @@ -252,7 +252,7 @@ TEST_F(DatabaseClonerTest, InvalidListCollectionsFilter) { // A database may have no collections. Nothing to do for the database cloner. TEST_F(DatabaseClonerTest, ListCollectionsReturnedNoCollections) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); // Keep going even if initial batch is empty. { @@ -290,7 +290,7 @@ TEST_F(DatabaseClonerTest, ListCollectionsPredicate) { stdx::placeholders::_1, stdx::placeholders::_2), stdx::bind(&DatabaseClonerTest::setStatus, this, stdx::placeholders::_1))); - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); const std::vector<BSONObj> sourceInfos = {BSON("name" << "a" @@ -320,7 +320,7 @@ TEST_F(DatabaseClonerTest, ListCollectionsPredicate) { } TEST_F(DatabaseClonerTest, ListCollectionsMultipleBatches) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); const std::vector<BSONObj> sourceInfos = {BSON("name" << "a" @@ -362,7 +362,7 @@ TEST_F(DatabaseClonerTest, ListCollectionsMultipleBatches) { } TEST_F(DatabaseClonerTest, CollectionInfoNameFieldMissing) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse( @@ -374,7 +374,7 @@ TEST_F(DatabaseClonerTest, CollectionInfoNameFieldMissing) { } TEST_F(DatabaseClonerTest, CollectionInfoNameNotAString) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse(createListCollectionsResponse( @@ -386,7 +386,7 @@ TEST_F(DatabaseClonerTest, CollectionInfoNameNotAString) { } TEST_F(DatabaseClonerTest, CollectionInfoNameEmpty) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse(createListCollectionsResponse(0, @@ -401,7 +401,7 @@ TEST_F(DatabaseClonerTest, CollectionInfoNameEmpty) { } TEST_F(DatabaseClonerTest, CollectionInfoNameDuplicate) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse(createListCollectionsResponse(0, @@ -420,7 +420,7 @@ TEST_F(DatabaseClonerTest, CollectionInfoNameDuplicate) { } TEST_F(DatabaseClonerTest, CollectionInfoOptionsFieldMissing) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse(createListCollectionsResponse(0, @@ -433,7 +433,7 @@ TEST_F(DatabaseClonerTest, CollectionInfoOptionsFieldMissing) { } TEST_F(DatabaseClonerTest, CollectionInfoOptionsNotAnObject) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse(createListCollectionsResponse(0, @@ -448,7 +448,7 @@ TEST_F(DatabaseClonerTest, CollectionInfoOptionsNotAnObject) { } TEST_F(DatabaseClonerTest, InvalidCollectionOptions) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); processNetworkResponse( @@ -476,7 +476,7 @@ TEST_F(DatabaseClonerTest, ListCollectionsReturnsEmptyCollectionName) { stdx::placeholders::_1, stdx::placeholders::_2), stdx::bind(&DatabaseClonerTest::setStatus, this, stdx::placeholders::_1))); - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); { executor::NetworkInterfaceMock::InNetworkGuard guard(getNet()); @@ -492,7 +492,7 @@ TEST_F(DatabaseClonerTest, ListCollectionsReturnsEmptyCollectionName) { } TEST_F(DatabaseClonerTest, StartFirstCollectionClonerFailed) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); _databaseCloner->setStartCollectionClonerFn([](CollectionCloner& cloner) { return Status(ErrorCodes::OperationFailed, @@ -512,7 +512,7 @@ TEST_F(DatabaseClonerTest, StartFirstCollectionClonerFailed) { } TEST_F(DatabaseClonerTest, StartSecondCollectionClonerFailed) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); const Status errStatus{ErrorCodes::OperationFailed, "StartSecondCollectionClonerFailed injected failure."}; @@ -520,7 +520,7 @@ TEST_F(DatabaseClonerTest, StartSecondCollectionClonerFailed) { if (cloner.getSourceNamespace().coll() == "b") { return errStatus; } - return cloner.start(); + return cloner.startup(); }); { @@ -538,13 +538,13 @@ TEST_F(DatabaseClonerTest, StartSecondCollectionClonerFailed) { processNetworkResponse(createListIndexesResponse(0, BSON_ARRAY(idIndexSpec))); processNetworkResponse(createCursorResponse(0, BSONArray())); } - _databaseCloner->wait(); + _databaseCloner->join(); ASSERT_FALSE(_databaseCloner->isActive()); ASSERT_EQUALS(errStatus, getStatus()); } TEST_F(DatabaseClonerTest, FirstCollectionListIndexesFailed) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); const std::vector<BSONObj> sourceInfos = {BSON("name" << "a" @@ -574,7 +574,7 @@ TEST_F(DatabaseClonerTest, FirstCollectionListIndexesFailed) { processNetworkResponse(createListIndexesResponse(0, BSON_ARRAY(idIndexSpec))); processNetworkResponse(createCursorResponse(0, BSONArray())); } - _databaseCloner->wait(); + _databaseCloner->join(); ASSERT_EQ(getStatus().code(), ErrorCodes::InitialSyncFailure); ASSERT_FALSE(_databaseCloner->isActive()); @@ -594,7 +594,7 @@ TEST_F(DatabaseClonerTest, FirstCollectionListIndexesFailed) { } TEST_F(DatabaseClonerTest, CreateCollections) { - ASSERT_OK(_databaseCloner->start()); + ASSERT_OK(_databaseCloner->startup()); const std::vector<BSONObj> sourceInfos = {BSON("name" << "a" @@ -635,7 +635,7 @@ TEST_F(DatabaseClonerTest, CreateCollections) { processNetworkResponse(createCursorResponse(0, BSONArray())); } - _databaseCloner->wait(); + _databaseCloner->join(); ASSERT_OK(getStatus()); ASSERT_FALSE(_databaseCloner->isActive()); |