2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @author Tomasz Swierczek (t.swierczek@samsung.com)
19 * @brief DBus client mockup class.
22 #ifndef WRT_MOCKUPS_DBUS_CLIENT_MOCK_H_
23 #define WRT_MOCKUPS_DBUS_CLIENT_MOCK_H_
25 #include <dpl/exception.h>
26 #include <dpl/assert.h>
30 #include "ace_server_api.h"
31 #include "popup_response_server_api.h"
33 namespace WrtSecurity {
34 namespace Communication {
37 * This class is a mockup implementation for some methods called
48 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
49 DECLARE_EXCEPTION_TYPE(Base, SecurityCommunicationClientException)
52 Client(std::string /*interfaceName*/)
56 // ACE server api check access method
57 void call(const std::string &methodName,
61 const std::vector<std::string>&,
62 const std::vector<std::string>&,
66 if (methodName == WrtSecurity::AceServerApi::CHECK_ACCESS_METHOD()) {
67 Assert(NULL != outArg);
68 *outArg = m_checkAccessResult;
73 void call(const std::string &methodName,
79 const std::vector<std::string>&,
80 const std::vector<std::string>&,
84 if (methodName == WrtSecurity::PopupServerApi::VALIDATION_METHOD()) {
85 Assert(NULL != outArg);
86 *outArg = m_validationResult;
96 static void setCheckAccessResult(int value)
98 m_checkAccessResult = value;
101 static void setValidationResult(bool value)
103 m_validationResult = value;
107 static int m_checkAccessResult;
108 static bool m_validationResult;
114 #endif // WRT_MOCKUPS_DBUS_CLIENT_MOCK_H_