You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2016/03/24 18:24:28 UTC

[3/9] mesos git commit: Enabled mocking on `TestContainerizer::destroy`.

Enabled mocking on `TestContainerizer::destroy`.

Review: https://reviews.apache.org/r/44991/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4aba78e8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4aba78e8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4aba78e8

Branch: refs/heads/master
Commit: 4aba78e855108b8e5d7c0631ad6d007814a2ffa9
Parents: 52cba1d
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Thu Mar 24 17:29:54 2016 +0100
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Thu Mar 24 18:21:01 2016 +0100

----------------------------------------------------------------------
 src/tests/containerizer.cpp | 7 +++++--
 src/tests/containerizer.hpp | 8 ++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4aba78e8/src/tests/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer.cpp b/src/tests/containerizer.cpp
index c6772ce..4c7f5a2 100644
--- a/src/tests/containerizer.cpp
+++ b/src/tests/containerizer.cpp
@@ -244,11 +244,11 @@ void TestContainerizer::destroy(
                  << executorId << "' of framework " << frameworkId;
     return;
   }
-  destroy(containers_[key]);
+  _destroy(containers_[key]);
 }
 
 
-void TestContainerizer::destroy(const ContainerID& containerId)
+void TestContainerizer::_destroy(const ContainerID& containerId)
 {
   if (drivers.contains(containerId)) {
     Owned<MesosExecutorDriver> driver = drivers[containerId];
@@ -305,6 +305,9 @@ void TestContainerizer::setup()
 
   EXPECT_CALL(*this, wait(_))
     .WillRepeatedly(Invoke(this, &TestContainerizer::_wait));
+
+  EXPECT_CALL(*this, destroy(_))
+    .WillRepeatedly(Invoke(this, &TestContainerizer::_destroy));
 }
 
 } // namespace tests {

http://git-wip-us.apache.org/repos/asf/mesos/blob/4aba78e8/src/tests/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer.hpp b/src/tests/containerizer.hpp
index 67fbe7f..60ba9a7 100644
--- a/src/tests/containerizer.hpp
+++ b/src/tests/containerizer.hpp
@@ -96,8 +96,6 @@ public:
   // ContainerID created for each container.
   void destroy(const FrameworkID& frameworkId, const ExecutorID& executorId);
 
-  virtual void destroy(const ContainerID& containerId);
-
   virtual process::Future<hashset<ContainerID> > containers();
 
   MOCK_METHOD1(
@@ -116,6 +114,10 @@ public:
       wait,
       process::Future<containerizer::Termination>(const ContainerID&));
 
+  MOCK_METHOD1(
+      destroy,
+      void(const ContainerID&));
+
 private:
   void setup();
 
@@ -132,6 +134,8 @@ private:
   process::Future<containerizer::Termination> _wait(
       const ContainerID& containerId);
 
+  void _destroy(const ContainerID& containerID);
+
   hashmap<ExecutorID, Executor*> executors;
   hashmap<ExecutorID, std::shared_ptr<MockV1HTTPExecutor>> v1Executors;