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 
68  usage,
70  const ContainerID&));
71 
73  wait,
75  const ContainerID&));
76 
78  destroy,
80  const ContainerID&));
81 
83  containers,
85 
89  const std::vector<Image>&));
90 };
91 
92 } // namespace tests {
93 } // namespace internal {
94 } // namespace mesos {
Definition: option.hpp:28
Definition: mock_containerizer.hpp:41
Definition: resources.hpp:79
virtual process::Future< Nothing > update(const ContainerID &containerId, const Resources &resources)=0
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_METHOD2(update, process::Future< Nothing >(const ContainerID &, const Resources &))
virtual process::Future< Nothing > recover(const Option< state::SlaveState > &state)=0
Definition: containerizer.hpp:57
Definition: spec.hpp:30
virtual process::Future< process::http::Connection > attach(const ContainerID &containerId)
Definition: containerizer.hpp:104
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 > &))