summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2017-12-19 15:13:58 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2017-12-19 17:29:29 -0500
commita318fd1bc13e59a87def8de0061a08ec0dd134eb (patch)
tree55fc10b1fe53d07a802aa5a40a643d8b6d27c921 /src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
parentb5a2cc0fec6ac30b1a0196da5feb41d85a8b76c3 (diff)
downloadmongo-a318fd1bc13e59a87def8de0061a08ec0dd134eb.tar.gz
SERVER-32190 Shorten MongoDProcessInterface to MongoDInterface.
Similarly shorten other similar MongoProcessInterface implementation's names, e.g. MongoSProcessInterface -> MongoSInterface and MockMongoProcessInterface -> MockMongoInterface.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_check_resume_token_test.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_check_resume_token_test.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp b/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
index b4dce391492..cf1267eeb03 100644
--- a/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
+++ b/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
@@ -213,9 +213,9 @@ TEST_F(CheckResumeTokenTest, ShouldSucceedWithNoDocuments) {
/**
* A mock MongoProcessInterface which allows mocking a foreign pipeline.
*/
-class MockMongoProcessInterface final : public StubMongoProcessInterface {
+class MockMongoInterface final : public StubMongoProcessInterface {
public:
- MockMongoProcessInterface(deque<DocumentSource::GetNextResult> mockResults)
+ MockMongoInterface(deque<DocumentSource::GetNextResult> mockResults)
: _mockResults(std::move(mockResults)) {}
bool isSharded(OperationContext* opCtx, const NamespaceString& ns) final {
@@ -259,7 +259,7 @@ TEST_F(ShardCheckResumabilityTest,
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
addDocument(resumeTimestamp, "ID");
// We should see the resume token.
auto result = shardCheckResumability->getNext();
@@ -275,7 +275,7 @@ TEST_F(ShardCheckResumabilityTest,
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
addDocument(resumeTimestamp, "ID");
// We should see the resume token.
auto result = shardCheckResumability->getNext();
@@ -289,7 +289,7 @@ TEST_F(ShardCheckResumabilityTest, ShouldSucceedIfResumeTokenIsPresentAndOplogIs
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog;
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
addDocument(resumeTimestamp, "ID");
// We should see the resume token.
auto result = shardCheckResumability->getNext();
@@ -305,7 +305,7 @@ TEST_F(ShardCheckResumabilityTest,
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result = shardCheckResumability->getNext();
ASSERT_TRUE(result.isEOF());
}
@@ -317,7 +317,7 @@ TEST_F(ShardCheckResumabilityTest,
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
ASSERT_THROWS_CODE(shardCheckResumability->getNext(), AssertionException, 40576);
}
@@ -326,7 +326,7 @@ TEST_F(ShardCheckResumabilityTest, ShouldSucceedWithNoDocumentsInPipelineAndOplo
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
deque<DocumentSource::GetNextResult> mockOplog;
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result = shardCheckResumability->getNext();
ASSERT_TRUE(result.isEOF());
}
@@ -340,7 +340,7 @@ TEST_F(ShardCheckResumabilityTest,
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
addDocument(docTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result = shardCheckResumability->getNext();
ASSERT_TRUE(result.isAdvanced());
auto& doc = result.getDocument();
@@ -356,7 +356,7 @@ TEST_F(ShardCheckResumabilityTest,
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
addDocument(docTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
ASSERT_THROWS_CODE(shardCheckResumability->getNext(), AssertionException, 40576);
}
@@ -369,14 +369,14 @@ TEST_F(ShardCheckResumabilityTest, ShouldIgnoreOplogAfterFirstDoc) {
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
addDocument(docTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result1 = shardCheckResumability->getNext();
ASSERT_TRUE(result1.isAdvanced());
auto& doc1 = result1.getDocument();
ASSERT_EQ(docTimestamp, ResumeToken::parse(doc1["_id"].getDocument()).getData().clusterTime);
mockOplog = {Document{{"ts", oplogFutureTimestamp}}};
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result2 = shardCheckResumability->getNext();
ASSERT_TRUE(result2.isEOF());
}
@@ -391,7 +391,7 @@ TEST_F(ShardCheckResumabilityTest, ShouldSucceedWhenOplogEntriesExistBeforeAndAf
addDocument(docTimestamp, "ID");
deque<DocumentSource::GetNextResult> mockOplog(
{{Document{{"ts", oplogTimestamp}}}, {Document{{"ts", oplogFutureTimestamp}}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result1 = shardCheckResumability->getNext();
ASSERT_TRUE(result1.isAdvanced());
auto& doc1 = result1.getDocument();
@@ -407,12 +407,12 @@ TEST_F(ShardCheckResumabilityTest, ShouldIgnoreOplogAfterFirstEOF) {
auto shardCheckResumability = createShardCheckResumability(resumeTimestamp, "0");
deque<DocumentSource::GetNextResult> mockOplog({Document{{"ts", oplogTimestamp}}});
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result1 = shardCheckResumability->getNext();
ASSERT_TRUE(result1.isEOF());
mockOplog = {Document{{"ts", oplogFutureTimestamp}}};
- getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoProcessInterface>(mockOplog);
+ getExpCtx()->mongoProcessInterface = std::make_shared<MockMongoInterface>(mockOplog);
auto result2 = shardCheckResumability->getNext();
ASSERT_TRUE(result2.isEOF());
}