Skip to content

Commit 2e44c49

Browse files
authored
RDK-57747: RDKV: Add contentPin parameter in User Settings (rdkcentral#6298)
Reason for change: RDK-57747: RDKV: Add contentPin parameter in User Settings RDK-57329: Enhance L1/L2 tests for Usersettings plugin for new Properties. Test Procedure: Make full stack build and verify curl commands. https://etwiki.sys.comcast.net/pages/viewpage.action?spaceKey=RDKV&title=User+Settings Run L1 and L2 tests and verify all tests are passing. Risks: Medium Priority: P1
1 parent 33e7ef2 commit 2e44c49

11 files changed

+1830
-407
lines changed

Tests/L2Tests/L2TestsPlugin/L2TestsMock.cpp

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,64 @@ uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *meth
159159
return status;
160160
}
161161

162+
/**
163+
* @brief Invoke a service method
164+
*
165+
* @param[in] callsign Service callsign
166+
* @param[in] method Method name
167+
* @param[in] params Method parameters
168+
* @param[out] results Method results
169+
* @return Zero (Core::ERROR_NONE) on succes or another value on error
170+
*/
171+
uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *method, JsonObject &params, Core::JSON::String &results)
172+
{
173+
174+
JSONRPC::LinkType<Core::JSON::IElement> jsonrpc(std::string(callsign), TEST_CALLSIGN);
175+
std::string message;
176+
std::string reply;
177+
uint32_t status = Core::ERROR_NONE;
178+
179+
params.ToString(message);
180+
TEST_LOG("Invoking %s.%s, parameters %s\n", callsign, method, message.c_str());
181+
182+
status = jsonrpc.Invoke<JsonObject, Core::JSON::String>(INVOKE_TIMEOUT, std::string(method), params, results);
183+
184+
results.ToString(reply);
185+
TEST_LOG("Status %u, results %s", status, reply.c_str());
186+
187+
return status;
188+
189+
}
190+
191+
/**
192+
* @brief Invoke a service method
193+
*
194+
* @param[in] callsign Service callsign
195+
* @param[in] method Method name
196+
* @param[in] params Method parameters
197+
* @param[out] results Method results with string format
198+
* @return Zero (Core::ERROR_NONE) on succes or another value on error
199+
*/
200+
uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *method, JsonObject &params, Core::JSON::Boolean &results)
201+
{
202+
203+
JSONRPC::LinkType<Core::JSON::IElement> jsonrpc(std::string(callsign), TEST_CALLSIGN);
204+
std::string message;
205+
std::string reply;
206+
uint32_t status = Core::ERROR_NONE;
207+
208+
params.ToString(message);
209+
TEST_LOG("Invoking %s.%s, parameters %s\n", callsign, method, message.c_str());
210+
211+
status = jsonrpc.Invoke<JsonObject, Core::JSON::Boolean>(INVOKE_TIMEOUT, std::string(method), params, results);
212+
213+
results.ToString(reply);
214+
TEST_LOG("Status %u, results %s", status, reply.c_str());
215+
216+
return status;
217+
218+
}
219+
162220
/**
163221
* @brief Invoke a service method
164222
*
@@ -206,6 +264,23 @@ uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *meth
206264
results.ToString(reply);
207265
TEST_LOG("Status %u, results %s", status, reply.c_str());
208266

267+
return status;
268+
269+
}
270+
271+
uint32_t L2TestMocks::InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::Double &results)
272+
{
273+
JSONRPC::LinkType<Core::JSON::IElement> jsonrpc(std::string(callsign), TEST_CALLSIGN);
274+
std::string reply;
275+
uint32_t status = Core::ERROR_NONE;
276+
277+
TEST_LOG("Invoking %s.%s \n", callsign, method);
278+
279+
status = jsonrpc.Invoke<void, Core::JSON::Double>(INVOKE_TIMEOUT, std::string(method), results);
280+
281+
results.ToString(reply);
282+
TEST_LOG("Status %u, results %s", status, reply.c_str());
283+
209284
return status;
210285
}
211286

Tests/L2Tests/L2TestsPlugin/L2TestsMock.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ class L2TestMocks : public ::testing::Test {
6666
*/
6767
uint32_t InvokeServiceMethod(const char *callsign, const char *method, JsonObject &params, JsonObject &results);
6868

69+
/**
70+
* @brief Invoke a service method
71+
*
72+
* @param[in] callsign Service callsign
73+
* @param[in] method Method name
74+
* @param[in] params Method parameters
75+
* @param[out] results Method results with string format
76+
* @return Zero (Core::ERROR_NONE) on succes or another value on error
77+
*/
78+
uint32_t InvokeServiceMethod(const char *callsign, const char *method, JsonObject &params, Core::JSON::String &results);
79+
80+
/**
81+
* @brief Invoke a service method
82+
*
83+
* @param[in] callsign Service callsign
84+
* @param[in] method Method name
85+
* @param[in] params Method parameters
86+
* @param[out] results Method results with string format
87+
* @return Zero (Core::ERROR_NONE) on succes or another value on error
88+
*/
89+
uint32_t InvokeServiceMethod(const char *callsign, const char *method, JsonObject &params, Core::JSON::Boolean &results);
90+
6991
/**
7092
* @brief Invoke a service method
7193
*
@@ -86,6 +108,16 @@ class L2TestMocks : public ::testing::Test {
86108
*/
87109
uint32_t InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::String &results);
88110

111+
/**
112+
* @brief Invoke a service method
113+
*
114+
* @param[in] callsign Service callsign
115+
* @param[in] method Method name
116+
* @param[out] results Method results
117+
* @return Zero (Core::ERROR_NONE) on succes or another value on error
118+
*/
119+
uint32_t InvokeServiceMethod(const char *callsign, const char *method, Core::JSON::Double &results);
120+
89121
/**
90122
* @brief Activate a service plugin
91123
*

0 commit comments

Comments
 (0)