Apache Mesos
mock_containerizer.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #include <map>
18 #include <string>
19 
20 #include <gmock/gmock.h>
21 
22 #include <mesos/mesos.hpp>
23 #include <mesos/resources.hpp>
24 
26 
27 #include <process/future.hpp>
28 #include <process/gmock.hpp>
29 #include <process/http.hpp>
30 
31 #include <stout/hashset.hpp>
32 #include <stout/nothing.hpp>
33 #include <stout/option.hpp>
34 
36 
37 namespace mesos {
38 namespace internal {
39 namespace tests {
40 
42 {
43 public:
45  recover,
48 
50  launch,
52  const ContainerID&,
53  const mesos::slave::ContainerConfig&,
54  const std::map<std::string, std::string>&,
55  const Option<std::string>&));
56 
58  attach,
59  process::Future<process::http::Connection>(const ContainerID&));
60 
62  update,
64  const ContainerID&,
65  const Resources&,
66  const google::protobuf::Map<std::string, Value::Scalar>&));
67 
69  usage,
71  const ContainerID&));
72 
74  wait,
76  const ContainerID&));
77 
79  destroy,
81  const ContainerID&));
82 
84  containers,
86 
90  const std::vector<Image>&));
91 };
92 
93 } // namespace tests {
94 } // namespace internal {
95 } // namespace mesos {
virtual process::Future< Nothing > update(const ContainerID &containerId, const Resources &resourceRequests, const google::protobuf::Map< std::string, Value::Scalar > &resourceLimits={})=0
Definition: option.hpp:29
Definition: mock_containerizer.hpp:41
Definition: resources.hpp:83
virtual process::Future< LaunchResult > launch(const ContainerID &containerId, const mesos::slave::ContainerConfig &containerConfig, const std::map< std::string, std::string > &environment, const Option< std::string > &pidCheckpointPath)=0
MOCK_METHOD3(update, process::Future< Nothing >(const ContainerID &, const Resources &, const google::protobuf::Map< std::string, Value::Scalar > &))
virtual process::Future< Nothing > recover(const Option< state::SlaveState > &state)=0
Definition: containerizer.hpp:64
Definition: agent.hpp:25
virtual process::Future< process::http::Connection > attach(const ContainerID &containerId)
Definition: containerizer.hpp:115
Definition: attributes.hpp:24
virtual process::Future< hashset< ContainerID > > containers()=0
virtual process::Future< ResourceStatistics > usage(const ContainerID &containerId)=0
MOCK_METHOD4(launch, process::Future< slave::Containerizer::LaunchResult >(const ContainerID &, const mesos::slave::ContainerConfig &, const std::map< std::string, std::string > &, const Option< std::string > &))
MOCK_METHOD0(containers, process::Future< hashset< ContainerID >>())
virtual process::Future< Option< mesos::slave::ContainerTermination > > wait(const ContainerID &containerId)=0
virtual process::Future< Nothing > pruneImages(const std::vector< Image > &excludedImages)=0
virtual process::Future< Option< mesos::slave::ContainerTermination > > destroy(const ContainerID &containerId)=0
MOCK_METHOD1(recover, process::Future< Nothing >(const Option< slave::state::SlaveState > &))