• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef MOCK_ICLOUD_SYNC_STORAGE_INTERFACE_H
16 #define MOCK_ICLOUD_SYNC_STORAGE_INTERFACE_H
17 
18 #include <gmock/gmock.h>
19 #include "icloud_sync_storage_interface.h"
20 
21 namespace DistributedDB {
22 class MockICloudSyncStorageInterface : public ICloudSyncStorageInterface {
23 public:
24     MOCK_CONST_METHOD2(GetMetaData, int(const Key &, Value &));
25     MOCK_METHOD2(PutMetaData, int(const Key &, const Value &));
26     MOCK_METHOD1(ChkSchema, int(const TableName &));
27     MOCK_METHOD1(SetCloudDbSchema, int(const DataBaseSchema &));
28     MOCK_METHOD1(GetCloudDbSchema, int(DataBaseSchema &));
29     MOCK_METHOD2(GetCloudTableSchema, int(const TableName &, TableSchema &));
30     MOCK_METHOD1(StartTransaction, int(TransactType));
31     MOCK_METHOD0(Commit, int(void));
32     MOCK_METHOD0(Rollback, int(void));
33     MOCK_METHOD4(GetUploadCount, int(const std::string &, const Timestamp &, const bool, int64_t &));
34     MOCK_METHOD1(FillCloudGid, int(const CloudSyncData &));
35     MOCK_METHOD4(GetCloudData, int(const TableSchema &, const Timestamp &, ContinueToken &, CloudSyncData &));
36     MOCK_METHOD2(GetCloudDataNext, int(ContinueToken &, CloudSyncData &));
37     MOCK_METHOD1(ReleaseCloudDataToken, int(ContinueToken &));
38     MOCK_METHOD4(GetInfoByPrimaryKeyOrGid, int(const std::string &, const VBucket &, DataInfoWithLog &, VBucket &));
39     MOCK_METHOD2(PutCloudSyncData, int(const std::string &, DownloadData &));
40     MOCK_METHOD3(TriggerObserverAction, void(const std::string &, ChangedData &&, bool));
41     MOCK_METHOD4(CleanCloudData, int(ClearMode mode, const std::vector<std::string> &tableNameList,
42         const RelationalSchemaObject &localSchema, std::vector<Asset> &assets));
43     MOCK_METHOD3(FillCloudAssetForDownload, int(const std::string &, VBucket &, bool));
44     MOCK_METHOD1(SetLogTriggerStatus, int(bool));
45     MOCK_METHOD2(FillCloudGidAndAsset, int(OpType, const CloudSyncData &));
46     MOCK_CONST_METHOD0(GetIdentify, std::string());
47 };
48 
49 }
50 #endif // #define MOCK_ICLOUD_SYNC_STORAGE_INTERFACE_H
51