AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MockMiscStorage.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
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  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_STORAGE_MOCKMISCSTORAGE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_STORAGE_MOCKMISCSTORAGE_H_
18 
19 #include <gmock/gmock.h>
20 
21 #include <memory>
22 #include <unordered_map>
23 #include <unordered_set>
24 
26 
27 namespace alexaClientSDK {
28 namespace avsCommon {
29 namespace sdkInterfaces {
30 namespace storage {
31 namespace test {
32 
37 public:
41  MOCK_METHOD0(open, bool());
42  MOCK_METHOD0(isOpened, bool());
43  MOCK_METHOD0(close, void());
46  bool(const std::string& componentName, const std::string& tableName, KeyType keyType, ValueType valueType));
47  MOCK_METHOD2(clearTable, bool(const std::string& componentName, const std::string& tableName));
48  MOCK_METHOD2(deleteTable, bool(const std::string& componentName, const std::string& tableName));
50  get,
51  bool(
52  const std::string& componentName,
53  const std::string& tableName,
54  const std::string& key,
55  std::string* value));
57  add,
58  bool(
59  const std::string& componentName,
60  const std::string& tableName,
61  const std::string& key,
62  const std::string& value));
64  update,
65  bool(
66  const std::string& componentName,
67  const std::string& tableName,
68  const std::string& key,
69  const std::string& value));
71  put,
72  bool(
73  const std::string& componentName,
74  const std::string& tableName,
75  const std::string& key,
76  const std::string& value));
77  MOCK_METHOD3(remove, bool(const std::string& componentName, const std::string& tableName, const std::string& key));
80  bool(
81  const std::string& componentName,
82  const std::string& tableName,
83  const std::string& key,
84  bool* tableEntryExistsValue));
87  bool(const std::string& componentName, const std::string& tableName, bool* tableExistsValue));
89  load,
90  bool(
91  const std::string& componentName,
92  const std::string& tableName,
93  std::unordered_map<std::string, std::string>* valueContainer));
95 };
96 
97 } // namespace test
98 } // namespace storage
99 } // namespace sdkInterfaces
100 } // namespace avsCommon
101 } // namespace alexaClientSDK
102 
103 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_STORAGE_MOCKMISCSTORAGE_H_
ValueType
The type of the value column in Misc DB.
Definition: MiscStorageInterface.h:44
MOCK_METHOD3(remove, bool(const std::string &componentName, const std::string &tableName, const std::string &key))
MOCK_METHOD2(clearTable, bool(const std::string &componentName, const std::string &tableName))
Definition: AmdMetricWrapperTest.cpp:24
::std::string string
Definition: gtest-port.h:1097
virtual bool load(const std::string &componentName, const std::string &tableName, std::unordered_map< std::string, std::string > *valueContainer)=0
virtual bool tableExists(const std::string &componentName, const std::string &tableName, bool *tableExistsValue)=0
virtual bool add(const std::string &componentName, const std::string &tableName, const std::string &key, const std::string &value)=0
static const std::string tableName
Definition: SmartScreenCaptionStateManagerTest.cpp:30
KeyType
The type of the key column in Misc DB.
Definition: MiscStorageInterface.h:36
virtual bool deleteTable(const std::string &componentName, const std::string &tableName)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual bool createTable(const std::string &componentName, const std::string &tableName, KeyType keyType, ValueType valueType)=0
static const std::string componentName
Definition: SmartScreenCaptionStateManagerTest.cpp:29
virtual bool put(const std::string &componentName, const std::string &tableName, const std::string &key, const std::string &value)=0
virtual bool tableEntryExists(const std::string &componentName, const std::string &tableName, const std::string &key, bool *tableEntryExistsValue)=0
virtual bool clearTable(const std::string &componentName, const std::string &tableName)=0
virtual bool update(const std::string &componentName, const std::string &tableName, const std::string &key, const std::string &value)=0
static const std::string key
The database key to be used by the protocol given the METADATA object.
Definition: SharedAVSSettingProtocolTest.cpp:58
MOCK_METHOD4(createTable, bool(const std::string &componentName, const std::string &tableName, KeyType keyType, ValueType valueType))

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0