• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "res_sched_mgr_test.h"
17 
18 using namespace std;
19 using namespace testing::ext;
20 
21 namespace OHOS {
22 namespace ResourceSchedule {
23 namespace {
24     const string LIB_NAME = "libunittest_plugin.z.so";
25 }
26 
SetUpTestCase()27 void ResSchedMgrTest::SetUpTestCase() {}
28 
TearDownTestCase()29 void ResSchedMgrTest::TearDownTestCase() {}
30 
SetUp()31 void ResSchedMgrTest::SetUp() {}
32 
TearDown()33 void ResSchedMgrTest::TearDown() {}
34 
35 /**
36  * @tc.name: Init ressched mgr 001
37  * @tc.desc: Verify if can Init the plugin correctly
38  * @tc.type: FUNC
39  * @tc.require: SR000GGUUN AR000GH00L
40  * @tc.author:xukuan
41  */
42 HWTEST_F(ResSchedMgrTest, Init001, TestSize.Level1)
43 {
44     ResSchedMgr::GetInstance().Init();
45     EXPECT_TRUE(ResSchedMgr::GetInstance().mainHandler_ != nullptr);
46 }
47 
48 /**
49  * @tc.name: Init ressched ReportData 002
50  * @tc.desc: Verify if ReportData is success
51  * @tc.type: FUNC
52  * @tc.require: issueI5WWV3
53  * @tc.author:lice
54  */
55 HWTEST_F(ResSchedMgrTest, ReportData001, TestSize.Level1)
56 {
57     nlohmann::json payload;
58     ResSchedMgr::GetInstance().ReportData(0, 0, payload);
59     EXPECT_TRUE(ResSchedMgr::GetInstance().mainHandler_ != nullptr);
60 
61     ResSchedMgr::GetInstance().DispatchResourceInner(0, 0, payload);
62 }
63 } // namespace ResourceSchedule
64 } // namespace OHOS
65