• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 #include <gtest/gtest.h>
16 #include "ability_lifecycle_executor.h"
17 #include "common_event_manager.h"
18 #include "st_ability_util.h"
19 #include "task_dispatcher_test_info.h"
20 #include "testConfigParser.h"
21 
22 namespace {
23 using namespace OHOS;
24 using namespace OHOS::AppExecFwk;
25 using namespace OHOS::AAFwk;
26 using namespace OHOS::EventFwk;
27 using namespace OHOS::STtools;
28 using namespace testing::ext;
29 using namespace STABUtil;
30 
31 using MAP_STR_STR = std::map<std::string, std::string>;
32 const std::string bundleNameFirst = "com.ohos.TaskDispatcherA";
33 const std::string bundleNameSecond = "com.ohos.TaskDispatcherB";
34 const std::string firstAbilityName = "MainAbility";
35 const std::string secondAbilityname = "SecondAbility";
36 constexpr int WAIT_TIME = 500;
37 constexpr int DELAY = 10;
38 int testCaseCode = 100;
39 std::vector<std::string> bundleNameList = {
40     "com.ohos.TaskDispatcherA",
41     "com.ohos.TaskDispatcherB",
42 };
43 std::vector<std::string> hapNameList = {
44     "taskDispatcherTestA",
45     "taskDispatcherTestB",
46 };
47 
48 class TaskDispatcherTest : public testing::Test {
49 public:
50     static void SetUpTestCase(void);
51     static void TearDownTestCase(void);
52     void SetUp();
53     void TearDown();
54 
55     static bool SubscribeEvent();
56     class AppEventSubscriber : public OHOS::EventFwk::CommonEventSubscriber {
57     public:
AppEventSubscriber(const OHOS::EventFwk::CommonEventSubscribeInfo & sp)58         explicit AppEventSubscriber(const OHOS::EventFwk::CommonEventSubscribeInfo &sp) : CommonEventSubscriber(sp) {};
59         virtual void OnReceiveEvent(const OHOS::EventFwk::CommonEventData &data) override;
~AppEventSubscriber()60         ~AppEventSubscriber() {};
61     };
62 
63     void StartAbility(const std::string &abilityName, const std::string &bundleName);
64     static OHOS::sptr<OHOS::AAFwk::IAbilityManager> abilityMs;
65     static OHOS::STtools::Event event;
66     static OHOS::StressTestLevel stLevel_;
67     static std::shared_ptr<AppEventSubscriber> subscriber_;
68 };
69 
70 Event TaskDispatcherTest::event = STtools::Event();
71 sptr<IAbilityManager> TaskDispatcherTest::abilityMs = nullptr;
72 StressTestLevel TaskDispatcherTest::stLevel_ {};
73 std::shared_ptr<TaskDispatcherTest::AppEventSubscriber> TaskDispatcherTest::subscriber_ = nullptr;
74 
SetUpTestCase(void)75 void TaskDispatcherTest::SetUpTestCase(void)
76 {
77     if (!SubscribeEvent()) {
78         GTEST_LOG_(INFO) << "SubscribeEvent error";
79     }
80     TestConfigParser tcp;
81     tcp.ParseFromFile4StressTest(STRESS_TEST_CONFIG_FILE_PATH, stLevel_);
82     std::cout << "stress test level : "
83               << "AMS : " << stLevel_.AMSLevel << " "
84               << "BMS : " << stLevel_.BMSLevel << " "
85               << "CES : " << stLevel_.CESLevel << std::endl;
86     stLevel_.AMSLevel = 1;
87 }
TearDownTestCase(void)88 void TaskDispatcherTest::TearDownTestCase(void)
89 {
90     CommonEventManager::UnSubscribeCommonEvent(subscriber_);
91 }
92 
SetUp()93 void TaskDispatcherTest::SetUp()
94 {
95     STAbilityUtil::InstallHaps(hapNameList);
96 }
97 
TearDown()98 void TaskDispatcherTest::TearDown()
99 {
100     STAbilityUtil::UninstallBundle(bundleNameList);
101     STAbilityUtil::CleanMsg(event);
102 }
103 
OnReceiveEvent(const CommonEventData & data)104 void TaskDispatcherTest::AppEventSubscriber::OnReceiveEvent(const CommonEventData &data)
105 {
106     STAbilityUtil::Completed(event, data.GetWant().GetAction(), data.GetCode(), data.GetData());
107 }
108 
SubscribeEvent()109 bool TaskDispatcherTest::SubscribeEvent()
110 {
111     std::vector<std::string> eventList = {
112         g_EVENT_RESP_FIRST,
113         g_EVENT_RESP_SECOND,
114         g_EVENT_RESP_FIRST_B,
115         g_EVENT_RESP_SECOND_B,
116     };
117     MatchingSkills matchingSkills;
118     for (const auto &e : eventList) {
119         matchingSkills.AddEvent(e);
120     }
121     CommonEventSubscribeInfo subscribeInfo(matchingSkills);
122     subscribeInfo.SetPriority(1);
123     auto subscriber = std::make_shared<AppEventSubscriber>(subscribeInfo);
124     return CommonEventManager::SubscribeCommonEvent(subscriber);
125 }
126 
StartAbility(const std::string & abilityName,const std::string & bundleName)127 void TaskDispatcherTest::StartAbility(const std::string &abilityName, const std::string &bundleName)
128 {
129     MAP_STR_STR params;
130     Want want = STAbilityUtil::MakeWant("device", abilityName, bundleName, params);
131     ErrCode result = STAbilityUtil::StartAbility(want, abilityMs, WAIT_TIME);
132     GTEST_LOG_(INFO) << "TaskDispatcherTest::StartAbility : " << result;
133     if (bundleName == bundleNameSecond) {
134         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST_B, 0, DELAY));
135     } else {
136         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, 0, DELAY));
137     }
138 }
139 
140 /**
141  * @tc.number    : TaskDispatcher_Global_00100
142  * @tc.name      : global sync:parallel sync
143  * @tc.desc      : two levels task dispatch
144  */
145 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00100, Function | MediumTest | Level1)
146 {
147     StartAbility(firstAbilityName, bundleNameFirst);
148     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_0";
149     bool result = false;
150     for (int i = 0; i < stLevel_.AMSLevel; i++) {
151         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
152         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
153         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
154         result = data.compare("1") == 0;
155         EXPECT_TRUE(result);
156         if (!result && i > 0) {
157             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00100 : " << i;
158             break;
159         }
160     }
161 }
162 
163 /**
164  * @tc.number    : TaskDispatcher_Global_00200
165  * @tc.name      : global sync:parallel async
166  * @tc.desc      : two levels task dispatch
167  */
168 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00200, Function | MediumTest | Level1)
169 {
170     StartAbility(firstAbilityName, bundleNameFirst);
171     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_1";
172     bool result = false;
173     for (int i = 0; i < stLevel_.AMSLevel; i++) {
174         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
175         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
176         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
177         result = data.compare("1") == 0;
178         EXPECT_TRUE(result);
179         if (!result && i > 0) {
180             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00200 : " << i;
181             break;
182         }
183     }
184 }
185 
186 /**
187  * @tc.number    : TaskDispatcher_Global_00300
188  * @tc.name      : global sync:parallel delay
189  * @tc.desc      : two levels task dispatch
190  */
191 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00300, Function | MediumTest | Level1)
192 {
193     StartAbility(firstAbilityName, bundleNameFirst);
194     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_2";
195     bool result = false;
196     for (int i = 0; i < stLevel_.AMSLevel; i++) {
197         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
198         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
199         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
200         result = data.compare("1") == 0;
201         EXPECT_TRUE(result);
202         if (!result && i > 0) {
203             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00300 : " << i;
204             break;
205         }
206     }
207 }
208 
209 /**
210  * @tc.number    : TaskDispatcher_Global_00400
211  * @tc.name      : global sync:parallel group
212  * @tc.desc      : two levels task dispatch
213  */
214 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00400, Function | MediumTest | Level1)
215 {
216     StartAbility(firstAbilityName, bundleNameFirst);
217     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_3";
218     bool result = false;
219     for (int i = 0; i < stLevel_.AMSLevel; i++) {
220         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
221         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
222         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
223         result = data.compare("1") == 0;
224         EXPECT_TRUE(result);
225         if (!result && i > 0) {
226             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00400 : " << i;
227             break;
228         }
229     }
230 }
231 
232 /**
233  * @tc.number    : TaskDispatcher_Global_00500
234  * @tc.name      : global sync:parallel group wait
235  * @tc.desc      : two levels task dispatch
236  */
237 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00500, Function | MediumTest | Level1)
238 {
239     StartAbility(firstAbilityName, bundleNameFirst);
240     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_4";
241     bool result = false;
242     for (int i = 0; i < stLevel_.AMSLevel; i++) {
243         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
244         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
245         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
246         result = data.compare("1") == 0;
247         EXPECT_TRUE(result);
248         if (!result && i > 0) {
249             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00500 : " << i;
250             break;
251         }
252     }
253 }
254 
255 /**
256  * @tc.number    : TaskDispatcher_Global_00600
257  * @tc.name      : global sync:parallel group notify
258  * @tc.desc      : two levels task dispatch
259  */
260 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00600, Function | MediumTest | Level1)
261 {
262     StartAbility(firstAbilityName, bundleNameFirst);
263     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_5";
264     bool result = false;
265     for (int i = 0; i < stLevel_.AMSLevel; i++) {
266         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
267         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
268         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
269         result = data.compare("1") == 0;
270         EXPECT_TRUE(result);
271         if (!result && i > 0) {
272             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00600 : " << i;
273             break;
274         }
275     }
276 }
277 
278 /**
279  * @tc.number    : TaskDispatcher_Global_00700
280  * @tc.name      : global sync:parallel sync barrier
281  * @tc.desc      : two levels task dispatch
282  */
283 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00700, Function | MediumTest | Level1)
284 {
285     StartAbility(firstAbilityName, bundleNameFirst);
286     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_6";
287     bool result = false;
288     for (int i = 0; i < stLevel_.AMSLevel; i++) {
289         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
290         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
291         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
292         result = data.compare("1") == 0;
293         EXPECT_TRUE(result);
294         if (!result && i > 0) {
295             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00700 : " << i;
296             break;
297         }
298     }
299 }
300 
301 /**
302  * @tc.number    : TaskDispatcher_Global_00800
303  * @tc.name      : global sync:parallel async barrier
304  * @tc.desc      : two levels task dispatch
305  */
306 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00800, Function | MediumTest | Level1)
307 {
308     StartAbility(firstAbilityName, bundleNameFirst);
309     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_7";
310     bool result = false;
311     for (int i = 0; i < stLevel_.AMSLevel; i++) {
312         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
313         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
314         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
315         result = data.compare("1") == 0;
316         EXPECT_TRUE(result);
317         if (!result && i > 0) {
318             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00800 : " << i;
319             break;
320         }
321     }
322 }
323 
324 /**
325  * @tc.number    : TaskDispatcher_Global_00900
326  * @tc.name      : global sync:parallel apply
327  * @tc.desc      : two levels task dispatch
328  */
329 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_00900, Function | MediumTest | Level1)
330 {
331     StartAbility(firstAbilityName, bundleNameFirst);
332     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_8";
333     bool result = false;
334     for (int i = 0; i < stLevel_.AMSLevel; i++) {
335         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
336         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
337         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
338         result = data.compare("1") == 0;
339         EXPECT_TRUE(result);
340         if (!result && i > 0) {
341             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00900 : " << i;
342             break;
343         }
344     }
345 }
346 
347 /**
348  * @tc.number    : TaskDispatcher_Global_01000
349  * @tc.name      : global sync:serial sync
350  * @tc.desc      : two levels task dispatch
351  */
352 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01000, Function | MediumTest | Level1)
353 {
354     StartAbility(firstAbilityName, bundleNameFirst);
355     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_9";
356     bool result = false;
357     for (int i = 0; i < stLevel_.AMSLevel; i++) {
358         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
359         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
360         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
361         result = data.compare("1") == 0;
362         EXPECT_TRUE(result);
363         if (!result && i > 0) {
364             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01000 : " << i;
365             break;
366         }
367     }
368 }
369 
370 /**
371  * @tc.number    : TaskDispatcher_Global_01100
372  * @tc.name      : global sync:serial async
373  * @tc.desc      : two levels task dispatch
374  */
375 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01100, Function | MediumTest | Level1)
376 {
377     StartAbility(firstAbilityName, bundleNameFirst);
378     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_10";
379     bool result = false;
380     for (int i = 0; i < stLevel_.AMSLevel; i++) {
381         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
382         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
383         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
384         result = data.compare("1") == 0;
385         EXPECT_TRUE(result);
386         if (!result && i > 0) {
387             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01100 : " << i;
388             break;
389         }
390     }
391 }
392 
393 /**
394  * @tc.number    : TaskDispatcher_Global_01200
395  * @tc.name      : global sync:serial delay
396  * @tc.desc      : two levels task dispatch
397  */
398 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01200, Function | MediumTest | Level1)
399 {
400     StartAbility(firstAbilityName, bundleNameFirst);
401     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_11";
402     bool result = false;
403     for (int i = 0; i < stLevel_.AMSLevel; i++) {
404         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
405         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
406         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
407         result = data.compare("1") == 0;
408         EXPECT_TRUE(result);
409         if (!result && i > 0) {
410             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01200 : " << i;
411             break;
412         }
413     }
414 }
415 
416 /**
417  * @tc.number    : TaskDispatcher_Global_01300
418  * @tc.name      : global sync:serial apply
419  * @tc.desc      : two levels task dispatch
420  */
421 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01300, Function | MediumTest | Level1)
422 {
423     StartAbility(firstAbilityName, bundleNameFirst);
424     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_12";
425     bool result = false;
426     for (int i = 0; i < stLevel_.AMSLevel; i++) {
427         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
428         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
429         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
430         result = data.compare("1") == 0;
431         EXPECT_TRUE(result);
432         if (!result && i > 0) {
433             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01300 : " << i;
434             break;
435         }
436     }
437 }
438 
439 /**
440  * @tc.number    : TaskDispatcher_Global_01400
441  * @tc.name      : global async:parallel sync
442  * @tc.desc      : two levels task dispatch
443  */
444 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01400, Function | MediumTest | Level1)
445 {
446     StartAbility(firstAbilityName, bundleNameFirst);
447     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_13";
448     bool result = false;
449     for (int i = 0; i < stLevel_.AMSLevel; i++) {
450         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
451         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
452         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
453         result = data.compare("1") == 0;
454         EXPECT_TRUE(result);
455         if (!result && i > 0) {
456             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01400 : " << i;
457             break;
458         }
459     }
460 }
461 
462 /**
463  * @tc.number    : TaskDispatcher_Global_01500
464  * @tc.name      : global async:parallel async
465  * @tc.desc      : two levels task dispatch
466  */
467 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01500, Function | MediumTest | Level1)
468 {
469     StartAbility(firstAbilityName, bundleNameFirst);
470     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_14";
471     bool result = false;
472     for (int i = 0; i < stLevel_.AMSLevel; i++) {
473         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
474         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
475         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
476         result = data.compare("1") == 0;
477         EXPECT_TRUE(result);
478         if (!result && i > 0) {
479             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01500 : " << i;
480             break;
481         }
482     }
483 }
484 
485 /**
486  * @tc.number    : TaskDispatcher_Global_01600
487  * @tc.name      : global async:parallel delay
488  * @tc.desc      : two levels task dispatch
489  */
490 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01600, Function | MediumTest | Level1)
491 {
492     StartAbility(firstAbilityName, bundleNameFirst);
493     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_15";
494     bool result = false;
495     for (int i = 0; i < stLevel_.AMSLevel; i++) {
496         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
497         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
498         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
499         result = data.compare("1") == 0;
500         EXPECT_TRUE(result);
501         if (!result && i > 0) {
502             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01600 : " << i;
503             break;
504         }
505     }
506 }
507 
508 /**
509  * @tc.number    : TaskDispatcher_Global_01700
510  * @tc.name      : global async:parallel group
511  * @tc.desc      : two levels task dispatch
512  */
513 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01700, Function | MediumTest | Level1)
514 {
515     StartAbility(firstAbilityName, bundleNameFirst);
516     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_16";
517     bool result = false;
518     for (int i = 0; i < stLevel_.AMSLevel; i++) {
519         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
520         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
521         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
522         result = data.compare("1") == 0;
523         EXPECT_TRUE(result);
524         if (!result && i > 0) {
525             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01700 : " << i;
526             break;
527         }
528     }
529 }
530 
531 /**
532  * @tc.number    : TaskDispatcher_Global_01800
533  * @tc.name      : global async:parallel group wait
534  * @tc.desc      : two levels task dispatch
535  */
536 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01800, Function | MediumTest | Level1)
537 {
538     StartAbility(firstAbilityName, bundleNameFirst);
539     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_17";
540     bool result = false;
541     for (int i = 0; i < stLevel_.AMSLevel; i++) {
542         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
543         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
544         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
545         result = data.compare("1") == 0;
546         EXPECT_TRUE(result);
547         if (!result && i > 0) {
548             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01800 : " << i;
549             break;
550         }
551     }
552 }
553 
554 /**
555  * @tc.number    : TaskDispatcher_Global_01900
556  * @tc.name      : global async:parallel group notify
557  * @tc.desc      : two levels task dispatch
558  */
559 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_01900, Function | MediumTest | Level1)
560 {
561     StartAbility(firstAbilityName, bundleNameFirst);
562     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_18";
563     bool result = false;
564     for (int i = 0; i < stLevel_.AMSLevel; i++) {
565         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
566         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
567         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
568         result = data.compare("1") == 0;
569         EXPECT_TRUE(result);
570         if (!result && i > 0) {
571             GTEST_LOG_(INFO) << "TaskDispatcher_Global_01900 : " << i;
572             break;
573         }
574     }
575 }
576 
577 /**
578  * @tc.number    : TaskDispatcher_Global_02000
579  * @tc.name      : global async:parallel sync barrier
580  * @tc.desc      : two levels task dispatch
581  */
582 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02000, Function | MediumTest | Level1)
583 {
584     StartAbility(firstAbilityName, bundleNameFirst);
585     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_19";
586     bool result = false;
587     for (int i = 0; i < stLevel_.AMSLevel; i++) {
588         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
589         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
590         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
591         result = data.compare("1") == 0;
592         EXPECT_TRUE(result);
593         if (!result && i > 0) {
594             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02000 : " << i;
595             break;
596         }
597     }
598 }
599 
600 /**
601  * @tc.number    : TaskDispatcher_Global_02100
602  * @tc.name      : global async:parallel async barrier
603  * @tc.desc      : two levels task dispatch
604  */
605 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02100, Function | MediumTest | Level1)
606 {
607     StartAbility(firstAbilityName, bundleNameFirst);
608     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_20";
609     bool result = false;
610     for (int i = 0; i < stLevel_.AMSLevel; i++) {
611         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
612         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
613         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
614         result = data.compare("1") == 0;
615         EXPECT_TRUE(result);
616         if (!result && i > 0) {
617             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02100 : " << i;
618             break;
619         }
620     }
621 }
622 
623 /**
624  * @tc.number    : TaskDispatcher_Global_02200
625  * @tc.name      : global async:parallel apply
626  * @tc.desc      : two levels task dispatch
627  */
628 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02200, Function | MediumTest | Level1)
629 {
630     StartAbility(firstAbilityName, bundleNameFirst);
631     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_21";
632     bool result = false;
633     for (int i = 0; i < stLevel_.AMSLevel; i++) {
634         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
635         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
636         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
637         result = data.compare("1") == 0;
638         EXPECT_TRUE(result);
639         if (!result && i > 0) {
640             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02200 : " << i;
641             break;
642         }
643     }
644 }
645 
646 /**
647  * @tc.number    : TaskDispatcher_Global_02300
648  * @tc.name      : global async:serial sync
649  * @tc.desc      : two levels task dispatch
650  */
651 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02300, Function | MediumTest | Level1)
652 {
653     StartAbility(firstAbilityName, bundleNameFirst);
654     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_22";
655     bool result = false;
656     for (int i = 0; i < stLevel_.AMSLevel; i++) {
657         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
658         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
659         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
660         result = data.compare("1") == 0;
661         EXPECT_TRUE(result);
662         if (!result && i > 0) {
663             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02300 : " << i;
664             break;
665         }
666     }
667 }
668 
669 /**
670  * @tc.number    : TaskDispatcher_Global_02400
671  * @tc.name      : global async:serial async
672  * @tc.desc      : two levels task dispatch
673  */
674 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02400, Function | MediumTest | Level1)
675 {
676     StartAbility(firstAbilityName, bundleNameFirst);
677     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_23";
678     bool result = false;
679     for (int i = 0; i < stLevel_.AMSLevel; i++) {
680         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
681         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
682         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
683         result = data.compare("1") == 0;
684         EXPECT_TRUE(result);
685         if (!result && i > 0) {
686             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02400 : " << i;
687             break;
688         }
689     }
690 }
691 
692 /**
693  * @tc.number    : TaskDispatcher_Global_02500
694  * @tc.name      : global async:serial delay
695  * @tc.desc      : two levels task dispatch
696  */
697 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02500, Function | MediumTest | Level1)
698 {
699     StartAbility(firstAbilityName, bundleNameFirst);
700     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_24";
701     bool result = false;
702     for (int i = 0; i < stLevel_.AMSLevel; i++) {
703         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
704         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
705         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
706         result = data.compare("1") == 0;
707         EXPECT_TRUE(result);
708         if (!result && i > 0) {
709             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02500 : " << i;
710             break;
711         }
712     }
713 }
714 
715 /**
716  * @tc.number    : TaskDispatcher_Global_02600
717  * @tc.name      : global async:serial apply
718  * @tc.desc      : two levels task dispatch
719  */
720 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02600, Function | MediumTest | Level1)
721 {
722     StartAbility(firstAbilityName, bundleNameFirst);
723     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_25";
724     bool result = false;
725     for (int i = 0; i < stLevel_.AMSLevel; i++) {
726         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
727         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
728         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
729         result = data.compare("1") == 0;
730         EXPECT_TRUE(result);
731         if (!result && i > 0) {
732             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02600 : " << i;
733             break;
734         }
735     }
736 }
737 
738 /**
739  * @tc.number    : TaskDispatcher_Global_02700
740  * @tc.name      : global delay:parallel sync
741  * @tc.desc      : two levels task dispatch
742  */
743 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02700, Function | MediumTest | Level1)
744 {
745     StartAbility(firstAbilityName, bundleNameFirst);
746     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_26";
747     bool result = false;
748     for (int i = 0; i < stLevel_.AMSLevel; i++) {
749         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
750         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
751         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
752         result = data.compare("1") == 0;
753         EXPECT_TRUE(result);
754         if (!result && i > 0) {
755             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02700 : " << i;
756             break;
757         }
758     }
759 }
760 
761 /**
762  * @tc.number    : TaskDispatcher_Global_02800
763  * @tc.name      : global delay:parallel async
764  * @tc.desc      : two levels task dispatch
765  */
766 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02800, Function | MediumTest | Level1)
767 {
768     StartAbility(firstAbilityName, bundleNameFirst);
769     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_27";
770     bool result = false;
771     for (int i = 0; i < stLevel_.AMSLevel; i++) {
772         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
773         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
774         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
775         result = data.compare("1") == 0;
776         EXPECT_TRUE(result);
777         if (!result && i > 0) {
778             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02800 : " << i;
779             break;
780         }
781     }
782 }
783 
784 /**
785  * @tc.number    : TaskDispatcher_Global_02900
786  * @tc.name      : global delay:parallel delay
787  * @tc.desc      : two levels task dispatch
788  */
789 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_02900, Function | MediumTest | Level1)
790 {
791     StartAbility(firstAbilityName, bundleNameFirst);
792     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_28";
793     bool result = false;
794     for (int i = 0; i < stLevel_.AMSLevel; i++) {
795         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
796         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
797         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
798         result = data.compare("1") == 0;
799         EXPECT_TRUE(result);
800         if (!result && i > 0) {
801             GTEST_LOG_(INFO) << "TaskDispatcher_Global_02900 : " << i;
802             break;
803         }
804     }
805 }
806 
807 /**
808  * @tc.number    : TaskDispatcher_Global_03000
809  * @tc.name      : global delay:parallel group
810  * @tc.desc      : two levels task dispatch
811  */
812 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03000, Function | MediumTest | Level1)
813 {
814     StartAbility(firstAbilityName, bundleNameFirst);
815     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_29";
816     bool result = false;
817     for (int i = 0; i < stLevel_.AMSLevel; i++) {
818         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
819         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
820         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
821         result = data.compare("1") == 0;
822         EXPECT_TRUE(result);
823         if (!result && i > 0) {
824             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03000 : " << i;
825             break;
826         }
827     }
828 }
829 
830 /**
831  * @tc.number    : TaskDispatcher_Global_03100
832  * @tc.name      : global delay:parallel group wait
833  * @tc.desc      : two levels task dispatch
834  */
835 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03100, Function | MediumTest | Level1)
836 {
837     StartAbility(firstAbilityName, bundleNameFirst);
838     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_30";
839     bool result = false;
840     for (int i = 0; i < stLevel_.AMSLevel; i++) {
841         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
842         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
843         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
844         result = data.compare("1") == 0;
845         EXPECT_TRUE(result);
846         if (!result && i > 0) {
847             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03100 : " << i;
848             break;
849         }
850     }
851 }
852 
853 /**
854  * @tc.number    : TaskDispatcher_Global_03200
855  * @tc.name      : global delay:parallel group notify
856  * @tc.desc      : two levels task dispatch
857  */
858 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03200, Function | MediumTest | Level1)
859 {
860     StartAbility(firstAbilityName, bundleNameFirst);
861     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_31";
862     bool result = false;
863     for (int i = 0; i < stLevel_.AMSLevel; i++) {
864         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
865         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
866         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
867         result = data.compare("1") == 0;
868         EXPECT_TRUE(result);
869         if (!result && i > 0) {
870             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03200 : " << i;
871             break;
872         }
873     }
874 }
875 
876 /**
877  * @tc.number    : TaskDispatcher_Global_03300
878  * @tc.name      : global delay:parallel sync barrier
879  * @tc.desc      : two levels task dispatch
880  */
881 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03300, Function | MediumTest | Level1)
882 {
883     StartAbility(firstAbilityName, bundleNameFirst);
884     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_32";
885     bool result = false;
886     for (int i = 0; i < stLevel_.AMSLevel; i++) {
887         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
888         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
889         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
890         result = data.compare("1") == 0;
891         EXPECT_TRUE(result);
892         if (!result && i > 0) {
893             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03300 : " << i;
894             break;
895         }
896     }
897 }
898 
899 /**
900  * @tc.number    : TaskDispatcher_Global_03400
901  * @tc.name      : global delay:parallel async barrier
902  * @tc.desc      : two levels task dispatch
903  */
904 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03400, Function | MediumTest | Level1)
905 {
906     StartAbility(firstAbilityName, bundleNameFirst);
907     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_33";
908     bool result = false;
909     for (int i = 0; i < stLevel_.AMSLevel; i++) {
910         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
911         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
912         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
913         result = data.compare("1") == 0;
914         EXPECT_TRUE(result);
915         if (!result && i > 0) {
916             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03400 : " << i;
917             break;
918         }
919     }
920 }
921 
922 /**
923  * @tc.number    : TaskDispatcher_Global_03500
924  * @tc.name      : global delay:parallel apply
925  * @tc.desc      : two levels task dispatch
926  */
927 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03500, Function | MediumTest | Level1)
928 {
929     StartAbility(firstAbilityName, bundleNameFirst);
930     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_34";
931     bool result = false;
932     for (int i = 0; i < stLevel_.AMSLevel; i++) {
933         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
934         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
935         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
936         result = data.compare("1") == 0;
937         EXPECT_TRUE(result);
938         if (!result && i > 0) {
939             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03500 : " << i;
940             break;
941         }
942     }
943 }
944 
945 /**
946  * @tc.number    : TaskDispatcher_Global_03600
947  * @tc.name      : global delay:serial sync
948  * @tc.desc      : two levels task dispatch
949  */
950 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03600, Function | MediumTest | Level1)
951 {
952     StartAbility(firstAbilityName, bundleNameFirst);
953     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_35";
954     bool result = false;
955     for (int i = 0; i < stLevel_.AMSLevel; i++) {
956         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
957         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
958         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
959         result = data.compare("1") == 0;
960         EXPECT_TRUE(result);
961         if (!result && i > 0) {
962             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03600 : " << i;
963             break;
964         }
965     }
966 }
967 
968 /**
969  * @tc.number    : TaskDispatcher_Global_03700
970  * @tc.name      : global delay:serial async
971  * @tc.desc      : two levels task dispatch
972  */
973 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03700, Function | MediumTest | Level1)
974 {
975     StartAbility(firstAbilityName, bundleNameFirst);
976     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_36";
977     bool result = false;
978     for (int i = 0; i < stLevel_.AMSLevel; i++) {
979         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
980         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
981         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
982         result = data.compare("1") == 0;
983         EXPECT_TRUE(result);
984         if (!result && i > 0) {
985             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03700 : " << i;
986             break;
987         }
988     }
989 }
990 
991 /**
992  * @tc.number    : TaskDispatcher_Global_03800
993  * @tc.name      : global delay:serial delay
994  * @tc.desc      : two levels task dispatch
995  */
996 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03800, Function | MediumTest | Level1)
997 {
998     StartAbility(firstAbilityName, bundleNameFirst);
999     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_37";
1000     bool result = false;
1001     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1002         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1003         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1004         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1005         result = data.compare("1") == 0;
1006         EXPECT_TRUE(result);
1007         if (!result && i > 0) {
1008             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03800 : " << i;
1009             break;
1010         }
1011     }
1012 }
1013 
1014 /**
1015  * @tc.number    : TaskDispatcher_Global_03900
1016  * @tc.name      : global delay:serial apply
1017  * @tc.desc      : two levels task dispatch
1018  */
1019 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_03900, Function | MediumTest | Level1)
1020 {
1021     StartAbility(firstAbilityName, bundleNameFirst);
1022     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_38";
1023     bool result = false;
1024     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1025         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1026         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1027         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1028         result = data.compare("1") == 0;
1029         EXPECT_TRUE(result);
1030         if (!result && i > 0) {
1031             GTEST_LOG_(INFO) << "TaskDispatcher_Global_03900 : " << i;
1032             break;
1033         }
1034     }
1035 }
1036 
1037 /**
1038  * @tc.number    : TaskDispatcher_Global_04000
1039  * @tc.name      : global group:parallel sync
1040  * @tc.desc      : two levels task dispatch
1041  */
1042 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04000, Function | MediumTest | Level1)
1043 {
1044     StartAbility(firstAbilityName, bundleNameFirst);
1045     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_39";
1046     bool result = false;
1047     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1048         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1049         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1050         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1051         result = data.compare("1") == 0;
1052         EXPECT_TRUE(result);
1053         if (!result && i > 0) {
1054             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04000 : " << i;
1055             break;
1056         }
1057     }
1058 }
1059 
1060 /**
1061  * @tc.number    : TaskDispatcher_Global_04100
1062  * @tc.name      : global group:parallel async
1063  * @tc.desc      : two levels task dispatch
1064  */
1065 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04100, Function | MediumTest | Level1)
1066 {
1067     StartAbility(firstAbilityName, bundleNameFirst);
1068     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_40";
1069     bool result = false;
1070     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1071         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1072         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1073         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1074         result = data.compare("1") == 0;
1075         EXPECT_TRUE(result);
1076         if (!result && i > 0) {
1077             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04100 : " << i;
1078             break;
1079         }
1080     }
1081 }
1082 
1083 /**
1084  * @tc.number    : TaskDispatcher_Global_04200
1085  * @tc.name      : global group:parallel delay
1086  * @tc.desc      : two levels task dispatch
1087  */
1088 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04200, Function | MediumTest | Level1)
1089 {
1090     StartAbility(firstAbilityName, bundleNameFirst);
1091     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_41";
1092     bool result = false;
1093     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1094         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1095         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1096         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1097         result = data.compare("1") == 0;
1098         EXPECT_TRUE(result);
1099         if (!result && i > 0) {
1100             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04200 : " << i;
1101             break;
1102         }
1103     }
1104 }
1105 
1106 /**
1107  * @tc.number    : TaskDispatcher_Global_04300
1108  * @tc.name      : global group:parallel group
1109  * @tc.desc      : two levels task dispatch
1110  */
1111 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04300, Function | MediumTest | Level1)
1112 {
1113     StartAbility(firstAbilityName, bundleNameFirst);
1114     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_42";
1115     bool result = false;
1116     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1117         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1118         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1119         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1120         result = data.compare("1") == 0;
1121         EXPECT_TRUE(result);
1122         if (!result && i > 0) {
1123             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04300 : " << i;
1124             break;
1125         }
1126     }
1127 }
1128 
1129 /**
1130  * @tc.number    : TaskDispatcher_Global_04400
1131  * @tc.name      : global group:parallel group wait
1132  * @tc.desc      : two levels task dispatch
1133  */
1134 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04400, Function | MediumTest | Level1)
1135 {
1136     StartAbility(firstAbilityName, bundleNameFirst);
1137     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_43";
1138     bool result = false;
1139     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1140         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1141         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1142         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1143         result = data.compare("1") == 0;
1144         EXPECT_TRUE(result);
1145         if (!result && i > 0) {
1146             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04400 : " << i;
1147             break;
1148         }
1149     }
1150 }
1151 
1152 /**
1153  * @tc.number    : TaskDispatcher_Global_04500
1154  * @tc.name      : global group:parallel group notify
1155  * @tc.desc      : two levels task dispatch
1156  */
1157 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04500, Function | MediumTest | Level1)
1158 {
1159     StartAbility(firstAbilityName, bundleNameFirst);
1160     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_44";
1161     bool result = false;
1162     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1163         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1164         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1165         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1166         result = data.compare("1") == 0;
1167         EXPECT_TRUE(result);
1168         if (!result && i > 0) {
1169             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04500 : " << i;
1170             break;
1171         }
1172     }
1173 }
1174 
1175 /**
1176  * @tc.number    : TaskDispatcher_Global_04600
1177  * @tc.name      : global group:parallel sync barrier
1178  * @tc.desc      : two levels task dispatch
1179  */
1180 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04600, Function | MediumTest | Level1)
1181 {
1182     StartAbility(firstAbilityName, bundleNameFirst);
1183     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_45";
1184     bool result = false;
1185     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1186         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1187         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1188         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1189         result = data.compare("1") == 0;
1190         EXPECT_TRUE(result);
1191         if (!result && i > 0) {
1192             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04600 : " << i;
1193             break;
1194         }
1195     }
1196 }
1197 
1198 /**
1199  * @tc.number    : TaskDispatcher_Global_04700
1200  * @tc.name      : global group:parallel async barrier
1201  * @tc.desc      : two levels task dispatch
1202  */
1203 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04700, Function | MediumTest | Level1)
1204 {
1205     StartAbility(firstAbilityName, bundleNameFirst);
1206     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_46";
1207     bool result = false;
1208     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1209         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1210         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1211         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1212         result = data.compare("1") == 0;
1213         EXPECT_TRUE(result);
1214         if (!result && i > 0) {
1215             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04700 : " << i;
1216             break;
1217         }
1218     }
1219 }
1220 
1221 /**
1222  * @tc.number    : TaskDispatcher_Global_04800
1223  * @tc.name      : global group:parallel apply
1224  * @tc.desc      : two levels task dispatch
1225  */
1226 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04800, Function | MediumTest | Level1)
1227 {
1228     StartAbility(firstAbilityName, bundleNameFirst);
1229     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_47";
1230     bool result = false;
1231     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1232         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1233         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1234         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1235         result = data.compare("1") == 0;
1236         EXPECT_TRUE(result);
1237         if (!result && i > 0) {
1238             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04800 : " << i;
1239             break;
1240         }
1241     }
1242 }
1243 
1244 /**
1245  * @tc.number    : TaskDispatcher_Global_04900
1246  * @tc.name      : global group:serial sync
1247  * @tc.desc      : two levels task dispatch
1248  */
1249 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_04900, Function | MediumTest | Level1)
1250 {
1251     StartAbility(firstAbilityName, bundleNameFirst);
1252     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_48";
1253     bool result = false;
1254     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1255         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1256         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1257         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1258         result = data.compare("1") == 0;
1259         EXPECT_TRUE(result);
1260         if (!result && i > 0) {
1261             GTEST_LOG_(INFO) << "TaskDispatcher_Global_04900 : " << i;
1262             break;
1263         }
1264     }
1265 }
1266 
1267 /**
1268  * @tc.number    : TaskDispatcher_Global_05000
1269  * @tc.name      : global group:serial async
1270  * @tc.desc      : two levels task dispatch
1271  */
1272 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05000, Function | MediumTest | Level1)
1273 {
1274     StartAbility(firstAbilityName, bundleNameFirst);
1275     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_49";
1276     bool result = false;
1277     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1278         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1279         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1280         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1281         result = data.compare("1") == 0;
1282         EXPECT_TRUE(result);
1283         if (!result && i > 0) {
1284             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05000 : " << i;
1285             break;
1286         }
1287     }
1288 }
1289 
1290 /**
1291  * @tc.number    : TaskDispatcher_Global_05100
1292  * @tc.name      : global group:serial delay
1293  * @tc.desc      : two levels task dispatch
1294  */
1295 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05100, Function | MediumTest | Level1)
1296 {
1297     StartAbility(firstAbilityName, bundleNameFirst);
1298     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_50";
1299     bool result = false;
1300     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1301         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1302         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1303         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1304         result = data.compare("1") == 0;
1305         EXPECT_TRUE(result);
1306         if (!result && i > 0) {
1307             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05100 : " << i;
1308             break;
1309         }
1310     }
1311 }
1312 
1313 /**
1314  * @tc.number    : TaskDispatcher_Global_05200
1315  * @tc.name      : global group:serial apply
1316  * @tc.desc      : two levels task dispatch
1317  */
1318 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05200, Function | MediumTest | Level1)
1319 {
1320     StartAbility(firstAbilityName, bundleNameFirst);
1321     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_51";
1322     bool result = false;
1323     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1324         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1325         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1326         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1327         result = data.compare("1") == 0;
1328         EXPECT_TRUE(result);
1329         if (!result && i > 0) {
1330             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05200 : " << i;
1331             break;
1332         }
1333     }
1334 }
1335 
1336 /**
1337  * @tc.number    : TaskDispatcher_Global_05300
1338  * @tc.name      : global group wait:parallel sync
1339  * @tc.desc      : two levels task dispatch
1340  */
1341 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05300, Function | MediumTest | Level1)
1342 {
1343     StartAbility(firstAbilityName, bundleNameFirst);
1344     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_52";
1345     bool result = false;
1346     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1347         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1348         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1349         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1350         result = data.compare("1") == 0;
1351         EXPECT_TRUE(result);
1352         if (!result && i > 0) {
1353             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05300 : " << i;
1354             break;
1355         }
1356     }
1357 }
1358 
1359 /**
1360  * @tc.number    : TaskDispatcher_Global_05400
1361  * @tc.name      : global group wait:parallel async
1362  * @tc.desc      : two levels task dispatch
1363  */
1364 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05400, Function | MediumTest | Level1)
1365 {
1366     StartAbility(firstAbilityName, bundleNameFirst);
1367     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_53";
1368     bool result = false;
1369     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1370         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1371         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1372         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1373         result = data.compare("1") == 0;
1374         EXPECT_TRUE(result);
1375         if (!result && i > 0) {
1376             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05400 : " << i;
1377             break;
1378         }
1379     }
1380 }
1381 
1382 /**
1383  * @tc.number    : TaskDispatcher_Global_05500
1384  * @tc.name      : global group wait:parallel delay
1385  * @tc.desc      : two levels task dispatch
1386  */
1387 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05500, Function | MediumTest | Level1)
1388 {
1389     StartAbility(firstAbilityName, bundleNameFirst);
1390     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_54";
1391     bool result = false;
1392     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1393         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1394         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1395         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1396         result = data.compare("1") == 0;
1397         EXPECT_TRUE(result);
1398         if (!result && i > 0) {
1399             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05500 : " << i;
1400             break;
1401         }
1402     }
1403 }
1404 
1405 /**
1406  * @tc.number    : TaskDispatcher_Global_05600
1407  * @tc.name      : global group wait:parallel group
1408  * @tc.desc      : two levels task dispatch
1409  */
1410 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05600, Function | MediumTest | Level1)
1411 {
1412     StartAbility(firstAbilityName, bundleNameFirst);
1413     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_55";
1414     bool result = false;
1415     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1416         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1417         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1418         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1419         result = data.compare("1") == 0;
1420         EXPECT_TRUE(result);
1421         if (!result && i > 0) {
1422             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05600 : " << i;
1423             break;
1424         }
1425     }
1426 }
1427 
1428 /**
1429  * @tc.number    : TaskDispatcher_Global_05700
1430  * @tc.name      : global group wait:parallel group wait
1431  * @tc.desc      : two levels task dispatch
1432  */
1433 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05700, Function | MediumTest | Level1)
1434 {
1435     StartAbility(firstAbilityName, bundleNameFirst);
1436     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_56";
1437     bool result = false;
1438     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1439         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1440         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1441         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1442         result = data.compare("1") == 0;
1443         EXPECT_TRUE(result);
1444         if (!result && i > 0) {
1445             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05700 : " << i;
1446             break;
1447         }
1448     }
1449 }
1450 
1451 /**
1452  * @tc.number    : TaskDispatcher_Global_05800
1453  * @tc.name      : global group wait:parallel group notify
1454  * @tc.desc      : two levels task dispatch
1455  */
1456 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05800, Function | MediumTest | Level1)
1457 {
1458     StartAbility(firstAbilityName, bundleNameFirst);
1459     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_57";
1460     bool result = false;
1461     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1462         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1463         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1464         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1465         result = data.compare("1") == 0;
1466         EXPECT_TRUE(result);
1467         if (!result && i > 0) {
1468             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05800 : " << i;
1469             break;
1470         }
1471     }
1472 }
1473 
1474 /**
1475  * @tc.number    : TaskDispatcher_Global_05900
1476  * @tc.name      : global group wait:parallel sync barrier
1477  * @tc.desc      : two levels task dispatch
1478  */
1479 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_05900, Function | MediumTest | Level1)
1480 {
1481     StartAbility(firstAbilityName, bundleNameFirst);
1482     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_58";
1483     bool result = false;
1484     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1485         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1486         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1487         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1488         result = data.compare("1") == 0;
1489         EXPECT_TRUE(result);
1490         if (!result && i > 0) {
1491             GTEST_LOG_(INFO) << "TaskDispatcher_Global_05900 : " << i;
1492             break;
1493         }
1494     }
1495 }
1496 
1497 /**
1498  * @tc.number    : TaskDispatcher_Global_06000
1499  * @tc.name      : global group wait:parallel async barrier
1500  * @tc.desc      : two levels task dispatch
1501  */
1502 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06000, Function | MediumTest | Level1)
1503 {
1504     StartAbility(firstAbilityName, bundleNameFirst);
1505     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_59";
1506     bool result = false;
1507     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1508         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1509         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1510         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1511         result = data.compare("1") == 0;
1512         EXPECT_TRUE(result);
1513         if (!result && i > 0) {
1514             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06000 : " << i;
1515             break;
1516         }
1517     }
1518 }
1519 
1520 /**
1521  * @tc.number    : TaskDispatcher_Global_06100
1522  * @tc.name      : global group wait:parallel apply
1523  * @tc.desc      : two levels task dispatch
1524  */
1525 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06100, Function | MediumTest | Level1)
1526 {
1527     StartAbility(firstAbilityName, bundleNameFirst);
1528     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_60";
1529     bool result = false;
1530     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1531         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1532         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1533         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1534         result = data.compare("1") == 0;
1535         EXPECT_TRUE(result);
1536         if (!result && i > 0) {
1537             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06100 : " << i;
1538             break;
1539         }
1540     }
1541 }
1542 
1543 /**
1544  * @tc.number    : TaskDispatcher_Global_06200
1545  * @tc.name      : global group wait:serial sync
1546  * @tc.desc      : two levels task dispatch
1547  */
1548 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06200, Function | MediumTest | Level1)
1549 {
1550     StartAbility(firstAbilityName, bundleNameFirst);
1551     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_61";
1552     bool result = false;
1553     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1554         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1555         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1556         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1557         result = data.compare("1") == 0;
1558         EXPECT_TRUE(result);
1559         if (!result && i > 0) {
1560             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06200 : " << i;
1561             break;
1562         }
1563     }
1564 }
1565 
1566 /**
1567  * @tc.number    : TaskDispatcher_Global_06300
1568  * @tc.name      : global group wait:serial async
1569  * @tc.desc      : two levels task dispatch
1570  */
1571 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06300, Function | MediumTest | Level1)
1572 {
1573     StartAbility(firstAbilityName, bundleNameFirst);
1574     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_62";
1575     bool result = false;
1576     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1577         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1578         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1579         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1580         result = data.compare("1") == 0;
1581         EXPECT_TRUE(result);
1582         if (!result && i > 0) {
1583             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06300 : " << i;
1584             break;
1585         }
1586     }
1587 }
1588 
1589 /**
1590  * @tc.number    : TaskDispatcher_Global_06400
1591  * @tc.name      : global group wait:serial delay
1592  * @tc.desc      : two levels task dispatch
1593  */
1594 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06400, Function | MediumTest | Level1)
1595 {
1596     StartAbility(firstAbilityName, bundleNameFirst);
1597     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_63";
1598     bool result = false;
1599     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1600         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1601         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1602         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1603         result = data.compare("1") == 0;
1604         EXPECT_TRUE(result);
1605         if (!result && i > 0) {
1606             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06400 : " << i;
1607             break;
1608         }
1609     }
1610 }
1611 
1612 /**
1613  * @tc.number    : TaskDispatcher_Global_06500
1614  * @tc.name      : global group wait:serial apply
1615  * @tc.desc      : two levels task dispatch
1616  */
1617 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06500, Function | MediumTest | Level1)
1618 {
1619     StartAbility(firstAbilityName, bundleNameFirst);
1620     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_64";
1621     bool result = false;
1622     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1623         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1624         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1625         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1626         result = data.compare("1") == 0;
1627         EXPECT_TRUE(result);
1628         if (!result && i > 0) {
1629             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06500 : " << i;
1630             break;
1631         }
1632     }
1633 }
1634 
1635 /**
1636  * @tc.number    : TaskDispatcher_Global_06600
1637  * @tc.name      : global group notify:parallel sync
1638  * @tc.desc      : two levels task dispatch
1639  */
1640 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06600, Function | MediumTest | Level1)
1641 {
1642     StartAbility(firstAbilityName, bundleNameFirst);
1643     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_65";
1644     bool result = false;
1645     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1646         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1647         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1648         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1649         result = data.compare("1") == 0;
1650         EXPECT_TRUE(result);
1651         if (!result && i > 0) {
1652             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06600 : " << i;
1653             break;
1654         }
1655     }
1656 }
1657 
1658 /**
1659  * @tc.number    : TaskDispatcher_Global_06700
1660  * @tc.name      : global group notify:parallel async
1661  * @tc.desc      : two levels task dispatch
1662  */
1663 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06700, Function | MediumTest | Level1)
1664 {
1665     StartAbility(firstAbilityName, bundleNameFirst);
1666     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_66";
1667     bool result = false;
1668     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1669         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1670         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1671         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1672         result = data.compare("1") == 0;
1673         EXPECT_TRUE(result);
1674         if (!result && i > 0) {
1675             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06700 : " << i;
1676             break;
1677         }
1678     }
1679 }
1680 
1681 /**
1682  * @tc.number    : TaskDispatcher_Global_06800
1683  * @tc.name      : global group notify:parallel delay
1684  * @tc.desc      : two levels task dispatch
1685  */
1686 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06800, Function | MediumTest | Level1)
1687 {
1688     StartAbility(firstAbilityName, bundleNameFirst);
1689     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_67";
1690     bool result = false;
1691     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1692         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1693         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1694         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1695         result = data.compare("1") == 0;
1696         EXPECT_TRUE(result);
1697         if (!result && i > 0) {
1698             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06800 : " << i;
1699             break;
1700         }
1701     }
1702 }
1703 
1704 /**
1705  * @tc.number    : TaskDispatcher_Global_06900
1706  * @tc.name      : global group notify:parallel group
1707  * @tc.desc      : two levels task dispatch
1708  */
1709 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_06900, Function | MediumTest | Level1)
1710 {
1711     StartAbility(firstAbilityName, bundleNameFirst);
1712     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_68";
1713     bool result = false;
1714     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1715         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1716         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1717         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1718         result = data.compare("1") == 0;
1719         EXPECT_TRUE(result);
1720         if (!result && i > 0) {
1721             GTEST_LOG_(INFO) << "TaskDispatcher_Global_06900 : " << i;
1722             break;
1723         }
1724     }
1725 }
1726 
1727 /**
1728  * @tc.number    : TaskDispatcher_Global_07000
1729  * @tc.name      : global group notify:parallel group wait
1730  * @tc.desc      : two levels task dispatch
1731  */
1732 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07000, Function | MediumTest | Level1)
1733 {
1734     StartAbility(firstAbilityName, bundleNameFirst);
1735     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_69";
1736     bool result = false;
1737     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1738         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1739         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1740         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1741         result = data.compare("1") == 0;
1742         EXPECT_TRUE(result);
1743         if (!result && i > 0) {
1744             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07000 : " << i;
1745             break;
1746         }
1747     }
1748 }
1749 
1750 /**
1751  * @tc.number    : TaskDispatcher_Global_07100
1752  * @tc.name      : global group notify:parallel group notify
1753  * @tc.desc      : two levels task dispatch
1754  */
1755 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07100, Function | MediumTest | Level1)
1756 {
1757     StartAbility(firstAbilityName, bundleNameFirst);
1758     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_70";
1759     bool result = false;
1760     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1761         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1762         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1763         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1764         result = data.compare("1") == 0;
1765         EXPECT_TRUE(result);
1766         if (!result && i > 0) {
1767             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07100 : " << i;
1768             break;
1769         }
1770     }
1771 }
1772 
1773 /**
1774  * @tc.number    : TaskDispatcher_Global_07200
1775  * @tc.name      : global group notify:parallel sync barrier
1776  * @tc.desc      : two levels task dispatch
1777  */
1778 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07200, Function | MediumTest | Level1)
1779 {
1780     StartAbility(firstAbilityName, bundleNameFirst);
1781     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_71";
1782     bool result = false;
1783     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1784         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1785         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1786         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1787         result = data.compare("1") == 0;
1788         EXPECT_TRUE(result);
1789         if (!result && i > 0) {
1790             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07200 : " << i;
1791             break;
1792         }
1793     }
1794 }
1795 
1796 /**
1797  * @tc.number    : TaskDispatcher_Global_07300
1798  * @tc.name      : global group notify:parallel async barrier
1799  * @tc.desc      : two levels task dispatch
1800  */
1801 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07300, Function | MediumTest | Level1)
1802 {
1803     StartAbility(firstAbilityName, bundleNameFirst);
1804     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_72";
1805     bool result = false;
1806     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1807         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1808         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1809         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1810         result = data.compare("1") == 0;
1811         EXPECT_TRUE(result);
1812         if (!result && i > 0) {
1813             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07300 : " << i;
1814             break;
1815         }
1816     }
1817 }
1818 
1819 /**
1820  * @tc.number    : TaskDispatcher_Global_07400
1821  * @tc.name      : global group notify:parallel apply
1822  * @tc.desc      : two levels task dispatch
1823  */
1824 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07400, Function | MediumTest | Level1)
1825 {
1826     StartAbility(firstAbilityName, bundleNameFirst);
1827     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_73";
1828     bool result = false;
1829     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1830         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1831         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1832         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1833         result = data.compare("1") == 0;
1834         EXPECT_TRUE(result);
1835         if (!result && i > 0) {
1836             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07400 : " << i;
1837             break;
1838         }
1839     }
1840 }
1841 
1842 /**
1843  * @tc.number    : TaskDispatcher_Global_07500
1844  * @tc.name      : global group notify:serial sync
1845  * @tc.desc      : two levels task dispatch
1846  */
1847 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07500, Function | MediumTest | Level1)
1848 {
1849     StartAbility(firstAbilityName, bundleNameFirst);
1850     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_74";
1851     bool result = false;
1852     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1853         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1854         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1855         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1856         result = data.compare("1") == 0;
1857         EXPECT_TRUE(result);
1858         if (!result && i > 0) {
1859             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07500 : " << i;
1860             break;
1861         }
1862     }
1863 }
1864 
1865 /**
1866  * @tc.number    : TaskDispatcher_Global_07600
1867  * @tc.name      : global group notify:serial async
1868  * @tc.desc      : two levels task dispatch
1869  */
1870 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07600, Function | MediumTest | Level1)
1871 {
1872     StartAbility(firstAbilityName, bundleNameFirst);
1873     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_75";
1874     bool result = false;
1875     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1876         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1877         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1878         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1879         result = data.compare("1") == 0;
1880         EXPECT_TRUE(result);
1881         if (!result && i > 0) {
1882             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07600 : " << i;
1883             break;
1884         }
1885     }
1886 }
1887 
1888 /**
1889  * @tc.number    : TaskDispatcher_Global_07700
1890  * @tc.name      : global group notify:serial delay
1891  * @tc.desc      : two levels task dispatch
1892  */
1893 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07700, Function | MediumTest | Level1)
1894 {
1895     StartAbility(firstAbilityName, bundleNameFirst);
1896     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_76";
1897     bool result = false;
1898     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1899         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1900         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1901         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1902         result = data.compare("1") == 0;
1903         EXPECT_TRUE(result);
1904         if (!result && i > 0) {
1905             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07700 : " << i;
1906             break;
1907         }
1908     }
1909 }
1910 
1911 /**
1912  * @tc.number    : TaskDispatcher_Global_07800
1913  * @tc.name      : global group notify:serial apply
1914  * @tc.desc      : two levels task dispatch
1915  */
1916 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07800, Function | MediumTest | Level1)
1917 {
1918     StartAbility(firstAbilityName, bundleNameFirst);
1919     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_77";
1920     bool result = false;
1921     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1922         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1923         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1924         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1925         result = data.compare("1") == 0;
1926         EXPECT_TRUE(result);
1927         if (!result && i > 0) {
1928             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07800 : " << i;
1929             break;
1930         }
1931     }
1932 }
1933 
1934 /**
1935  * @tc.number    : TaskDispatcher_Global_07900
1936  * @tc.name      : global apply:parallel sync
1937  * @tc.desc      : two levels task dispatch
1938  */
1939 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_07900, Function | MediumTest | Level1)
1940 {
1941     StartAbility(firstAbilityName, bundleNameFirst);
1942     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_78";
1943     bool result = false;
1944     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1945         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1946         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1947         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1948         result = data.compare("1") == 0;
1949         EXPECT_TRUE(result);
1950         if (!result && i > 0) {
1951             GTEST_LOG_(INFO) << "TaskDispatcher_Global_07900 : " << i;
1952             break;
1953         }
1954     }
1955 }
1956 
1957 /**
1958  * @tc.number    : TaskDispatcher_Global_08000
1959  * @tc.name      : global apply:parallel async
1960  * @tc.desc      : two levels task dispatch
1961  */
1962 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08000, Function | MediumTest | Level1)
1963 {
1964     StartAbility(firstAbilityName, bundleNameFirst);
1965     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_79";
1966     bool result = false;
1967     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1968         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1969         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1970         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1971         result = data.compare("1") == 0;
1972         EXPECT_TRUE(result);
1973         if (!result && i > 0) {
1974             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08000 : " << i;
1975             break;
1976         }
1977     }
1978 }
1979 
1980 /**
1981  * @tc.number    : TaskDispatcher_Global_08100
1982  * @tc.name      : global apply:parallel delay
1983  * @tc.desc      : two levels task dispatch
1984  */
1985 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08100, Function | MediumTest | Level1)
1986 {
1987     StartAbility(firstAbilityName, bundleNameFirst);
1988     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_80";
1989     bool result = false;
1990     for (int i = 0; i < stLevel_.AMSLevel; i++) {
1991         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
1992         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
1993         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
1994         result = data.compare("1") == 0;
1995         EXPECT_TRUE(result);
1996         if (!result && i > 0) {
1997             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08100 : " << i;
1998             break;
1999         }
2000     }
2001 }
2002 
2003 /**
2004  * @tc.number    : TaskDispatcher_Global_08200
2005  * @tc.name      : global apply:parallel group
2006  * @tc.desc      : two levels task dispatch
2007  */
2008 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08200, Function | MediumTest | Level1)
2009 {
2010     StartAbility(firstAbilityName, bundleNameFirst);
2011     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_81";
2012     bool result = false;
2013     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2014         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2015         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2016         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2017         result = data.compare("1") == 0;
2018         EXPECT_TRUE(result);
2019         if (!result && i > 0) {
2020             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08200 : " << i;
2021             break;
2022         }
2023     }
2024 }
2025 
2026 /**
2027  * @tc.number    : TaskDispatcher_Global_08300
2028  * @tc.name      : global apply:parallel group wait
2029  * @tc.desc      : two levels task dispatch
2030  */
2031 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08300, Function | MediumTest | Level1)
2032 {
2033     StartAbility(firstAbilityName, bundleNameFirst);
2034     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_82";
2035     bool result = false;
2036     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2037         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2038         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2039         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2040         result = data.compare("1") == 0;
2041         EXPECT_TRUE(result);
2042         if (!result && i > 0) {
2043             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08300 : " << i;
2044             break;
2045         }
2046     }
2047 }
2048 
2049 /**
2050  * @tc.number    : TaskDispatcher_Global_08400
2051  * @tc.name      : global apply:parallel group notify
2052  * @tc.desc      : two levels task dispatch
2053  */
2054 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08400, Function | MediumTest | Level1)
2055 {
2056     StartAbility(firstAbilityName, bundleNameFirst);
2057     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_83";
2058     bool result = false;
2059     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2060         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2061         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2062         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2063         result = data.compare("1") == 0;
2064         EXPECT_TRUE(result);
2065         if (!result && i > 0) {
2066             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08400 : " << i;
2067             break;
2068         }
2069     }
2070 }
2071 
2072 /**
2073  * @tc.number    : TaskDispatcher_Global_08500
2074  * @tc.name      : global apply:parallel sync barrier
2075  * @tc.desc      : two levels task dispatch
2076  */
2077 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08500, Function | MediumTest | Level1)
2078 {
2079     StartAbility(firstAbilityName, bundleNameFirst);
2080     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_84";
2081     bool result = false;
2082     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2083         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2084         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2085         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2086         result = data.compare("1") == 0;
2087         EXPECT_TRUE(result);
2088         if (!result && i > 0) {
2089             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08500 : " << i;
2090             break;
2091         }
2092     }
2093 }
2094 
2095 /**
2096  * @tc.number    : TaskDispatcher_Global_08600
2097  * @tc.name      : global apply:parallel async barrier
2098  * @tc.desc      : two levels task dispatch
2099  */
2100 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08600, Function | MediumTest | Level1)
2101 {
2102     StartAbility(firstAbilityName, bundleNameFirst);
2103     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_85";
2104     bool result = false;
2105     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2106         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2107         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2108         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2109         result = data.compare("1") == 0;
2110         EXPECT_TRUE(result);
2111         if (!result && i > 0) {
2112             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08600 : " << i;
2113             break;
2114         }
2115     }
2116 }
2117 
2118 /**
2119  * @tc.number    : TaskDispatcher_Global_08700
2120  * @tc.name      : global apply:parallel apply
2121  * @tc.desc      : two levels task dispatch
2122  */
2123 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08700, Function | MediumTest | Level1)
2124 {
2125     StartAbility(firstAbilityName, bundleNameFirst);
2126     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_86";
2127     bool result = false;
2128     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2129         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2130         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2131         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2132         result = data.compare("1") == 0;
2133         EXPECT_TRUE(result);
2134         if (!result && i > 0) {
2135             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08700 : " << i;
2136             break;
2137         }
2138     }
2139 }
2140 
2141 /**
2142  * @tc.number    : TaskDispatcher_Global_08800
2143  * @tc.name      : global apply:serial sync
2144  * @tc.desc      : two levels task dispatch
2145  */
2146 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08800, Function | MediumTest | Level1)
2147 {
2148     StartAbility(firstAbilityName, bundleNameFirst);
2149     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_87";
2150     bool result = false;
2151     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2152         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2153         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2154         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2155         result = data.compare("1") == 0;
2156         EXPECT_TRUE(result);
2157         if (!result && i > 0) {
2158             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08800 : " << i;
2159             break;
2160         }
2161     }
2162 }
2163 
2164 /**
2165  * @tc.number    : TaskDispatcher_Global_08900
2166  * @tc.name      : global apply:serial async
2167  * @tc.desc      : two levels task dispatch
2168  */
2169 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_08900, Function | MediumTest | Level1)
2170 {
2171     StartAbility(firstAbilityName, bundleNameFirst);
2172     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_88";
2173     bool result = false;
2174     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2175         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2176         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2177         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2178         result = data.compare("1") == 0;
2179         EXPECT_TRUE(result);
2180         if (!result && i > 0) {
2181             GTEST_LOG_(INFO) << "TaskDispatcher_Global_08900 : " << i;
2182             break;
2183         }
2184     }
2185 }
2186 
2187 /**
2188  * @tc.number    : TaskDispatcher_Global_09000
2189  * @tc.name      : global apply:serial delay
2190  * @tc.desc      : two levels task dispatch
2191  */
2192 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_09000, Function | MediumTest | Level1)
2193 {
2194     StartAbility(firstAbilityName, bundleNameFirst);
2195     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_89";
2196     bool result = false;
2197     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2198         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2199         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2200         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2201         result = data.compare("1") == 0;
2202         EXPECT_TRUE(result);
2203         if (!result && i > 0) {
2204             GTEST_LOG_(INFO) << "TaskDispatcher_Global_09000 : " << i;
2205             break;
2206         }
2207     }
2208 }
2209 
2210 /**
2211  * @tc.number    : TaskDispatcher_Global_09100
2212  * @tc.name      : global apply:serial apply
2213  * @tc.desc      : two levels task dispatch
2214  */
2215 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Global_09100, Function | MediumTest | Level1)
2216 {
2217     StartAbility(firstAbilityName, bundleNameFirst);
2218     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::GLOBAL) + "_90";
2219     bool result = false;
2220     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2221         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2222         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2223         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2224         result = data.compare("1") == 0;
2225         EXPECT_TRUE(result);
2226         if (!result && i > 0) {
2227             GTEST_LOG_(INFO) << "TaskDispatcher_Global_09100 : " << i;
2228             break;
2229         }
2230     }
2231 }
2232 
2233 /**
2234  * @tc.number    : TaskDispatcher_Parallel_00100
2235  * @tc.name      : parallel sync:parallel sync
2236  * @tc.desc      : two levels task dispatch
2237  */
2238 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00100, Function | MediumTest | Level1)
2239 {
2240     StartAbility(firstAbilityName, bundleNameFirst);
2241     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_0";
2242     bool result = false;
2243     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2244         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2245         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2246         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2247         result = data.compare("1") == 0;
2248         EXPECT_TRUE(result);
2249         if (!result && i > 0) {
2250             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00100 : " << i;
2251             break;
2252         }
2253     }
2254 }
2255 
2256 /**
2257  * @tc.number    : TaskDispatcher_Parallel_00200
2258  * @tc.name      : parallel sync:parallel async
2259  * @tc.desc      : two levels task dispatch
2260  */
2261 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00200, Function | MediumTest | Level1)
2262 {
2263     StartAbility(firstAbilityName, bundleNameFirst);
2264     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_1";
2265     bool result = false;
2266     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2267         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2268         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2269         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2270         result = data.compare("1") == 0;
2271         EXPECT_TRUE(result);
2272         if (!result && i > 0) {
2273             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00200 : " << i;
2274             break;
2275         }
2276     }
2277 }
2278 
2279 /**
2280  * @tc.number    : TaskDispatcher_Parallel_00300
2281  * @tc.name      : parallel sync:parallel delay
2282  * @tc.desc      : two levels task dispatch
2283  */
2284 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00300, Function | MediumTest | Level1)
2285 {
2286     StartAbility(firstAbilityName, bundleNameFirst);
2287     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_2";
2288     bool result = false;
2289     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2290         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2291         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2292         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2293         result = data.compare("1") == 0;
2294         EXPECT_TRUE(result);
2295         if (!result && i > 0) {
2296             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00300 : " << i;
2297             break;
2298         }
2299     }
2300 }
2301 
2302 /**
2303  * @tc.number    : TaskDispatcher_Parallel_00400
2304  * @tc.name      : parallel sync:parallel group
2305  * @tc.desc      : two levels task dispatch
2306  */
2307 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00400, Function | MediumTest | Level1)
2308 {
2309     StartAbility(firstAbilityName, bundleNameFirst);
2310     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_3";
2311     bool result = false;
2312     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2313         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2314         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2315         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2316         result = data.compare("1") == 0;
2317         EXPECT_TRUE(result);
2318         if (!result && i > 0) {
2319             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00400 : " << i;
2320             break;
2321         }
2322     }
2323 }
2324 
2325 /**
2326  * @tc.number    : TaskDispatcher_Parallel_00500
2327  * @tc.name      : parallel sync:parallel group wait
2328  * @tc.desc      : two levels task dispatch
2329  */
2330 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00500, Function | MediumTest | Level1)
2331 {
2332     StartAbility(firstAbilityName, bundleNameFirst);
2333     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_4";
2334     bool result = false;
2335     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2336         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2337         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2338         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2339         result = data.compare("1") == 0;
2340         EXPECT_TRUE(result);
2341         if (!result && i > 0) {
2342             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00500 : " << i;
2343             break;
2344         }
2345     }
2346 }
2347 
2348 /**
2349  * @tc.number    : TaskDispatcher_Parallel_00600
2350  * @tc.name      : parallel sync:parallel group notify
2351  * @tc.desc      : two levels task dispatch
2352  */
2353 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00600, Function | MediumTest | Level1)
2354 {
2355     StartAbility(firstAbilityName, bundleNameFirst);
2356     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_5";
2357     bool result = false;
2358     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2359         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2360         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2361         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2362         result = data.compare("1") == 0;
2363         EXPECT_TRUE(result);
2364         if (!result && i > 0) {
2365             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00600 : " << i;
2366             break;
2367         }
2368     }
2369 }
2370 
2371 /**
2372  * @tc.number    : TaskDispatcher_Parallel_00700
2373  * @tc.name      : parallel sync:parallel sync barrier
2374  * @tc.desc      : two levels task dispatch
2375  */
2376 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00700, Function | MediumTest | Level1)
2377 {
2378     StartAbility(firstAbilityName, bundleNameFirst);
2379     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_6";
2380     bool result = false;
2381     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2382         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2383         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2384         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2385         result = data.compare("1") == 0;
2386         EXPECT_TRUE(result);
2387         if (!result && i > 0) {
2388             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00700 : " << i;
2389             break;
2390         }
2391     }
2392 }
2393 
2394 /**
2395  * @tc.number    : TaskDispatcher_Parallel_00800
2396  * @tc.name      : parallel sync:parallel async barrier
2397  * @tc.desc      : two levels task dispatch
2398  */
2399 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00800, Function | MediumTest | Level1)
2400 {
2401     StartAbility(firstAbilityName, bundleNameFirst);
2402     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_7";
2403     bool result = false;
2404     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2405         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2406         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2407         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2408         result = data.compare("1") == 0;
2409         EXPECT_TRUE(result);
2410         if (!result && i > 0) {
2411             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00800 : " << i;
2412             break;
2413         }
2414     }
2415 }
2416 
2417 /**
2418  * @tc.number    : TaskDispatcher_Parallel_00900
2419  * @tc.name      : parallel sync:parallel apply
2420  * @tc.desc      : two levels task dispatch
2421  */
2422 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_00900, Function | MediumTest | Level1)
2423 {
2424     StartAbility(firstAbilityName, bundleNameFirst);
2425     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_8";
2426     bool result = false;
2427     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2428         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2429         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2430         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2431         result = data.compare("1") == 0;
2432         EXPECT_TRUE(result);
2433         if (!result && i > 0) {
2434             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_00900 : " << i;
2435             break;
2436         }
2437     }
2438 }
2439 
2440 /**
2441  * @tc.number    : TaskDispatcher_Parallel_01000
2442  * @tc.name      : parallel sync:serial sync
2443  * @tc.desc      : two levels task dispatch
2444  */
2445 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01000, Function | MediumTest | Level1)
2446 {
2447     StartAbility(firstAbilityName, bundleNameFirst);
2448     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_9";
2449     bool result = false;
2450     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2451         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2452         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2453         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2454         result = data.compare("1") == 0;
2455         EXPECT_TRUE(result);
2456         if (!result && i > 0) {
2457             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01000 : " << i;
2458             break;
2459         }
2460     }
2461 }
2462 
2463 /**
2464  * @tc.number    : TaskDispatcher_Parallel_01100
2465  * @tc.name      : parallel sync:serial async
2466  * @tc.desc      : two levels task dispatch
2467  */
2468 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01100, Function | MediumTest | Level1)
2469 {
2470     StartAbility(firstAbilityName, bundleNameFirst);
2471     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_10";
2472     bool result = false;
2473     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2474         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2475         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2476         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2477         result = data.compare("1") == 0;
2478         EXPECT_TRUE(result);
2479         if (!result && i > 0) {
2480             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01100 : " << i;
2481             break;
2482         }
2483     }
2484 }
2485 
2486 /**
2487  * @tc.number    : TaskDispatcher_Parallel_01200
2488  * @tc.name      : parallel sync:serial delay
2489  * @tc.desc      : two levels task dispatch
2490  */
2491 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01200, Function | MediumTest | Level1)
2492 {
2493     StartAbility(firstAbilityName, bundleNameFirst);
2494     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_11";
2495     bool result = false;
2496     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2497         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2498         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2499         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2500         result = data.compare("1") == 0;
2501         EXPECT_TRUE(result);
2502         if (!result && i > 0) {
2503             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01200 : " << i;
2504             break;
2505         }
2506     }
2507 }
2508 
2509 /**
2510  * @tc.number    : TaskDispatcher_Parallel_01300
2511  * @tc.name      : parallel sync:serial apply
2512  * @tc.desc      : two levels task dispatch
2513  */
2514 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01300, Function | MediumTest | Level1)
2515 {
2516     StartAbility(firstAbilityName, bundleNameFirst);
2517     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_12";
2518     bool result = false;
2519     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2520         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2521         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2522         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2523         result = data.compare("1") == 0;
2524         EXPECT_TRUE(result);
2525         if (!result && i > 0) {
2526             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01300 : " << i;
2527             break;
2528         }
2529     }
2530 }
2531 
2532 /**
2533  * @tc.number    : TaskDispatcher_Parallel_01400
2534  * @tc.name      : parallel async:parallel sync
2535  * @tc.desc      : two levels task dispatch
2536  */
2537 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01400, Function | MediumTest | Level1)
2538 {
2539     StartAbility(firstAbilityName, bundleNameFirst);
2540     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_13";
2541     bool result = false;
2542     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2543         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2544         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2545         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2546         result = data.compare("1") == 0;
2547         EXPECT_TRUE(result);
2548         if (!result && i > 0) {
2549             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01400 : " << i;
2550             break;
2551         }
2552     }
2553 }
2554 
2555 /**
2556  * @tc.number    : TaskDispatcher_Parallel_01500
2557  * @tc.name      : parallel async:parallel async
2558  * @tc.desc      : two levels task dispatch
2559  */
2560 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01500, Function | MediumTest | Level1)
2561 {
2562     StartAbility(firstAbilityName, bundleNameFirst);
2563     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_14";
2564     bool result = false;
2565     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2566         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2567         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2568         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2569         result = data.compare("1") == 0;
2570         EXPECT_TRUE(result);
2571         if (!result && i > 0) {
2572             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01500 : " << i;
2573             break;
2574         }
2575     }
2576 }
2577 
2578 /**
2579  * @tc.number    : TaskDispatcher_Parallel_01600
2580  * @tc.name      : parallel async:parallel delay
2581  * @tc.desc      : two levels task dispatch
2582  */
2583 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01600, Function | MediumTest | Level1)
2584 {
2585     StartAbility(firstAbilityName, bundleNameFirst);
2586     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_15";
2587     bool result = false;
2588     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2589         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2590         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2591         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2592         result = data.compare("1") == 0;
2593         EXPECT_TRUE(result);
2594         if (!result && i > 0) {
2595             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01600 : " << i;
2596             break;
2597         }
2598     }
2599 }
2600 
2601 /**
2602  * @tc.number    : TaskDispatcher_Parallel_01700
2603  * @tc.name      : parallel async:parallel group
2604  * @tc.desc      : two levels task dispatch
2605  */
2606 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01700, Function | MediumTest | Level1)
2607 {
2608     StartAbility(firstAbilityName, bundleNameFirst);
2609     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_16";
2610     bool result = false;
2611     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2612         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2613         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2614         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2615         result = data.compare("1") == 0;
2616         EXPECT_TRUE(result);
2617         if (!result && i > 0) {
2618             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01700 : " << i;
2619             break;
2620         }
2621     }
2622 }
2623 
2624 /**
2625  * @tc.number    : TaskDispatcher_Parallel_01800
2626  * @tc.name      : parallel async:parallel group wait
2627  * @tc.desc      : two levels task dispatch
2628  */
2629 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01800, Function | MediumTest | Level1)
2630 {
2631     StartAbility(firstAbilityName, bundleNameFirst);
2632     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_17";
2633     bool result = false;
2634     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2635         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2636         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2637         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2638         result = data.compare("1") == 0;
2639         EXPECT_TRUE(result);
2640         if (!result && i > 0) {
2641             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01800 : " << i;
2642             break;
2643         }
2644     }
2645 }
2646 
2647 /**
2648  * @tc.number    : TaskDispatcher_Parallel_01900
2649  * @tc.name      : parallel async:parallel group notify
2650  * @tc.desc      : two levels task dispatch
2651  */
2652 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_01900, Function | MediumTest | Level1)
2653 {
2654     StartAbility(firstAbilityName, bundleNameFirst);
2655     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_18";
2656     bool result = false;
2657     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2658         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2659         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2660         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2661         result = data.compare("1") == 0;
2662         EXPECT_TRUE(result);
2663         if (!result && i > 0) {
2664             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_01900 : " << i;
2665             break;
2666         }
2667     }
2668 }
2669 
2670 /**
2671  * @tc.number    : TaskDispatcher_Parallel_02000
2672  * @tc.name      : parallel async:parallel sync barrier
2673  * @tc.desc      : two levels task dispatch
2674  */
2675 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02000, Function | MediumTest | Level1)
2676 {
2677     StartAbility(firstAbilityName, bundleNameFirst);
2678     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_19";
2679     bool result = false;
2680     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2681         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2682         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2683         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2684         result = data.compare("1") == 0;
2685         EXPECT_TRUE(result);
2686         if (!result && i > 0) {
2687             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02000 : " << i;
2688             break;
2689         }
2690     }
2691 }
2692 
2693 /**
2694  * @tc.number    : TaskDispatcher_Parallel_02100
2695  * @tc.name      : parallel async:parallel async barrier
2696  * @tc.desc      : two levels task dispatch
2697  */
2698 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02100, Function | MediumTest | Level1)
2699 {
2700     StartAbility(firstAbilityName, bundleNameFirst);
2701     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_20";
2702     bool result = false;
2703     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2704         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2705         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2706         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2707         result = data.compare("1") == 0;
2708         EXPECT_TRUE(result);
2709         if (!result && i > 0) {
2710             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02100 : " << i;
2711             break;
2712         }
2713     }
2714 }
2715 
2716 /**
2717  * @tc.number    : TaskDispatcher_Parallel_02200
2718  * @tc.name      : parallel async:parallel apply
2719  * @tc.desc      : two levels task dispatch
2720  */
2721 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02200, Function | MediumTest | Level1)
2722 {
2723     StartAbility(firstAbilityName, bundleNameFirst);
2724     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_21";
2725     bool result = false;
2726     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2727         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2728         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2729         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2730         result = data.compare("1") == 0;
2731         EXPECT_TRUE(result);
2732         if (!result && i > 0) {
2733             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02200 : " << i;
2734             break;
2735         }
2736     }
2737 }
2738 
2739 /**
2740  * @tc.number    : TaskDispatcher_Parallel_02300
2741  * @tc.name      : parallel async:serial sync
2742  * @tc.desc      : two levels task dispatch
2743  */
2744 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02300, Function | MediumTest | Level1)
2745 {
2746     StartAbility(firstAbilityName, bundleNameFirst);
2747     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_22";
2748     bool result = false;
2749     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2750         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2751         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2752         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2753         result = data.compare("1") == 0;
2754         EXPECT_TRUE(result);
2755         if (!result && i > 0) {
2756             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02300 : " << i;
2757             break;
2758         }
2759     }
2760 }
2761 
2762 /**
2763  * @tc.number    : TaskDispatcher_Parallel_02400
2764  * @tc.name      : parallel async:serial async
2765  * @tc.desc      : two levels task dispatch
2766  */
2767 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02400, Function | MediumTest | Level1)
2768 {
2769     StartAbility(firstAbilityName, bundleNameFirst);
2770     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_23";
2771     bool result = false;
2772     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2773         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2774         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2775         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2776         result = data.compare("1") == 0;
2777         EXPECT_TRUE(result);
2778         if (!result && i > 0) {
2779             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02400 : " << i;
2780             break;
2781         }
2782     }
2783 }
2784 
2785 /**
2786  * @tc.number    : TaskDispatcher_Parallel_02500
2787  * @tc.name      : parallel async:serial delay
2788  * @tc.desc      : two levels task dispatch
2789  */
2790 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02500, Function | MediumTest | Level1)
2791 {
2792     StartAbility(firstAbilityName, bundleNameFirst);
2793     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_24";
2794     bool result = false;
2795     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2796         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2797         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2798         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2799         result = data.compare("1") == 0;
2800         EXPECT_TRUE(result);
2801         if (!result && i > 0) {
2802             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02500 : " << i;
2803             break;
2804         }
2805     }
2806 }
2807 
2808 /**
2809  * @tc.number    : TaskDispatcher_Parallel_02600
2810  * @tc.name      : parallel async:serial apply
2811  * @tc.desc      : two levels task dispatch
2812  */
2813 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02600, Function | MediumTest | Level1)
2814 {
2815     StartAbility(firstAbilityName, bundleNameFirst);
2816     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_25";
2817     bool result = false;
2818     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2819         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2820         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2821         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2822         result = data.compare("1") == 0;
2823         EXPECT_TRUE(result);
2824         if (!result && i > 0) {
2825             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02600 : " << i;
2826             break;
2827         }
2828     }
2829 }
2830 
2831 /**
2832  * @tc.number    : TaskDispatcher_Parallel_02700
2833  * @tc.name      : parallel delay:parallel sync
2834  * @tc.desc      : two levels task dispatch
2835  */
2836 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02700, Function | MediumTest | Level1)
2837 {
2838     StartAbility(firstAbilityName, bundleNameFirst);
2839     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_26";
2840     bool result = false;
2841     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2842         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2843         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2844         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2845         result = data.compare("1") == 0;
2846         EXPECT_TRUE(result);
2847         if (!result && i > 0) {
2848             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02700 : " << i;
2849             break;
2850         }
2851     }
2852 }
2853 
2854 /**
2855  * @tc.number    : TaskDispatcher_Parallel_02800
2856  * @tc.name      : parallel delay:parallel async
2857  * @tc.desc      : two levels task dispatch
2858  */
2859 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02800, Function | MediumTest | Level1)
2860 {
2861     StartAbility(firstAbilityName, bundleNameFirst);
2862     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_27";
2863     bool result = false;
2864     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2865         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2866         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2867         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2868         result = data.compare("1") == 0;
2869         EXPECT_TRUE(result);
2870         if (!result && i > 0) {
2871             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02800 : " << i;
2872             break;
2873         }
2874     }
2875 }
2876 
2877 /**
2878  * @tc.number    : TaskDispatcher_Parallel_02900
2879  * @tc.name      : parallel delay:parallel delay
2880  * @tc.desc      : two levels task dispatch
2881  */
2882 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_02900, Function | MediumTest | Level1)
2883 {
2884     StartAbility(firstAbilityName, bundleNameFirst);
2885     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_28";
2886     bool result = false;
2887     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2888         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2889         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2890         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2891         result = data.compare("1") == 0;
2892         EXPECT_TRUE(result);
2893         if (!result && i > 0) {
2894             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_02900 : " << i;
2895             break;
2896         }
2897     }
2898 }
2899 
2900 /**
2901  * @tc.number    : TaskDispatcher_Parallel_03000
2902  * @tc.name      : parallel delay:parallel group
2903  * @tc.desc      : two levels task dispatch
2904  */
2905 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03000, Function | MediumTest | Level1)
2906 {
2907     StartAbility(firstAbilityName, bundleNameFirst);
2908     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_29";
2909     bool result = false;
2910     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2911         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2912         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2913         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2914         result = data.compare("1") == 0;
2915         EXPECT_TRUE(result);
2916         if (!result && i > 0) {
2917             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03000 : " << i;
2918             break;
2919         }
2920     }
2921 }
2922 
2923 /**
2924  * @tc.number    : TaskDispatcher_Parallel_03100
2925  * @tc.name      : parallel delay:parallel group wait
2926  * @tc.desc      : two levels task dispatch
2927  */
2928 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03100, Function | MediumTest | Level1)
2929 {
2930     StartAbility(firstAbilityName, bundleNameFirst);
2931     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_30";
2932     bool result = false;
2933     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2934         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2935         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2936         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2937         result = data.compare("1") == 0;
2938         EXPECT_TRUE(result);
2939         if (!result && i > 0) {
2940             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03100 : " << i;
2941             break;
2942         }
2943     }
2944 }
2945 
2946 /**
2947  * @tc.number    : TaskDispatcher_Parallel_03200
2948  * @tc.name      : parallel delay:parallel group notify
2949  * @tc.desc      : two levels task dispatch
2950  */
2951 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03200, Function | MediumTest | Level1)
2952 {
2953     StartAbility(firstAbilityName, bundleNameFirst);
2954     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_31";
2955     bool result = false;
2956     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2957         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2958         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2959         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2960         result = data.compare("1") == 0;
2961         EXPECT_TRUE(result);
2962         if (!result && i > 0) {
2963             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03200 : " << i;
2964             break;
2965         }
2966     }
2967 }
2968 
2969 /**
2970  * @tc.number    : TaskDispatcher_Parallel_03300
2971  * @tc.name      : parallel delay:parallel sync barrier
2972  * @tc.desc      : two levels task dispatch
2973  */
2974 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03300, Function | MediumTest | Level1)
2975 {
2976     StartAbility(firstAbilityName, bundleNameFirst);
2977     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_32";
2978     bool result = false;
2979     for (int i = 0; i < stLevel_.AMSLevel; i++) {
2980         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
2981         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
2982         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
2983         result = data.compare("1") == 0;
2984         EXPECT_TRUE(result);
2985         if (!result && i > 0) {
2986             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03300 : " << i;
2987             break;
2988         }
2989     }
2990 }
2991 
2992 /**
2993  * @tc.number    : TaskDispatcher_Parallel_03400
2994  * @tc.name      : parallel delay:parallel async barrier
2995  * @tc.desc      : two levels task dispatch
2996  */
2997 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03400, Function | MediumTest | Level1)
2998 {
2999     StartAbility(firstAbilityName, bundleNameFirst);
3000     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_33";
3001     bool result = false;
3002     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3003         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3004         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3005         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3006         result = data.compare("1") == 0;
3007         EXPECT_TRUE(result);
3008         if (!result && i > 0) {
3009             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03400 : " << i;
3010             break;
3011         }
3012     }
3013 }
3014 
3015 /**
3016  * @tc.number    : TaskDispatcher_Parallel_03500
3017  * @tc.name      : parallel delay:parallel apply
3018  * @tc.desc      : two levels task dispatch
3019  */
3020 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03500, Function | MediumTest | Level1)
3021 {
3022     StartAbility(firstAbilityName, bundleNameFirst);
3023     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_34";
3024     bool result = false;
3025     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3026         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3027         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3028         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3029         result = data.compare("1") == 0;
3030         EXPECT_TRUE(result);
3031         if (!result && i > 0) {
3032             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03500 : " << i;
3033             break;
3034         }
3035     }
3036 }
3037 
3038 /**
3039  * @tc.number    : TaskDispatcher_Parallel_03600
3040  * @tc.name      : parallel delay:serial sync
3041  * @tc.desc      : two levels task dispatch
3042  */
3043 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03600, Function | MediumTest | Level1)
3044 {
3045     StartAbility(firstAbilityName, bundleNameFirst);
3046     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_35";
3047     bool result = false;
3048     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3049         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3050         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3051         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3052         result = data.compare("1") == 0;
3053         EXPECT_TRUE(result);
3054         if (!result && i > 0) {
3055             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03600 : " << i;
3056             break;
3057         }
3058     }
3059 }
3060 
3061 /**
3062  * @tc.number    : TaskDispatcher_Parallel_03700
3063  * @tc.name      : parallel delay:serial async
3064  * @tc.desc      : two levels task dispatch
3065  */
3066 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03700, Function | MediumTest | Level1)
3067 {
3068     StartAbility(firstAbilityName, bundleNameFirst);
3069     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_36";
3070     bool result = false;
3071     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3072         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3073         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3074         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3075         result = data.compare("1") == 0;
3076         EXPECT_TRUE(result);
3077         if (!result && i > 0) {
3078             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03700 : " << i;
3079             break;
3080         }
3081     }
3082 }
3083 
3084 /**
3085  * @tc.number    : TaskDispatcher_Parallel_03800
3086  * @tc.name      : parallel delay:serial delay
3087  * @tc.desc      : two levels task dispatch
3088  */
3089 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03800, Function | MediumTest | Level1)
3090 {
3091     StartAbility(firstAbilityName, bundleNameFirst);
3092     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_37";
3093     bool result = false;
3094     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3095         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3096         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3097         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3098         result = data.compare("1") == 0;
3099         EXPECT_TRUE(result);
3100         if (!result && i > 0) {
3101             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03800 : " << i;
3102             break;
3103         }
3104     }
3105 }
3106 
3107 /**
3108  * @tc.number    : TaskDispatcher_Parallel_03900
3109  * @tc.name      : parallel delay:serial apply
3110  * @tc.desc      : two levels task dispatch
3111  */
3112 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_03900, Function | MediumTest | Level1)
3113 {
3114     StartAbility(firstAbilityName, bundleNameFirst);
3115     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_38";
3116     bool result = false;
3117     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3118         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3119         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3120         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3121         result = data.compare("1") == 0;
3122         EXPECT_TRUE(result);
3123         if (!result && i > 0) {
3124             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_03900 : " << i;
3125             break;
3126         }
3127     }
3128 }
3129 
3130 /**
3131  * @tc.number    : TaskDispatcher_Parallel_04000
3132  * @tc.name      : parallel group:parallel sync
3133  * @tc.desc      : two levels task dispatch
3134  */
3135 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04000, Function | MediumTest | Level1)
3136 {
3137     StartAbility(firstAbilityName, bundleNameFirst);
3138     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_39";
3139     bool result = false;
3140     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3141         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3142         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3143         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3144         result = data.compare("1") == 0;
3145         EXPECT_TRUE(result);
3146         if (!result && i > 0) {
3147             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04000 : " << i;
3148             break;
3149         }
3150     }
3151 }
3152 
3153 /**
3154  * @tc.number    : TaskDispatcher_Parallel_04100
3155  * @tc.name      : parallel group:parallel async
3156  * @tc.desc      : two levels task dispatch
3157  */
3158 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04100, Function | MediumTest | Level1)
3159 {
3160     StartAbility(firstAbilityName, bundleNameFirst);
3161     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_40";
3162     bool result = false;
3163     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3164         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3165         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3166         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3167         result = data.compare("1") == 0;
3168         EXPECT_TRUE(result);
3169         if (!result && i > 0) {
3170             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04100 : " << i;
3171             break;
3172         }
3173     }
3174 }
3175 
3176 /**
3177  * @tc.number    : TaskDispatcher_Parallel_04200
3178  * @tc.name      : parallel group:parallel delay
3179  * @tc.desc      : two levels task dispatch
3180  */
3181 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04200, Function | MediumTest | Level1)
3182 {
3183     StartAbility(firstAbilityName, bundleNameFirst);
3184     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_41";
3185     bool result = false;
3186     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3187         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3188         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3189         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3190         result = data.compare("1") == 0;
3191         EXPECT_TRUE(result);
3192         if (!result && i > 0) {
3193             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04200 : " << i;
3194             break;
3195         }
3196     }
3197 }
3198 
3199 /**
3200  * @tc.number    : TaskDispatcher_Parallel_04300
3201  * @tc.name      : parallel group:parallel group
3202  * @tc.desc      : two levels task dispatch
3203  */
3204 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04300, Function | MediumTest | Level1)
3205 {
3206     StartAbility(firstAbilityName, bundleNameFirst);
3207     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_42";
3208     bool result = false;
3209     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3210         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3211         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3212         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3213         result = data.compare("1") == 0;
3214         EXPECT_TRUE(result);
3215         if (!result && i > 0) {
3216             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04300 : " << i;
3217             break;
3218         }
3219     }
3220 }
3221 
3222 /**
3223  * @tc.number    : TaskDispatcher_Parallel_04400
3224  * @tc.name      : parallel group:parallel group wait
3225  * @tc.desc      : two levels task dispatch
3226  */
3227 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04400, Function | MediumTest | Level1)
3228 {
3229     StartAbility(firstAbilityName, bundleNameFirst);
3230     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_43";
3231     bool result = false;
3232     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3233         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3234         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3235         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3236         result = data.compare("1") == 0;
3237         EXPECT_TRUE(result);
3238         if (!result && i > 0) {
3239             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04400 : " << i;
3240             break;
3241         }
3242     }
3243 }
3244 
3245 /**
3246  * @tc.number    : TaskDispatcher_Parallel_04500
3247  * @tc.name      : parallel group:parallel group notify
3248  * @tc.desc      : two levels task dispatch
3249  */
3250 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04500, Function | MediumTest | Level1)
3251 {
3252     StartAbility(firstAbilityName, bundleNameFirst);
3253     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_44";
3254     bool result = false;
3255     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3256         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3257         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3258         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3259         result = data.compare("1") == 0;
3260         EXPECT_TRUE(result);
3261         if (!result && i > 0) {
3262             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04500 : " << i;
3263             break;
3264         }
3265     }
3266 }
3267 
3268 /**
3269  * @tc.number    : TaskDispatcher_Parallel_04600
3270  * @tc.name      : parallel group:parallel sync barrier
3271  * @tc.desc      : two levels task dispatch
3272  */
3273 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04600, Function | MediumTest | Level1)
3274 {
3275     StartAbility(firstAbilityName, bundleNameFirst);
3276     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_45";
3277     bool result = false;
3278     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3279         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3280         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3281         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3282         result = data.compare("1") == 0;
3283         EXPECT_TRUE(result);
3284         if (!result && i > 0) {
3285             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04600 : " << i;
3286             break;
3287         }
3288     }
3289 }
3290 
3291 /**
3292  * @tc.number    : TaskDispatcher_Parallel_04700
3293  * @tc.name      : parallel group:parallel async barrier
3294  * @tc.desc      : two levels task dispatch
3295  */
3296 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04700, Function | MediumTest | Level1)
3297 {
3298     StartAbility(firstAbilityName, bundleNameFirst);
3299     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_46";
3300     bool result = false;
3301     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3302         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3303         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3304         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3305         result = data.compare("1") == 0;
3306         EXPECT_TRUE(result);
3307         if (!result && i > 0) {
3308             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04700 : " << i;
3309             break;
3310         }
3311     }
3312 }
3313 
3314 /**
3315  * @tc.number    : TaskDispatcher_Parallel_04800
3316  * @tc.name      : parallel group:parallel apply
3317  * @tc.desc      : two levels task dispatch
3318  */
3319 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04800, Function | MediumTest | Level1)
3320 {
3321     StartAbility(firstAbilityName, bundleNameFirst);
3322     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_47";
3323     bool result = false;
3324     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3325         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3326         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3327         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3328         result = data.compare("1") == 0;
3329         EXPECT_TRUE(result);
3330         if (!result && i > 0) {
3331             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04800 : " << i;
3332             break;
3333         }
3334     }
3335 }
3336 
3337 /**
3338  * @tc.number    : TaskDispatcher_Parallel_04900
3339  * @tc.name      : parallel group:serial sync
3340  * @tc.desc      : two levels task dispatch
3341  */
3342 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_04900, Function | MediumTest | Level1)
3343 {
3344     StartAbility(firstAbilityName, bundleNameFirst);
3345     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_48";
3346     bool result = false;
3347     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3348         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3349         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3350         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3351         result = data.compare("1") == 0;
3352         EXPECT_TRUE(result);
3353         if (!result && i > 0) {
3354             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_04900 : " << i;
3355             break;
3356         }
3357     }
3358 }
3359 
3360 /**
3361  * @tc.number    : TaskDispatcher_Parallel_05000
3362  * @tc.name      : parallel group:serial async
3363  * @tc.desc      : two levels task dispatch
3364  */
3365 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05000, Function | MediumTest | Level1)
3366 {
3367     StartAbility(firstAbilityName, bundleNameFirst);
3368     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_49";
3369     bool result = false;
3370     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3371         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3372         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3373         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3374         result = data.compare("1") == 0;
3375         EXPECT_TRUE(result);
3376         if (!result && i > 0) {
3377             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05000 : " << i;
3378             break;
3379         }
3380     }
3381 }
3382 
3383 /**
3384  * @tc.number    : TaskDispatcher_Parallel_05100
3385  * @tc.name      : parallel group:serial delay
3386  * @tc.desc      : two levels task dispatch
3387  */
3388 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05100, Function | MediumTest | Level1)
3389 {
3390     StartAbility(firstAbilityName, bundleNameFirst);
3391     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_50";
3392     bool result = false;
3393     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3394         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3395         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3396         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3397         result = data.compare("1") == 0;
3398         EXPECT_TRUE(result);
3399         if (!result && i > 0) {
3400             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05100 : " << i;
3401             break;
3402         }
3403     }
3404 }
3405 
3406 /**
3407  * @tc.number    : TaskDispatcher_Parallel_05200
3408  * @tc.name      : parallel group:serial apply
3409  * @tc.desc      : two levels task dispatch
3410  */
3411 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05200, Function | MediumTest | Level1)
3412 {
3413     StartAbility(firstAbilityName, bundleNameFirst);
3414     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_51";
3415     bool result = false;
3416     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3417         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3418         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3419         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3420         result = data.compare("1") == 0;
3421         EXPECT_TRUE(result);
3422         if (!result && i > 0) {
3423             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05200 : " << i;
3424             break;
3425         }
3426     }
3427 }
3428 
3429 /**
3430  * @tc.number    : TaskDispatcher_Parallel_05300
3431  * @tc.name      : parallel group wait:parallel sync
3432  * @tc.desc      : two levels task dispatch
3433  */
3434 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05300, Function | MediumTest | Level1)
3435 {
3436     StartAbility(firstAbilityName, bundleNameFirst);
3437     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_52";
3438     bool result = false;
3439     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3440         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3441         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3442         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3443         result = data.compare("1") == 0;
3444         EXPECT_TRUE(result);
3445         if (!result && i > 0) {
3446             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05300 : " << i;
3447             break;
3448         }
3449     }
3450 }
3451 
3452 /**
3453  * @tc.number    : TaskDispatcher_Parallel_05400
3454  * @tc.name      : parallel group wait:parallel async
3455  * @tc.desc      : two levels task dispatch
3456  */
3457 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05400, Function | MediumTest | Level1)
3458 {
3459     StartAbility(firstAbilityName, bundleNameFirst);
3460     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_53";
3461     bool result = false;
3462     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3463         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3464         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3465         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3466         result = data.compare("1") == 0;
3467         EXPECT_TRUE(result);
3468         if (!result && i > 0) {
3469             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05400 : " << i;
3470             break;
3471         }
3472     }
3473 }
3474 
3475 /**
3476  * @tc.number    : TaskDispatcher_Parallel_05500
3477  * @tc.name      : parallel group wait:parallel delay
3478  * @tc.desc      : two levels task dispatch
3479  */
3480 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05500, Function | MediumTest | Level1)
3481 {
3482     StartAbility(firstAbilityName, bundleNameFirst);
3483     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_54";
3484     bool result = false;
3485     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3486         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3487         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3488         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3489         result = data.compare("1") == 0;
3490         EXPECT_TRUE(result);
3491         if (!result && i > 0) {
3492             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05500 : " << i;
3493             break;
3494         }
3495     }
3496 }
3497 
3498 /**
3499  * @tc.number    : TaskDispatcher_Parallel_05600
3500  * @tc.name      : parallel group wait:parallel group
3501  * @tc.desc      : two levels task dispatch
3502  */
3503 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05600, Function | MediumTest | Level1)
3504 {
3505     StartAbility(firstAbilityName, bundleNameFirst);
3506     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_55";
3507     bool result = false;
3508     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3509         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3510         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3511         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3512         result = data.compare("1") == 0;
3513         EXPECT_TRUE(result);
3514         if (!result && i > 0) {
3515             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05600 : " << i;
3516             break;
3517         }
3518     }
3519 }
3520 
3521 /**
3522  * @tc.number    : TaskDispatcher_Parallel_05700
3523  * @tc.name      : parallel group wait:parallel group wait
3524  * @tc.desc      : two levels task dispatch
3525  */
3526 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05700, Function | MediumTest | Level1)
3527 {
3528     StartAbility(firstAbilityName, bundleNameFirst);
3529     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_56";
3530     bool result = false;
3531     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3532         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3533         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3534         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3535         result = data.compare("1") == 0;
3536         EXPECT_TRUE(result);
3537         if (!result && i > 0) {
3538             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05700 : " << i;
3539             break;
3540         }
3541     }
3542 }
3543 
3544 /**
3545  * @tc.number    : TaskDispatcher_Parallel_05800
3546  * @tc.name      : parallel group wait:parallel group notify
3547  * @tc.desc      : two levels task dispatch
3548  */
3549 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05800, Function | MediumTest | Level1)
3550 {
3551     StartAbility(firstAbilityName, bundleNameFirst);
3552     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_57";
3553     bool result = false;
3554     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3555         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3556         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3557         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3558         result = data.compare("1") == 0;
3559         EXPECT_TRUE(result);
3560         if (!result && i > 0) {
3561             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05800 : " << i;
3562             break;
3563         }
3564     }
3565 }
3566 
3567 /**
3568  * @tc.number    : TaskDispatcher_Parallel_05900
3569  * @tc.name      : parallel group wait:parallel sync barrier
3570  * @tc.desc      : two levels task dispatch
3571  */
3572 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_05900, Function | MediumTest | Level1)
3573 {
3574     StartAbility(firstAbilityName, bundleNameFirst);
3575     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_58";
3576     bool result = false;
3577     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3578         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3579         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3580         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3581         result = data.compare("1") == 0;
3582         EXPECT_TRUE(result);
3583         if (!result && i > 0) {
3584             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_05900 : " << i;
3585             break;
3586         }
3587     }
3588 }
3589 
3590 /**
3591  * @tc.number    : TaskDispatcher_Parallel_06000
3592  * @tc.name      : parallel group wait:parallel async barrier
3593  * @tc.desc      : two levels task dispatch
3594  */
3595 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06000, Function | MediumTest | Level1)
3596 {
3597     StartAbility(firstAbilityName, bundleNameFirst);
3598     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_59";
3599     bool result = false;
3600     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3601         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3602         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3603         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3604         result = data.compare("1") == 0;
3605         EXPECT_TRUE(result);
3606         if (!result && i > 0) {
3607             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06000 : " << i;
3608             break;
3609         }
3610     }
3611 }
3612 
3613 /**
3614  * @tc.number    : TaskDispatcher_Parallel_06100
3615  * @tc.name      : parallel group wait:parallel apply
3616  * @tc.desc      : two levels task dispatch
3617  */
3618 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06100, Function | MediumTest | Level1)
3619 {
3620     StartAbility(firstAbilityName, bundleNameFirst);
3621     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_60";
3622     bool result = false;
3623     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3624         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3625         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3626         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3627         result = data.compare("1") == 0;
3628         EXPECT_TRUE(result);
3629         if (!result && i > 0) {
3630             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06100 : " << i;
3631             break;
3632         }
3633     }
3634 }
3635 
3636 /**
3637  * @tc.number    : TaskDispatcher_Parallel_06200
3638  * @tc.name      : parallel group wait:serial sync
3639  * @tc.desc      : two levels task dispatch
3640  */
3641 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06200, Function | MediumTest | Level1)
3642 {
3643     StartAbility(firstAbilityName, bundleNameFirst);
3644     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_61";
3645     bool result = false;
3646     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3647         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3648         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3649         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3650         result = data.compare("1") == 0;
3651         EXPECT_TRUE(result);
3652         if (!result && i > 0) {
3653             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06200 : " << i;
3654             break;
3655         }
3656     }
3657 }
3658 
3659 /**
3660  * @tc.number    : TaskDispatcher_Parallel_06300
3661  * @tc.name      : parallel group wait:serial async
3662  * @tc.desc      : two levels task dispatch
3663  */
3664 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06300, Function | MediumTest | Level1)
3665 {
3666     StartAbility(firstAbilityName, bundleNameFirst);
3667     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_62";
3668     bool result = false;
3669     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3670         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3671         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3672         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3673         result = data.compare("1") == 0;
3674         EXPECT_TRUE(result);
3675         if (!result && i > 0) {
3676             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06300 : " << i;
3677             break;
3678         }
3679     }
3680 }
3681 
3682 /**
3683  * @tc.number    : TaskDispatcher_Parallel_06400
3684  * @tc.name      : parallel group wait:serial delay
3685  * @tc.desc      : two levels task dispatch
3686  */
3687 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06400, Function | MediumTest | Level1)
3688 {
3689     StartAbility(firstAbilityName, bundleNameFirst);
3690     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_63";
3691     bool result = false;
3692     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3693         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3694         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3695         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3696         result = data.compare("1") == 0;
3697         EXPECT_TRUE(result);
3698         if (!result && i > 0) {
3699             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06400 : " << i;
3700             break;
3701         }
3702     }
3703 }
3704 
3705 /**
3706  * @tc.number    : TaskDispatcher_Parallel_06500
3707  * @tc.name      : parallel group wait:serial apply
3708  * @tc.desc      : two levels task dispatch
3709  */
3710 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06500, Function | MediumTest | Level1)
3711 {
3712     StartAbility(firstAbilityName, bundleNameFirst);
3713     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_64";
3714     bool result = false;
3715     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3716         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3717         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3718         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3719         result = data.compare("1") == 0;
3720         EXPECT_TRUE(result);
3721         if (!result && i > 0) {
3722             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06500 : " << i;
3723             break;
3724         }
3725     }
3726 }
3727 
3728 /**
3729  * @tc.number    : TaskDispatcher_Parallel_06600
3730  * @tc.name      : parallel group notify:parallel sync
3731  * @tc.desc      : two levels task dispatch
3732  */
3733 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06600, Function | MediumTest | Level1)
3734 {
3735     StartAbility(firstAbilityName, bundleNameFirst);
3736     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_65";
3737     bool result = false;
3738     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3739         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3740         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3741         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3742         result = data.compare("1") == 0;
3743         EXPECT_TRUE(result);
3744         if (!result && i > 0) {
3745             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06600 : " << i;
3746             break;
3747         }
3748     }
3749 }
3750 
3751 /**
3752  * @tc.number    : TaskDispatcher_Parallel_06700
3753  * @tc.name      : parallel group notify:parallel async
3754  * @tc.desc      : two levels task dispatch
3755  */
3756 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06700, Function | MediumTest | Level1)
3757 {
3758     StartAbility(firstAbilityName, bundleNameFirst);
3759     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_66";
3760     bool result = false;
3761     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3762         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3763         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3764         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3765         result = data.compare("1") == 0;
3766         EXPECT_TRUE(result);
3767         if (!result && i > 0) {
3768             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06700 : " << i;
3769             break;
3770         }
3771     }
3772 }
3773 
3774 /**
3775  * @tc.number    : TaskDispatcher_Parallel_06800
3776  * @tc.name      : parallel group notify:parallel delay
3777  * @tc.desc      : two levels task dispatch
3778  */
3779 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06800, Function | MediumTest | Level1)
3780 {
3781     StartAbility(firstAbilityName, bundleNameFirst);
3782     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_67";
3783     bool result = false;
3784     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3785         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3786         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3787         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3788         result = data.compare("1") == 0;
3789         EXPECT_TRUE(result);
3790         if (!result && i > 0) {
3791             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06800 : " << i;
3792             break;
3793         }
3794     }
3795 }
3796 
3797 /**
3798  * @tc.number    : TaskDispatcher_Parallel_06900
3799  * @tc.name      : parallel group notify:parallel group
3800  * @tc.desc      : two levels task dispatch
3801  */
3802 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_06900, Function | MediumTest | Level1)
3803 {
3804     StartAbility(firstAbilityName, bundleNameFirst);
3805     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_68";
3806     bool result = false;
3807     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3808         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3809         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3810         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3811         result = data.compare("1") == 0;
3812         EXPECT_TRUE(result);
3813         if (!result && i > 0) {
3814             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_06900 : " << i;
3815             break;
3816         }
3817     }
3818 }
3819 
3820 /**
3821  * @tc.number    : TaskDispatcher_Parallel_07000
3822  * @tc.name      : parallel group notify:parallel group wait
3823  * @tc.desc      : two levels task dispatch
3824  */
3825 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07000, Function | MediumTest | Level1)
3826 {
3827     StartAbility(firstAbilityName, bundleNameFirst);
3828     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_69";
3829     bool result = false;
3830     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3831         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3832         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3833         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3834         result = data.compare("1") == 0;
3835         EXPECT_TRUE(result);
3836         if (!result && i > 0) {
3837             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07000 : " << i;
3838             break;
3839         }
3840     }
3841 }
3842 
3843 /**
3844  * @tc.number    : TaskDispatcher_Parallel_07100
3845  * @tc.name      : parallel group notify:parallel group notify
3846  * @tc.desc      : two levels task dispatch
3847  */
3848 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07100, Function | MediumTest | Level1)
3849 {
3850     StartAbility(firstAbilityName, bundleNameFirst);
3851     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_70";
3852     bool result = false;
3853     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3854         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3855         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3856         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3857         result = data.compare("1") == 0;
3858         EXPECT_TRUE(result);
3859         if (!result && i > 0) {
3860             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07100 : " << i;
3861             break;
3862         }
3863     }
3864 }
3865 
3866 /**
3867  * @tc.number    : TaskDispatcher_Parallel_07200
3868  * @tc.name      : parallel group notify:parallel sync barrier
3869  * @tc.desc      : two levels task dispatch
3870  */
3871 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07200, Function | MediumTest | Level1)
3872 {
3873     StartAbility(firstAbilityName, bundleNameFirst);
3874     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_71";
3875     bool result = false;
3876     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3877         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3878         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3879         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3880         result = data.compare("1") == 0;
3881         EXPECT_TRUE(result);
3882         if (!result && i > 0) {
3883             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07200 : " << i;
3884             break;
3885         }
3886     }
3887 }
3888 
3889 /**
3890  * @tc.number    : TaskDispatcher_Parallel_07300
3891  * @tc.name      : parallel group notify:parallel async barrier
3892  * @tc.desc      : two levels task dispatch
3893  */
3894 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07300, Function | MediumTest | Level1)
3895 {
3896     StartAbility(firstAbilityName, bundleNameFirst);
3897     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_72";
3898     bool result = false;
3899     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3900         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3901         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3902         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3903         result = data.compare("1") == 0;
3904         EXPECT_TRUE(result);
3905         if (!result && i > 0) {
3906             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07300 : " << i;
3907             break;
3908         }
3909     }
3910 }
3911 
3912 /**
3913  * @tc.number    : TaskDispatcher_Parallel_07400
3914  * @tc.name      : parallel group notify:parallel apply
3915  * @tc.desc      : two levels task dispatch
3916  */
3917 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07400, Function | MediumTest | Level1)
3918 {
3919     StartAbility(firstAbilityName, bundleNameFirst);
3920     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_73";
3921     bool result = false;
3922     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3923         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3924         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3925         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3926         result = data.compare("1") == 0;
3927         EXPECT_TRUE(result);
3928         if (!result && i > 0) {
3929             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07400 : " << i;
3930             break;
3931         }
3932     }
3933 }
3934 
3935 /**
3936  * @tc.number    : TaskDispatcher_Parallel_07500
3937  * @tc.name      : parallel group notify:serial sync
3938  * @tc.desc      : two levels task dispatch
3939  */
3940 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07500, Function | MediumTest | Level1)
3941 {
3942     StartAbility(firstAbilityName, bundleNameFirst);
3943     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_74";
3944     bool result = false;
3945     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3946         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3947         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3948         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3949         result = data.compare("1") == 0;
3950         EXPECT_TRUE(result);
3951         if (!result && i > 0) {
3952             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07500 : " << i;
3953             break;
3954         }
3955     }
3956 }
3957 
3958 /**
3959  * @tc.number    : TaskDispatcher_Parallel_07600
3960  * @tc.name      : parallel group notify:serial async
3961  * @tc.desc      : two levels task dispatch
3962  */
3963 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07600, Function | MediumTest | Level1)
3964 {
3965     StartAbility(firstAbilityName, bundleNameFirst);
3966     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_75";
3967     bool result = false;
3968     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3969         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3970         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3971         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3972         result = data.compare("1") == 0;
3973         EXPECT_TRUE(result);
3974         if (!result && i > 0) {
3975             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07600 : " << i;
3976             break;
3977         }
3978     }
3979 }
3980 
3981 /**
3982  * @tc.number    : TaskDispatcher_Parallel_07700
3983  * @tc.name      : parallel group notify:serial delay
3984  * @tc.desc      : two levels task dispatch
3985  */
3986 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07700, Function | MediumTest | Level1)
3987 {
3988     StartAbility(firstAbilityName, bundleNameFirst);
3989     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_76";
3990     bool result = false;
3991     for (int i = 0; i < stLevel_.AMSLevel; i++) {
3992         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
3993         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
3994         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
3995         result = data.compare("1") == 0;
3996         EXPECT_TRUE(result);
3997         if (!result && i > 0) {
3998             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07700 : " << i;
3999             break;
4000         }
4001     }
4002 }
4003 
4004 /**
4005  * @tc.number    : TaskDispatcher_Parallel_07800
4006  * @tc.name      : parallel group notify:serial apply
4007  * @tc.desc      : two levels task dispatch
4008  */
4009 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07800, Function | MediumTest | Level1)
4010 {
4011     StartAbility(firstAbilityName, bundleNameFirst);
4012     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_77";
4013     bool result = false;
4014     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4015         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4016         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4017         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4018         result = data.compare("1") == 0;
4019         EXPECT_TRUE(result);
4020         if (!result && i > 0) {
4021             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07800 : " << i;
4022             break;
4023         }
4024     }
4025 }
4026 
4027 /**
4028  * @tc.number    : TaskDispatcher_Parallel_07900
4029  * @tc.name      : parallel sync barrier:parallel sync
4030  * @tc.desc      : two levels task dispatch
4031  */
4032 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_07900, Function | MediumTest | Level1)
4033 {
4034     StartAbility(firstAbilityName, bundleNameFirst);
4035     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_78";
4036     bool result = false;
4037     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4038         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4039         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4040         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4041         result = data.compare("1") == 0;
4042         EXPECT_TRUE(result);
4043         if (!result && i > 0) {
4044             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_07900 : " << i;
4045             break;
4046         }
4047     }
4048 }
4049 
4050 /**
4051  * @tc.number    : TaskDispatcher_Parallel_08000
4052  * @tc.name      : parallel sync barrier:parallel async
4053  * @tc.desc      : two levels task dispatch
4054  */
4055 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08000, Function | MediumTest | Level1)
4056 {
4057     StartAbility(firstAbilityName, bundleNameFirst);
4058     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_79";
4059     bool result = false;
4060     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4061         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4062         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4063         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4064         result = data.compare("1") == 0;
4065         EXPECT_TRUE(result);
4066         if (!result && i > 0) {
4067             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08000 : " << i;
4068             break;
4069         }
4070     }
4071 }
4072 
4073 /**
4074  * @tc.number    : TaskDispatcher_Parallel_08100
4075  * @tc.name      : parallel sync barrier:parallel delay
4076  * @tc.desc      : two levels task dispatch
4077  */
4078 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08100, Function | MediumTest | Level1)
4079 {
4080     StartAbility(firstAbilityName, bundleNameFirst);
4081     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_80";
4082     bool result = false;
4083     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4084         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4085         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4086         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4087         result = data.compare("1") == 0;
4088         EXPECT_TRUE(result);
4089         if (!result && i > 0) {
4090             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08100 : " << i;
4091             break;
4092         }
4093     }
4094 }
4095 
4096 /**
4097  * @tc.number    : TaskDispatcher_Parallel_08200
4098  * @tc.name      : parallel sync barrier:parallel group
4099  * @tc.desc      : two levels task dispatch
4100  */
4101 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08200, Function | MediumTest | Level1)
4102 {
4103     StartAbility(firstAbilityName, bundleNameFirst);
4104     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_81";
4105     bool result = false;
4106     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4107         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4108         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4109         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4110         result = data.compare("1") == 0;
4111         EXPECT_TRUE(result);
4112         if (!result && i > 0) {
4113             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08200 : " << i;
4114             break;
4115         }
4116     }
4117 }
4118 
4119 /**
4120  * @tc.number    : TaskDispatcher_Parallel_08300
4121  * @tc.name      : parallel sync barrier:parallel group wait
4122  * @tc.desc      : two levels task dispatch
4123  */
4124 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08300, Function | MediumTest | Level1)
4125 {
4126     StartAbility(firstAbilityName, bundleNameFirst);
4127     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_82";
4128     bool result = false;
4129     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4130         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4131         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4132         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4133         result = data.compare("1") == 0;
4134         EXPECT_TRUE(result);
4135         if (!result && i > 0) {
4136             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08300 : " << i;
4137             break;
4138         }
4139     }
4140 }
4141 
4142 /**
4143  * @tc.number    : TaskDispatcher_Parallel_08400
4144  * @tc.name      : parallel sync barrier:parallel group notify
4145  * @tc.desc      : two levels task dispatch
4146  */
4147 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08400, Function | MediumTest | Level1)
4148 {
4149     StartAbility(firstAbilityName, bundleNameFirst);
4150     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_83";
4151     bool result = false;
4152     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4153         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4154         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4155         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4156         result = data.compare("1") == 0;
4157         EXPECT_TRUE(result);
4158         if (!result && i > 0) {
4159             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08400 : " << i;
4160             break;
4161         }
4162     }
4163 }
4164 
4165 /**
4166  * @tc.number    : TaskDispatcher_Parallel_08500
4167  * @tc.name      : parallel sync barrier:parallel sync barrier
4168  * @tc.desc      : two levels task dispatch
4169  */
4170 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08500, Function | MediumTest | Level1)
4171 {
4172     StartAbility(firstAbilityName, bundleNameFirst);
4173     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_84";
4174     bool result = false;
4175     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4176         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4177         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4178         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4179         result = data.compare("1") == 0;
4180         EXPECT_TRUE(result);
4181         if (!result && i > 0) {
4182             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08500 : " << i;
4183             break;
4184         }
4185     }
4186 }
4187 
4188 /**
4189  * @tc.number    : TaskDispatcher_Parallel_08600
4190  * @tc.name      : parallel sync barrier:parallel async barrier
4191  * @tc.desc      : two levels task dispatch
4192  */
4193 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08600, Function | MediumTest | Level1)
4194 {
4195     StartAbility(firstAbilityName, bundleNameFirst);
4196     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_85";
4197     bool result = false;
4198     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4199         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4200         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4201         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4202         result = data.compare("1") == 0;
4203         EXPECT_TRUE(result);
4204         if (!result && i > 0) {
4205             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08600 : " << i;
4206             break;
4207         }
4208     }
4209 }
4210 
4211 /**
4212  * @tc.number    : TaskDispatcher_Parallel_08700
4213  * @tc.name      : parallel sync barrier:parallel apply
4214  * @tc.desc      : two levels task dispatch
4215  */
4216 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08700, Function | MediumTest | Level1)
4217 {
4218     StartAbility(firstAbilityName, bundleNameFirst);
4219     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_86";
4220     bool result = false;
4221     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4222         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4223         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4224         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4225         result = data.compare("1") == 0;
4226         EXPECT_TRUE(result);
4227         if (!result && i > 0) {
4228             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08700 : " << i;
4229             break;
4230         }
4231     }
4232 }
4233 
4234 /**
4235  * @tc.number    : TaskDispatcher_Parallel_08800
4236  * @tc.name      : parallel sync barrier:serial sync
4237  * @tc.desc      : two levels task dispatch
4238  */
4239 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08800, Function | MediumTest | Level1)
4240 {
4241     StartAbility(firstAbilityName, bundleNameFirst);
4242     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_87";
4243     bool result = false;
4244     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4245         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4246         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4247         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4248         result = data.compare("1") == 0;
4249         EXPECT_TRUE(result);
4250         if (!result && i > 0) {
4251             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08800 : " << i;
4252             break;
4253         }
4254     }
4255 }
4256 
4257 /**
4258  * @tc.number    : TaskDispatcher_Parallel_08900
4259  * @tc.name      : parallel sync barrier:serial async
4260  * @tc.desc      : two levels task dispatch
4261  */
4262 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_08900, Function | MediumTest | Level1)
4263 {
4264     StartAbility(firstAbilityName, bundleNameFirst);
4265     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_88";
4266     bool result = false;
4267     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4268         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4269         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4270         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4271         result = data.compare("1") == 0;
4272         EXPECT_TRUE(result);
4273         if (!result && i > 0) {
4274             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_08900 : " << i;
4275             break;
4276         }
4277     }
4278 }
4279 
4280 /**
4281  * @tc.number    : TaskDispatcher_Parallel_09000
4282  * @tc.name      : parallel sync barrier:serial delay
4283  * @tc.desc      : two levels task dispatch
4284  */
4285 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09000, Function | MediumTest | Level1)
4286 {
4287     StartAbility(firstAbilityName, bundleNameFirst);
4288     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_89";
4289     bool result = false;
4290     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4291         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4292         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4293         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4294         result = data.compare("1") == 0;
4295         EXPECT_TRUE(result);
4296         if (!result && i > 0) {
4297             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09000 : " << i;
4298             break;
4299         }
4300     }
4301 }
4302 
4303 /**
4304  * @tc.number    : TaskDispatcher_Parallel_09100
4305  * @tc.name      : parallel sync barrier:serial apply
4306  * @tc.desc      : two levels task dispatch
4307  */
4308 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09100, Function | MediumTest | Level1)
4309 {
4310     StartAbility(firstAbilityName, bundleNameFirst);
4311     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_90";
4312     bool result = false;
4313     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4314         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4315         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4316         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4317         result = data.compare("1") == 0;
4318         EXPECT_TRUE(result);
4319         if (!result && i > 0) {
4320             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09100 : " << i;
4321             break;
4322         }
4323     }
4324 }
4325 
4326 /**
4327  * @tc.number    : TaskDispatcher_Parallel_09200
4328  * @tc.name      : parallel async barrier:parallel sync
4329  * @tc.desc      : two levels task dispatch
4330  */
4331 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09200, Function | MediumTest | Level1)
4332 {
4333     StartAbility(firstAbilityName, bundleNameFirst);
4334     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_91";
4335     bool result = false;
4336     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4337         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4338         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4339         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4340         result = data.compare("1") == 0;
4341         EXPECT_TRUE(result);
4342         if (!result && i > 0) {
4343             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09200 : " << i;
4344             break;
4345         }
4346     }
4347 }
4348 
4349 /**
4350  * @tc.number    : TaskDispatcher_Parallel_09300
4351  * @tc.name      : parallel async barrier:parallel async
4352  * @tc.desc      : two levels task dispatch
4353  */
4354 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09300, Function | MediumTest | Level1)
4355 {
4356     StartAbility(firstAbilityName, bundleNameFirst);
4357     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_92";
4358     bool result = false;
4359     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4360         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4361         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4362         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4363         result = data.compare("1") == 0;
4364         EXPECT_TRUE(result);
4365         if (!result && i > 0) {
4366             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09300 : " << i;
4367             break;
4368         }
4369     }
4370 }
4371 
4372 /**
4373  * @tc.number    : TaskDispatcher_Parallel_09400
4374  * @tc.name      : parallel async barrier:parallel delay
4375  * @tc.desc      : two levels task dispatch
4376  */
4377 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09400, Function | MediumTest | Level1)
4378 {
4379     StartAbility(firstAbilityName, bundleNameFirst);
4380     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_93";
4381     bool result = false;
4382     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4383         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4384         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4385         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4386         result = data.compare("1") == 0;
4387         EXPECT_TRUE(result);
4388         if (!result && i > 0) {
4389             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09400 : " << i;
4390             break;
4391         }
4392     }
4393 }
4394 
4395 /**
4396  * @tc.number    : TaskDispatcher_Parallel_09500
4397  * @tc.name      : parallel async barrier:parallel group
4398  * @tc.desc      : two levels task dispatch
4399  */
4400 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09500, Function | MediumTest | Level1)
4401 {
4402     StartAbility(firstAbilityName, bundleNameFirst);
4403     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_94";
4404     bool result = false;
4405     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4406         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4407         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4408         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4409         result = data.compare("1") == 0;
4410         EXPECT_TRUE(result);
4411         if (!result && i > 0) {
4412             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09500 : " << i;
4413             break;
4414         }
4415     }
4416 }
4417 
4418 /**
4419  * @tc.number    : TaskDispatcher_Parallel_09600
4420  * @tc.name      : parallel async barrier:parallel group wait
4421  * @tc.desc      : two levels task dispatch
4422  */
4423 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09600, Function | MediumTest | Level1)
4424 {
4425     StartAbility(firstAbilityName, bundleNameFirst);
4426     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_95";
4427     bool result = false;
4428     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4429         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4430         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4431         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4432         result = data.compare("1") == 0;
4433         EXPECT_TRUE(result);
4434         if (!result && i > 0) {
4435             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09600 : " << i;
4436             break;
4437         }
4438     }
4439 }
4440 
4441 /**
4442  * @tc.number    : TaskDispatcher_Parallel_09700
4443  * @tc.name      : parallel async barrier:parallel group notify
4444  * @tc.desc      : two levels task dispatch
4445  */
4446 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09700, Function | MediumTest | Level1)
4447 {
4448     StartAbility(firstAbilityName, bundleNameFirst);
4449     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_96";
4450     bool result = false;
4451     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4452         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4453         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4454         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4455         result = data.compare("1") == 0;
4456         EXPECT_TRUE(result);
4457         if (!result && i > 0) {
4458             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09700 : " << i;
4459             break;
4460         }
4461     }
4462 }
4463 
4464 /**
4465  * @tc.number    : TaskDispatcher_Parallel_09800
4466  * @tc.name      : parallel async barrier:parallel sync barrier
4467  * @tc.desc      : two levels task dispatch
4468  */
4469 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09800, Function | MediumTest | Level1)
4470 {
4471     StartAbility(firstAbilityName, bundleNameFirst);
4472     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_97";
4473     bool result = false;
4474     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4475         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4476         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4477         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4478         result = data.compare("1") == 0;
4479         EXPECT_TRUE(result);
4480         if (!result && i > 0) {
4481             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09800 : " << i;
4482             break;
4483         }
4484     }
4485 }
4486 
4487 /**
4488  * @tc.number    : TaskDispatcher_Parallel_09900
4489  * @tc.name      : parallel async barrier:parallel async barrier
4490  * @tc.desc      : two levels task dispatch
4491  */
4492 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_09900, Function | MediumTest | Level1)
4493 {
4494     StartAbility(firstAbilityName, bundleNameFirst);
4495     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_98";
4496     bool result = false;
4497     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4498         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4499         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4500         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4501         result = data.compare("1") == 0;
4502         EXPECT_TRUE(result);
4503         if (!result && i > 0) {
4504             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_09900 : " << i;
4505             break;
4506         }
4507     }
4508 }
4509 
4510 /**
4511  * @tc.number    : TaskDispatcher_Parallel_10000
4512  * @tc.name      : parallel async barrier:parallel apply
4513  * @tc.desc      : two levels task dispatch
4514  */
4515 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10000, Function | MediumTest | Level1)
4516 {
4517     StartAbility(firstAbilityName, bundleNameFirst);
4518     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_99";
4519     bool result = false;
4520     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4521         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4522         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4523         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4524         result = data.compare("1") == 0;
4525         EXPECT_TRUE(result);
4526         if (!result && i > 0) {
4527             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10000 : " << i;
4528             break;
4529         }
4530     }
4531 }
4532 
4533 /**
4534  * @tc.number    : TaskDispatcher_Parallel_10100
4535  * @tc.name      : parallel async barrier:serial sync
4536  * @tc.desc      : two levels task dispatch
4537  */
4538 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10100, Function | MediumTest | Level1)
4539 {
4540     StartAbility(firstAbilityName, bundleNameFirst);
4541     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_100";
4542     bool result = false;
4543     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4544         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4545         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4546         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4547         result = data.compare("1") == 0;
4548         EXPECT_TRUE(result);
4549         if (!result && i > 0) {
4550             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10100 : " << i;
4551             break;
4552         }
4553     }
4554 }
4555 
4556 /**
4557  * @tc.number    : TaskDispatcher_Parallel_10200
4558  * @tc.name      : parallel async barrier:serial async
4559  * @tc.desc      : two levels task dispatch
4560  */
4561 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10200, Function | MediumTest | Level1)
4562 {
4563     StartAbility(firstAbilityName, bundleNameFirst);
4564     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_101";
4565     bool result = false;
4566     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4567         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4568         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4569         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4570         result = data.compare("1") == 0;
4571         EXPECT_TRUE(result);
4572         if (!result && i > 0) {
4573             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10200 : " << i;
4574             break;
4575         }
4576     }
4577 }
4578 
4579 /**
4580  * @tc.number    : TaskDispatcher_Parallel_10300
4581  * @tc.name      : parallel async barrier:serial delay
4582  * @tc.desc      : two levels task dispatch
4583  */
4584 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10300, Function | MediumTest | Level1)
4585 {
4586     StartAbility(firstAbilityName, bundleNameFirst);
4587     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_102";
4588     bool result = false;
4589     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4590         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4591         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4592         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4593         result = data.compare("1") == 0;
4594         EXPECT_TRUE(result);
4595         if (!result && i > 0) {
4596             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10300 : " << i;
4597             break;
4598         }
4599     }
4600 }
4601 
4602 /**
4603  * @tc.number    : TaskDispatcher_Parallel_10400
4604  * @tc.name      : parallel async barrier:serial apply
4605  * @tc.desc      : two levels task dispatch
4606  */
4607 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10400, Function | MediumTest | Level1)
4608 {
4609     StartAbility(firstAbilityName, bundleNameFirst);
4610     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_103";
4611     bool result = false;
4612     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4613         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4614         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4615         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4616         result = data.compare("1") == 0;
4617         EXPECT_TRUE(result);
4618         if (!result && i > 0) {
4619             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10400 : " << i;
4620             break;
4621         }
4622     }
4623 }
4624 
4625 /**
4626  * @tc.number    : TaskDispatcher_Parallel_10500
4627  * @tc.name      : parallel apply:parallel sync
4628  * @tc.desc      : two levels task dispatch
4629  */
4630 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10500, Function | MediumTest | Level1)
4631 {
4632     StartAbility(firstAbilityName, bundleNameFirst);
4633     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_104";
4634     bool result = false;
4635     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4636         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4637         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4638         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4639         result = data.compare("1") == 0;
4640         EXPECT_TRUE(result);
4641         if (!result && i > 0) {
4642             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10500 : " << i;
4643             break;
4644         }
4645     }
4646 }
4647 
4648 /**
4649  * @tc.number    : TaskDispatcher_Parallel_10600
4650  * @tc.name      : parallel apply:parallel async
4651  * @tc.desc      : two levels task dispatch
4652  */
4653 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10600, Function | MediumTest | Level1)
4654 {
4655     StartAbility(firstAbilityName, bundleNameFirst);
4656     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_105";
4657     bool result = false;
4658     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4659         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4660         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4661         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4662         result = data.compare("1") == 0;
4663         EXPECT_TRUE(result);
4664         if (!result && i > 0) {
4665             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10600 : " << i;
4666             break;
4667         }
4668     }
4669 }
4670 
4671 /**
4672  * @tc.number    : TaskDispatcher_Parallel_10700
4673  * @tc.name      : parallel apply:parallel delay
4674  * @tc.desc      : two levels task dispatch
4675  */
4676 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10700, Function | MediumTest | Level1)
4677 {
4678     StartAbility(firstAbilityName, bundleNameFirst);
4679     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_106";
4680     bool result = false;
4681     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4682         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4683         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4684         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4685         result = data.compare("1") == 0;
4686         EXPECT_TRUE(result);
4687         if (!result && i > 0) {
4688             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10700 : " << i;
4689             break;
4690         }
4691     }
4692 }
4693 
4694 /**
4695  * @tc.number    : TaskDispatcher_Parallel_10800
4696  * @tc.name      : parallel apply:parallel group
4697  * @tc.desc      : two levels task dispatch
4698  */
4699 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10800, Function | MediumTest | Level1)
4700 {
4701     StartAbility(firstAbilityName, bundleNameFirst);
4702     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_107";
4703     bool result = false;
4704     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4705         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4706         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4707         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4708         result = data.compare("1") == 0;
4709         EXPECT_TRUE(result);
4710         if (!result && i > 0) {
4711             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10800 : " << i;
4712             break;
4713         }
4714     }
4715 }
4716 
4717 /**
4718  * @tc.number    : TaskDispatcher_Parallel_10900
4719  * @tc.name      : parallel apply:parallel group wait
4720  * @tc.desc      : two levels task dispatch
4721  */
4722 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_10900, Function | MediumTest | Level1)
4723 {
4724     StartAbility(firstAbilityName, bundleNameFirst);
4725     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_108";
4726     bool result = false;
4727     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4728         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4729         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4730         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4731         result = data.compare("1") == 0;
4732         EXPECT_TRUE(result);
4733         if (!result && i > 0) {
4734             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_10900 : " << i;
4735             break;
4736         }
4737     }
4738 }
4739 
4740 /**
4741  * @tc.number    : TaskDispatcher_Parallel_11000
4742  * @tc.name      : parallel apply:parallel group notify
4743  * @tc.desc      : two levels task dispatch
4744  */
4745 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11000, Function | MediumTest | Level1)
4746 {
4747     StartAbility(firstAbilityName, bundleNameFirst);
4748     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_109";
4749     bool result = false;
4750     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4751         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4752         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4753         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4754         result = data.compare("1") == 0;
4755         EXPECT_TRUE(result);
4756         if (!result && i > 0) {
4757             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11000 : " << i;
4758             break;
4759         }
4760     }
4761 }
4762 
4763 /**
4764  * @tc.number    : TaskDispatcher_Parallel_11100
4765  * @tc.name      : parallel apply:parallel sync barrier
4766  * @tc.desc      : two levels task dispatch
4767  */
4768 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11100, Function | MediumTest | Level1)
4769 {
4770     StartAbility(firstAbilityName, bundleNameFirst);
4771     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_110";
4772     bool result = false;
4773     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4774         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4775         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4776         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4777         result = data.compare("1") == 0;
4778         EXPECT_TRUE(result);
4779         if (!result && i > 0) {
4780             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11100 : " << i;
4781             break;
4782         }
4783     }
4784 }
4785 
4786 /**
4787  * @tc.number    : TaskDispatcher_Parallel_11200
4788  * @tc.name      : parallel apply:parallel async barrier
4789  * @tc.desc      : two levels task dispatch
4790  */
4791 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11200, Function | MediumTest | Level1)
4792 {
4793     StartAbility(firstAbilityName, bundleNameFirst);
4794     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_111";
4795     bool result = false;
4796     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4797         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4798         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4799         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4800         result = data.compare("1") == 0;
4801         EXPECT_TRUE(result);
4802         if (!result && i > 0) {
4803             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11200 : " << i;
4804             break;
4805         }
4806     }
4807 }
4808 
4809 /**
4810  * @tc.number    : TaskDispatcher_Parallel_11300
4811  * @tc.name      : parallel apply:parallel apply
4812  * @tc.desc      : two levels task dispatch
4813  */
4814 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11300, Function | MediumTest | Level1)
4815 {
4816     StartAbility(firstAbilityName, bundleNameFirst);
4817     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_112";
4818     bool result = false;
4819     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4820         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4821         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4822         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4823         result = data.compare("1") == 0;
4824         EXPECT_TRUE(result);
4825         if (!result && i > 0) {
4826             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11300 : " << i;
4827             break;
4828         }
4829     }
4830 }
4831 
4832 /**
4833  * @tc.number    : TaskDispatcher_Parallel_11400
4834  * @tc.name      : parallel apply:serial sync
4835  * @tc.desc      : two levels task dispatch
4836  */
4837 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11400, Function | MediumTest | Level1)
4838 {
4839     StartAbility(firstAbilityName, bundleNameFirst);
4840     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_113";
4841     bool result = false;
4842     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4843         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4844         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4845         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4846         result = data.compare("1") == 0;
4847         EXPECT_TRUE(result);
4848         if (!result && i > 0) {
4849             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11400 : " << i;
4850             break;
4851         }
4852     }
4853 }
4854 
4855 /**
4856  * @tc.number    : TaskDispatcher_Parallel_11500
4857  * @tc.name      : parallel apply:serial async
4858  * @tc.desc      : two levels task dispatch
4859  */
4860 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11500, Function | MediumTest | Level1)
4861 {
4862     StartAbility(firstAbilityName, bundleNameFirst);
4863     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_114";
4864     bool result = false;
4865     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4866         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4867         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4868         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4869         result = data.compare("1") == 0;
4870         EXPECT_TRUE(result);
4871         if (!result && i > 0) {
4872             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11500 : " << i;
4873             break;
4874         }
4875     }
4876 }
4877 
4878 /**
4879  * @tc.number    : TaskDispatcher_Parallel_11600
4880  * @tc.name      : parallel apply:serial delay
4881  * @tc.desc      : two levels task dispatch
4882  */
4883 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11600, Function | MediumTest | Level1)
4884 {
4885     StartAbility(firstAbilityName, bundleNameFirst);
4886     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_115";
4887     bool result = false;
4888     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4889         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4890         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4891         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4892         result = data.compare("1") == 0;
4893         EXPECT_TRUE(result);
4894         if (!result && i > 0) {
4895             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11600 : " << i;
4896             break;
4897         }
4898     }
4899 }
4900 
4901 /**
4902  * @tc.number    : TaskDispatcher_Parallel_11700
4903  * @tc.name      : parallel apply:serial apply
4904  * @tc.desc      : two levels task dispatch
4905  */
4906 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Parallel_11700, Function | MediumTest | Level1)
4907 {
4908     StartAbility(firstAbilityName, bundleNameFirst);
4909     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PARALLEL) + "_116";
4910     bool result = false;
4911     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4912         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4913         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4914         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4915         result = data.compare("1") == 0;
4916         EXPECT_TRUE(result);
4917         if (!result && i > 0) {
4918             GTEST_LOG_(INFO) << "TaskDispatcher_Parallel_11700 : " << i;
4919             break;
4920         }
4921     }
4922 }
4923 
4924 /**
4925  * @tc.number    : TaskDispatcher_Serial_00100
4926  * @tc.name      : serial sync:parallel sync
4927  * @tc.desc      : two levels task dispatch
4928  */
4929 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00100, Function | MediumTest | Level1)
4930 {
4931     StartAbility(firstAbilityName, bundleNameFirst);
4932     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_0";
4933     bool result = false;
4934     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4935         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4936         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4937         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4938         result = data.compare("1") == 0;
4939         EXPECT_TRUE(result);
4940         if (!result && i > 0) {
4941             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00100 : " << i;
4942             break;
4943         }
4944     }
4945 }
4946 
4947 /**
4948  * @tc.number    : TaskDispatcher_Serial_00200
4949  * @tc.name      : serial sync:parallel async
4950  * @tc.desc      : two levels task dispatch
4951  */
4952 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00200, Function | MediumTest | Level1)
4953 {
4954     StartAbility(firstAbilityName, bundleNameFirst);
4955     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_1";
4956     bool result = false;
4957     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4958         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4959         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4960         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4961         result = data.compare("1") == 0;
4962         EXPECT_TRUE(result);
4963         if (!result && i > 0) {
4964             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00200 : " << i;
4965             break;
4966         }
4967     }
4968 }
4969 
4970 /**
4971  * @tc.number    : TaskDispatcher_Serial_00300
4972  * @tc.name      : serial sync:parallel delay
4973  * @tc.desc      : two levels task dispatch
4974  */
4975 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00300, Function | MediumTest | Level1)
4976 {
4977     StartAbility(firstAbilityName, bundleNameFirst);
4978     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_2";
4979     bool result = false;
4980     for (int i = 0; i < stLevel_.AMSLevel; i++) {
4981         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
4982         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
4983         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
4984         result = data.compare("1") == 0;
4985         EXPECT_TRUE(result);
4986         if (!result && i > 0) {
4987             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00300 : " << i;
4988             break;
4989         }
4990     }
4991 }
4992 
4993 /**
4994  * @tc.number    : TaskDispatcher_Serial_00400
4995  * @tc.name      : serial sync:parallel group
4996  * @tc.desc      : two levels task dispatch
4997  */
4998 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00400, Function | MediumTest | Level1)
4999 {
5000     StartAbility(firstAbilityName, bundleNameFirst);
5001     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_3";
5002     bool result = false;
5003     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5004         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5005         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5006         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5007         result = data.compare("1") == 0;
5008         EXPECT_TRUE(result);
5009         if (!result && i > 0) {
5010             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00400 : " << i;
5011             break;
5012         }
5013     }
5014 }
5015 
5016 /**
5017  * @tc.number    : TaskDispatcher_Serial_00500
5018  * @tc.name      : serial sync:parallel group wait
5019  * @tc.desc      : two levels task dispatch
5020  */
5021 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00500, Function | MediumTest | Level1)
5022 {
5023     StartAbility(firstAbilityName, bundleNameFirst);
5024     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_4";
5025     bool result = false;
5026     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5027         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5028         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5029         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5030         result = data.compare("1") == 0;
5031         EXPECT_TRUE(result);
5032         if (!result && i > 0) {
5033             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00500 : " << i;
5034             break;
5035         }
5036     }
5037 }
5038 
5039 /**
5040  * @tc.number    : TaskDispatcher_Serial_00600
5041  * @tc.name      : serial sync:parallel group notify
5042  * @tc.desc      : two levels task dispatch
5043  */
5044 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00600, Function | MediumTest | Level1)
5045 {
5046     StartAbility(firstAbilityName, bundleNameFirst);
5047     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_5";
5048     bool result = false;
5049     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5050         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5051         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5052         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5053         result = data.compare("1") == 0;
5054         EXPECT_TRUE(result);
5055         if (!result && i > 0) {
5056             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00600 : " << i;
5057             break;
5058         }
5059     }
5060 }
5061 
5062 /**
5063  * @tc.number    : TaskDispatcher_Serial_00700
5064  * @tc.name      : serial sync:parallel sync barrier
5065  * @tc.desc      : two levels task dispatch
5066  */
5067 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00700, Function | MediumTest | Level1)
5068 {
5069     StartAbility(firstAbilityName, bundleNameFirst);
5070     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_6";
5071     bool result = false;
5072     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5073         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5074         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5075         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5076         result = data.compare("1") == 0;
5077         EXPECT_TRUE(result);
5078         if (!result && i > 0) {
5079             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00700 : " << i;
5080             break;
5081         }
5082     }
5083 }
5084 
5085 /**
5086  * @tc.number    : TaskDispatcher_Serial_00800
5087  * @tc.name      : serial sync:parallel async barrier
5088  * @tc.desc      : two levels task dispatch
5089  */
5090 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00800, Function | MediumTest | Level1)
5091 {
5092     StartAbility(firstAbilityName, bundleNameFirst);
5093     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_7";
5094     bool result = false;
5095     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5096         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5097         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5098         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5099         result = data.compare("1") == 0;
5100         EXPECT_TRUE(result);
5101         if (!result && i > 0) {
5102             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00800 : " << i;
5103             break;
5104         }
5105     }
5106 }
5107 
5108 /**
5109  * @tc.number    : TaskDispatcher_Serial_00900
5110  * @tc.name      : serial sync:parallel apply
5111  * @tc.desc      : two levels task dispatch
5112  */
5113 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_00900, Function | MediumTest | Level1)
5114 {
5115     StartAbility(firstAbilityName, bundleNameFirst);
5116     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_8";
5117     bool result = false;
5118     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5119         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5120         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5121         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5122         result = data.compare("1") == 0;
5123         EXPECT_TRUE(result);
5124         if (!result && i > 0) {
5125             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_00900 : " << i;
5126             break;
5127         }
5128     }
5129 }
5130 
5131 /**
5132  * @tc.number    : TaskDispatcher_Serial_01000
5133  * @tc.name      : serial sync:serial sync
5134  * @tc.desc      : two levels task dispatch
5135  */
5136 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01000, Function | MediumTest | Level1)
5137 {
5138     StartAbility(firstAbilityName, bundleNameFirst);
5139     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_9";
5140     bool result = false;
5141     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5142         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5143         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5144         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5145         result = data.compare("1") == 0;
5146         EXPECT_TRUE(result);
5147         if (!result && i > 0) {
5148             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01000 : " << i;
5149             break;
5150         }
5151     }
5152 }
5153 
5154 /**
5155  * @tc.number    : TaskDispatcher_Serial_01100
5156  * @tc.name      : serial sync:serial async
5157  * @tc.desc      : two levels task dispatch
5158  */
5159 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01100, Function | MediumTest | Level1)
5160 {
5161     StartAbility(firstAbilityName, bundleNameFirst);
5162     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_10";
5163     bool result = false;
5164     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5165         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5166         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5167         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5168         result = data.compare("1") == 0;
5169         EXPECT_TRUE(result);
5170         if (!result && i > 0) {
5171             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01100 : " << i;
5172             break;
5173         }
5174     }
5175 }
5176 
5177 /**
5178  * @tc.number    : TaskDispatcher_Serial_01200
5179  * @tc.name      : serial sync:serial delay
5180  * @tc.desc      : two levels task dispatch
5181  */
5182 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01200, Function | MediumTest | Level1)
5183 {
5184     StartAbility(firstAbilityName, bundleNameFirst);
5185     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_11";
5186     bool result = false;
5187     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5188         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5189         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5190         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5191         result = data.compare("1") == 0;
5192         EXPECT_TRUE(result);
5193         if (!result && i > 0) {
5194             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01200 : " << i;
5195             break;
5196         }
5197     }
5198 }
5199 
5200 /**
5201  * @tc.number    : TaskDispatcher_Serial_01300
5202  * @tc.name      : serial sync:serial apply
5203  * @tc.desc      : two levels task dispatch
5204  */
5205 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01300, Function | MediumTest | Level1)
5206 {
5207     StartAbility(firstAbilityName, bundleNameFirst);
5208     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_12";
5209     bool result = false;
5210     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5211         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5212         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5213         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5214         result = data.compare("1") == 0;
5215         EXPECT_TRUE(result);
5216         if (!result && i > 0) {
5217             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01300 : " << i;
5218             break;
5219         }
5220     }
5221 }
5222 
5223 /**
5224  * @tc.number    : TaskDispatcher_Serial_01400
5225  * @tc.name      : serial async:parallel sync
5226  * @tc.desc      : two levels task dispatch
5227  */
5228 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01400, Function | MediumTest | Level1)
5229 {
5230     StartAbility(firstAbilityName, bundleNameFirst);
5231     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_13";
5232     bool result = false;
5233     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5234         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5235         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5236         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5237         result = data.compare("1") == 0;
5238         EXPECT_TRUE(result);
5239         if (!result && i > 0) {
5240             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01400 : " << i;
5241             break;
5242         }
5243     }
5244 }
5245 
5246 /**
5247  * @tc.number    : TaskDispatcher_Serial_01500
5248  * @tc.name      : serial async:parallel async
5249  * @tc.desc      : two levels task dispatch
5250  */
5251 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01500, Function | MediumTest | Level1)
5252 {
5253     StartAbility(firstAbilityName, bundleNameFirst);
5254     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_14";
5255     bool result = false;
5256     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5257         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5258         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5259         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5260         result = data.compare("1") == 0;
5261         EXPECT_TRUE(result);
5262         if (!result && i > 0) {
5263             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01500 : " << i;
5264             break;
5265         }
5266     }
5267 }
5268 
5269 /**
5270  * @tc.number    : TaskDispatcher_Serial_01600
5271  * @tc.name      : serial async:parallel delay
5272  * @tc.desc      : two levels task dispatch
5273  */
5274 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01600, Function | MediumTest | Level1)
5275 {
5276     StartAbility(firstAbilityName, bundleNameFirst);
5277     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_15";
5278     bool result = false;
5279     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5280         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5281         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5282         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5283         result = data.compare("1") == 0;
5284         EXPECT_TRUE(result);
5285         if (!result && i > 0) {
5286             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01600 : " << i;
5287             break;
5288         }
5289     }
5290 }
5291 
5292 /**
5293  * @tc.number    : TaskDispatcher_Serial_01700
5294  * @tc.name      : serial async:parallel group
5295  * @tc.desc      : two levels task dispatch
5296  */
5297 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01700, Function | MediumTest | Level1)
5298 {
5299     StartAbility(firstAbilityName, bundleNameFirst);
5300     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_16";
5301     bool result = false;
5302     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5303         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5304         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5305         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5306         result = data.compare("1") == 0;
5307         EXPECT_TRUE(result);
5308         if (!result && i > 0) {
5309             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01700 : " << i;
5310             break;
5311         }
5312     }
5313 }
5314 
5315 /**
5316  * @tc.number    : TaskDispatcher_Serial_01800
5317  * @tc.name      : serial async:parallel group wait
5318  * @tc.desc      : two levels task dispatch
5319  */
5320 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01800, Function | MediumTest | Level1)
5321 {
5322     StartAbility(firstAbilityName, bundleNameFirst);
5323     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_17";
5324     bool result = false;
5325     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5326         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5327         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5328         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5329         result = data.compare("1") == 0;
5330         EXPECT_TRUE(result);
5331         if (!result && i > 0) {
5332             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01800 : " << i;
5333             break;
5334         }
5335     }
5336 }
5337 
5338 /**
5339  * @tc.number    : TaskDispatcher_Serial_01900
5340  * @tc.name      : serial async:parallel group notify
5341  * @tc.desc      : two levels task dispatch
5342  */
5343 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_01900, Function | MediumTest | Level1)
5344 {
5345     StartAbility(firstAbilityName, bundleNameFirst);
5346     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_18";
5347     bool result = false;
5348     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5349         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5350         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5351         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5352         result = data.compare("1") == 0;
5353         EXPECT_TRUE(result);
5354         if (!result && i > 0) {
5355             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_01900 : " << i;
5356             break;
5357         }
5358     }
5359 }
5360 
5361 /**
5362  * @tc.number    : TaskDispatcher_Serial_02000
5363  * @tc.name      : serial async:parallel sync barrier
5364  * @tc.desc      : two levels task dispatch
5365  */
5366 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02000, Function | MediumTest | Level1)
5367 {
5368     StartAbility(firstAbilityName, bundleNameFirst);
5369     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_19";
5370     bool result = false;
5371     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5372         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5373         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5374         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5375         result = data.compare("1") == 0;
5376         EXPECT_TRUE(result);
5377         if (!result && i > 0) {
5378             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02000 : " << i;
5379             break;
5380         }
5381     }
5382 }
5383 
5384 /**
5385  * @tc.number    : TaskDispatcher_Serial_02100
5386  * @tc.name      : serial async:parallel async barrier
5387  * @tc.desc      : two levels task dispatch
5388  */
5389 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02100, Function | MediumTest | Level1)
5390 {
5391     StartAbility(firstAbilityName, bundleNameFirst);
5392     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_20";
5393     bool result = false;
5394     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5395         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5396         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5397         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5398         result = data.compare("1") == 0;
5399         EXPECT_TRUE(result);
5400         if (!result && i > 0) {
5401             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02100 : " << i;
5402             break;
5403         }
5404     }
5405 }
5406 
5407 /**
5408  * @tc.number    : TaskDispatcher_Serial_02200
5409  * @tc.name      : serial async:parallel apply
5410  * @tc.desc      : two levels task dispatch
5411  */
5412 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02200, Function | MediumTest | Level1)
5413 {
5414     StartAbility(firstAbilityName, bundleNameFirst);
5415     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_21";
5416     bool result = false;
5417     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5418         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5419         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5420         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5421         result = data.compare("1") == 0;
5422         EXPECT_TRUE(result);
5423         if (!result && i > 0) {
5424             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02200 : " << i;
5425             break;
5426         }
5427     }
5428 }
5429 
5430 /**
5431  * @tc.number    : TaskDispatcher_Serial_02300
5432  * @tc.name      : serial async:serial sync
5433  * @tc.desc      : two levels task dispatch
5434  */
5435 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02300, Function | MediumTest | Level1)
5436 {
5437     StartAbility(firstAbilityName, bundleNameFirst);
5438     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_22";
5439     bool result = false;
5440     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5441         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5442         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5443         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5444         result = data.compare("1") == 0;
5445         EXPECT_TRUE(result);
5446         if (!result && i > 0) {
5447             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02300 : " << i;
5448             break;
5449         }
5450     }
5451 }
5452 
5453 /**
5454  * @tc.number    : TaskDispatcher_Serial_02400
5455  * @tc.name      : serial async:serial async
5456  * @tc.desc      : two levels task dispatch
5457  */
5458 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02400, Function | MediumTest | Level1)
5459 {
5460     StartAbility(firstAbilityName, bundleNameFirst);
5461     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_23";
5462     bool result = false;
5463     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5464         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5465         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5466         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5467         result = data.compare("1") == 0;
5468         EXPECT_TRUE(result);
5469         if (!result && i > 0) {
5470             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02400 : " << i;
5471             break;
5472         }
5473     }
5474 }
5475 
5476 /**
5477  * @tc.number    : TaskDispatcher_Serial_02500
5478  * @tc.name      : serial async:serial delay
5479  * @tc.desc      : two levels task dispatch
5480  */
5481 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02500, Function | MediumTest | Level1)
5482 {
5483     StartAbility(firstAbilityName, bundleNameFirst);
5484     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_24";
5485     bool result = false;
5486     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5487         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5488         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5489         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5490         result = data.compare("1") == 0;
5491         EXPECT_TRUE(result);
5492         if (!result && i > 0) {
5493             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02500 : " << i;
5494             break;
5495         }
5496     }
5497 }
5498 
5499 /**
5500  * @tc.number    : TaskDispatcher_Serial_02600
5501  * @tc.name      : serial async:serial apply
5502  * @tc.desc      : two levels task dispatch
5503  */
5504 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02600, Function | MediumTest | Level1)
5505 {
5506     StartAbility(firstAbilityName, bundleNameFirst);
5507     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_25";
5508     bool result = false;
5509     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5510         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5511         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5512         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5513         result = data.compare("1") == 0;
5514         EXPECT_TRUE(result);
5515         if (!result && i > 0) {
5516             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02600 : " << i;
5517             break;
5518         }
5519     }
5520 }
5521 
5522 /**
5523  * @tc.number    : TaskDispatcher_Serial_02700
5524  * @tc.name      : serial delay:parallel sync
5525  * @tc.desc      : two levels task dispatch
5526  */
5527 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02700, Function | MediumTest | Level1)
5528 {
5529     StartAbility(firstAbilityName, bundleNameFirst);
5530     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_26";
5531     bool result = false;
5532     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5533         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5534         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5535         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5536         result = data.compare("1") == 0;
5537         EXPECT_TRUE(result);
5538         if (!result && i > 0) {
5539             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02700 : " << i;
5540             break;
5541         }
5542     }
5543 }
5544 
5545 /**
5546  * @tc.number    : TaskDispatcher_Serial_02800
5547  * @tc.name      : serial delay:parallel async
5548  * @tc.desc      : two levels task dispatch
5549  */
5550 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02800, Function | MediumTest | Level1)
5551 {
5552     StartAbility(firstAbilityName, bundleNameFirst);
5553     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_27";
5554     bool result = false;
5555     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5556         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5557         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5558         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5559         result = data.compare("1") == 0;
5560         EXPECT_TRUE(result);
5561         if (!result && i > 0) {
5562             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02800 : " << i;
5563             break;
5564         }
5565     }
5566 }
5567 
5568 /**
5569  * @tc.number    : TaskDispatcher_Serial_02900
5570  * @tc.name      : serial delay:parallel delay
5571  * @tc.desc      : two levels task dispatch
5572  */
5573 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_02900, Function | MediumTest | Level1)
5574 {
5575     StartAbility(firstAbilityName, bundleNameFirst);
5576     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_28";
5577     bool result = false;
5578     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5579         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5580         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5581         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5582         result = data.compare("1") == 0;
5583         EXPECT_TRUE(result);
5584         if (!result && i > 0) {
5585             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_02900 : " << i;
5586             break;
5587         }
5588     }
5589 }
5590 
5591 /**
5592  * @tc.number    : TaskDispatcher_Serial_03000
5593  * @tc.name      : serial delay:parallel group
5594  * @tc.desc      : two levels task dispatch
5595  */
5596 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03000, Function | MediumTest | Level1)
5597 {
5598     StartAbility(firstAbilityName, bundleNameFirst);
5599     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_29";
5600     bool result = false;
5601     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5602         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5603         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5604         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5605         result = data.compare("1") == 0;
5606         EXPECT_TRUE(result);
5607         if (!result && i > 0) {
5608             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03000 : " << i;
5609             break;
5610         }
5611     }
5612 }
5613 
5614 /**
5615  * @tc.number    : TaskDispatcher_Serial_03100
5616  * @tc.name      : serial delay:parallel group wait
5617  * @tc.desc      : two levels task dispatch
5618  */
5619 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03100, Function | MediumTest | Level1)
5620 {
5621     StartAbility(firstAbilityName, bundleNameFirst);
5622     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_30";
5623     bool result = false;
5624     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5625         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5626         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5627         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5628         result = data.compare("1") == 0;
5629         EXPECT_TRUE(result);
5630         if (!result && i > 0) {
5631             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03100 : " << i;
5632             break;
5633         }
5634     }
5635 }
5636 
5637 /**
5638  * @tc.number    : TaskDispatcher_Serial_03200
5639  * @tc.name      : serial delay:parallel group notify
5640  * @tc.desc      : two levels task dispatch
5641  */
5642 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03200, Function | MediumTest | Level1)
5643 {
5644     StartAbility(firstAbilityName, bundleNameFirst);
5645     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_31";
5646     bool result = false;
5647     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5648         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5649         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5650         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5651         result = data.compare("1") == 0;
5652         EXPECT_TRUE(result);
5653         if (!result && i > 0) {
5654             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03200 : " << i;
5655             break;
5656         }
5657     }
5658 }
5659 
5660 /**
5661  * @tc.number    : TaskDispatcher_Serial_03300
5662  * @tc.name      : serial delay:parallel sync barrier
5663  * @tc.desc      : two levels task dispatch
5664  */
5665 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03300, Function | MediumTest | Level1)
5666 {
5667     StartAbility(firstAbilityName, bundleNameFirst);
5668     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_32";
5669     bool result = false;
5670     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5671         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5672         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5673         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5674         result = data.compare("1") == 0;
5675         EXPECT_TRUE(result);
5676         if (!result && i > 0) {
5677             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03300 : " << i;
5678             break;
5679         }
5680     }
5681 }
5682 
5683 /**
5684  * @tc.number    : TaskDispatcher_Serial_03400
5685  * @tc.name      : serial delay:parallel async barrier
5686  * @tc.desc      : two levels task dispatch
5687  */
5688 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03400, Function | MediumTest | Level1)
5689 {
5690     StartAbility(firstAbilityName, bundleNameFirst);
5691     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_33";
5692     bool result = false;
5693     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5694         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5695         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5696         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5697         result = data.compare("1") == 0;
5698         EXPECT_TRUE(result);
5699         if (!result && i > 0) {
5700             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03400 : " << i;
5701             break;
5702         }
5703     }
5704 }
5705 
5706 /**
5707  * @tc.number    : TaskDispatcher_Serial_03500
5708  * @tc.name      : serial delay:parallel apply
5709  * @tc.desc      : two levels task dispatch
5710  */
5711 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03500, Function | MediumTest | Level1)
5712 {
5713     StartAbility(firstAbilityName, bundleNameFirst);
5714     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_34";
5715     bool result = false;
5716     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5717         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5718         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5719         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5720         result = data.compare("1") == 0;
5721         EXPECT_TRUE(result);
5722         if (!result && i > 0) {
5723             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03500 : " << i;
5724             break;
5725         }
5726     }
5727 }
5728 
5729 /**
5730  * @tc.number    : TaskDispatcher_Serial_03600
5731  * @tc.name      : serial delay:serial sync
5732  * @tc.desc      : two levels task dispatch
5733  */
5734 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03600, Function | MediumTest | Level1)
5735 {
5736     StartAbility(firstAbilityName, bundleNameFirst);
5737     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_35";
5738     bool result = false;
5739     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5740         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5741         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5742         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5743         result = data.compare("1") == 0;
5744         EXPECT_TRUE(result);
5745         if (!result && i > 0) {
5746             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03600 : " << i;
5747             break;
5748         }
5749     }
5750 }
5751 
5752 /**
5753  * @tc.number    : TaskDispatcher_Serial_03700
5754  * @tc.name      : serial delay:serial async
5755  * @tc.desc      : two levels task dispatch
5756  */
5757 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03700, Function | MediumTest | Level1)
5758 {
5759     StartAbility(firstAbilityName, bundleNameFirst);
5760     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_36";
5761     bool result = false;
5762     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5763         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5764         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5765         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5766         result = data.compare("1") == 0;
5767         EXPECT_TRUE(result);
5768         if (!result && i > 0) {
5769             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03700 : " << i;
5770             break;
5771         }
5772     }
5773 }
5774 
5775 /**
5776  * @tc.number    : TaskDispatcher_Serial_03800
5777  * @tc.name      : serial delay:serial delay
5778  * @tc.desc      : two levels task dispatch
5779  */
5780 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03800, Function | MediumTest | Level1)
5781 {
5782     StartAbility(firstAbilityName, bundleNameFirst);
5783     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_37";
5784     bool result = false;
5785     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5786         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5787         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5788         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5789         result = data.compare("1") == 0;
5790         EXPECT_TRUE(result);
5791         if (!result && i > 0) {
5792             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03800 : " << i;
5793             break;
5794         }
5795     }
5796 }
5797 
5798 /**
5799  * @tc.number    : TaskDispatcher_Serial_03900
5800  * @tc.name      : serial delay:serial apply
5801  * @tc.desc      : two levels task dispatch
5802  */
5803 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_03900, Function | MediumTest | Level1)
5804 {
5805     StartAbility(firstAbilityName, bundleNameFirst);
5806     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_38";
5807     bool result = false;
5808     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5809         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5810         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5811         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5812         result = data.compare("1") == 0;
5813         EXPECT_TRUE(result);
5814         if (!result && i > 0) {
5815             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_03900 : " << i;
5816             break;
5817         }
5818     }
5819 }
5820 
5821 /**
5822  * @tc.number    : TaskDispatcher_Serial_04000
5823  * @tc.name      : serial apply:parallel sync
5824  * @tc.desc      : two levels task dispatch
5825  */
5826 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04000, Function | MediumTest | Level1)
5827 {
5828     StartAbility(firstAbilityName, bundleNameFirst);
5829     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_39";
5830     bool result = false;
5831     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5832         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5833         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5834         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5835         result = data.compare("1") == 0;
5836         EXPECT_TRUE(result);
5837         if (!result && i > 0) {
5838             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04000 : " << i;
5839             break;
5840         }
5841     }
5842 }
5843 
5844 /**
5845  * @tc.number    : TaskDispatcher_Serial_04100
5846  * @tc.name      : serial apply:parallel async
5847  * @tc.desc      : two levels task dispatch
5848  */
5849 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04100, Function | MediumTest | Level1)
5850 {
5851     StartAbility(firstAbilityName, bundleNameFirst);
5852     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_40";
5853     bool result = false;
5854     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5855         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5856         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5857         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5858         result = data.compare("1") == 0;
5859         EXPECT_TRUE(result);
5860         if (!result && i > 0) {
5861             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04100 : " << i;
5862             break;
5863         }
5864     }
5865 }
5866 
5867 /**
5868  * @tc.number    : TaskDispatcher_Serial_04200
5869  * @tc.name      : serial apply:parallel delay
5870  * @tc.desc      : two levels task dispatch
5871  */
5872 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04200, Function | MediumTest | Level1)
5873 {
5874     StartAbility(firstAbilityName, bundleNameFirst);
5875     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_41";
5876     bool result = false;
5877     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5878         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5879         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5880         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5881         result = data.compare("1") == 0;
5882         EXPECT_TRUE(result);
5883         if (!result && i > 0) {
5884             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04200 : " << i;
5885             break;
5886         }
5887     }
5888 }
5889 
5890 /**
5891  * @tc.number    : TaskDispatcher_Serial_04300
5892  * @tc.name      : serial apply:parallel group
5893  * @tc.desc      : two levels task dispatch
5894  */
5895 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04300, Function | MediumTest | Level1)
5896 {
5897     StartAbility(firstAbilityName, bundleNameFirst);
5898     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_42";
5899     bool result = false;
5900     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5901         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5902         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5903         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5904         result = data.compare("1") == 0;
5905         EXPECT_TRUE(result);
5906         if (!result && i > 0) {
5907             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04300 : " << i;
5908             break;
5909         }
5910     }
5911 }
5912 
5913 /**
5914  * @tc.number    : TaskDispatcher_Serial_04400
5915  * @tc.name      : serial apply:parallel group wait
5916  * @tc.desc      : two levels task dispatch
5917  */
5918 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04400, Function | MediumTest | Level1)
5919 {
5920     StartAbility(firstAbilityName, bundleNameFirst);
5921     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_43";
5922     bool result = false;
5923     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5924         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5925         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5926         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5927         result = data.compare("1") == 0;
5928         EXPECT_TRUE(result);
5929         if (!result && i > 0) {
5930             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04400 : " << i;
5931             break;
5932         }
5933     }
5934 }
5935 
5936 /**
5937  * @tc.number    : TaskDispatcher_Serial_04500
5938  * @tc.name      : serial apply:parallel group notify
5939  * @tc.desc      : two levels task dispatch
5940  */
5941 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04500, Function | MediumTest | Level1)
5942 {
5943     StartAbility(firstAbilityName, bundleNameFirst);
5944     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_44";
5945     bool result = false;
5946     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5947         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5948         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5949         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5950         result = data.compare("1") == 0;
5951         EXPECT_TRUE(result);
5952         if (!result && i > 0) {
5953             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04500 : " << i;
5954             break;
5955         }
5956     }
5957 }
5958 
5959 /**
5960  * @tc.number    : TaskDispatcher_Serial_04600
5961  * @tc.name      : serial apply:parallel sync barrier
5962  * @tc.desc      : two levels task dispatch
5963  */
5964 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04600, Function | MediumTest | Level1)
5965 {
5966     StartAbility(firstAbilityName, bundleNameFirst);
5967     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_45";
5968     bool result = false;
5969     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5970         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5971         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5972         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5973         result = data.compare("1") == 0;
5974         EXPECT_TRUE(result);
5975         if (!result && i > 0) {
5976             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04600 : " << i;
5977             break;
5978         }
5979     }
5980 }
5981 
5982 /**
5983  * @tc.number    : TaskDispatcher_Serial_04700
5984  * @tc.name      : serial apply:parallel async barrier
5985  * @tc.desc      : two levels task dispatch
5986  */
5987 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04700, Function | MediumTest | Level1)
5988 {
5989     StartAbility(firstAbilityName, bundleNameFirst);
5990     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_46";
5991     bool result = false;
5992     for (int i = 0; i < stLevel_.AMSLevel; i++) {
5993         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
5994         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
5995         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
5996         result = data.compare("1") == 0;
5997         EXPECT_TRUE(result);
5998         if (!result && i > 0) {
5999             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04700 : " << i;
6000             break;
6001         }
6002     }
6003 }
6004 
6005 /**
6006  * @tc.number    : TaskDispatcher_Serial_04800
6007  * @tc.name      : serial apply:parallel apply
6008  * @tc.desc      : two levels task dispatch
6009  */
6010 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04800, Function | MediumTest | Level1)
6011 {
6012     StartAbility(firstAbilityName, bundleNameFirst);
6013     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_47";
6014     bool result = false;
6015     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6016         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6017         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6018         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6019         result = data.compare("1") == 0;
6020         EXPECT_TRUE(result);
6021         if (!result && i > 0) {
6022             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04800 : " << i;
6023             break;
6024         }
6025     }
6026 }
6027 
6028 /**
6029  * @tc.number    : TaskDispatcher_Serial_04900
6030  * @tc.name      : serial apply:serial sync
6031  * @tc.desc      : two levels task dispatch
6032  */
6033 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_04900, Function | MediumTest | Level1)
6034 {
6035     StartAbility(firstAbilityName, bundleNameFirst);
6036     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_48";
6037     bool result = false;
6038     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6039         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6040         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6041         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6042         result = data.compare("1") == 0;
6043         EXPECT_TRUE(result);
6044         if (!result && i > 0) {
6045             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_04900 : " << i;
6046             break;
6047         }
6048     }
6049 }
6050 
6051 /**
6052  * @tc.number    : TaskDispatcher_Serial_05000
6053  * @tc.name      : serial apply:serial async
6054  * @tc.desc      : two levels task dispatch
6055  */
6056 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_05000, Function | MediumTest | Level1)
6057 {
6058     StartAbility(firstAbilityName, bundleNameFirst);
6059     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_49";
6060     bool result = false;
6061     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6062         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6063         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6064         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6065         result = data.compare("1") == 0;
6066         EXPECT_TRUE(result);
6067         if (!result && i > 0) {
6068             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_05000 : " << i;
6069             break;
6070         }
6071     }
6072 }
6073 
6074 /**
6075  * @tc.number    : TaskDispatcher_Serial_05100
6076  * @tc.name      : serial apply:serial delay
6077  * @tc.desc      : two levels task dispatch
6078  */
6079 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_05100, Function | MediumTest | Level1)
6080 {
6081     StartAbility(firstAbilityName, bundleNameFirst);
6082     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_50";
6083     bool result = false;
6084     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6085         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6086         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6087         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6088         result = data.compare("1") == 0;
6089         EXPECT_TRUE(result);
6090         if (!result && i > 0) {
6091             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_05100 : " << i;
6092             break;
6093         }
6094     }
6095 }
6096 
6097 /**
6098  * @tc.number    : TaskDispatcher_Serial_05200
6099  * @tc.name      : serial apply:serial apply
6100  * @tc.desc      : two levels task dispatch
6101  */
6102 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Serial_05200, Function | MediumTest | Level1)
6103 {
6104     StartAbility(firstAbilityName, bundleNameFirst);
6105     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SERIAL) + "_51";
6106     bool result = false;
6107     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6108         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6109         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6110         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6111         result = data.compare("1") == 0;
6112         EXPECT_TRUE(result);
6113         if (!result && i > 0) {
6114             GTEST_LOG_(INFO) << "TaskDispatcher_Serial_05200 : " << i;
6115             break;
6116         }
6117     }
6118 }
6119 
6120 /**
6121  * @tc.number    : TaskDispatcher_Spec_00100
6122  * @tc.name      : spec sync:parallel sync
6123  * @tc.desc      : two levels task dispatch
6124  */
6125 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00100, Function | MediumTest | Level1)
6126 {
6127     StartAbility(firstAbilityName, bundleNameFirst);
6128     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_0";
6129     bool result = false;
6130     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6131         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6132         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6133         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6134         result = data.compare("1") == 0;
6135         EXPECT_TRUE(result);
6136         if (!result && i > 0) {
6137             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00100 : " << i;
6138             break;
6139         }
6140     }
6141 }
6142 
6143 /**
6144  * @tc.number    : TaskDispatcher_Spec_00200
6145  * @tc.name      : spec sync:parallel async
6146  * @tc.desc      : two levels task dispatch
6147  */
6148 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00200, Function | MediumTest | Level1)
6149 {
6150     StartAbility(firstAbilityName, bundleNameFirst);
6151     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_1";
6152     bool result = false;
6153     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6154         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6155         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6156         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6157         result = data.compare("1") == 0;
6158         EXPECT_TRUE(result);
6159         if (!result && i > 0) {
6160             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00200 : " << i;
6161             break;
6162         }
6163     }
6164 }
6165 
6166 /**
6167  * @tc.number    : TaskDispatcher_Spec_00300
6168  * @tc.name      : spec sync:parallel delay
6169  * @tc.desc      : two levels task dispatch
6170  */
6171 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00300, Function | MediumTest | Level1)
6172 {
6173     StartAbility(firstAbilityName, bundleNameFirst);
6174     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_2";
6175     bool result = false;
6176     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6177         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6178         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6179         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6180         result = data.compare("1") == 0;
6181         EXPECT_TRUE(result);
6182         if (!result && i > 0) {
6183             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00300 : " << i;
6184             break;
6185         }
6186     }
6187 }
6188 
6189 /**
6190  * @tc.number    : TaskDispatcher_Spec_00400
6191  * @tc.name      : spec sync:parallel group
6192  * @tc.desc      : two levels task dispatch
6193  */
6194 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00400, Function | MediumTest | Level1)
6195 {
6196     StartAbility(firstAbilityName, bundleNameFirst);
6197     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_3";
6198     bool result = false;
6199     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6200         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6201         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6202         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6203         result = data.compare("1") == 0;
6204         EXPECT_TRUE(result);
6205         if (!result && i > 0) {
6206             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00400 : " << i;
6207             break;
6208         }
6209     }
6210 }
6211 
6212 /**
6213  * @tc.number    : TaskDispatcher_Spec_00500
6214  * @tc.name      : spec sync:parallel group wait
6215  * @tc.desc      : two levels task dispatch
6216  */
6217 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00500, Function | MediumTest | Level1)
6218 {
6219     StartAbility(firstAbilityName, bundleNameFirst);
6220     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_4";
6221     bool result = false;
6222     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6223         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6224         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6225         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6226         result = data.compare("1") == 0;
6227         EXPECT_TRUE(result);
6228         if (!result && i > 0) {
6229             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00500 : " << i;
6230             break;
6231         }
6232     }
6233 }
6234 
6235 /**
6236  * @tc.number    : TaskDispatcher_Spec_00600
6237  * @tc.name      : spec sync:parallel group notify
6238  * @tc.desc      : two levels task dispatch
6239  */
6240 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00600, Function | MediumTest | Level1)
6241 {
6242     StartAbility(firstAbilityName, bundleNameFirst);
6243     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_5";
6244     bool result = false;
6245     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6246         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6247         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6248         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6249         result = data.compare("1") == 0;
6250         EXPECT_TRUE(result);
6251         if (!result && i > 0) {
6252             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00600 : " << i;
6253             break;
6254         }
6255     }
6256 }
6257 
6258 /**
6259  * @tc.number    : TaskDispatcher_Spec_00700
6260  * @tc.name      : spec sync:parallel sync barrier
6261  * @tc.desc      : two levels task dispatch
6262  */
6263 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00700, Function | MediumTest | Level1)
6264 {
6265     StartAbility(firstAbilityName, bundleNameFirst);
6266     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_6";
6267     bool result = false;
6268     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6269         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6270         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6271         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6272         result = data.compare("1") == 0;
6273         EXPECT_TRUE(result);
6274         if (!result && i > 0) {
6275             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00700 : " << i;
6276             break;
6277         }
6278     }
6279 }
6280 
6281 /**
6282  * @tc.number    : TaskDispatcher_Spec_00800
6283  * @tc.name      : spec sync:parallel async barrier
6284  * @tc.desc      : two levels task dispatch
6285  */
6286 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00800, Function | MediumTest | Level1)
6287 {
6288     StartAbility(firstAbilityName, bundleNameFirst);
6289     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_7";
6290     bool result = false;
6291     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6292         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6293         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6294         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6295         result = data.compare("1") == 0;
6296         EXPECT_TRUE(result);
6297         if (!result && i > 0) {
6298             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00800 : " << i;
6299             break;
6300         }
6301     }
6302 }
6303 
6304 /**
6305  * @tc.number    : TaskDispatcher_Spec_00900
6306  * @tc.name      : spec sync:parallel apply
6307  * @tc.desc      : two levels task dispatch
6308  */
6309 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_00900, Function | MediumTest | Level1)
6310 {
6311     StartAbility(firstAbilityName, bundleNameFirst);
6312     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_8";
6313     bool result = false;
6314     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6315         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6316         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6317         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6318         result = data.compare("1") == 0;
6319         EXPECT_TRUE(result);
6320         if (!result && i > 0) {
6321             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_00900 : " << i;
6322             break;
6323         }
6324     }
6325 }
6326 
6327 /**
6328  * @tc.number    : TaskDispatcher_Spec_01000
6329  * @tc.name      : spec sync:serial sync
6330  * @tc.desc      : two levels task dispatch
6331  */
6332 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01000, Function | MediumTest | Level1)
6333 {
6334     StartAbility(firstAbilityName, bundleNameFirst);
6335     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_9";
6336     bool result = false;
6337     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6338         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6339         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6340         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6341         result = data.compare("1") == 0;
6342         EXPECT_TRUE(result);
6343         if (!result && i > 0) {
6344             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01000 : " << i;
6345             break;
6346         }
6347     }
6348 }
6349 
6350 /**
6351  * @tc.number    : TaskDispatcher_Spec_01100
6352  * @tc.name      : spec sync:serial async
6353  * @tc.desc      : two levels task dispatch
6354  */
6355 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01100, Function | MediumTest | Level1)
6356 {
6357     StartAbility(firstAbilityName, bundleNameFirst);
6358     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_10";
6359     bool result = false;
6360     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6361         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6362         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6363         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6364         result = data.compare("1") == 0;
6365         EXPECT_TRUE(result);
6366         if (!result && i > 0) {
6367             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01100 : " << i;
6368             break;
6369         }
6370     }
6371 }
6372 
6373 /**
6374  * @tc.number    : TaskDispatcher_Spec_01200
6375  * @tc.name      : spec sync:serial delay
6376  * @tc.desc      : two levels task dispatch
6377  */
6378 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01200, Function | MediumTest | Level1)
6379 {
6380     StartAbility(firstAbilityName, bundleNameFirst);
6381     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_11";
6382     bool result = false;
6383     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6384         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6385         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6386         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6387         result = data.compare("1") == 0;
6388         EXPECT_TRUE(result);
6389         if (!result && i > 0) {
6390             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01200 : " << i;
6391             break;
6392         }
6393     }
6394 }
6395 
6396 /**
6397  * @tc.number    : TaskDispatcher_Spec_01300
6398  * @tc.name      : spec sync:serial apply
6399  * @tc.desc      : two levels task dispatch
6400  */
6401 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01300, Function | MediumTest | Level1)
6402 {
6403     StartAbility(firstAbilityName, bundleNameFirst);
6404     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_12";
6405     bool result = false;
6406     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6407         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6408         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6409         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6410         result = data.compare("1") == 0;
6411         EXPECT_TRUE(result);
6412         if (!result && i > 0) {
6413             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01300 : " << i;
6414             break;
6415         }
6416     }
6417 }
6418 
6419 /**
6420  * @tc.number    : TaskDispatcher_Spec_01400
6421  * @tc.name      : spec async:parallel sync
6422  * @tc.desc      : two levels task dispatch
6423  */
6424 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01400, Function | MediumTest | Level1)
6425 {
6426     StartAbility(firstAbilityName, bundleNameFirst);
6427     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_13";
6428     bool result = false;
6429     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6430         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6431         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6432         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6433         result = data.compare("1") == 0;
6434         EXPECT_TRUE(result);
6435         if (!result && i > 0) {
6436             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01400 : " << i;
6437             break;
6438         }
6439     }
6440 }
6441 
6442 /**
6443  * @tc.number    : TaskDispatcher_Spec_01500
6444  * @tc.name      : spec async:parallel async
6445  * @tc.desc      : two levels task dispatch
6446  */
6447 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01500, Function | MediumTest | Level1)
6448 {
6449     StartAbility(firstAbilityName, bundleNameFirst);
6450     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_14";
6451     bool result = false;
6452     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6453         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6454         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6455         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6456         result = data.compare("1") == 0;
6457         EXPECT_TRUE(result);
6458         if (!result && i > 0) {
6459             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01500 : " << i;
6460             break;
6461         }
6462     }
6463 }
6464 
6465 /**
6466  * @tc.number    : TaskDispatcher_Spec_01600
6467  * @tc.name      : spec async:parallel delay
6468  * @tc.desc      : two levels task dispatch
6469  */
6470 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01600, Function | MediumTest | Level1)
6471 {
6472     StartAbility(firstAbilityName, bundleNameFirst);
6473     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_15";
6474     bool result = false;
6475     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6476         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6477         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6478         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6479         result = data.compare("1") == 0;
6480         EXPECT_TRUE(result);
6481         if (!result && i > 0) {
6482             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01600 : " << i;
6483             break;
6484         }
6485     }
6486 }
6487 
6488 /**
6489  * @tc.number    : TaskDispatcher_Spec_01700
6490  * @tc.name      : spec async:parallel group
6491  * @tc.desc      : two levels task dispatch
6492  */
6493 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01700, Function | MediumTest | Level1)
6494 {
6495     StartAbility(firstAbilityName, bundleNameFirst);
6496     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_16";
6497     bool result = false;
6498     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6499         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6500         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6501         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6502         result = data.compare("1") == 0;
6503         EXPECT_TRUE(result);
6504         if (!result && i > 0) {
6505             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01700 : " << i;
6506             break;
6507         }
6508     }
6509 }
6510 
6511 /**
6512  * @tc.number    : TaskDispatcher_Spec_01800
6513  * @tc.name      : spec async:parallel group wait
6514  * @tc.desc      : two levels task dispatch
6515  */
6516 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01800, Function | MediumTest | Level1)
6517 {
6518     StartAbility(firstAbilityName, bundleNameFirst);
6519     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_17";
6520     bool result = false;
6521     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6522         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6523         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6524         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6525         result = data.compare("1") == 0;
6526         EXPECT_TRUE(result);
6527         if (!result && i > 0) {
6528             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01800 : " << i;
6529             break;
6530         }
6531     }
6532 }
6533 
6534 /**
6535  * @tc.number    : TaskDispatcher_Spec_01900
6536  * @tc.name      : spec async:parallel group notify
6537  * @tc.desc      : two levels task dispatch
6538  */
6539 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_01900, Function | MediumTest | Level1)
6540 {
6541     StartAbility(firstAbilityName, bundleNameFirst);
6542     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_18";
6543     bool result = false;
6544     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6545         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6546         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6547         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6548         result = data.compare("1") == 0;
6549         EXPECT_TRUE(result);
6550         if (!result && i > 0) {
6551             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_01900 : " << i;
6552             break;
6553         }
6554     }
6555 }
6556 
6557 /**
6558  * @tc.number    : TaskDispatcher_Spec_02000
6559  * @tc.name      : spec async:parallel sync barrier
6560  * @tc.desc      : two levels task dispatch
6561  */
6562 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02000, Function | MediumTest | Level1)
6563 {
6564     StartAbility(firstAbilityName, bundleNameFirst);
6565     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_19";
6566     bool result = false;
6567     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6568         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6569         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6570         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6571         result = data.compare("1") == 0;
6572         EXPECT_TRUE(result);
6573         if (!result && i > 0) {
6574             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02000 : " << i;
6575             break;
6576         }
6577     }
6578 }
6579 
6580 /**
6581  * @tc.number    : TaskDispatcher_Spec_02100
6582  * @tc.name      : spec async:parallel async barrier
6583  * @tc.desc      : two levels task dispatch
6584  */
6585 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02100, Function | MediumTest | Level1)
6586 {
6587     StartAbility(firstAbilityName, bundleNameFirst);
6588     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_20";
6589     bool result = false;
6590     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6591         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6592         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6593         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6594         result = data.compare("1") == 0;
6595         EXPECT_TRUE(result);
6596         if (!result && i > 0) {
6597             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02100 : " << i;
6598             break;
6599         }
6600     }
6601 }
6602 
6603 /**
6604  * @tc.number    : TaskDispatcher_Spec_02200
6605  * @tc.name      : spec async:parallel apply
6606  * @tc.desc      : two levels task dispatch
6607  */
6608 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02200, Function | MediumTest | Level1)
6609 {
6610     StartAbility(firstAbilityName, bundleNameFirst);
6611     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_21";
6612     bool result = false;
6613     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6614         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6615         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6616         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6617         result = data.compare("1") == 0;
6618         EXPECT_TRUE(result);
6619         if (!result && i > 0) {
6620             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02200 : " << i;
6621             break;
6622         }
6623     }
6624 }
6625 
6626 /**
6627  * @tc.number    : TaskDispatcher_Spec_02300
6628  * @tc.name      : spec async:serial sync
6629  * @tc.desc      : two levels task dispatch
6630  */
6631 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02300, Function | MediumTest | Level1)
6632 {
6633     StartAbility(firstAbilityName, bundleNameFirst);
6634     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_22";
6635     bool result = false;
6636     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6637         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6638         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6639         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6640         result = data.compare("1") == 0;
6641         EXPECT_TRUE(result);
6642         if (!result && i > 0) {
6643             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02300 : " << i;
6644             break;
6645         }
6646     }
6647 }
6648 
6649 /**
6650  * @tc.number    : TaskDispatcher_Spec_02400
6651  * @tc.name      : spec async:serial async
6652  * @tc.desc      : two levels task dispatch
6653  */
6654 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02400, Function | MediumTest | Level1)
6655 {
6656     StartAbility(firstAbilityName, bundleNameFirst);
6657     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_23";
6658     bool result = false;
6659     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6660         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6661         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6662         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6663         result = data.compare("1") == 0;
6664         EXPECT_TRUE(result);
6665         if (!result && i > 0) {
6666             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02400 : " << i;
6667             break;
6668         }
6669     }
6670 }
6671 
6672 /**
6673  * @tc.number    : TaskDispatcher_Spec_02500
6674  * @tc.name      : spec async:serial delay
6675  * @tc.desc      : two levels task dispatch
6676  */
6677 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02500, Function | MediumTest | Level1)
6678 {
6679     StartAbility(firstAbilityName, bundleNameFirst);
6680     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_24";
6681     bool result = false;
6682     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6683         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6684         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6685         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6686         result = data.compare("1") == 0;
6687         EXPECT_TRUE(result);
6688         if (!result && i > 0) {
6689             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02500 : " << i;
6690             break;
6691         }
6692     }
6693 }
6694 
6695 /**
6696  * @tc.number    : TaskDispatcher_Spec_02600
6697  * @tc.name      : spec async:serial apply
6698  * @tc.desc      : two levels task dispatch
6699  */
6700 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02600, Function | MediumTest | Level1)
6701 {
6702     StartAbility(firstAbilityName, bundleNameFirst);
6703     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_25";
6704     bool result = false;
6705     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6706         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6707         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6708         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6709         result = data.compare("1") == 0;
6710         EXPECT_TRUE(result);
6711         if (!result && i > 0) {
6712             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02600 : " << i;
6713             break;
6714         }
6715     }
6716 }
6717 
6718 /**
6719  * @tc.number    : TaskDispatcher_Spec_02700
6720  * @tc.name      : spec delay:parallel sync
6721  * @tc.desc      : two levels task dispatch
6722  */
6723 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02700, Function | MediumTest | Level1)
6724 {
6725     StartAbility(firstAbilityName, bundleNameFirst);
6726     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_26";
6727     bool result = false;
6728     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6729         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6730         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6731         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6732         result = data.compare("1") == 0;
6733         EXPECT_TRUE(result);
6734         if (!result && i > 0) {
6735             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02700 : " << i;
6736             break;
6737         }
6738     }
6739 }
6740 
6741 /**
6742  * @tc.number    : TaskDispatcher_Spec_02800
6743  * @tc.name      : spec delay:parallel async
6744  * @tc.desc      : two levels task dispatch
6745  */
6746 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02800, Function | MediumTest | Level1)
6747 {
6748     StartAbility(firstAbilityName, bundleNameFirst);
6749     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_27";
6750     bool result = false;
6751     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6752         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6753         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6754         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6755         result = data.compare("1") == 0;
6756         EXPECT_TRUE(result);
6757         if (!result && i > 0) {
6758             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02800 : " << i;
6759             break;
6760         }
6761     }
6762 }
6763 
6764 /**
6765  * @tc.number    : TaskDispatcher_Spec_02900
6766  * @tc.name      : spec delay:parallel delay
6767  * @tc.desc      : two levels task dispatch
6768  */
6769 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_02900, Function | MediumTest | Level1)
6770 {
6771     StartAbility(firstAbilityName, bundleNameFirst);
6772     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_28";
6773     bool result = false;
6774     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6775         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6776         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6777         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6778         result = data.compare("1") == 0;
6779         EXPECT_TRUE(result);
6780         if (!result && i > 0) {
6781             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_02900 : " << i;
6782             break;
6783         }
6784     }
6785 }
6786 
6787 /**
6788  * @tc.number    : TaskDispatcher_Spec_03000
6789  * @tc.name      : spec delay:parallel group
6790  * @tc.desc      : two levels task dispatch
6791  */
6792 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03000, Function | MediumTest | Level1)
6793 {
6794     StartAbility(firstAbilityName, bundleNameFirst);
6795     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_29";
6796     bool result = false;
6797     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6798         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6799         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6800         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6801         result = data.compare("1") == 0;
6802         EXPECT_TRUE(result);
6803         if (!result && i > 0) {
6804             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03000 : " << i;
6805             break;
6806         }
6807     }
6808 }
6809 
6810 /**
6811  * @tc.number    : TaskDispatcher_Spec_03100
6812  * @tc.name      : spec delay:parallel group wait
6813  * @tc.desc      : two levels task dispatch
6814  */
6815 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03100, Function | MediumTest | Level1)
6816 {
6817     StartAbility(firstAbilityName, bundleNameFirst);
6818     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_30";
6819     bool result = false;
6820     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6821         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6822         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6823         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6824         result = data.compare("1") == 0;
6825         EXPECT_TRUE(result);
6826         if (!result && i > 0) {
6827             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03100 : " << i;
6828             break;
6829         }
6830     }
6831 }
6832 
6833 /**
6834  * @tc.number    : TaskDispatcher_Spec_03200
6835  * @tc.name      : spec delay:parallel group notify
6836  * @tc.desc      : two levels task dispatch
6837  */
6838 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03200, Function | MediumTest | Level1)
6839 {
6840     StartAbility(firstAbilityName, bundleNameFirst);
6841     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_31";
6842     bool result = false;
6843     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6844         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6845         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6846         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6847         result = data.compare("1") == 0;
6848         EXPECT_TRUE(result);
6849         if (!result && i > 0) {
6850             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03200 : " << i;
6851             break;
6852         }
6853     }
6854 }
6855 
6856 /**
6857  * @tc.number    : TaskDispatcher_Spec_03300
6858  * @tc.name      : spec delay:parallel sync barrier
6859  * @tc.desc      : two levels task dispatch
6860  */
6861 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03300, Function | MediumTest | Level1)
6862 {
6863     StartAbility(firstAbilityName, bundleNameFirst);
6864     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_32";
6865     bool result = false;
6866     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6867         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6868         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6869         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6870         result = data.compare("1") == 0;
6871         EXPECT_TRUE(result);
6872         if (!result && i > 0) {
6873             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03300 : " << i;
6874             break;
6875         }
6876     }
6877 }
6878 
6879 /**
6880  * @tc.number    : TaskDispatcher_Spec_03400
6881  * @tc.name      : spec delay:parallel async barrier
6882  * @tc.desc      : two levels task dispatch
6883  */
6884 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03400, Function | MediumTest | Level1)
6885 {
6886     StartAbility(firstAbilityName, bundleNameFirst);
6887     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_33";
6888     bool result = false;
6889     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6890         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6891         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6892         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6893         result = data.compare("1") == 0;
6894         EXPECT_TRUE(result);
6895         if (!result && i > 0) {
6896             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03400 : " << i;
6897             break;
6898         }
6899     }
6900 }
6901 
6902 /**
6903  * @tc.number    : TaskDispatcher_Spec_03500
6904  * @tc.name      : spec delay:parallel apply
6905  * @tc.desc      : two levels task dispatch
6906  */
6907 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03500, Function | MediumTest | Level1)
6908 {
6909     StartAbility(firstAbilityName, bundleNameFirst);
6910     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_34";
6911     bool result = false;
6912     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6913         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6914         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6915         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6916         result = data.compare("1") == 0;
6917         EXPECT_TRUE(result);
6918         if (!result && i > 0) {
6919             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03500 : " << i;
6920             break;
6921         }
6922     }
6923 }
6924 
6925 /**
6926  * @tc.number    : TaskDispatcher_Spec_03600
6927  * @tc.name      : spec delay:serial sync
6928  * @tc.desc      : two levels task dispatch
6929  */
6930 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03600, Function | MediumTest | Level1)
6931 {
6932     StartAbility(firstAbilityName, bundleNameFirst);
6933     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_35";
6934     bool result = false;
6935     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6936         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6937         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6938         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6939         result = data.compare("1") == 0;
6940         EXPECT_TRUE(result);
6941         if (!result && i > 0) {
6942             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03600 : " << i;
6943             break;
6944         }
6945     }
6946 }
6947 
6948 /**
6949  * @tc.number    : TaskDispatcher_Spec_03700
6950  * @tc.name      : spec delay:serial async
6951  * @tc.desc      : two levels task dispatch
6952  */
6953 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03700, Function | MediumTest | Level1)
6954 {
6955     StartAbility(firstAbilityName, bundleNameFirst);
6956     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_36";
6957     bool result = false;
6958     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6959         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6960         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6961         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6962         result = data.compare("1") == 0;
6963         EXPECT_TRUE(result);
6964         if (!result && i > 0) {
6965             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03700 : " << i;
6966             break;
6967         }
6968     }
6969 }
6970 
6971 /**
6972  * @tc.number    : TaskDispatcher_Spec_03800
6973  * @tc.name      : spec delay:serial delay
6974  * @tc.desc      : two levels task dispatch
6975  */
6976 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03800, Function | MediumTest | Level1)
6977 {
6978     StartAbility(firstAbilityName, bundleNameFirst);
6979     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_37";
6980     bool result = false;
6981     for (int i = 0; i < stLevel_.AMSLevel; i++) {
6982         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
6983         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
6984         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
6985         result = data.compare("1") == 0;
6986         EXPECT_TRUE(result);
6987         if (!result && i > 0) {
6988             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03800 : " << i;
6989             break;
6990         }
6991     }
6992 }
6993 
6994 /**
6995  * @tc.number    : TaskDispatcher_Spec_03900
6996  * @tc.name      : spec delay:serial apply
6997  * @tc.desc      : two levels task dispatch
6998  */
6999 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_03900, Function | MediumTest | Level1)
7000 {
7001     StartAbility(firstAbilityName, bundleNameFirst);
7002     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_38";
7003     bool result = false;
7004     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7005         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7006         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7007         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7008         result = data.compare("1") == 0;
7009         EXPECT_TRUE(result);
7010         if (!result && i > 0) {
7011             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_03900 : " << i;
7012             break;
7013         }
7014     }
7015 }
7016 
7017 /**
7018  * @tc.number    : TaskDispatcher_Spec_04000
7019  * @tc.name      : spec apply:parallel sync
7020  * @tc.desc      : two levels task dispatch
7021  */
7022 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04000, Function | MediumTest | Level1)
7023 {
7024     StartAbility(firstAbilityName, bundleNameFirst);
7025     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_39";
7026     bool result = false;
7027     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7028         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7029         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7030         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7031         result = data.compare("1") == 0;
7032         EXPECT_TRUE(result);
7033         if (!result && i > 0) {
7034             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04000 : " << i;
7035             break;
7036         }
7037     }
7038 }
7039 
7040 /**
7041  * @tc.number    : TaskDispatcher_Spec_04100
7042  * @tc.name      : spec apply:parallel async
7043  * @tc.desc      : two levels task dispatch
7044  */
7045 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04100, Function | MediumTest | Level1)
7046 {
7047     StartAbility(firstAbilityName, bundleNameFirst);
7048     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_40";
7049     bool result = false;
7050     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7051         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7052         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7053         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7054         result = data.compare("1") == 0;
7055         EXPECT_TRUE(result);
7056         if (!result && i > 0) {
7057             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04100 : " << i;
7058             break;
7059         }
7060     }
7061 }
7062 
7063 /**
7064  * @tc.number    : TaskDispatcher_Spec_04200
7065  * @tc.name      : spec apply:parallel delay
7066  * @tc.desc      : two levels task dispatch
7067  */
7068 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04200, Function | MediumTest | Level1)
7069 {
7070     StartAbility(firstAbilityName, bundleNameFirst);
7071     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_41";
7072     bool result = false;
7073     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7074         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7075         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7076         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7077         result = data.compare("1") == 0;
7078         EXPECT_TRUE(result);
7079         if (!result && i > 0) {
7080             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04200 : " << i;
7081             break;
7082         }
7083     }
7084 }
7085 
7086 /**
7087  * @tc.number    : TaskDispatcher_Spec_04300
7088  * @tc.name      : spec apply:parallel group
7089  * @tc.desc      : two levels task dispatch
7090  */
7091 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04300, Function | MediumTest | Level1)
7092 {
7093     StartAbility(firstAbilityName, bundleNameFirst);
7094     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_42";
7095     bool result = false;
7096     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7097         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7098         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7099         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7100         result = data.compare("1") == 0;
7101         EXPECT_TRUE(result);
7102         if (!result && i > 0) {
7103             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04300 : " << i;
7104             break;
7105         }
7106     }
7107 }
7108 
7109 /**
7110  * @tc.number    : TaskDispatcher_Spec_04400
7111  * @tc.name      : spec apply:parallel group wait
7112  * @tc.desc      : two levels task dispatch
7113  */
7114 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04400, Function | MediumTest | Level1)
7115 {
7116     StartAbility(firstAbilityName, bundleNameFirst);
7117     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_43";
7118     bool result = false;
7119     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7120         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7121         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7122         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7123         result = data.compare("1") == 0;
7124         EXPECT_TRUE(result);
7125         if (!result && i > 0) {
7126             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04400 : " << i;
7127             break;
7128         }
7129     }
7130 }
7131 
7132 /**
7133  * @tc.number    : TaskDispatcher_Spec_04500
7134  * @tc.name      : spec apply:parallel group notify
7135  * @tc.desc      : two levels task dispatch
7136  */
7137 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04500, Function | MediumTest | Level1)
7138 {
7139     StartAbility(firstAbilityName, bundleNameFirst);
7140     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_44";
7141     bool result = false;
7142     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7143         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7144         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7145         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7146         result = data.compare("1") == 0;
7147         EXPECT_TRUE(result);
7148         if (!result && i > 0) {
7149             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04500 : " << i;
7150             break;
7151         }
7152     }
7153 }
7154 
7155 /**
7156  * @tc.number    : TaskDispatcher_Spec_04600
7157  * @tc.name      : spec apply:parallel sync barrier
7158  * @tc.desc      : two levels task dispatch
7159  */
7160 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04600, Function | MediumTest | Level1)
7161 {
7162     StartAbility(firstAbilityName, bundleNameFirst);
7163     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_45";
7164     bool result = false;
7165     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7166         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7167         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7168         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7169         result = data.compare("1") == 0;
7170         EXPECT_TRUE(result);
7171         if (!result && i > 0) {
7172             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04600 : " << i;
7173             break;
7174         }
7175     }
7176 }
7177 
7178 /**
7179  * @tc.number    : TaskDispatcher_Spec_04700
7180  * @tc.name      : spec apply:parallel async barrier
7181  * @tc.desc      : two levels task dispatch
7182  */
7183 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04700, Function | MediumTest | Level1)
7184 {
7185     StartAbility(firstAbilityName, bundleNameFirst);
7186     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_46";
7187     bool result = false;
7188     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7189         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7190         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7191         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7192         result = data.compare("1") == 0;
7193         EXPECT_TRUE(result);
7194         if (!result && i > 0) {
7195             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04700 : " << i;
7196             break;
7197         }
7198     }
7199 }
7200 
7201 /**
7202  * @tc.number    : TaskDispatcher_Spec_04800
7203  * @tc.name      : spec apply:parallel apply
7204  * @tc.desc      : two levels task dispatch
7205  */
7206 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04800, Function | MediumTest | Level1)
7207 {
7208     StartAbility(firstAbilityName, bundleNameFirst);
7209     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_47";
7210     bool result = false;
7211     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7212         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7213         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7214         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7215         result = data.compare("1") == 0;
7216         EXPECT_TRUE(result);
7217         if (!result && i > 0) {
7218             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04800 : " << i;
7219             break;
7220         }
7221     }
7222 }
7223 
7224 /**
7225  * @tc.number    : TaskDispatcher_Spec_04900
7226  * @tc.name      : spec apply:serial sync
7227  * @tc.desc      : two levels task dispatch
7228  */
7229 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_04900, Function | MediumTest | Level1)
7230 {
7231     StartAbility(firstAbilityName, bundleNameFirst);
7232     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_48";
7233     bool result = false;
7234     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7235         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7236         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7237         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7238         result = data.compare("1") == 0;
7239         EXPECT_TRUE(result);
7240         if (!result && i > 0) {
7241             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_04900 : " << i;
7242             break;
7243         }
7244     }
7245 }
7246 
7247 /**
7248  * @tc.number    : TaskDispatcher_Spec_05000
7249  * @tc.name      : spec apply:serial async
7250  * @tc.desc      : two levels task dispatch
7251  */
7252 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_05000, Function | MediumTest | Level1)
7253 {
7254     StartAbility(firstAbilityName, bundleNameFirst);
7255     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_49";
7256     bool result = false;
7257     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7258         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7259         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7260         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7261         result = data.compare("1") == 0;
7262         EXPECT_TRUE(result);
7263         if (!result && i > 0) {
7264             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_05000 : " << i;
7265             break;
7266         }
7267     }
7268 }
7269 
7270 /**
7271  * @tc.number    : TaskDispatcher_Spec_05100
7272  * @tc.name      : spec apply:serial delay
7273  * @tc.desc      : two levels task dispatch
7274  */
7275 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_05100, Function | MediumTest | Level1)
7276 {
7277     StartAbility(firstAbilityName, bundleNameFirst);
7278     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_50";
7279     bool result = false;
7280     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7281         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7282         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7283         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7284         result = data.compare("1") == 0;
7285         EXPECT_TRUE(result);
7286         if (!result && i > 0) {
7287             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_05100 : " << i;
7288             break;
7289         }
7290     }
7291 }
7292 
7293 /**
7294  * @tc.number    : TaskDispatcher_Spec_05200
7295  * @tc.name      : spec apply:serial apply
7296  * @tc.desc      : two levels task dispatch
7297  */
7298 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Spec_05200, Function | MediumTest | Level1)
7299 {
7300     StartAbility(firstAbilityName, bundleNameFirst);
7301     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::SPEC) + "_51";
7302     bool result = false;
7303     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7304         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7305         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7306         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7307         result = data.compare("1") == 0;
7308         EXPECT_TRUE(result);
7309         if (!result && i > 0) {
7310             GTEST_LOG_(INFO) << "TaskDispatcher_Spec_05200 : " << i;
7311             break;
7312         }
7313     }
7314 }
7315 /**
7316  * @tc.number    : TaskDispatcher_Hybird_00100
7317  * @tc.name      : GlobalTaskDispatcher all operation
7318  * @tc.desc      : dispatcher all operation in GolbalTaskDispatcher
7319  */
7320 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00100, Function | MediumTest | Level1)
7321 {
7322     StartAbility(firstAbilityName, bundleNameFirst);
7323     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_0";
7324     bool result = false;
7325     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7326         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7327         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7328         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7329         result = data.compare("1") == 0;
7330         EXPECT_TRUE(result);
7331         if (!result && i > 0) {
7332             GTEST_LOG_(INFO) << "TaskDispatcher_Global_00100 : " << i;
7333             break;
7334         }
7335     }
7336 }
7337 /**
7338  * @tc.number    : TaskDispatcher_Hybird_00200
7339  * @tc.name      : ParallelTaskDispatcher all operation
7340  * @tc.desc      : dispatcher all operation in ParallelTaskDispatcher
7341  */
7342 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00200, Function | MediumTest | Level1)
7343 {
7344     StartAbility(firstAbilityName, bundleNameFirst);
7345     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_1";
7346     bool result = false;
7347     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7348         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7349         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7350         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7351         result = data.compare("1") == 0;
7352         EXPECT_TRUE(result);
7353         if (!result && i > 0) {
7354             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00200 : " << i;
7355             break;
7356         }
7357     }
7358 }
7359 /**
7360  * @tc.number    : TaskDispatcher_Hybird_00300
7361  * @tc.name      : SerialTaskDispatcher all operation
7362  * @tc.desc      : dispatcher all operation in SerialTaskDispatcher
7363  */
7364 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00300, Function | MediumTest | Level1)
7365 {
7366     StartAbility(firstAbilityName, bundleNameFirst);
7367     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_2";
7368     bool result = false;
7369     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7370         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7371         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7372         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7373         result = data.compare("1") == 0;
7374         EXPECT_TRUE(result);
7375         if (!result && i > 0) {
7376             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00300 : " << i;
7377             break;
7378         }
7379     }
7380 }
7381 /**
7382  * @tc.number    : TaskDispatcher_Hybird_00400
7383  * @tc.name      : SpecTaskDispatcher all operation
7384  * @tc.desc      : dispatcher all operation in GolbalTaskDispatcher
7385  */
7386 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00400, Function | MediumTest | Level1)
7387 {
7388     StartAbility(firstAbilityName, bundleNameFirst);
7389     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_3";
7390     bool result = false;
7391     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7392         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7393         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7394         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7395         result = data.compare("1") == 0;
7396         EXPECT_TRUE(result);
7397         if (!result && i > 0) {
7398             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00400 : " << i;
7399             break;
7400         }
7401     }
7402 }
7403 /**
7404  * @tc.number    : TaskDispatcher_Hybird_00500
7405  * @tc.name      : MutiDispatcher hybird
7406  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7407  */
7408 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00500, Function | MediumTest | Level1)
7409 {
7410     StartAbility(firstAbilityName, bundleNameFirst);
7411     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_4";
7412     bool result = false;
7413     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7414         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7415         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7416         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7417         result = data.compare("1") == 0;
7418         EXPECT_TRUE(result);
7419         if (!result && i > 0) {
7420             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00500 : " << i;
7421             break;
7422         }
7423     }
7424 }
7425 /**
7426  * @tc.number    : TaskDispatcher_Hybird_00600
7427  * @tc.name      : MutiDispatcher hybird
7428  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7429  */
7430 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00600, Function | MediumTest | Level1)
7431 {
7432     StartAbility(firstAbilityName, bundleNameFirst);
7433     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_5";
7434     bool result = false;
7435     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7436         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7437         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7438         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7439         result = data.compare("1") == 0;
7440         EXPECT_TRUE(result);
7441         if (!result && i > 0) {
7442             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00600 : " << i;
7443             break;
7444         }
7445     }
7446 }
7447 /**
7448  * @tc.number    : TaskDispatcher_Hybird_00700
7449  * @tc.name      : MutiDispatcher hybird
7450  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7451  */
7452 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00700, Function | MediumTest | Level1)
7453 {
7454     StartAbility(firstAbilityName, bundleNameFirst);
7455     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_6";
7456     bool result = false;
7457     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7458         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7459         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7460         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7461         result = data.compare("1") == 0;
7462         EXPECT_TRUE(result);
7463         if (!result && i > 0) {
7464             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00700 : " << i;
7465             break;
7466         }
7467     }
7468 }
7469 /**
7470  * @tc.number    : TaskDispatcher_Hybird_00800
7471  * @tc.name      : MutiDispatcher hybird
7472  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7473  */
7474 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00800, Function | MediumTest | Level1)
7475 {
7476     StartAbility(firstAbilityName, bundleNameFirst);
7477     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_7";
7478     bool result = false;
7479     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7480         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7481         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7482         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7483         result = data.compare("1") == 0;
7484         EXPECT_TRUE(result);
7485         if (!result && i > 0) {
7486             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00800 : " << i;
7487             break;
7488         }
7489     }
7490 }
7491 /**
7492  * @tc.number    : TaskDispatcher_Hybird_00900
7493  * @tc.name      : MutiDispatcher hybird
7494  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7495  */
7496 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_00900, Function | MediumTest | Level1)
7497 {
7498     StartAbility(firstAbilityName, bundleNameFirst);
7499     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_8";
7500     bool result = false;
7501     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7502         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7503         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7504         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7505         result = data.compare("1") == 0;
7506         EXPECT_TRUE(result);
7507         if (!result && i > 0) {
7508             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_00900 : " << i;
7509             break;
7510         }
7511     }
7512 }
7513 /**
7514  * @tc.number    : TaskDispatcher_Hybird_01000
7515  * @tc.name      : MutiDispatcher hybird
7516  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7517  */
7518 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01000, Function | MediumTest | Level1)
7519 {
7520     StartAbility(firstAbilityName, bundleNameFirst);
7521     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_9";
7522     bool result = false;
7523     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7524         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7525         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7526         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7527         result = data.compare("1") == 0;
7528         EXPECT_TRUE(result);
7529         if (!result && i > 0) {
7530             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01000 : " << i;
7531             break;
7532         }
7533     }
7534 }
7535 /**
7536  * @tc.number    : TaskDispatcher_Hybird_01100
7537  * @tc.name      : MutiDispatcher hybird
7538  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7539  */
7540 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01100, Function | MediumTest | Level1)
7541 {
7542     StartAbility(firstAbilityName, bundleNameFirst);
7543     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_10";
7544     bool result = false;
7545     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7546         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7547         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7548         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7549         result = data.compare("1") == 0;
7550         EXPECT_TRUE(result);
7551         if (!result && i > 0) {
7552             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01100 : " << i;
7553             break;
7554         }
7555     }
7556 }
7557 /**
7558  * @tc.number    : TaskDispatcher_Hybird_01200
7559  * @tc.name      : MutiDispatcher hybird
7560  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7561  */
7562 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01200, Function | MediumTest | Level1)
7563 {
7564     StartAbility(firstAbilityName, bundleNameFirst);
7565     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_11";
7566     bool result = false;
7567     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7568         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7569         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7570         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7571         result = data.compare("1") == 0;
7572         EXPECT_TRUE(result);
7573         if (!result && i > 0) {
7574             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01200 : " << i;
7575             break;
7576         }
7577     }
7578 }
7579 /**
7580  * @tc.number    : TaskDispatcher_Hybird_01300
7581  * @tc.name      : MutiDispatcher hybird
7582  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7583  */
7584 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01300, Function | MediumTest | Level1)
7585 {
7586     StartAbility(firstAbilityName, bundleNameFirst);
7587     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_12";
7588     bool result = false;
7589     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7590         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7591         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7592         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7593         result = data.compare("1") == 0;
7594         EXPECT_TRUE(result);
7595         if (!result && i > 0) {
7596             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01300 : " << i;
7597             break;
7598         }
7599     }
7600 }
7601 /**
7602  * @tc.number    : TaskDispatcher_Hybird_01400
7603  * @tc.name      : MutiDispatcher hybird
7604  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7605  */
7606 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01400, Function | MediumTest | Level1)
7607 {
7608     StartAbility(firstAbilityName, bundleNameFirst);
7609     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_13";
7610     bool result = false;
7611     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7612         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7613         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7614         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7615         result = data.compare("1") == 0;
7616         EXPECT_TRUE(result);
7617         if (!result && i > 0) {
7618             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01400 : " << i;
7619             break;
7620         }
7621     }
7622 }
7623 /**
7624  * @tc.number    : TaskDispatcher_Hybird_01500
7625  * @tc.name      : MutiDispatcher hybird
7626  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7627  */
7628 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01500, Function | MediumTest | Level1)
7629 {
7630     StartAbility(firstAbilityName, bundleNameFirst);
7631     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_14";
7632     bool result = false;
7633     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7634         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7635         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7636         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7637         result = data.compare("1") == 0;
7638         EXPECT_TRUE(result);
7639         if (!result && i > 0) {
7640             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01500 : " << i;
7641             break;
7642         }
7643     }
7644 }
7645 /**
7646  * @tc.number    : TaskDispatcher_Hybird_01600
7647  * @tc.name      : MutiDispatcher hybird
7648  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7649  */
7650 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01600, Function | MediumTest | Level1)
7651 {
7652     StartAbility(firstAbilityName, bundleNameFirst);
7653     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_15";
7654     bool result = false;
7655     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7656         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7657         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7658         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7659         result = data.compare("1") == 0;
7660         EXPECT_TRUE(result);
7661         if (!result && i > 0) {
7662             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01600 : " << i;
7663             break;
7664         }
7665     }
7666 }
7667 /**
7668  * @tc.number    : TaskDispatcher_Hybird_01700
7669  * @tc.name      : MutiDispatcher hybird
7670  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7671  */
7672 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01700, Function | MediumTest | Level1)
7673 {
7674     StartAbility(firstAbilityName, bundleNameFirst);
7675     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_16";
7676     bool result = false;
7677     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7678         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7679         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7680         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7681         result = data.compare("1") == 0;
7682         EXPECT_TRUE(result);
7683         if (!result && i > 0) {
7684             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01700 : " << i;
7685             break;
7686         }
7687     }
7688 }
7689 /**
7690  * @tc.number    : TaskDispatcher_Hybird_01800
7691  * @tc.name      : MutiDispatcher hybird
7692  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7693  */
7694 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01800, Function | MediumTest | Level1)
7695 {
7696     StartAbility(firstAbilityName, bundleNameFirst);
7697     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_17";
7698     bool result = false;
7699     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7700         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7701         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7702         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7703         result = data.compare("1") == 0;
7704         EXPECT_TRUE(result);
7705         if (!result && i > 0) {
7706             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01800 : " << i;
7707             break;
7708         }
7709     }
7710 }
7711 /**
7712  * @tc.number    : TaskDispatcher_Hybird_01900
7713  * @tc.name      : MutiDispatcher hybird
7714  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7715  */
7716 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_01900, Function | MediumTest | Level1)
7717 {
7718     StartAbility(firstAbilityName, bundleNameFirst);
7719     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_18";
7720     bool result = false;
7721     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7722         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7723         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7724         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7725         result = data.compare("1") == 0;
7726         EXPECT_TRUE(result);
7727         if (!result && i > 0) {
7728             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_01900 : " << i;
7729             break;
7730         }
7731     }
7732 }
7733 /**
7734  * @tc.number    : TaskDispatcher_Hybird_02000
7735  * @tc.name      : MutiDispatcher hybird
7736  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7737  */
7738 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02000, Function | MediumTest | Level1)
7739 {
7740     StartAbility(firstAbilityName, bundleNameFirst);
7741     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_19";
7742     bool result = false;
7743     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7744         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7745         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7746         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7747         result = data.compare("1") == 0;
7748         EXPECT_TRUE(result);
7749         if (!result && i > 0) {
7750             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02000 : " << i;
7751             break;
7752         }
7753     }
7754 }
7755 /**
7756  * @tc.number    : TaskDispatcher_Hybird_02100
7757  * @tc.name      : MutiDispatcher hybird
7758  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7759  */
7760 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02100, Function | MediumTest | Level1)
7761 {
7762     StartAbility(firstAbilityName, bundleNameFirst);
7763     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_20";
7764     bool result = false;
7765     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7766         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7767         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7768         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7769         result = data.compare("1") == 0;
7770         EXPECT_TRUE(result);
7771         if (!result && i > 0) {
7772             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02100 : " << i;
7773             break;
7774         }
7775     }
7776 }
7777 /**
7778  * @tc.number    : TaskDispatcher_Hybird_02200
7779  * @tc.name      : MutiDispatcher hybird
7780  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7781  */
7782 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02200, Function | MediumTest | Level1)
7783 {
7784     StartAbility(firstAbilityName, bundleNameFirst);
7785     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_21";
7786     bool result = false;
7787     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7788         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7789         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7790         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7791         result = data.compare("1") == 0;
7792         EXPECT_TRUE(result);
7793         if (!result && i > 0) {
7794             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02200 : " << i;
7795             break;
7796         }
7797     }
7798 }
7799 /**
7800  * @tc.number    : TaskDispatcher_Hybird_00500
7801  * @tc.name      : MutiDispatcher hybird
7802  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7803  */
7804 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02300, Function | MediumTest | Level1)
7805 {
7806     StartAbility(firstAbilityName, bundleNameFirst);
7807     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_22";
7808     bool result = false;
7809     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7810         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7811         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7812         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7813         result = data.compare("1") == 0;
7814         EXPECT_TRUE(result);
7815         if (!result && i > 0) {
7816             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02300 : " << i;
7817             break;
7818         }
7819     }
7820 }
7821 /**
7822  * @tc.number    : TaskDispatcher_Hybird_02400
7823  * @tc.name      : MutiDispatcher hybird
7824  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7825  */
7826 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02400, Function | MediumTest | Level1)
7827 {
7828     StartAbility(firstAbilityName, bundleNameFirst);
7829     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_23";
7830     bool result = false;
7831     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7832         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7833         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7834         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7835         result = data.compare("1") == 0;
7836         EXPECT_TRUE(result);
7837         if (!result && i > 0) {
7838             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02400 : " << i;
7839             break;
7840         }
7841     }
7842 }
7843 /**
7844  * @tc.number    : TaskDispatcher_Hybird_02500
7845  * @tc.name      : MutiDispatcher hybird
7846  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7847  */
7848 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02500, Function | MediumTest | Level1)
7849 {
7850     StartAbility(firstAbilityName, bundleNameFirst);
7851     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_24";
7852     bool result = false;
7853     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7854         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7855         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7856         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7857         result = data.compare("1") == 0;
7858         EXPECT_TRUE(result);
7859         if (!result && i > 0) {
7860             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02500 : " << i;
7861             break;
7862         }
7863     }
7864 }
7865 /**
7866  * @tc.number    : TaskDispatcher_Hybird_02600
7867  * @tc.name      : MutiDispatcher hybird
7868  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7869  */
7870 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02600, Function | MediumTest | Level1)
7871 {
7872     StartAbility(firstAbilityName, bundleNameFirst);
7873     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_25";
7874     bool result = false;
7875     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7876         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7877         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7878         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7879         result = data.compare("1") == 0;
7880         EXPECT_TRUE(result);
7881         if (!result && i > 0) {
7882             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02600 : " << i;
7883             break;
7884         }
7885     }
7886 }
7887 /**
7888  * @tc.number    : TaskDispatcher_Hybird_02700
7889  * @tc.name      : MutiDispatcher hybird
7890  * @tc.desc      : dispatcher task in MutiDispatcher by unorder operations
7891  */
7892 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Hybird_02700, Function | MediumTest | Level1)
7893 {
7894     StartAbility(firstAbilityName, bundleNameFirst);
7895     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::HYBRID) + "_26";
7896     bool result = false;
7897     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7898         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7899         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7900         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7901         result = data.compare("1") == 0;
7902         EXPECT_TRUE(result);
7903         if (!result && i > 0) {
7904             GTEST_LOG_(INFO) << "TaskDispatcher_Hybird_02700 : " << i;
7905             break;
7906         }
7907     }
7908 }
7909 
7910 /**
7911  * @tc.number    : TaskDispatcher_Extra_00100
7912  * @tc.name      : start ability in Dispatcher
7913  * @tc.desc      : start service ability in dispatcher
7914  */
7915 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Extra_00100, Function | MediumTest | Level1)
7916 {
7917     StartAbility(firstAbilityName, bundleNameFirst);
7918     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::EXTRA) + "_0";
7919     bool result = false;
7920     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7921         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7922         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7923         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7924         result = data.compare("1") == 0;
7925         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_SECOND, 0, DELAY));
7926         EXPECT_TRUE(result);
7927         if (!result && i > 0) {
7928             GTEST_LOG_(INFO) << "TaskDispatcher_Rxtra_00100 : " << i;
7929             break;
7930         }
7931     }
7932 }
7933 
7934 /**
7935  * @tc.number    : TaskDispatcher_Priority_00100
7936  * @tc.name      : task Dispatcher priority
7937  * @tc.desc      : use dispatcher in different prioritys
7938  */
7939 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Priority_00100, Function | MediumTest | Level1)
7940 {
7941     StartAbility(firstAbilityName, bundleNameFirst);
7942     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PRIORITY) + "_0";
7943     bool result = false;
7944     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7945         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7946         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7947         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7948         result = data.compare("1") == 0;
7949         EXPECT_TRUE(result);
7950         if (!result && i > 0) {
7951             GTEST_LOG_(INFO) << "TaskDispatcher_Priority_00100 : " << i;
7952             break;
7953         }
7954     }
7955 }
7956 
7957 /**
7958  * @tc.number    : TaskDispatcher_Priority_00200
7959  * @tc.name      : task Dispatcher priority
7960  * @tc.desc      : use dispatcher in different prioritys
7961  */
7962 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Priority_00200, Function | MediumTest | Level1)
7963 {
7964     StartAbility(firstAbilityName, bundleNameFirst);
7965     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PRIORITY) + "_1";
7966     bool result = false;
7967     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7968         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7969         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7970         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7971         result = data.compare("1") == 0;
7972         EXPECT_TRUE(result);
7973         if (!result && i > 0) {
7974             GTEST_LOG_(INFO) << "TaskDispatcher_Priority_00200 : " << i;
7975             break;
7976         }
7977     }
7978 }
7979 
7980 /**
7981  * @tc.number    : TaskDispatcher_Priority_00300
7982  * @tc.name      : task Dispatcher priority
7983  * @tc.desc      : use dispatcher in different prioritys
7984  */
7985 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Priority_00300, Function | MediumTest | Level1)
7986 {
7987     StartAbility(firstAbilityName, bundleNameFirst);
7988     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PRIORITY) + "_2";
7989     bool result = false;
7990     for (int i = 0; i < stLevel_.AMSLevel; i++) {
7991         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
7992         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
7993         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
7994         result = data.compare("1") == 0;
7995         EXPECT_TRUE(result);
7996         if (!result && i > 0) {
7997             GTEST_LOG_(INFO) << "TaskDispatcher_Priority_00300 : " << i;
7998             break;
7999         }
8000     }
8001 }
8002 
8003 /**
8004  * @tc.number    : TaskDispatcher_Priority_00400
8005  * @tc.name      : task Dispatcher priority
8006  * @tc.desc      : use dispatcher in different prioritys
8007  */
8008 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Priority_00400, Function | MediumTest | Level1)
8009 {
8010     StartAbility(firstAbilityName, bundleNameFirst);
8011     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PRIORITY) + "_3";
8012     bool result = false;
8013     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8014         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8015         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8016         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8017         result = data.compare("1") == 0;
8018         EXPECT_TRUE(result);
8019         if (!result && i > 0) {
8020             GTEST_LOG_(INFO) << "TaskDispatcher_Priority_00400 : " << i;
8021             break;
8022         }
8023     }
8024 }
8025 
8026 /**
8027  * @tc.number    : TaskDispatcher_Priority_00500
8028  * @tc.name      : task Dispatcher priority
8029  * @tc.desc      : use dispatcher in different prioritys
8030  */
8031 HWTEST_F(TaskDispatcherTest, TaskDispatcher_Priority_00500, Function | MediumTest | Level1)
8032 {
8033     StartAbility(firstAbilityName, bundleNameFirst);
8034     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::PRIORITY) + "_4";
8035     bool result = false;
8036     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8037         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8038         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8039         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8040         result = data.compare("1") == 0;
8041         EXPECT_TRUE(result);
8042         if (!result && i > 0) {
8043             GTEST_LOG_(INFO) << "TaskDispatcher_Priority_00500 : " << i;
8044             break;
8045         }
8046     }
8047 }
8048 
8049 /**
8050  * @tc.number    : TaskDispatcher_CancelTask_00100
8051  * @tc.name      : cancel async task successed
8052  * @tc.desc      : cancel async task successed
8053  */
8054 HWTEST_F(TaskDispatcherTest, TaskDispatcher_CancelTask_00100, Function | MediumTest | Level1)
8055 {
8056     StartAbility(firstAbilityName, bundleNameFirst);
8057     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::CANCEL_TASK) + "_0";
8058     bool result = false;
8059     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8060         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8061         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8062         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8063         result = data.compare("1") == 0;
8064         EXPECT_TRUE(result);
8065         if (!result && i > 0) {
8066             GTEST_LOG_(INFO) << "TaskDispatcher_CancelTask_00100 : " << i;
8067             break;
8068         }
8069     }
8070 }
8071 
8072 /**
8073  * @tc.number    : TaskDispatcher_CancelTask_00200
8074  * @tc.name      : cancel async task failed
8075  * @tc.desc      : cancel async task failed
8076  */
8077 HWTEST_F(TaskDispatcherTest, TaskDispatcher_CancelTask_00200, Function | MediumTest | Level1)
8078 {
8079     StartAbility(firstAbilityName, bundleNameFirst);
8080     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::CANCEL_TASK) + "_1";
8081     bool result = false;
8082     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8083         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8084         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8085         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8086         result = data.compare("1") == 0;
8087         EXPECT_TRUE(result);
8088         if (!result && i > 0) {
8089             GTEST_LOG_(INFO) << "TaskDispatcher_CancelTask_00200 : " << i;
8090             break;
8091         }
8092     }
8093 }
8094 
8095 /**
8096  * @tc.number    : TaskDispatcher_CancelTask_00300
8097  * @tc.name      : cancel delay task successed
8098  * @tc.desc      : cancel delay task successed
8099  */
8100 HWTEST_F(TaskDispatcherTest, TaskDispatcher_CancelTask_00300, Function | MediumTest | Level1)
8101 {
8102     StartAbility(firstAbilityName, bundleNameFirst);
8103     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::CANCEL_TASK) + "_2";
8104     bool result = false;
8105     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8106         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8107         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8108         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8109         result = data.compare("1") == 0;
8110         EXPECT_TRUE(result);
8111         if (!result && i > 0) {
8112             GTEST_LOG_(INFO) << "TaskDispatcher_CancelTask_00300 : " << i;
8113             break;
8114         }
8115     }
8116 }
8117 
8118 /**
8119  * @tc.number    : TaskDispatcher_CancelTask_00400
8120  * @tc.name      : cancel delay task failed
8121  * @tc.desc      : cancel delay task failed
8122  */
8123 HWTEST_F(TaskDispatcherTest, TaskDispatcher_CancelTask_00400, Function | MediumTest | Level1)
8124 {
8125     StartAbility(firstAbilityName, bundleNameFirst);
8126     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::CANCEL_TASK) + "_3";
8127     bool result = false;
8128     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8129         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8130         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8131         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8132         result = data.compare("1") == 0;
8133         EXPECT_TRUE(result);
8134         if (!result && i > 0) {
8135             GTEST_LOG_(INFO) << "TaskDispatcher_CancelTask_00400 : " << i;
8136             break;
8137         }
8138     }
8139 }
8140 
8141 /**
8142  * @tc.number    : TaskDispatcher_CancelTask_00500
8143  * @tc.name      : cancel async_group task successed
8144  * @tc.desc      : cancel async_group task successed
8145  */
8146 HWTEST_F(TaskDispatcherTest, TaskDispatcher_CancelTask_00500, Function | MediumTest | Level1)
8147 {
8148     StartAbility(firstAbilityName, bundleNameFirst);
8149     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::CANCEL_TASK) + "_4";
8150     bool result = false;
8151     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8152         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8153         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8154         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8155         result = data.compare("1") == 0;
8156         EXPECT_TRUE(result);
8157         if (!result && i > 0) {
8158             GTEST_LOG_(INFO) << "TaskDispatcher_CancelTask_00500 : " << i;
8159             break;
8160         }
8161     }
8162 }
8163 
8164 /**
8165  * @tc.number    : TaskDispatcher_CancelTask_00600
8166  * @tc.name      : cancel async_group task failed
8167  * @tc.desc      : cancel async_group task failed
8168  */
8169 HWTEST_F(TaskDispatcherTest, TaskDispatcher_CancelTask_00600, Function | MediumTest | Level1)
8170 {
8171     StartAbility(firstAbilityName, bundleNameFirst);
8172     std::string data = "Dispatcher_" + std::to_string((int)TestFunc::CANCEL_TASK) + "_5";
8173     bool result = false;
8174     for (int i = 0; i < stLevel_.AMSLevel; i++) {
8175         STAbilityUtil::PublishEvent(g_EVENT_REQU_FIRST, ++testCaseCode, data);
8176         EXPECT_EQ(0, STAbilityUtil::WaitCompleted(event, g_EVENT_RESP_FIRST, testCaseCode, DELAY));
8177         data = STAbilityUtil::GetData(event, g_EVENT_RESP_FIRST, testCaseCode);
8178         result = data.compare("1") == 0;
8179         EXPECT_TRUE(result);
8180         if (!result && i > 0) {
8181             GTEST_LOG_(INFO) << "TaskDispatcher_CancelTask_00600 : " << i;
8182             break;
8183         }
8184     }
8185 }
8186 }  // namespace