ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
dpmClientMock.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_ocm_libdaq_test
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief `daq::DpmClient`
7  */
8 #ifndef DAQ_MOCK_DPMCLIENT_MOCK_HPP
9 #define DAQ_MOCK_DPMCLIENT_MOCK_HPP
10 #include <daq/dpmClient.hpp>
11 
12 #include <gmock/gmock.h>
13 
14 namespace daq {
15 
16 /**
17  * Combined mock and fake of interface to DPM server
18  */
19 class DpmClientMock : public DpmClient {
20 public:
21  /**
22  * Schedule merging.
23  */
24  MOCK_METHOD(boost::future<State>, ScheduleAsync, (std::string const& spec), (override));
25 
26  /**
27  * Abort merging.
28  */
29  MOCK_METHOD(boost::future<State>,
30  AbortAsync,
31  (std::string const& id),
32  (override));
33 
34  auto ConnectStatusSignal(StatusSignal::slot_type const& slot)
35  -> boost::signals2::connection override {
36  return status_signal.connect(slot);
37  }
38 
39  auto ConnectStorageSignal(StorageSignal::slot_type const& slot)
40  -> boost::signals2::connection override {
41  return storage_signal.connect(slot);
42  }
45 };
46 
47 } // namespace daq
48 #endif
daq::DpmClient::ScheduleAsync
virtual auto ScheduleAsync(std::string const &spec) -> boost::future< State >=0
Schedule merging.
dpmClient.hpp
daq::DpmClient
daq::DpmClient::StatusSignal
boost::signals2::signal< void(Status)> StatusSignal
Definition: dpmClient.hpp:41
daq::DpmClient
Interface to DPM server.
Definition: dpmClient.hpp:38
daq::DpmClientMock::MOCK_METHOD
MOCK_METHOD(boost::future< State >, AbortAsync,(std::string const &id),(override))
Abort merging.
daq
Definition: asyncProcess.cpp:15
daq::DpmClientMock::ConnectStorageSignal
auto ConnectStorageSignal(StorageSignal::slot_type const &slot) -> boost::signals2::connection override
Connect slot to storage change signal.
Definition: dpmClientMock.hpp:39
daq::DpmClientMock
Combined mock and fake of interface to DPM server.
Definition: dpmClientMock.hpp:19
daq::DpmClientMock::storage_signal
StorageSignal storage_signal
Definition: dpmClientMock.hpp:44
daq::DpmClientMock::ConnectStatusSignal
auto ConnectStatusSignal(StatusSignal::slot_type const &slot) -> boost::signals2::connection override
Connect slot to status change signal.
Definition: dpmClientMock.hpp:34
daq::DpmClient::StorageSignal
boost::signals2::signal< void(std::filesystem::space_info)> StorageSignal
Definition: dpmClient.hpp:40
daq::DpmClientMock::MOCK_METHOD
MOCK_METHOD(boost::future< State >, ScheduleAsync,(std::string const &spec),(override))
Schedule merging.
daq::DpmClient::AbortAsync
virtual auto AbortAsync(std::string const &id) -> boost::future< State >=0
Abort merging.
daq::DpmClientMock::status_signal
StatusSignal status_signal
Definition: dpmClientMock.hpp:43