You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jp...@apache.org on 2018/07/17 16:00:16 UTC

mesos git commit: Removed unused `TestStore` mock.

Repository: mesos
Updated Branches:
  refs/heads/master bc864cd95 -> 4e5e72616


Removed unused `TestStore` mock.

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


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

Branch: refs/heads/master
Commit: 4e5e72616b2d48a01401c4ba5992c144b6dba1a1
Parents: bc864cd
Author: James Peach <jp...@apache.org>
Authored: Tue Jul 17 08:37:19 2018 -0700
Committer: James Peach <jp...@apache.org>
Committed: Tue Jul 17 08:37:19 2018 -0700

----------------------------------------------------------------------
 src/Makefile.am                   |  1 -
 src/tests/containerizer/store.hpp | 96 ----------------------------------
 2 files changed, 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4e5e7261/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 228e168..ecb95ef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2639,7 +2639,6 @@ mesos_tests_SOURCES =						\
   tests/containerizer/provisioner_paths_tests.cpp		\
   tests/containerizer/rootfs.hpp				\
   tests/containerizer/setns_test_helper.hpp			\
-  tests/containerizer/store.hpp					\
   tests/containerizer/volume_sandbox_path_isolator_tests.cpp
 
 if ENABLE_GRPC

http://git-wip-us.apache.org/repos/asf/mesos/blob/4e5e7261/src/tests/containerizer/store.hpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/store.hpp b/src/tests/containerizer/store.hpp
deleted file mode 100644
index 0589be6..0000000
--- a/src/tests/containerizer/store.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef __TEST_STORE_HPP__
-#define __TEST_STORE_HPP__
-
-#include <gmock/gmock.h>
-
-#include <stout/option.hpp>
-
-#include <process/future.hpp>
-#include <process/shared.hpp>
-
-#include "slave/containerizer/mesos/provisioner/store.hpp"
-
-#include "tests/containerizer/rootfs.hpp"
-
-namespace mesos {
-namespace internal {
-namespace tests {
-
-class TestStore : public slave::Store
-{
-public:
-  TestStore(const hashmap<std::string, process::Shared<Rootfs>>& _rootfses)
-      : rootfses(_rootfses)
-  {
-    using testing::_;
-    using testing::DoDefault;
-    using testing::Invoke;
-
-    ON_CALL(*this, recover())
-      .WillByDefault(Invoke(this, &TestStore::unmocked_recover));
-    EXPECT_CALL(*this, recover())
-      .WillRepeatedly(DoDefault());
-
-    ON_CALL(*this, get(_, _))
-      .WillByDefault(Invoke(this, &TestStore::unmocked_get));
-    EXPECT_CALL(*this, get(_, _))
-      .WillRepeatedly(DoDefault());
-  }
-
-  MOCK_METHOD0(
-      recover,
-      process::Future<Nothing>());
-
-  MOCK_METHOD1(
-      get,
-      process::Future<slave::ImageInfo>(
-          const Image& image,
-          const std::string& backend));
-
-  process::Future<Nothing> unmocked_recover()
-  {
-    return Nothing();
-  }
-
-  process::Future<slave::ImageInfo> unmocked_get(
-      const Image& image,
-      const std::string& backend)
-  {
-    if (!image.has_appc()) {
-      return process::Failure("Expecting APPC image");
-    }
-
-    Option<process::Shared<Rootfs>> rootfs = rootfses.at(image.appc().name());
-    if (rootfs.isSome()) {
-      return slave::ImageInfo{
-          std::vector<std::string>({rootfs.get()->root}), None()};
-    }
-
-    return process::Failure("Cannot find image '" + image.appc().name());
-  }
-
-private:
-  hashmap<std::string, process::Shared<Rootfs>> rootfses;
-};
-
-} // namespace tests {
-} // namespace internal {
-} // namespace mesos {
-
-#endif // __TEST_STORE_HPP__