1 /*
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include "common_event_manager.h"
16 #define private public
17 #define protected public
18 #include "common_event_manager_service.h"
19 #undef private
20 #undef protected
21
22 #include "common_event_subscribe_info.h"
23
24 #include <gtest/gtest.h>
25 #include "testConfigParser.h"
26
27 using namespace testing::ext;
28
29 namespace OHOS {
30 namespace EventFwk {
31 class ActsCommonEventServicesSystemTest : public CommonEventSubscriber {
32 public:
33 explicit ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo);
~ActsCommonEventServicesSystemTest()34 virtual ~ActsCommonEventServicesSystemTest() {};
35 virtual void OnReceiveEvent(const CommonEventData &data);
36 };
37
ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo & subscribeInfo)38 ActsCommonEventServicesSystemTest::ActsCommonEventServicesSystemTest(const CommonEventSubscribeInfo &subscribeInfo)
39 : CommonEventSubscriber(subscribeInfo)
40 {}
41
OnReceiveEvent(const CommonEventData & data)42 void ActsCommonEventServicesSystemTest::OnReceiveEvent(const CommonEventData &data)
43 {}
44
45 class ActsCESCESpublishInfoTest : public testing::Test {
46 public:
47 static void SetUpTestCase();
48 static void TearDownTestCase();
49 void SetUp();
50 void TearDown();
51
52 static StressTestLevel stLevel_;
53 };
54 StressTestLevel ActsCESCESpublishInfoTest::stLevel_ {};
55
SetUpTestCase()56 void ActsCESCESpublishInfoTest::SetUpTestCase()
57 {
58 TestConfigParser tcp;
59 tcp.ParseFromFile4StressTest(STRESS_TEST_CONFIG_FILE_PATH, stLevel_);
60 std::cout << "stress test level : "
61 << "AMS : " << stLevel_.AMSLevel << " "
62 << "BMS : " << stLevel_.BMSLevel << " "
63 << "CES : " << stLevel_.CESLevel << std::endl;
64 }
65
TearDownTestCase()66 void ActsCESCESpublishInfoTest::TearDownTestCase()
67 {}
68
SetUp()69 void ActsCESCESpublishInfoTest::SetUp()
70 {}
71
TearDown()72 void ActsCESCESpublishInfoTest::TearDown()
73 {}
74
75 /*
76 * @tc.number: CES_PublishInfo_Sticky_0100
77 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
78 * @tc.desc: 1.Set publishInfo
79 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
80 */
81 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0100, Function | MediumTest | Level1)
82 {
83 bool result = false;
84 std::string eventName = "StickyFalseTest001";
85 bool sticky = false;
86 MatchingSkills matchingSkills;
87 for (int i = 1; i <= stLevel_.CESLevel; i++) {
88 matchingSkills.AddEvent(eventName);
89 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
90 CommonEventPublishInfo publishInfo;
91 publishInfo.SetSticky(sticky);
92 if (publishInfo.IsSticky()) {
93 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0100 failed, frequency: " << i;
94 result = false;
95 break;
96 } else {
97 result = true;
98 }
99 matchingSkills.RemoveEvent(eventName);
100 }
101 if (result && stLevel_.CESLevel >= 1) {
102 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0100 stress level: " << stLevel_.CESLevel;
103 GTEST_LOG_(INFO) << "CES_SetEventAuthority_0100 stress level: " << stLevel_.CESLevel;
104 }
105 EXPECT_TRUE(result);
106 }
107
108 /*
109 * @tc.number: CES_PublishInfo_Sticky_0200
110 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
111 * @tc.desc: 1.Set publishInfo
112 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
113 */
114 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0200, Function | MediumTest | Level1)
115 {
116 bool result = false;
117 std::string eventName = "StickyFalseTest001";
118 bool sticky = true;
119 MatchingSkills matchingSkills;
120 for (int i = 1; i <= stLevel_.CESLevel; i++) {
121 matchingSkills.AddEvent(eventName);
122 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
123 CommonEventPublishInfo publishInfo;
124 publishInfo.SetSticky(sticky);
125 if (!publishInfo.IsSticky()) {
126 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0200 failed, frequency: " << i;
127 result = false;
128 break;
129 } else {
130 result = true;
131 }
132 matchingSkills.RemoveEvent(eventName);
133 }
134 if (result && stLevel_.CESLevel >= 1) {
135 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0200 stress level: " << stLevel_.CESLevel;
136 }
137 EXPECT_TRUE(result);
138 }
139
140 /*
141 * @tc.number: CES_PublishInfo_Sticky_0300
142 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
143 * @tc.desc: 1.Set publishInfo
144 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
145 */
146 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0300, Function | MediumTest | Level1)
147 {
148 bool result = false;
149 std::string eventName = "StickyFalseTest003";
150 bool sticky = false;
151 MatchingSkills matchingSkills;
152 for (int i = 1; i <= stLevel_.CESLevel; i++) {
153 matchingSkills.AddEvent(eventName);
154 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
155 CommonEventPublishInfo publishInfo;
156 publishInfo.SetSticky(sticky);
157 if (publishInfo.IsSticky()) {
158 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0300 failed, frequency: " << i;
159 result = false;
160 break;
161 } else {
162 result = true;
163 }
164 matchingSkills.RemoveEvent(eventName);
165 }
166 if (result && stLevel_.CESLevel >= 1) {
167 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0300 stress level: " << stLevel_.CESLevel;
168 }
169 EXPECT_TRUE(result);
170 }
171
172 /*
173 * @tc.number: CES_PublishInfo_Sticky_0400
174 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
175 * @tc.desc: 1.Set publishInfo
176 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
177 */
178 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0400, Function | MediumTest | Level1)
179 {
180 bool result = false;
181 std::string eventName = "StickyTrueTest004";
182 bool sticky = true;
183 MatchingSkills matchingSkills;
184 for (int i = 1; i <= stLevel_.CESLevel; i++) {
185 matchingSkills.AddEvent(eventName);
186 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
187 CommonEventPublishInfo publishInfo;
188 publishInfo.SetSticky(sticky);
189 if (!publishInfo.IsSticky()) {
190 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0400 failed, frequency: " << i;
191 result = false;
192 break;
193 } else {
194 result = true;
195 }
196 matchingSkills.RemoveEvent(eventName);
197 }
198 if (result && stLevel_.CESLevel >= 1) {
199 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0400 stress level: " << stLevel_.CESLevel;
200 }
201 EXPECT_TRUE(result);
202 }
203
204 /*
205 * @tc.number: CES_PublishInfo_Sticky_0500
206 * @tc.name: CommonEventPublishInfo : IsSticky
207 * @tc.desc: 1.Set publishInfo
208 * 2.Verify the function of CommonEventPublishInfo: IsSticky
209 */
210 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0500, Function | MediumTest | Level2)
211 {
212 bool result = false;
213 std::string eventName = "StickyFalseTest005";
214 MatchingSkills matchingSkills;
215 for (int i = 1; i <= stLevel_.CESLevel; i++) {
216 matchingSkills.AddEvent(eventName);
217 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
218 CommonEventPublishInfo publishInfo;
219 if (publishInfo.IsSticky()) {
220 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0500 failed, frequency: " << i;
221 result = false;
222 break;
223 } else {
224 result = true;
225 }
226 matchingSkills.RemoveEvent(eventName);
227 }
228 if (result && stLevel_.CESLevel >= 1) {
229 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0500 stress level: " << stLevel_.CESLevel;
230 }
231 EXPECT_TRUE(result);
232 }
233
234 /*
235 * @tc.number: CES_PublishInfo_Sticky_0600
236 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
237 * @tc.desc: 1.Set publishInfo
238 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
239 */
240 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0600, Function | MediumTest | Level1)
241 {
242 bool result = false;
243 std::string eventName = "StickyTrueTest006";
244 bool sticky = true;
245 MatchingSkills matchingSkills;
246 for (int i = 1; i <= stLevel_.CESLevel; i++) {
247 matchingSkills.AddEvent(eventName);
248 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
249 CommonEventPublishInfo publishInfo;
250 publishInfo.SetSticky(sticky);
251 EXPECT_TRUE(publishInfo.IsSticky());
252 sticky = false;
253 publishInfo.SetSticky(sticky);
254 if (publishInfo.IsSticky()) {
255 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0600 failed, frequency: " << i;
256 result = false;
257 break;
258 } else {
259 result = true;
260 }
261 matchingSkills.RemoveEvent(eventName);
262 sticky = true;
263 }
264 if (result && stLevel_.CESLevel >= 1) {
265 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0600 stress level: " << stLevel_.CESLevel;
266 }
267 EXPECT_TRUE(result);
268 }
269
270 /*
271 * @tc.number: CES_PublishInfo_Sticky_0700
272 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
273 * @tc.desc: 1.Set publishInfo
274 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
275 */
276 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0700, Function | MediumTest | Level1)
277 {
278 bool result = false;
279 std::string eventName = "StickyTrueTest007";
280 bool sticky = false;
281 MatchingSkills matchingSkills;
282 for (int i = 1; i <= stLevel_.CESLevel; i++) {
283 matchingSkills.AddEvent(eventName);
284 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
285 CommonEventPublishInfo publishInfo;
286 publishInfo.SetSticky(sticky);
287 EXPECT_FALSE(publishInfo.IsSticky());
288 sticky = true;
289 publishInfo.SetSticky(sticky);
290 if (!publishInfo.IsSticky()) {
291 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0700 failed, frequency: " << i;
292 result = false;
293 break;
294 } else {
295 result = true;
296 }
297 matchingSkills.RemoveEvent(eventName);
298 sticky = false;
299 }
300 if (result && stLevel_.CESLevel >= 1) {
301 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0700 stress level: " << stLevel_.CESLevel;
302 }
303 EXPECT_TRUE(result);
304 }
305
306 /*
307 * @tc.number: CES_PublishInfo_Sticky_0800
308 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
309 * @tc.desc: 1.Set publishInfo
310 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
311 */
312 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0800, Function | MediumTest | Level2)
313 {
314 bool result = false;
315 std::string eventName = "StickyFalseTest008";
316 bool sticky = false;
317 MatchingSkills matchingSkills;
318 for (int i = 1; i <= stLevel_.CESLevel; i++) {
319 matchingSkills.AddEvent(eventName);
320 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
321 CommonEventPublishInfo publishInfo;
322 publishInfo.SetSticky(sticky);
323 EXPECT_FALSE(publishInfo.IsSticky());
324 sticky = true;
325 publishInfo.SetSticky(sticky);
326 if (!publishInfo.IsSticky()) {
327 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0800 failed, frequency: " << i;
328 result = false;
329 break;
330 } else {
331 result = true;
332 }
333 matchingSkills.RemoveEvent(eventName);
334 sticky = false;
335 }
336 if (result && stLevel_.CESLevel >= 1) {
337 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0800 stress level: " << stLevel_.CESLevel;
338 }
339 EXPECT_TRUE(result);
340 }
341
342 /*
343 * @tc.number: CES_PublishInfo_Sticky_0900
344 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
345 * @tc.desc: 1.Set publishInfo
346 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
347 */
348 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_0900, Function | MediumTest | Level1)
349 {
350 bool result = false;
351 std::string eventName = "StickyFalseTest009";
352 bool sticky = true;
353 MatchingSkills matchingSkills;
354 for (int i = 1; i <= stLevel_.CESLevel; i++) {
355 matchingSkills.AddEvent(eventName);
356 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
357 CommonEventPublishInfo publishInfo;
358 publishInfo.SetSticky(sticky);
359 EXPECT_TRUE(publishInfo.IsSticky());
360 sticky = false;
361 publishInfo.SetSticky(sticky);
362 if (publishInfo.IsSticky()) {
363 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0900 failed, frequency: " << i;
364 result = false;
365 break;
366 } else {
367 result = true;
368 }
369 matchingSkills.RemoveEvent(eventName);
370 sticky = true;
371 }
372 if (result && stLevel_.CESLevel >= 1) {
373 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_0900 stress level: " << stLevel_.CESLevel;
374 }
375 EXPECT_TRUE(result);
376 }
377
378 /*
379 * @tc.number: CES_PublishInfo_Sticky_1000
380 * @tc.name: CommonEventPublishInfo : SetSticky and IsSticky
381 * @tc.desc: 1.Set publishInfo
382 * 2.Verify the function of CommonEventPublishInfo: SetSticky and IsSticky
383 */
384 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Sticky_1000, Function | MediumTest | Level2)
385 {
386 bool result = false;
387 std::string eventName = "StickyFalseTest010";
388 MatchingSkills matchingSkills;
389 for (int i = 1; i <= stLevel_.CESLevel; i++) {
390 matchingSkills.AddEvent(eventName);
391 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
392 CommonEventPublishInfo publishInfo;
393 EXPECT_FALSE(publishInfo.IsSticky());
394 bool sticky = true;
395 publishInfo.SetSticky(sticky);
396 if (!publishInfo.IsSticky()) {
397 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_1000 failed, frequency: " << i;
398 result = false;
399 break;
400 } else {
401 result = true;
402 }
403 matchingSkills.RemoveEvent(eventName);
404 }
405 if (result && stLevel_.CESLevel >= 1) {
406 GTEST_LOG_(INFO) << "CES_PublishInfo_Sticky_1000 stress level: " << stLevel_.CESLevel;
407 }
408 EXPECT_TRUE(result);
409 }
410
411 /*
412 * @tc.number: CES_PublishInfo_Permissions_0100
413 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
414 * @tc.desc: 1.Set publishInfo
415 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
416 */
417 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0100, Function | MediumTest | Level1)
418 {
419 bool result = false;
420 std::string eventName = "PermissionsTest001";
421 std::string eventAction = "PermissionsTest001";
422 std::string permissin = "PERMISSION1";
423 std::vector<std::string> permissins;
424 permissins.push_back(permissin);
425 MatchingSkills matchingSkills;
426 for (int i = 1; i <= stLevel_.CESLevel; i++) {
427 matchingSkills.AddEvent(eventName);
428 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
429 CommonEventPublishInfo publishInfo;
430 publishInfo.SetSubscriberPermissions(permissins);
431 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
432 if (!(permissin == testPermissions[0])) {
433 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0100 failed, frequency: " << i;
434 result = false;
435 break;
436 } else {
437 result = true;
438 }
439 matchingSkills.RemoveEvent(eventName);
440 }
441 if (result && stLevel_.CESLevel >= 1) {
442 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0100 stress level: " << stLevel_.CESLevel;
443 }
444 EXPECT_TRUE(result);
445 }
446
447 /*
448 * @tc.number: CES_PublishInfo_Permissions_0200
449 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
450 * @tc.desc: 1.Set publishInfo
451 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
452 */
453 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0200, Function | MediumTest | Level2)
454 {
455 bool result = false;
456 std::string eventName = "PermissionsTest002";
457 std::string eventAction = "PermissionsTest002";
458 std::string permissin1 = "PERMISSION2";
459 std::string permissin2 = "PERMISSION3";
460 std::vector<std::string> permissins;
461 permissins.push_back(permissin1);
462 permissins.push_back(permissin2);
463 MatchingSkills matchingSkills;
464 for (int i = 1; i <= stLevel_.CESLevel; i++) {
465 matchingSkills.AddEvent(eventName);
466 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
467 CommonEventPublishInfo publishInfo;
468 publishInfo.SetSubscriberPermissions(permissins);
469 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
470 if (!(permissin2 == testPermissions[1])) {
471 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0200 failed, frequency: " << i;
472 result = false;
473 break;
474 } else {
475 result = true;
476 }
477 matchingSkills.RemoveEvent(eventName);
478 }
479 if (result && stLevel_.CESLevel >= 1) {
480 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0200 stress level: " << stLevel_.CESLevel;
481 }
482 EXPECT_TRUE(result);
483 }
484
485 /*
486 * @tc.number: CES_PublishInfo_Permissions_0300
487 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
488 * @tc.desc: 1.Set publishInfo
489 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
490 */
491 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0300, Function | MediumTest | Level2)
492 {
493 bool result = false;
494 std::string eventName = "PermissionsTest003";
495 std::string eventAction = "PermissionsTest003";
496 std::string permissin1 = "PERMISSION4";
497 std::string permissin2 = "PERMISSION5";
498 std::string permissin3 = "PERMISSION6";
499 std::vector<std::string> permissins;
500 permissins.push_back(permissin1);
501 permissins.push_back(permissin2);
502 permissins.push_back(permissin3);
503 MatchingSkills matchingSkills;
504 for (int i = 1; i <= stLevel_.CESLevel; i++) {
505 matchingSkills.AddEvent(eventName);
506 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
507 CommonEventPublishInfo publishInfo;
508 publishInfo.SetSubscriberPermissions(permissins);
509 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
510 if (!(permissin3 == testPermissions[2])) {
511 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0300 failed, frequency: " << i;
512 result = false;
513 break;
514 } else {
515 result = true;
516 }
517 matchingSkills.RemoveEvent(eventName);
518 }
519 if (result && stLevel_.CESLevel >= 1) {
520 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0300 stress level: " << stLevel_.CESLevel;
521 }
522 EXPECT_TRUE(result);
523 }
524
525 /*
526 * @tc.number: CES_PublishInfo_Permissions_0400
527 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
528 * @tc.desc: 1.Set publishInfo
529 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
530 */
531 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0400, Function | MediumTest | Level2)
532 {
533 bool result = false;
534 std::string eventName = "PermissionsTest004";
535 std::string eventAction = "PermissionsTest004";
536 std::string permissin = "PERMISSION1";
537 std::string teststr = "test";
538 std::vector<std::string> permissins;
539 permissins.push_back(permissin);
540 MatchingSkills matchingSkills;
541 for (int i = 1; i <= stLevel_.CESLevel; i++) {
542 matchingSkills.AddEvent(eventName);
543 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
544 CommonEventPublishInfo publishInfo;
545 publishInfo.SetSubscriberPermissions(permissins);
546 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
547 if (teststr == testPermissions[0]) {
548 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0400 failed, frequency: " << i;
549 result = false;
550 break;
551 } else {
552 result = true;
553 }
554 matchingSkills.RemoveEvent(eventName);
555 }
556 if (result && stLevel_.CESLevel >= 1) {
557 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0400 stress level: " << stLevel_.CESLevel;
558 }
559 EXPECT_TRUE(result);
560 }
561
562 /*
563 * @tc.number: CES_PublishInfo_Permissions_0500
564 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
565 * @tc.desc: 1.Set publishInfo
566 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
567 */
568 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0500, Function | MediumTest | Level2)
569 {
570 bool result = false;
571 std::string eventName = "PermissionsTest005";
572 std::string eventAction = "PermissionsTest005";
573 std::string permissin1 = "PERMISSION2";
574 std::string permissin2 = "PERMISSION3";
575 std::vector<std::string> permissins;
576 permissins.push_back(permissin1);
577 permissins.push_back(permissin2);
578 MatchingSkills matchingSkills;
579 for (int i = 1; i <= stLevel_.CESLevel; i++) {
580 matchingSkills.AddEvent(eventName);
581 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
582 CommonEventPublishInfo publishInfo;
583 publishInfo.SetSubscriberPermissions(permissins);
584 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
585 if (permissin1 == testPermissions[1]) {
586 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0500 failed, frequency: " << i;
587 result = false;
588 break;
589 } else {
590 result = true;
591 }
592 matchingSkills.RemoveEvent(eventName);
593 }
594 if (result && stLevel_.CESLevel >= 1) {
595 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0500 stress level: " << stLevel_.CESLevel;
596 }
597 EXPECT_TRUE(result);
598 }
599
600 /*
601 * @tc.number: CES_PublishInfo_Permissions_0600
602 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
603 * @tc.desc: 1.Set publishInfo
604 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
605 */
606 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0600, Function | MediumTest | Level2)
607 {
608 bool result = false;
609 std::string eventName = "PermissionsTest006";
610 std::string eventAction = "PermissionsTest006";
611 std::string permissin1 = "PERMISSION4";
612 std::string permissin2 = "PERMISSION5";
613 std::string permissin3 = "PERMISSION6";
614 std::vector<std::string> permissins;
615 permissins.push_back(permissin1);
616 permissins.push_back(permissin2);
617 permissins.push_back(permissin3);
618 MatchingSkills matchingSkills;
619 for (int i = 1; i <= stLevel_.CESLevel; i++) {
620 matchingSkills.AddEvent(eventName);
621 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
622 CommonEventPublishInfo publishInfo;
623 publishInfo.SetSubscriberPermissions(permissins);
624 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
625 if (permissin1 == testPermissions[2]) {
626 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0600 failed, frequency: " << i;
627 result = false;
628 break;
629 } else {
630 result = true;
631 }
632 matchingSkills.RemoveEvent(eventName);
633 }
634 if (result && stLevel_.CESLevel >= 1) {
635 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0600 stress level: " << stLevel_.CESLevel;
636 }
637 EXPECT_TRUE(result);
638 }
639
640 /*
641 * @tc.number: CES_PublishInfo_Permissions_0700
642 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
643 * @tc.desc: 1.Set publishInfo
644 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
645 */
646 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0700, Function | MediumTest | Level1)
647 {
648 bool result = false;
649 std::string eventName = "PermissionsTest007";
650 std::string eventAction = "PermissionsTest007";
651 std::string permissin1 = "PERMISSION4";
652 std::vector<std::string> permissins;
653 permissins.push_back(permissin1);
654 MatchingSkills matchingSkills;
655 for (int i = 1; i <= stLevel_.CESLevel; i++) {
656 matchingSkills.AddEvent(eventName);
657 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
658 CommonEventPublishInfo publishInfo;
659 publishInfo.SetSubscriberPermissions(permissins);
660 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
661 if (!(1 == testPermissions.size())) {
662 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0700 failed, frequency: " << i;
663 result = false;
664 break;
665 } else {
666 result = true;
667 }
668 matchingSkills.RemoveEvent(eventName);
669 }
670 if (result && stLevel_.CESLevel >= 1) {
671 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0700 stress level: " << stLevel_.CESLevel;
672 }
673 EXPECT_TRUE(result);
674 }
675
676 /*
677 * @tc.number: CES_PublishInfo_Permissions_0800
678 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
679 * @tc.desc: 1.Set publishInfo
680 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
681 */
682 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0800, Function | MediumTest | Level1)
683 {
684 bool result = false;
685 std::string eventName = "PermissionsTest008";
686 std::string eventAction = "PermissionsTest008";
687 std::string permissin1 = "PERMISSION4";
688 std::string permissin2 = "PERMISSION5";
689 std::vector<std::string> permissins;
690 permissins.push_back(permissin1);
691 permissins.push_back(permissin2);
692 MatchingSkills matchingSkills;
693 for (int i = 1; i <= stLevel_.CESLevel; i++) {
694 matchingSkills.AddEvent(eventName);
695 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
696 CommonEventPublishInfo publishInfo;
697 publishInfo.SetSubscriberPermissions(permissins);
698 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
699 if (!(2 == testPermissions.size())) {
700 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0800 failed, frequency: " << i;
701 result = false;
702 break;
703 } else {
704 result = true;
705 }
706 matchingSkills.RemoveEvent(eventName);
707 }
708 if (result && stLevel_.CESLevel >= 1) {
709 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0800 stress level: " << stLevel_.CESLevel;
710 }
711 EXPECT_TRUE(result);
712 }
713
714 /*
715 * @tc.number: CES_PublishInfo_Permissions_0900
716 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
717 * @tc.desc: 1.Set publishInfo
718 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
719 */
720 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_0900, Function | MediumTest | Level1)
721 {
722 bool result = false;
723 std::string eventName = "PermissionsTest009";
724 std::string eventAction = "PermissionsTest009";
725 std::string permissin1 = "PERMISSION4";
726 std::string permissin2 = "PERMISSION5";
727 std::string permissin3 = "PERMISSION6";
728 std::vector<std::string> permissins;
729 permissins.push_back(permissin1);
730 permissins.push_back(permissin2);
731 permissins.push_back(permissin3);
732 MatchingSkills matchingSkills;
733 for (int i = 1; i <= stLevel_.CESLevel; i++) {
734 matchingSkills.AddEvent(eventName);
735 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
736 CommonEventPublishInfo publishInfo;
737 publishInfo.SetSubscriberPermissions(permissins);
738 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
739 if (!(3 == testPermissions.size())) {
740 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0900 failed, frequency: " << i;
741 result = false;
742 break;
743 } else {
744 result = true;
745 }
746 matchingSkills.RemoveEvent(eventName);
747 }
748 if (result && stLevel_.CESLevel >= 1) {
749 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_0900 stress level: " << stLevel_.CESLevel;
750 }
751 EXPECT_TRUE(result);
752 }
753
754 /*
755 * @tc.number: CES_PublishInfo_Permissions_1000
756 * @tc.name: CommonEventPublishInfo : GetSubscriberPermissions
757 * @tc.desc: 1.Set publishInfo
758 * 2.Verify the function of CommonEventPublishInfo: GetSubscriberPermissions
759 */
760 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Permissions_1000, Function | MediumTest | Level2)
761 {
762 bool result = false;
763 std::string eventName = "PermissionsTest010";
764 std::string eventAction = "PermissionsTest010";
765 std::vector<std::string> permissins;
766 MatchingSkills matchingSkills;
767 for (int i = 1; i <= stLevel_.CESLevel; i++) {
768 matchingSkills.AddEvent(eventName);
769 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
770 CommonEventPublishInfo publishInfo;
771 publishInfo.SetSubscriberPermissions(permissins);
772 std::vector<std::string> testPermissions = publishInfo.GetSubscriberPermissions();
773 if (!(0 == testPermissions.size())) {
774 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_1000 failed, frequency: " << i;
775 result = false;
776 break;
777 } else {
778 result = true;
779 }
780 matchingSkills.RemoveEvent(eventName);
781 }
782 if (result && stLevel_.CESLevel >= 1) {
783 GTEST_LOG_(INFO) << "CES_PublishInfo_Permissions_1000 stress level: " << stLevel_.CESLevel;
784 }
785 EXPECT_TRUE(result);
786 }
787
788 /*
789 * @tc.number: CES_PublishInfo_Ordered_0100
790 * @tc.name: CommonEventPublishInfo : SetOrdered and IsOrdered
791 * @tc.desc: 1.Set publishInfo
792 * 2.Verify the function of CommonEventPublishInfo: SetOrdered and IsOrdered
793 */
794 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0100, Function | MediumTest | Level1)
795 {
796 bool result = false;
797 std::string eventName = "OrderedTest001";
798 bool order = false;
799 MatchingSkills matchingSkills;
800 for (int i = 1; i <= stLevel_.CESLevel; i++) {
801 matchingSkills.AddEvent(eventName);
802 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
803 CommonEventPublishInfo publishInfo;
804 publishInfo.SetOrdered(order);
805 if (publishInfo.IsOrdered()) {
806 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0100 failed, frequency: " << i;
807 result = false;
808 break;
809 } else {
810 result = true;
811 }
812 matchingSkills.RemoveEvent(eventName);
813 }
814 if (result && stLevel_.CESLevel >= 1) {
815 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0100 stress level: " << stLevel_.CESLevel;
816 }
817 EXPECT_TRUE(result);
818 }
819
820 /*
821 * @tc.number: CES_PublishInfo_Ordered_0200
822 * @tc.name: CommonEventPublishInfo : SetOrdered and IsOrdered
823 * @tc.desc: 1.Set publishInfo
824 * 2.Verify the function of CommonEventPublishInfo: SetOrdered and IsOrdered
825 */
826 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0200, Function | MediumTest | Level1)
827 {
828 bool result = false;
829 std::string eventName = "OrderedTest002";
830 bool order = true;
831 MatchingSkills matchingSkills;
832 for (int i = 1; i <= stLevel_.CESLevel; i++) {
833 matchingSkills.AddEvent(eventName);
834 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
835 CommonEventPublishInfo publishInfo;
836 publishInfo.SetOrdered(order);
837 if (!publishInfo.IsOrdered()) {
838 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0200 failed, frequency: " << i;
839 result = false;
840 break;
841 } else {
842 result = true;
843 }
844 matchingSkills.RemoveEvent(eventName);
845 }
846 if (result && stLevel_.CESLevel >= 1) {
847 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0200 stress level: " << stLevel_.CESLevel;
848 }
849 EXPECT_TRUE(result);
850 }
851
852 /*
853 * @tc.number: CES_PublishInfo_Ordered_0300
854 * @tc.name: CommonEventPublishInfo : SetOrdered and IsOrdered
855 * @tc.desc: 1.Set publishInfo
856 * 2.Verify the function of CommonEventPublishInfo: SetOrdered and IsOrdered
857 */
858 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0300, Function | MediumTest | Level2)
859 {
860 bool result = false;
861 std::string eventName = "OrderedTest003";
862 MatchingSkills matchingSkills;
863 for (int i = 1; i <= stLevel_.CESLevel; i++) {
864 matchingSkills.AddEvent(eventName);
865 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
866 CommonEventPublishInfo publishInfo;
867 if (publishInfo.IsOrdered()) {
868 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0300 failed, frequency: " << i;
869 result = false;
870 break;
871 } else {
872 result = true;
873 }
874 matchingSkills.RemoveEvent(eventName);
875 }
876 if (result && stLevel_.CESLevel >= 1) {
877 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0300 stress level: " << stLevel_.CESLevel;
878 }
879 EXPECT_TRUE(result);
880 }
881
882 /*
883 * @tc.number: CES_PublishInfo_Ordered_0400
884 * @tc.name: CommonEventPublishInfo : SetOrdered and IsOrdered
885 * @tc.desc: 1.Set publishInfo
886 * 2.Verify the function of CommonEventPublishInfo: SetOrdered and IsOrdered
887 */
888 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0400, Function | MediumTest | Level2)
889 {
890 bool result = false;
891 std::string eventName = "OrderedTest004";
892 bool order = false;
893 MatchingSkills matchingSkills;
894 for (int i = 1; i <= stLevel_.CESLevel; i++) {
895 matchingSkills.AddEvent(eventName);
896 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
897 CommonEventPublishInfo publishInfo;
898 publishInfo.SetOrdered(order);
899 if (publishInfo.IsOrdered()) {
900 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0400 failed, frequency: " << i;
901 result = false;
902 break;
903 } else {
904 result = true;
905 }
906 matchingSkills.RemoveEvent(eventName);
907 }
908 if (result && stLevel_.CESLevel >= 1) {
909 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0400 stress level: " << stLevel_.CESLevel;
910 }
911 EXPECT_TRUE(result);
912 }
913
914 /*
915 * @tc.number: CES_PublishInfo_Ordered_0500
916 * @tc.name: CommonEventPublishInfo : SetOrdered and IsOrdered
917 * @tc.desc: 1.Set publishInfo
918 * 2.Verify the function of CommonEventPublishInfo: SetOrdered and IsOrdered
919 */
920 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0500, Function | MediumTest | Level2)
921 {
922 bool result = false;
923 std::string eventName = "OrderedTest005";
924 bool order = true;
925 MatchingSkills matchingSkills;
926 for (int i = 1; i <= stLevel_.CESLevel; i++) {
927 matchingSkills.AddEvent(eventName);
928 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
929 CommonEventPublishInfo publishInfo;
930 publishInfo.SetOrdered(order);
931 if (!publishInfo.IsOrdered()) {
932 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0500 failed, frequency: " << i;
933 result = false;
934 break;
935 } else {
936 result = true;
937 }
938 matchingSkills.RemoveEvent(eventName);
939 }
940 if (result && stLevel_.CESLevel >= 1) {
941 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0500 stress level: " << stLevel_.CESLevel;
942 }
943 EXPECT_TRUE(result);
944 }
945
946 /*
947 * @tc.number: CES_PublishInfo_Ordered_0600
948 * @tc.name: CommonEventPublishInfo : SetOrdered and IsOrdered
949 * @tc.desc: 1.Set publishInfo
950 * 2.Verify the function of CommonEventPublishInfo: SetOrdered and IsOrdered
951 */
952 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0600, Function | MediumTest | Level2)
953 {
954 bool result = false;
955 std::string eventName = "OrderedTest006";
956 MatchingSkills matchingSkills;
957 for (int i = 1; i <= stLevel_.CESLevel; i++) {
958 matchingSkills.AddEvent(eventName);
959 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
960 CommonEventPublishInfo publishInfo;
961 if (publishInfo.IsOrdered()) {
962 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0600 failed, frequency: " << i;
963 result = false;
964 break;
965 } else {
966 result = true;
967 }
968 matchingSkills.RemoveEvent(eventName);
969 }
970 if (result && stLevel_.CESLevel >= 1) {
971 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0600 stress level: " << stLevel_.CESLevel;
972 }
973 EXPECT_TRUE(result);
974 }
975
976 /*
977 * @tc.number: CES_PublishInfo_Ordered_0700
978 * @tc.name: CommonEventPublishInfo : SetOrdered SetSticky and IsOrdered
979 * @tc.desc: 1.Set publishInfo
980 * 2.Verify the function of CommonEventPublishInfo: SetOrdered SetSticky and IsOrdered
981 */
982 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0700, Function | MediumTest | Level2)
983 {
984 bool result = false;
985 std::string eventName = "OrderedTest007";
986 bool order = true;
987 bool sticky = true;
988 MatchingSkills matchingSkills;
989 for (int i = 1; i <= stLevel_.CESLevel; i++) {
990 matchingSkills.AddEvent(eventName);
991 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
992 CommonEventPublishInfo publishInfo;
993 publishInfo.SetOrdered(order);
994 publishInfo.SetSticky(sticky);
995 if (!publishInfo.IsOrdered()) {
996 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0700 failed, frequency: " << i;
997 result = false;
998 break;
999 } else {
1000 result = true;
1001 }
1002 matchingSkills.RemoveEvent(eventName);
1003 }
1004 if (result && stLevel_.CESLevel >= 1) {
1005 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0700 stress level: " << stLevel_.CESLevel;
1006 }
1007 EXPECT_TRUE(result);
1008 }
1009
1010 /*
1011 * @tc.number: CES_PublishInfo_Ordered_0800
1012 * @tc.name: CommonEventPublishInfo : SetOrdered SetSticky and IsOrdered
1013 * @tc.desc: 1.Set publishInfo
1014 * 2.Verify the function of CommonEventPublishInfo: SetOrdered SetSticky and IsOrdered
1015 */
1016 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0800, Function | MediumTest | Level2)
1017 {
1018 bool result = false;
1019 std::string eventName = "OrderedTest008";
1020 bool order = true;
1021 bool sticky = false;
1022 MatchingSkills matchingSkills;
1023 for (int i = 1; i <= stLevel_.CESLevel; i++) {
1024 matchingSkills.AddEvent(eventName);
1025 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
1026 CommonEventPublishInfo publishInfo;
1027 publishInfo.SetOrdered(order);
1028 publishInfo.SetSticky(sticky);
1029 if (!publishInfo.IsOrdered()) {
1030 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0800 failed, frequency: " << i;
1031 result = false;
1032 break;
1033 } else {
1034 result = true;
1035 }
1036 matchingSkills.RemoveEvent(eventName);
1037 }
1038 if (result && stLevel_.CESLevel >= 1) {
1039 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0800 stress level: " << stLevel_.CESLevel;
1040 }
1041 EXPECT_TRUE(result);
1042 }
1043
1044 /*
1045 * @tc.number: CES_PublishInfo_Ordered_0900
1046 * @tc.name: CommonEventPublishInfo : SetOrdered SetSticky and IsOrdered
1047 * @tc.desc: 1.Set publishInfo
1048 * 2.Verify the function of CommonEventPublishInfo: SetOrdered SetSticky and IsOrdered
1049 */
1050 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_0900, Function | MediumTest | Level2)
1051 {
1052 bool result = false;
1053 std::string eventName = "OrderedTest009";
1054 bool order = false;
1055 bool sticky = false;
1056 MatchingSkills matchingSkills;
1057 for (int i = 1; i <= stLevel_.CESLevel; i++) {
1058 matchingSkills.AddEvent(eventName);
1059 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
1060 CommonEventPublishInfo publishInfo;
1061 publishInfo.SetOrdered(order);
1062 publishInfo.SetSticky(sticky);
1063 if (publishInfo.IsOrdered()) {
1064 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0900 failed, frequency: " << i;
1065 result = false;
1066 break;
1067 } else {
1068 result = true;
1069 }
1070 matchingSkills.RemoveEvent(eventName);
1071 }
1072 if (result && stLevel_.CESLevel >= 1) {
1073 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_0900 stress level: " << stLevel_.CESLevel;
1074 }
1075 EXPECT_TRUE(result);
1076 }
1077
1078 /*
1079 * @tc.number: CES_PublishInfo_Ordered_1000
1080 * @tc.name: CommonEventPublishInfo : SetOrdered SetSticky and IsOrdered
1081 * @tc.desc: 1.Set publishInfo
1082 * 2.Verify the function of CommonEventPublishInfo: SetOrdered SetSticky and IsOrdered
1083 */
1084 HWTEST_F(ActsCESCESpublishInfoTest, CES_PublishInfo_Ordered_1000, Function | MediumTest | Level2)
1085 {
1086 bool result = false;
1087 std::string eventName = "OrderedTest010";
1088 bool order = false;
1089 bool sticky = true;
1090 MatchingSkills matchingSkills;
1091 for (int i = 1; i <= stLevel_.CESLevel; i++) {
1092 matchingSkills.AddEvent(eventName);
1093 CommonEventSubscribeInfo subscribeInfo(matchingSkills);
1094 CommonEventPublishInfo publishInfo;
1095 publishInfo.SetOrdered(order);
1096 publishInfo.SetSticky(sticky);
1097 if (publishInfo.IsOrdered()) {
1098 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_1000 failed, frequency: " << i;
1099 result = false;
1100 break;
1101 } else {
1102 result = true;
1103 }
1104 matchingSkills.RemoveEvent(eventName);
1105 }
1106 if (result && stLevel_.CESLevel >= 1) {
1107 GTEST_LOG_(INFO) << "CES_PublishInfo_Ordered_1000 stress level: " << stLevel_.CESLevel;
1108 }
1109 EXPECT_TRUE(result);
1110 }
1111 } // namespace EventFwk
1112 } // namespace OHOS