2 * Copyright (C) 2011, BMW AG
4 * GeniviAudioMananger AudioManagerDaemon
6 * \file MockInterfaces.h
8 * \date 20-Oct-2011 3:42:04 PM
9 * \author Christian Mueller (christian.ei.mueller@bmw.de)
12 * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
13 * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
15 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
16 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
17 * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
18 * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
19 * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
20 * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
21 * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
25 #ifndef MOCKROUTINGINTERFACE_H_
26 #define MOCKROUTINGINTERFACE_H_
28 #include <control/ControlSendInterface.h>
29 #include <routing/RoutingSendInterface.h>
30 #include <gtest/gtest.h>
31 #include <gmock/gmock.h>
35 class MockRoutingSendInterface : public RoutingSendInterface {
37 MOCK_METHOD1(startupRoutingInterface,
38 void(RoutingReceiveInterface* routingreceiveinterface));
39 MOCK_METHOD0(routingInterfacesReady,
41 MOCK_METHOD0(routingInterfacesRundown,
43 MOCK_METHOD1(asyncAbort,
44 am_Error_e(const am_Handle_s handle));
45 MOCK_METHOD5(asyncConnect,
46 am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
47 MOCK_METHOD2(asyncDisconnect,
48 am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
49 MOCK_METHOD5(asyncSetSinkVolume,
50 am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
51 MOCK_METHOD5(asyncSetSourceVolume,
52 am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
53 MOCK_METHOD3(asyncSetSourceState,
54 am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
55 MOCK_METHOD3(asyncSetSinkSoundProperty,
56 am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
57 MOCK_METHOD3(asyncSetSourceSoundProperty,
58 am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
59 MOCK_METHOD5(asyncCrossFade,
60 am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
61 MOCK_METHOD2(setDomainState,
62 am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
63 MOCK_CONST_METHOD1(returnBusName,
64 am_Error_e(std::string& BusName));
68 class MockControlSendInterface : public ControlSendInterface {
70 MOCK_METHOD1(startupController,
71 am_Error_e(ControlReceiveInterface* controlreceiveinterface));
72 MOCK_METHOD0(stopController,
74 MOCK_METHOD0(hookAllPluginsLoaded,
76 MOCK_METHOD3(hookUserConnectionRequest,
77 am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID));
78 MOCK_METHOD1(hookUserDisconnectionRequest,
79 am_Error_e(const am_mainConnectionID_t connectionID));
80 MOCK_METHOD2(hookUserSetMainSinkSoundProperty,
81 am_Error_e(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty));
82 MOCK_METHOD2(hookUserSetMainSourceSoundProperty,
83 am_Error_e(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty));
84 MOCK_METHOD1(hookUserSetSystemProperty,
85 am_Error_e(const am_SystemProperty_s& property));
86 MOCK_METHOD2(hookUserVolumeChange,
87 am_Error_e(const am_sinkID_t SinkID, const am_mainVolume_t newVolume));
88 MOCK_METHOD2(hookUserVolumeStep,
89 am_Error_e(const am_sinkID_t SinkID, const int16_t increment));
90 MOCK_METHOD2(hookUserSetSinkMuteState,
91 am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState));
92 MOCK_METHOD2(hookSystemRegisterDomain,
93 am_Error_e(const am_Domain_s& domainData, am_domainID_t& domainID));
94 MOCK_METHOD1(hookSystemDeregisterDomain,
95 am_Error_e(const am_domainID_t domainID));
96 MOCK_METHOD1(hookSystemDomainRegistrationComplete,
97 void(const am_domainID_t domainID));
98 MOCK_METHOD2(hookSystemRegisterSink,
99 am_Error_e(const am_Sink_s& sinkData, am_sinkID_t& sinkID));
100 MOCK_METHOD1(hookSystemDeregisterSink,
101 am_Error_e(const am_sinkID_t sinkID));
102 MOCK_METHOD2(hookSystemRegisterSource,
103 am_Error_e(const am_Source_s& sourceData, am_sourceID_t& sourceID));
104 MOCK_METHOD1(hookSystemDeregisterSource,
105 am_Error_e(const am_sourceID_t sourceID));
106 MOCK_METHOD2(hookSystemRegisterGateway,
107 am_Error_e(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID));
108 MOCK_METHOD1(hookSystemDeregisterGateway,
109 am_Error_e(const am_gatewayID_t gatewayID));
110 MOCK_METHOD2(hookSystemRegisterCrossfader,
111 am_Error_e(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID));
112 MOCK_METHOD1(hookSystemDeregisterCrossfader,
113 am_Error_e(const am_crossfaderID_t crossfaderID));
114 MOCK_METHOD3(hookSystemSinkVolumeTick,
115 void(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume));
116 MOCK_METHOD3(hookSystemSourceVolumeTick,
117 void(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume));
118 MOCK_METHOD2(hookSystemInterruptStateChange,
119 void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState));
120 MOCK_METHOD2(hookSystemSinkAvailablityStateChange,
121 void(const am_sinkID_t sinkID, const am_Availability_s& availability));
122 MOCK_METHOD2(hookSystemSourceAvailablityStateChange,
123 void(const am_sourceID_t sourceID, const am_Availability_s& availability));
124 MOCK_METHOD2(hookSystemDomainStateChange,
125 void(const am_domainID_t domainID, const am_DomainState_e state));
126 MOCK_METHOD1(hookSystemReceiveEarlyData,
127 void(const std::vector<am_EarlyData_s>& data));
128 MOCK_METHOD1(hookSystemSpeedChange,
129 void(const am_speed_t speed));
130 MOCK_METHOD2(hookSystemTimingInformationChanged,
131 void(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time));
132 MOCK_METHOD2(cbAckConnect,
133 void(const am_Handle_s handle, const am_Error_e errorID));
134 MOCK_METHOD2(cbAckDisconnect,
135 void(const am_Handle_s handle, const am_Error_e errorID));
136 MOCK_METHOD3(cbAckCrossFade,
137 void(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error));
138 MOCK_METHOD3(cbAckSetSinkVolumeChange,
139 void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error));
140 MOCK_METHOD3(cbAckSetSourceVolumeChange,
141 void(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error));
142 MOCK_METHOD2(cbAckSetSourceState,
143 void(const am_Handle_s handle, const am_Error_e error));
144 MOCK_METHOD2(cbAckSetSourceSoundProperty,
145 void(const am_Handle_s handle, const am_Error_e error));
146 MOCK_METHOD2(cbAckSetSinkSoundProperty,
147 void(const am_Handle_s handle, const am_Error_e error));
154 #endif /* MOCKROUTINGINTERFACE_H_ */