1 /*
2 * Copyright (c) 2022 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
16 #include "gtest/gtest.h"
17 #include "concurrent_task_client.h"
18
19 namespace OHOS {
20 namespace FFRT_TEST {
21 using namespace testing;
22 using namespace testing::ext;
23 using namespace OHOS::ConcurrentTask;
24
25
26 class ConcurrentTaskClientTest : public testing::Test {
27 public:
28 static void SetUpTestCase();
29 static void TearDownTestCase();
30 void SetUp();
31 void TearDown();
32 };
33
SetUpTestCase()34 void ConcurrentTaskClientTest::SetUpTestCase()
35 {
36 }
37
TearDownTestCase()38 void ConcurrentTaskClientTest::TearDownTestCase()
39 {
40 }
41
SetUp()42 void ConcurrentTaskClientTest::SetUp()
43 {
44 }
45
TearDown()46 void ConcurrentTaskClientTest::TearDown()
47 {
48 }
49
50 /**
51 * @tc.name: PushTaskTest
52 * @tc.desc: Test whether the PushTask interface are normal.
53 * @tc.type: FUNC
54 */
55 HWTEST_F(ConcurrentTaskClientTest, ReportDataTest, TestSize.Level1)
56 {
57 uint32_t resType = 0;
58 int64_t value = 3587;
59 std::unordered_map<std::string, std::string> payload;
60 payload["uid"] = "3587";
61 payload["type"] = "appStart";
62 ConcurrentTaskClient::GetInstance().ReportData(resType, value, payload);
63 }
64
65 /**
66 * @tc.name: PushTaskTest
67 * @tc.desc: Test whether the PushTask interface are normal.
68 * @tc.type: FUNC
69 */
70 HWTEST_F(ConcurrentTaskClientTest, QueryIntervalTest, TestSize.Level1)
71 {
72 int queryItem = 3;
73 IntervalReply queryRs = {87, 657, 357, 214};
74 ConcurrentTaskClient::GetInstance().QueryInterval(queryItem, queryRs);
75 }
76
77 /**
78 * @tc.name: PushTaskTest
79 * @tc.desc: Test whether the PushTask interface are normal.
80 * @tc.type: FUNC
81 */
82 HWTEST_F(ConcurrentTaskClientTest, StopRemoteObjectTest, TestSize.Level1)
83 {
84 ConcurrentTaskClient::GetInstance().StopRemoteObject();
85 }
86 }
87 }