summaryrefslogtreecommitdiffstats
path: root/src/test/immutable_object_cache/MockCacheDaemon.h
blob: 02e86acb2a709c833543f3622d1ac90e36d9a376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#ifndef IMMUTABLE_OBJECT_CACHE_MOCK_DAEMON
#define IMMUTABLE_OBJECT_CACHE_MOCK_DAEMON

#include <iostream>
#include <unistd.h>

#include "gmock/gmock.h"

#include "include/Context.h"
#include "tools/immutable_object_cache/CacheClient.h"

namespace ceph {
namespace immutable_obj_cache {

class MockCacheClient {
 public:
  MockCacheClient(const std::string& file, CephContext* ceph_ctx) {}
  MOCK_METHOD0(run, void());
  MOCK_METHOD0(is_session_work, bool());
  MOCK_METHOD0(close, void());
  MOCK_METHOD0(stop, void());
  MOCK_METHOD0(connect, int());
  MOCK_METHOD1(connect, void(Context*));
  MOCK_METHOD6(lookup_object, void(std::string, uint64_t, uint64_t, uint64_t,
                                  std::string, CacheGenContextURef));
  MOCK_METHOD1(register_client, int(Context*));
};

class MockCacheServer {
 public:
  MockCacheServer(CephContext* cct, const std::string& file,
                  ProcessMsg processmsg) {
  }
  MOCK_METHOD0(run, int());
  MOCK_METHOD0(start_accept, int()); 
  MOCK_METHOD0(stop, int());
};

}  // namespace immutable_obj_cach3
}  // namespace ceph

#endif  // IMMUTABLE_OBJECT_CACHE_MOCK_DAEMON