summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h')
-rw-r--r--src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h104
1 files changed, 52 insertions, 52 deletions
diff --git a/src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h b/src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h
index 05a5dcf4e1f..9331f44ad4f 100644
--- a/src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h
+++ b/src/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture.h
@@ -36,74 +36,74 @@
namespace mongo {
- class BSONObj;
- class CatalogManagerReplicaSet;
- class DistLockManagerMock;
- struct RemoteCommandRequest;
- class RemoteCommandRunnerMock;
- class ShardRegistry;
- template<typename T> class StatusWith;
+class BSONObj;
+class CatalogManagerReplicaSet;
+class DistLockManagerMock;
+struct RemoteCommandRequest;
+class RemoteCommandRunnerMock;
+class ShardRegistry;
+template <typename T>
+class StatusWith;
namespace executor {
- class NetworkInterfaceMock;
+class NetworkInterfaceMock;
-} // namespace executor
+} // namespace executor
+/**
+ * Sets up the mocked out objects for testing the replica-set backed catalog manager.
+ */
+class CatalogManagerReplSetTestFixture : public mongo::unittest::Test {
+public:
+ CatalogManagerReplSetTestFixture();
+ ~CatalogManagerReplSetTestFixture();
+
+protected:
/**
- * Sets up the mocked out objects for testing the replica-set backed catalog manager.
+ * Shortcut function to be used for generating mock responses to network requests.
+ *
+ * @param dbName Name of the database for which this request came.
+ * @param cmdObj Contents of the request.
+ *
+ * Return the BSON object representing the response(s) or an error, which will be passed
+ * back on the network.
*/
- class CatalogManagerReplSetTestFixture : public mongo::unittest::Test {
- public:
- CatalogManagerReplSetTestFixture();
- ~CatalogManagerReplSetTestFixture();
+ using OnCommandFunction = std::function<StatusWith<BSONObj>(const RemoteCommandRequest&)>;
- protected:
- /**
- * Shortcut function to be used for generating mock responses to network requests.
- *
- * @param dbName Name of the database for which this request came.
- * @param cmdObj Contents of the request.
- *
- * Return the BSON object representing the response(s) or an error, which will be passed
- * back on the network.
- */
- using OnCommandFunction =
- std::function<StatusWith<BSONObj>(const RemoteCommandRequest&)>;
+ using OnFindCommandFunction =
+ std::function<StatusWith<std::vector<BSONObj>>(const RemoteCommandRequest&)>;
- using OnFindCommandFunction =
- std::function<StatusWith<std::vector<BSONObj>>(const RemoteCommandRequest&)>;
+ CatalogManagerReplicaSet* catalogManager() const;
- CatalogManagerReplicaSet* catalogManager() const;
+ ShardRegistry* shardRegistry() const;
- ShardRegistry* shardRegistry() const;
+ RemoteCommandRunnerMock* commandRunner() const;
- RemoteCommandRunnerMock* commandRunner() const;
+ executor::NetworkInterfaceMock* network() const;
- executor::NetworkInterfaceMock* network() const;
+ DistLockManagerMock* distLock() const;
- DistLockManagerMock* distLock() const;
-
- /**
- * Blocking methods, which receive one message from the network and respond using the
- * responses returned from the input function. This is a syntactic sugar for simple,
- * single request + response or find tests.
- */
- void onCommand(OnCommandFunction func);
- void onFindCommand(OnFindCommandFunction func);
+ /**
+ * Blocking methods, which receive one message from the network and respond using the
+ * responses returned from the input function. This is a syntactic sugar for simple,
+ * single request + response or find tests.
+ */
+ void onCommand(OnCommandFunction func);
+ void onFindCommand(OnFindCommandFunction func);
- private:
- void setUp() override;
+private:
+ void setUp() override;
- void tearDown() override;
+ void tearDown() override;
- // Mocked out network under the task executor. This pointer is owned by the executor on
- // the ShardRegistry, so it must not be accessed once the executor has been shut down.
- executor::NetworkInterfaceMock* _mockNetwork;
+ // Mocked out network under the task executor. This pointer is owned by the executor on
+ // the ShardRegistry, so it must not be accessed once the executor has been shut down.
+ executor::NetworkInterfaceMock* _mockNetwork;
- // Thread used to execute the task executor's loop. This thread will be busy until the
- // shutdown is called on the shard registry's task executor.
- std::thread _executorThread;
- };
+ // Thread used to execute the task executor's loop. This thread will be busy until the
+ // shutdown is called on the shard registry's task executor.
+ std::thread _executorThread;
+};
-} // namespace mongo
+} // namespace mongo