Merge test folder of test branch
[iotivity.git] / test / include / MntResource.h
1 /******************************************************************
2 *
3 * Copyright 2018 Open Connectivity Foundation All Rights Reserved.
4 *
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ******************************************************************/
20
21 #ifndef COMMON_TESTCASE_MNTRESOURCE_H_
22 #define COMMON_TESTCASE_MNTRESOURCE_H_
23
24 #include "SampleResource.h"
25
26 using namespace std;
27 namespace PH = std::placeholders;
28
29 class MntResource : public SampleResource
30 {
31 protected:
32     int numberOf503ErrorResponse;
33     bool expect503ErrorRespond;
34
35 public:
36     MntResource(void);
37
38     MntResource(std::string resourceUri,
39             std::string resourceTypeName,
40             std::string resourceInterface,
41             uint8_t resourceProperty = OC_ACTIVE);
42
43     MntResource(std::string resourceUri,
44             std::string resourceTypeName,
45             std::string resourceInterface,
46             uint8_t resourceProperty,
47             OCRepresentation resourceRepresentation);
48
49     virtual ~MntResource(void);
50
51     virtual void handleGetRequest(QueryParamsMap &queryParamsMap,
52             std::shared_ptr< OCResourceRequest > request,
53             std::shared_ptr< OCResourceResponse > response);
54
55     virtual void handlePostRequest(QueryParamsMap &queryParamsMap,
56         OCRepresentation incomingRepresentation, std::shared_ptr< OCResourceRequest > request,
57         std::shared_ptr< OCResourceResponse > response);
58 };
59
60 #endif /* COMMON_TESTCASE_MNTRESOURCE_H_ */