Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Unified Diff: src/ObjectFinderTest.cc

Issue 231001: missing files from previous commit add
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ObjectFinder.cc ('k') | src/TableManager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ObjectFinderTest.cc
diff --git a/src/ObjectFinderTest.cc b/src/ObjectFinderTest.cc
index 6582f1e2d4aa9d8017bb85a3a5722fc656b44bce..6553dd29c3f4de24ea4951117fedbcd5bb62326a 100644
--- a/src/ObjectFinderTest.cc
+++ b/src/ObjectFinderTest.cc
@@ -97,27 +97,35 @@ class ObjectFinderTest : public ::testing::Test {
DISALLOW_COPY_AND_ASSIGN(ObjectFinderTest);
};
-/*
+
TEST_F(ObjectFinderTest, lookupTablet) {
// first tableMap is empty, throws TableDoesntExistException
- EXPECT_THROW(Transport::SessionRef
- session0(objectFinder->lookup(10, "foo", 9)),
- TableDoesntExistException);
-
- // tablet map in operation
- Transport::SessionRef session2(objectFinder->lookup(1, "testKey", 7));
- // find tablet in operation
- EXPECT_EQ(3U, refresher->called);
- EXPECT_EQ("mock:host=server0",
+ EXPECT_THROW(Transport::SessionRef session1(
+ objectFinder->lookup(10, "testKey", 7)),
+ TableDoesntExistException);
+
+ // find if a random tablet is in the map;
+ Transport::SessionRef session2(objectFinder->lookup(2, "testKey", 7));
+ EXPECT_EQ(1U, refresher->called);
+ EXPECT_EQ("mock:host=server1",
static_cast<BindTransport::BindSession*>(session2.get())->
getServiceLocator());
- // tablet map in operation
- Transport::SessionRef session3(objectFinder->lookup(2, "testKey", 7));
- EXPECT_EQ(4U, refresher->called);
+
+ // now test the flush(tableId) method
+ objectFinder->flush(1);
+ // expect lookup to throw TableDoesntExistException
+ EXPECT_THROW(Transport::SessionRef session3(
+ objectFinder->lookup(1, "testKey", 7)),
+ TableDoesntExistException);
+
+ // once more lookup method:
+ Transport::SessionRef session4(objectFinder->lookup(2, "testKey", 7));
+ EXPECT_EQ(2U, refresher->called);
EXPECT_EQ("mock:host=server1",
- static_cast<BindTransport::BindSession*>(session3.get())->
+ static_cast<BindTransport::BindSession*>(session4.get())->
getServiceLocator());
+
}
-*/
+
}
// namespace RAMCloud
« no previous file with comments | « src/ObjectFinder.cc ('k') | src/TableManager.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld aab5469