• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16
17import * as ohosBundle from "ohos_bundle";
18import * as abilityInfo from "abilityInfo";
19import * as bundleInfo from "bundleInfo";
20import * as customizeData from "customizeData";
21import * as hapModuleInfo from "hapModuleInfo";
22import * as moduleInfo from "moduleInfo";
23import * as shortcutInfo from "shortcutInfo";
24import * as elementName from "elementName";
25import * as applicationInfo from "applicationInfo";
26import { Want } from "ohos_app_ability_want";
27
28loadLibrary("ani_bundle");
29
30//@ohos.bundle.d.ts
31let bundleName = "ohos.bundle";
32let bundleFlags = 419;
33let userId = 391550;
34let abilityName = "abilityName";
35let uid = 2147483647;
36let hapFilePath = "/home/zhaojinguo/taihe0411/taihe";
37let arrString = ["this", "is", "bundle"];
38
39function test_bundle_enum_BundleFlag_with_DEFAULT() {
40    const first = ohosBundle.BundleFlag.GET_BUNDLE_DEFAULT;
41
42    console.log("BundleFlag.GET_BUNDLE_DEFAULT is : " + first);
43    assertEQ(first, ohosBundle.BundleFlag.GET_BUNDLE_DEFAULT);
44}
45
46function test_bundle_enum_BundleFlag_with_INFO() {
47    const first = ohosBundle.BundleFlag.GET_ALL_APPLICATION_INFO;
48
49    console.log("BundleFlag.GET_ALL_APPLICATION_INFO is : " + first);
50    assertEQ(first, ohosBundle.BundleFlag.GET_ALL_APPLICATION_INFO);
51}
52
53function test_bundle_enum_BundleFlag_with_DISABLE() {
54    const first = ohosBundle.BundleFlag.GET_APPLICATION_INFO_WITH_DISABLE;
55
56    console.log("BundleFlag.GET_APPLICATION_INFO_WITH_DISABLE is : " + first);
57    assertEQ(first, ohosBundle.BundleFlag.GET_APPLICATION_INFO_WITH_DISABLE);
58}
59
60function test_bundle_enum_with_colorMode() {
61    const first = ohosBundle.ColorMode.AUTO_MODE;
62
63    console.log("ColorMode.AUTO_MODE is : " + first);
64    assertEQ(first, ohosBundle.ColorMode.AUTO_MODE);
65}
66
67function test_bundle_enum_with_grantStatus() {
68    const first = ohosBundle.GrantStatus.PERMISSION_DENIED;
69
70    console.log("GrantStatus.PERMISSION_DENIED is : " + first);
71    assertEQ(first, ohosBundle.GrantStatus.PERMISSION_DENIED);
72}
73
74function test_bundle_enum_with_abilityType() {
75    let first = ohosBundle.AbilityType.UNKNOWN;
76
77    console.log("AbilityType.UNKNOWN is : " + first);
78    assertEQ(first, ohosBundle.AbilityType.UNKNOWN);
79}
80
81function test_bundle_enum_with_abilitySubType() {
82    const first = ohosBundle.AbilitySubType.UNSPECIFIED;
83
84    console.log("AbilitySubType.UNSPECIFIED is : " + first);
85    assertEQ(first, ohosBundle.AbilitySubType.UNSPECIFIED);
86}
87
88function test_bundle_enum_with_displayOrientation() {
89    const first = ohosBundle.DisplayOrientation.UNSPECIFIED;
90
91    console.log("DisplayOrientation.UNSPECIFIED is : " + first);
92    assertEQ(first, ohosBundle.DisplayOrientation.UNSPECIFIED);
93}
94
95function test_bundle_enum_with_launchMode() {
96    const first = ohosBundle.LaunchMode.SINGLETON;
97
98    console.log("LaunchMode.SINGLETON is : " + first);
99    assertEQ(first, ohosBundle.LaunchMode.SINGLETON);
100}
101
102function test_bundle_enum_with_installErrorCode_SUCCESS() {
103    const first = ohosBundle.InstallErrorCode.SUCCESS;
104
105    console.log("InstallErrorCode.SUCCESS is : " + first);
106    assertEQ(first, ohosBundle.InstallErrorCode.SUCCESS);
107}
108
109function test_bundle_enum_with_installErrorCode_TIMEOUT() {
110    const first = ohosBundle.InstallErrorCode.STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT;
111
112    console.log("InstallErrorCode.STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT is : " + first);
113    assertEQ(first, ohosBundle.InstallErrorCode.STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT);
114}
115
116function test_bundle_enum_with_installErrorCode_FOUND() {
117    const first = ohosBundle.InstallErrorCode.STATUS_ABILITY_NOT_FOUND;
118
119    console.log("InstallErrorCode.STATUS_ABILITY_NOT_FOUND is : " + first);
120    assertEQ(first, ohosBundle.InstallErrorCode.STATUS_ABILITY_NOT_FOUND);
121}
122
123let bundleOpt: ohosBundle.BundleOptions = ohosBundle.getBundleOptions();
124function test_bundle_interface_bundleOptions_with_userId_noSet() {
125    let id = bundleOpt.userId;
126
127    console.log("BundleOptions userId is : " + id);
128    assertEQ(id, undefined);
129}
130
131function test_bundle_interface_bundleOptions_with_userId() {
132    bundleOpt.userId = userId;
133    let id = bundleOpt.userId;
134
135    console.log("BundleOptions userId is : " + id);
136    assertEQ(id, userId);
137}
138
139function test_bundle_function_with_getBundleInfo() {
140    ohosBundle.getBundleInfo("getBundleInfo", bundleFlags);
141
142    console.log("ohos bundle function is : getBundleInfo ");
143}
144
145function test_bundle_function_with_getAbilityInfo() {
146    ohosBundle.getAbilityInfo(bundleName, abilityName);
147
148    console.log("ohos bundle function is : getAbilityInfo ");
149}
150
151function test_bundle_function_with_getApplicationInfo3param() {
152    let instance : ohosBundle.OverloadInterface = ohosBundle.get_interface();
153    instance.getApplicationInfo("getApplicationInfo", bundleFlags, userId);
154
155    console.log("ohos bundle function is : getApplicationInfo 3 param.");
156}
157
158function test_bundle_function_with_getApplicationInfo2param() {
159    let instance : ohosBundle.OverloadInterface = ohosBundle.get_interface();
160    instance.getApplicationInfo("getApplicationInfo", bundleFlags);
161
162    console.log("ohos bundle function is : getApplicationInfo 2 param.");
163}
164
165function test_bundle_function_with_getApplicationInfoOptional_1() {
166    let instance : ohosBundle.OverloadInterface = ohosBundle.get_interface();
167    instance.getApplicationInfo("getApplicationInfo", bundleFlags, userId);
168
169    console.log("ohos bundle function is : getApplicationInfo have Optional.");
170}
171
172function test_bundle_function_with_getApplicationInfoOptional_2() {
173    let instance : ohosBundle.OverloadInterface = ohosBundle.get_interface();
174    instance.getApplicationInfo("getApplicationInfo", bundleFlags);
175
176    console.log("ohos bundle function is : getApplicationInfo no Optional.");
177}
178
179function test_bundle_function_with_queryAbilityByWant() {
180    ohosBundle.queryAbilityByWant(bundleFlags, userId);
181
182    console.log("ohos bundle function is : queryAbilityByWant ");
183}
184
185function test_bundle_function_with_getAllBundleInfo() {
186    ohosBundle.getAllBundleInfo(userId);
187
188    console.log("ohos bundle function is : getAllBundleInfo ");
189}
190
191function test_bundle_function_with_getAllApplicationInfo() {
192    ohosBundle.getAllApplicationInfo(bundleFlags, userId);
193
194    console.log("ohos bundle function is : getAllApplicationInfo ");
195}
196
197function test_bundle_function_with_getNameForUid() {
198    ohosBundle.getNameForUid(uid);
199
200    console.log("ohos bundle function is : getNameForUid ");
201}
202
203function test_bundle_function_with_getBundleArchiveInfo() {
204    ohosBundle.getBundleArchiveInfo(hapFilePath, bundleFlags);
205
206    console.log("ohos bundle function is : getBundleArchiveInfo ");
207}
208
209function test_bundle_function_with_getLaunchWantForBundle() {
210    ohosBundle.getLaunchWantForBundle(bundleName);
211
212    console.log("ohos bundle function is : getLaunchWantForBundle ");
213}
214
215function test_bundle_function_with_getAbilityLabel() {
216    ohosBundle.getAbilityLabel(bundleName, abilityName);
217
218    console.log("ohos bundle function is : getAbilityLabel ");
219}
220
221function test_bundle_function_with_getAbilityIcon() {
222    ohosBundle.getAbilityIcon(bundleName, abilityName);
223
224    console.log("ohos bundle function is : getAbilityIcon ");
225}
226
227function test_bundle_function_with_isAbilityEnabled() {
228    ohosBundle.isAbilityEnabled();
229
230    console.log("ohos bundle function is : isAbilityEnabled ");
231}
232
233function test_bundle_function_with_isApplicationEnabled() {
234    ohosBundle.isApplicationEnabled(bundleName);
235
236    console.log("ohos bundle function is : isApplicationEnabled ");
237}
238
239//abilityInfo.d.ts
240let abInfo: abilityInfo.AbilityInfo = abilityInfo.getAbilityInfo();
241function test_abilityinfo_with_bundleName(){
242    let info = abInfo.bundleName;
243
244    console.log("abInfo.bundleName is : " + info);
245    assertEQ(info, "AbilityInfo::getBundleName");
246}
247
248function test_abilityinfo_with_name(){
249    let info = abInfo.name;
250
251    console.log("abInfo.name is : " + info);
252    assertEQ(info, "AbilityInfo::getName");
253}
254
255function test_abilityinfo_with_label(){
256    let info = abInfo.label;
257
258    console.log("abInfo.label is : " + info);
259    assertEQ(info, "AbilityInfo::getLabel");
260}
261
262function test_abilityinfo_with_description(){
263    let info = abInfo.description;
264
265    console.log("abInfo.description is : " + info);
266    assertEQ(info, "AbilityInfo::getDescription");
267}
268
269function test_abilityinfo_with_icon(){
270    let info = abInfo.icon;
271
272    console.log("abInfo.icon is : " + info);
273    assertEQ(info, "AbilityInfo::getIcon");
274}
275
276function test_abilityinfo_with_labelId(){
277    let info = abInfo.labelId;
278
279    console.log("abInfo.labelId is : " + info);
280    assertEQ(info, 100 as short);
281}
282
283function test_abilityinfo_with_descriptionId(){
284    let info = abInfo.descriptionId;
285
286    console.log("abInfo.descriptionId is : " + info);
287    assertEQ(info, 100 as short);
288}
289
290function test_abilityinfo_with_iconId(){
291    let info = abInfo.iconId;
292
293    console.log("abInfo.iconId is : " + info);
294    assertEQ(info, 100 as short);
295}
296
297function test_abilityinfo_with_moduleName(){
298    let info = abInfo.moduleName;
299
300    console.log("abInfo.moduleName is : " + info);
301    assertEQ(info, "AbilityInfo::getModuleName");
302}
303
304function test_abilityinfo_with_process(){
305    let info = abInfo.process;
306
307    console.log("abInfo.process is : " + info);
308    assertEQ(info, "AbilityInfo::getProcess");
309}
310
311function test_abilityinfo_with_targetAbility(){
312    let info = abInfo.targetAbility;
313
314    console.log("abInfo.targetAbility is : " + info);
315    assertEQ(info, "AbilityInfo::getTargetAbility");
316}
317
318function test_abilityinfo_with_backgroundModes(){
319    let info = abInfo.backgroundModes;
320
321    console.log("abInfo.backgroundModes is : " + info);
322    assertEQ(info, 100 as short);
323}
324
325function test_abilityinfo_with_isVisible(){
326    let info = abInfo.isVisible;
327
328    console.log("abInfo.isVisible is : " + info);
329    assertEQ(info, true);
330}
331
332function test_abilityinfo_with_formEnabled(){
333    let info = abInfo.formEnabled;
334
335    console.log("abInfo.formEnabled is : " + info);
336    assertEQ(info, true);
337}
338
339function test_abilityinfo_with_permissions(){
340    let info = abInfo.permissions[0];
341
342    console.log("abInfo.permissions is : " + info);
343    assertEQ(info, "AbilityInfo::getTargetAbility");
344}
345
346function test_abilityinfo_with_deviceTypes(){
347    let info = abInfo.deviceTypes[0];
348
349    console.log("abInfo.deviceTypes is : " + info);
350    assertEQ(info, "AbilityInfo::getDeviceTypes");
351}
352
353function test_abilityinfo_with_deviceCapabilities(){
354    let info = abInfo.deviceCapabilities[0];
355
356    console.log("abInfo.deviceCapabilities is : " + info);
357    assertEQ(info, "AbilityInfo::getDeviceCapabilities");
358}
359
360function test_abilityinfo_with_readPermission(){
361    let info = abInfo.readPermission;
362
363    console.log("abInfo.readPermission is : " + info);
364    assertEQ(info, "AbilityInfo::getReadPermission");
365}
366
367function test_abilityinfo_with_writePermission(){
368    let info = abInfo.writePermission;
369
370    console.log("abInfo.writePermission is : " + info);
371    assertEQ(info, "AbilityInfo::getWritePermission");
372}
373
374function test_abilityinfo_with_uri(){
375    let info = abInfo.uri;
376
377    console.log("abInfo.uri is : " + info);
378    assertEQ(info, "AbilityInfo::getUri");
379}
380
381function test_abilityinfo_with_enabled(){
382    let info = abInfo.enabled;
383
384    console.log("abInfo.enabled is : " + info);
385    assertEQ(info, true);
386}
387
388//bundleInfo.d.ts
389let usedScene: bundleInfo.UsedScene = bundleInfo.getUsedScene();
390let reqPerDetail: bundleInfo.ReqPermissionDetail = bundleInfo.getReqPermissionDetail();
391let bunInfo: bundleInfo.BundleInfo = bundleInfo.getBundleInfo();
392
393function test_bundleinfo_interface_usedScene_with_abilities(){
394    usedScene.abilities = ["this ", "is ", "abilities"];
395    let info = usedScene.abilities[2];
396
397    console.log("usedScene.abilities is : " + info);
398    assertEQ(info, "abilities");
399}
400
401function test_bundleinfo_interface_usedScene_with_when(){
402    usedScene.when = "this is when";
403    let info = usedScene.when;
404
405    console.log("usedScene.when is : " + info);
406    assertEQ(info, "this is when");
407}
408
409function test_bundleinfo_interface_reqperdetail_with_name(){
410    reqPerDetail.name = "this is name";
411    let info = reqPerDetail.name;
412
413    console.log("reqPerDetail.name is : " + info);
414    assertEQ(info, "this is name");
415}
416
417function test_bundleinfo_interface_reqperdetail_with_reason(){
418    reqPerDetail.reason = "this is reason";
419    let info = reqPerDetail.reason;
420
421    console.log("reqPerDetail.reason is : " + info);
422    assertEQ(info, "this is reason");
423}
424
425function test_bundleinfo_interface_with_name(){
426    let info = bunInfo.name;
427
428    console.log("bunInfo.name is : " + info);
429    assertEQ(info, "bundleInfo::getName");
430}
431
432function test_bundleinfo_interface_with_type(){
433    let info = bunInfo.type;
434
435    console.log("bunInfo.type is : " + info);
436    assertEQ(info, "bundleInfo::getType");
437}
438
439function test_bundleinfo_interface_with_appId(){
440    let info = bunInfo.appId;
441
442    console.log("bunInfo.appId is : " + info);
443    assertEQ(info, "bundleInfo::getAppId");
444}
445
446function test_bundleinfo_interface_withuid(){
447    let info = bunInfo.uid;
448
449    console.log("bunInfo.uid is : " + info);
450    assertEQ(info, 127 as short);
451}
452
453function test_bundleinfo_interface_with_installTime(){
454    let info = bunInfo.installTime;
455
456    console.log("bunInfo.installTime is : " + info);
457    assertEQ(info, 127 as short);
458}
459
460function test_bundleinfo_interface_with_updateTime(){
461    let info = bunInfo.updateTime;
462
463    console.log("bunInfo.updateTime is : " + info);
464    assertEQ(info, 127 as short);
465}
466
467function test_bundleinfo_interface_with_reqPermissions(){
468    let info = bunInfo.reqPermissions[0];
469
470    console.log("bunInfo.reqPermissions is : " + info);
471    assertEQ(info, "bundleInfo::getReqPermissions");
472}
473
474function test_bundleinfo_interface_with_vendor(){
475    let info = bunInfo.vendor;
476
477    console.log("bunInfo.vendor is : " + info);
478    assertEQ(info, "bundleInfo::getVendor");
479}
480
481function test_bundleinfo_interface_with_versionCode(){
482    let info = bunInfo.versionCode;
483
484    console.log("bunInfo.versionCode is : " + info);
485    assertEQ(info, 127 as short);
486}
487
488function test_bundleinfo_interface_with_versionName(){
489    let info = bunInfo.versionName;
490
491    console.log("bunInfo.versionName is : " + info);
492    assertEQ(info, "bundleInfo::getVersionName");
493}
494
495function test_bundleinfo_interface_with_compatibleVersion(){
496    let info = bunInfo.compatibleVersion;
497
498    console.log("bunInfo.compatibleVersion is : " + info);
499    assertEQ(info, 127 as short);
500}
501
502function test_bundleinfo_interface_with_targetVersion(){
503    let info = bunInfo.targetVersion;
504
505    console.log("bunInfo.targetVersion is : " + info);
506    assertEQ(info, 127 as short);
507}
508
509function test_bundleinfo_interface_with_isCompressNativeLibs(){
510    let info = bunInfo.isCompressNativeLibs;
511
512    console.log("bunInfo.isCompressNativeLibs is : " + info);
513    assertEQ(info, true);
514}
515
516function test_bundleinfo_interface_with_entryModuleName(){
517    let info = bunInfo.entryModuleName;
518
519    console.log("bunInfo.entryModuleName is : " + info);
520    assertEQ(info, "bundleInfo::getEntryModuleName");
521}
522
523function test_bundleinfo_interface_with_cpuAbi(){
524    let info = bunInfo.cpuAbi;
525
526    console.log("bunInfo.cpuAbi is : " + info);
527    assertEQ(info, "bundleInfo::getCpuAbi");
528}
529
530function test_bundleinfo_interface_with_isSilentInstallation(){
531    let info = bunInfo.isSilentInstallation;
532
533    console.log("bunInfo.isSilentInstallation is : " + info);
534    assertEQ(info, "bundleInfo::getIsSilentInstallation");
535}
536
537function test_bundleinfo_interface_with_minCompatibleVersionCode(){
538    let info = bunInfo.minCompatibleVersionCode;
539
540    console.log("bunInfo.minCompatibleVersionCode is : " + info);
541    assertEQ(info, 127 as short);
542}
543
544function test_bundleinfo_interface_with_entryInstallationFree(){
545    let info = bunInfo.entryInstallationFree;
546
547    console.log("bunInfo.entryInstallationFree is : " + info);
548    assertEQ(info, true);
549}
550
551function test_bundleinfo_interface_with_reqPermissionStates(){
552    let info = bunInfo.reqPermissionStates[0];
553
554    console.log("bunInfo.reqPermissionStates is : " + info);
555    assertEQ(info, 127 as short);
556}
557
558//customizeData.d.ts
559let custData: customizeData.CustomizeData = customizeData.getCustomizeData();
560function test_bundleinfo_interface_custdata_with_name(){
561    custData.name = "tom";
562    let info = custData.name;
563
564    console.log("custData.name is : " + info);
565    assertEQ(info, "tom");
566}
567
568function test_bundleinfo_interface_custdata_with_value(){
569    custData.value = "tom";
570    let info = custData.value;
571
572    console.log("custData.value is : " + info);
573    assertEQ(info, "tom");
574}
575
576function test_bundleinfo_interface_custdata_with_extra(){
577    custData.extra = "tom";
578    let info = custData.extra;
579
580    console.log("custData.extra is : " + info);
581    assertEQ(info, "tom");
582}
583
584//hapModuleInfo.d.ts
585let hapInfo: hapModuleInfo.HapModuleInfo = hapModuleInfo.getHapModuleInfo();
586function test_bundle_interface_hapModuleInfo_with_name() {
587    let info = hapInfo.name;
588
589    console.log("hapInfo.name is : " + info);
590    assertEQ(info, "HapModuleInfo::getName");
591}
592
593function test_bundle_interface_hapModuleInfo_with_description() {
594    let info = hapInfo.description;
595
596    console.log("hapInfo.description is : " + info);
597    assertEQ(info, "HapModuleInfo::getDescription");
598}
599
600function test_bundle_interface_hapModuleInfo_with_descriptionid() {
601    let info = hapInfo.descriptionId;
602
603    console.log("hapInfo.descriptionId is : " + info);
604    assertEQ(info, 1024 as short);
605}
606
607function test_bundle_interface_hapModuleInfo_with_icon() {
608    let info = hapInfo.icon;
609
610    console.log("hapInfo.icon is : " + info);
611    assertEQ(info, "HapModuleInfo::getIcon");
612}
613
614function test_bundle_interface_hapModuleInfo_with_label() {
615    let info = hapInfo.label;
616
617    console.log("hapInfo.label is : " + info);
618    assertEQ(info, "HapModuleInfo::getLabel");
619}
620
621function test_bundle_interface_hapModuleInfo_with_labelid() {
622    let info = hapInfo.labelId;
623
624    console.log("hapInfo.labelId is : " + info);
625    assertEQ(info, 1024 as short);
626}
627
628function test_bundle_interface_hapModuleInfo_with_iconid() {
629    let info = hapInfo.iconId;
630
631    console.log("hapInfo.iconId is : " + info);
632    assertEQ(info, 1024 as short);
633}
634
635function test_bundle_interface_hapModuleInfo_with_backgroundImg() {
636    let info = hapInfo.backgroundImg;
637
638    console.log("hapInfo.backgroundImg is : " + info);
639    assertEQ(info, "HapModuleInfo::getBackgroundImg");
640}
641
642function test_bundle_interface_hapModuleInfo_with_supportedModes() {
643    let info = hapInfo.supportedModes;
644
645    console.log("hapInfo.supportedModes is : " + info);
646    assertEQ(info, 1024 as short);
647}
648
649function test_bundle_interface_hapModuleInfo_with_reqCapabilities() {
650    let info = hapInfo.reqCapabilities[0];
651
652    console.log("hapInfo.reqCapabilities is : " + info);
653    assertEQ(info, "HapModuleInfo::getReqCapabilities");
654}
655
656function test_bundle_interface_hapModuleInfo_with_deviceTypes() {
657    let info = hapInfo.deviceTypes[0];
658
659    console.log("hapInfo.deviceTypes is : " + info);
660    assertEQ(info, "HapModuleInfo::getDeviceTypes");
661}
662
663function test_bundle_interface_hapModuleInfo_with_moduleName() {
664    let info = hapInfo.moduleName;
665
666    console.log("hapInfo.moduleName is : " + info);
667    assertEQ(info, "HapModuleInfo::getModuleName");
668}
669
670function test_bundle_interface_hapModuleInfo_with_mainAbilityName() {
671    let info = hapInfo.mainAbilityName;
672
673    console.log("hapInfo.mainAbilityName is : " + info);
674    assertEQ(info, "HapModuleInfo::getMainAbilityName");
675}
676
677function test_bundle_interface_hapModuleInfo_with_installationFree() {
678    let info = hapInfo.installationFree;
679
680    console.log("hapInfo.installationFree is : " + info);
681    assertEQ(info, true);
682}
683
684//moduleInfo.d.ts
685let moInfo: moduleInfo.ModuleInfo = moduleInfo.getModuleInfo();
686function test_bundle_interface_moduleInfo_with_moduleName() {
687    let info = moInfo.moduleName;
688
689    console.log("moInfo.moduleName is : " + info);
690    assertEQ(info, "this is moduleinfo with name");
691}
692
693function test_bundle_interface_moduleInfo_with_moduleSourceDir() {
694    let info = moInfo.moduleSourceDir;
695
696    console.log("moInfo.moduleSourceDir is : " + info);
697    assertEQ(info, "this is moduleinfo with moduleSourceDir");
698}
699
700//shortcutInfo.d.ts
701let shortInfo: shortcutInfo.ShortcutInfo = shortcutInfo.getShortcutInfo();
702function test_bundle_interface_shortcutInfo_with_id() {
703    let info = shortInfo.id;
704
705    console.log("shortInfo.id is : " + info);
706    assertEQ(info, "ShortcutInfo::GetId");
707}
708
709function test_bundle_interface_shortcutInfo_with_bundleName() {
710    let info = shortInfo.bundleName;
711
712    console.log("shortInfo.bundleName is : " + info);
713    assertEQ(info, "ShortcutInfo::GetBundleName");
714}
715
716function test_bundle_interface_shortcutInfo_with_hostAbility() {
717    let info = shortInfo.hostAbility;
718
719    console.log("shortInfo.hostAbility is : " + info);
720    assertEQ(info, "ShortcutInfo::GetHostAbility");
721}
722
723function test_bundle_interface_shortcutInfo_with_icon() {
724    let info = shortInfo.icon;
725
726    console.log("shortInfo.icon is : " + info);
727    assertEQ(info, "ShortcutInfo::GetIcon");
728}
729
730function test_bundle_interface_shortcutInfo_with_iconId() {
731    let info = shortInfo.iconId;
732
733    console.log("shortInfo.iconId is : " + info);
734    assertEQ(info, 4096);
735}
736
737function test_bundle_interface_shortcutInfo_with_label() {
738    let info = shortInfo.label;
739
740    console.log("shortInfo.label is : " + info);
741    assertEQ(info, "ShortcutInfo::GetLabel");
742}
743
744function test_bundle_interface_shortcutInfo_with_labelId() {
745    let info = shortInfo.labelId;
746
747    console.log("shortInfo.labelId is : " + info);
748    assertEQ(info, 4096);
749}
750
751function test_bundle_interface_shortcutInfo_with_disableMessage() {
752    let info = shortInfo.disableMessage;
753
754    console.log("shortInfo.disableMessage is : " + info);
755    assertEQ(info, "ShortcutInfo::GetDisableMessage");
756}
757
758function test_bundle_interface_shortcutInfo_with_isStatic() {
759    let info = shortInfo.isStatic;
760
761    console.log("shortInfo.isStatic is : " + info);
762    assertEQ(info, true);
763}
764
765function test_bundle_interface_shortcutInfo_with_isHomeShortcut() {
766    let info = shortInfo.isHomeShortcut;
767
768    console.log("shortInfo.isHomeShortcut is : " + info);
769    assertEQ(info, true);
770}
771
772function test_bundle_interface_shortcutInfo_with_isEnabled() {
773    let info = shortInfo.isEnabled;
774
775    console.log("shortInfo.isEnabled is : " + info);
776    assertEQ(info, true);
777}
778
779//elementName.d.ts
780function test_bundle_interface_elementName_with_deviceId_noSet() {
781    let eleName: elementName.ElementName = elementName.getElementName()
782    let info = eleName.deviceId;
783    console.log("eleName.deviceId: " + info)
784    assertEQ(info, undefined);
785}
786
787function test_bundle_interface_elementName_with_deviceId() {
788    let eleName: elementName.ElementName = elementName.getElementName()
789    eleName.deviceId = "ID20250422";
790    let info = eleName.deviceId;
791    console.log("eleName.deviceId: " + info)
792    assertEQ(info, "ID20250422");
793}
794
795function test_bundle_interface_elementName_with_bundleName() {
796    let eleName: elementName.ElementName = elementName.getElementName()
797    eleName.bundleName = "ID20250422";
798    let info = eleName.bundleName;
799
800    assertEQ(info, "ID20250422");
801}
802
803function test_bundle_interface_elementName_with_abilityName() {
804    let eleName: elementName.ElementName = elementName.getElementName()
805    eleName.abilityName = "ID20250422";
806    let info = eleName.abilityName;
807
808    assertEQ(info, "ID20250422");
809}
810
811function test_bundle_interface_elementName_with_uri_noSet() {
812    let eleName: elementName.ElementName = elementName.getElementName()
813    let info = eleName.uri;
814
815    assertEQ(info, undefined);
816}
817
818function test_bundle_interface_elementName_with_uri() {
819    let eleName: elementName.ElementName = elementName.getElementName()
820    eleName.uri = "ID20250422";
821    let info = eleName.uri;
822
823    assertEQ(info, "ID20250422");
824}
825
826function test_bundle_interface_elementName_with_shortName_noSet() {
827    let eleName: elementName.ElementName = elementName.getElementName()
828    let info = eleName.shortName;
829
830    assertEQ(info, undefined);
831}
832
833function test_bundle_interface_elementName_with_shortName() {
834    let eleName: elementName.ElementName = elementName.getElementName()
835    eleName.shortName = "ID20250422";
836    let info = eleName.shortName;
837
838    assertEQ(info, "ID20250422");
839}
840
841//applicationInfo.d.ts
842let appInfo: applicationInfo.ApplicationInfo = applicationInfo.getApplicationInfo();
843function test_bundle_interface_applicationInfo_with_name() {
844    let info = appInfo.name;
845
846    assertEQ(info, "ApplicationInfo::getName")
847}
848
849function test_bundle_interface_applicationInfo_with_description() {
850    let info = appInfo.description;
851
852    assertEQ(info, "ApplicationInfo::getDescription")
853}
854
855function test_bundle_interface_applicationInfo_with_descriptionId() {
856    let info = appInfo.descriptionId;
857
858    assertEQ(info, 102 as short)
859}
860
861function test_bundle_interface_applicationInfo_with_systemApp() {
862    let info = appInfo.systemApp;
863
864    assertEQ(info, true)
865}
866
867function test_bundle_interface_applicationInfo_with_enabled() {
868    let info = appInfo.enabled;
869
870    assertEQ(info, true)
871}
872
873function test_bundle_interface_applicationInfo_with_label() {
874    let info = appInfo.label;
875
876    assertEQ(info, "ApplicationInfo::getLabel")
877}
878
879function test_bundle_interface_applicationInfo_with_labelId() {
880    let info = appInfo.labelId;
881
882    assertEQ(info, "ApplicationInfo::getLabelId")
883}
884
885function test_bundle_interface_applicationInfo_with_icon() {
886    let info = appInfo.icon;
887
888    assertEQ(info, "ApplicationInfo::getIcon")
889}
890
891function test_bundle_interface_applicationInfo_with_iconId() {
892    let info = appInfo.iconId;
893
894    assertEQ(info, 102 as short)
895}
896
897function test_bundle_interface_applicationInfo_with_process() {
898    let info = appInfo.process;
899
900    assertEQ(info, "ApplicationInfo::getProcess")
901}
902
903function test_bundle_interface_applicationInfo_with_supportedModes() {
904    let info = appInfo.supportedModes;
905
906    assertEQ(info, 102 as short)
907}
908
909function test_bundle_interface_applicationInfo_with_moduleSourceDirs() {
910    let info = appInfo.moduleSourceDirs[0];
911
912    assertEQ(info, "ApplicationInfo::getProcess")
913}
914
915function test_bundle_interface_applicationInfo_with_permissions() {
916    let info = appInfo.permissions[0];
917
918    assertEQ(info, "ApplicationInfo::getPermissions")
919}
920
921function test_bundle_interface_applicationInfo_with_entryDir() {
922    let info = appInfo.entryDir;
923
924    assertEQ(info, "ApplicationInfo::getEntryDir")
925}
926
927function test_bundle_interface_applicationInfo_with_codePath() {
928    let info = appInfo.codePath;
929
930    assertEQ(info, "ApplicationInfo::getCodePath")
931}
932
933function test_bundle_interface_applicationInfo_with_removable() {
934    let info = appInfo.removable;
935
936    assertEQ(info, true)
937}
938
939function test_bundle_interface_applicationInfo_with_accessTokenId() {
940    let info = appInfo.accessTokenId;
941
942    assertEQ(info, 102 as short)
943}
944
945function test_bundle_interface_applicationInfo_with_uid() {
946    let info = appInfo.uid;
947
948    assertEQ(info, 102 as short)
949}
950
951function test_bundle_interface_applicationInfo_with_entityType() {
952    let info = appInfo.entityType;
953
954    assertEQ(info, "ApplicationInfo::getEntityType")
955}
956
957//ohos.app.ability.Want.d.ts
958function test_bundle_class_want_with_bundleName_noSet() {
959    let wantTest = new Want();
960    let info = wantTest.bundleName;
961
962    assertEQ(info, undefined)
963}
964
965function test_bundle_class_want_with_bundleName() {
966    let wantTest = new Want();
967    wantTest.bundleName = bundleName;
968    let info = wantTest.bundleName;
969
970    assertEQ(info, bundleName)
971}
972
973function test_bundle_class_want_with_abilityName_noSet() {
974    let wantTest = new Want();
975    let info = wantTest.abilityName;
976
977    assertEQ(info, undefined)
978}
979
980function test_bundle_class_want_with_abilityName() {
981    let wantTest = new Want();
982    wantTest.abilityName = bundleName;
983    let info = wantTest.abilityName;
984
985    assertEQ(info, bundleName)
986}
987
988function test_bundle_class_want_with_deviceId_noSet() {
989    let wantTest = new Want();
990    let info = wantTest.deviceId;
991
992    assertEQ(info, undefined)
993}
994
995function test_bundle_class_want_with_deviceId() {
996    let wantTest = new Want();
997    wantTest.deviceId = bundleName;
998    let info = wantTest.deviceId;
999
1000    assertEQ(info, bundleName)
1001}
1002
1003function test_bundle_class_want_with_uri_noSet() {
1004    let wantTest = new Want();
1005    let info = wantTest.uri;
1006
1007    assertEQ(info, undefined)
1008}
1009
1010function test_bundle_class_want_with_uri() {
1011    let wantTest = new Want();
1012    wantTest.uri = bundleName;
1013    let info = wantTest.uri;
1014
1015    assertEQ(info, bundleName)
1016}
1017
1018function test_bundle_class_want_with_type_noSet() {
1019    let wantTest = new Want();
1020    let info = wantTest.type;
1021
1022    assertEQ(info, undefined)
1023}
1024
1025function test_bundle_class_want_with_type() {
1026    let wantTest = new Want();
1027    wantTest.type = bundleName;
1028    let info = wantTest.type;
1029
1030    assertEQ(info, bundleName)
1031}
1032
1033function test_bundle_class_want_with_flags_noSet() {
1034    let wantTest = new Want();
1035    let info = wantTest.flags;
1036
1037    assertEQ(info, undefined)
1038}
1039
1040function test_bundle_class_want_with_flags() {
1041    let wantTest = new Want();
1042    wantTest.flags = 16.08f;
1043    let info = wantTest.flags;
1044
1045    assertEQ(info, 16.08 as float)
1046}
1047
1048function test_bundle_class_want_with_action_noSet() {
1049    let wantTest = new Want();
1050    let info = wantTest.action;
1051
1052    assertEQ(info, undefined)
1053}
1054
1055function test_bundle_class_want_with_action() {
1056    let wantTest = new Want();
1057    wantTest.action = bundleName;
1058    let info = wantTest.action;
1059
1060    assertEQ(info, bundleName);
1061}
1062
1063function test_bundle_class_want_with_parameters_noSet() {
1064    let wantTest = new Want();
1065    let info = wantTest.parameters;
1066
1067    assertEQ(info, undefined);
1068}
1069
1070class A {
1071    constructor() {}
1072}
1073
1074function test_bundle_class_want_with_parameters() {
1075    let wantTest = new Want();
1076    const a = new A();
1077    let Settings: Record<string, object> = {
1078        "theme": a,
1079        "fontSize": a,
1080        "language": a,
1081    };
1082    wantTest.parameters = Settings;
1083    let info: Record<string, object>|undefined = wantTest.parameters;
1084
1085    assertEQ(info?.["theme"], Settings["theme"]);
1086}
1087
1088function test_bundle_class_want_with_entities_noSet() {
1089    let wantTest = new Want();
1090    let info = wantTest.entities;
1091
1092    assertEQ(info, undefined);
1093}
1094
1095function test_bundle_class_want_with_entities() {
1096    let wantTest = new Want();
1097    wantTest.entities = arrString;
1098    let info = wantTest.entities;
1099
1100    assertEQ(info?.[0], arrString[0])
1101}
1102
1103function test_bundle_class_want_with_moduleName_noSet() {
1104    let wantTest = new Want();
1105    let info = wantTest.moduleName;
1106
1107    assertEQ(info, undefined)
1108}
1109
1110function test_bundle_class_want_with_moduleName() {
1111    let wantTest = new Want();
1112    wantTest.moduleName = bundleName;
1113    let info = wantTest.moduleName;
1114
1115    assertEQ(info, bundleName)
1116}
1117
1118function main() {
1119    console.log("##############start#############");
1120    const suite = new ArkTestsuite("BundleTest Tests");
1121
1122    //abilityInfo.d.ts
1123    suite.addTest("test bundle abilityInfo with bundleName", test_abilityinfo_with_bundleName)
1124    suite.addTest("test bundle abilityInfo with name", test_abilityinfo_with_name)
1125    suite.addTest("test bundle abilityInfo with label", test_abilityinfo_with_label)
1126    suite.addTest("test bundle abilityInfo with description", test_abilityinfo_with_description)
1127    suite.addTest("test bundle abilityInfo with icon", test_abilityinfo_with_icon)
1128    suite.addTest("test bundle abilityInfo with labelId", test_abilityinfo_with_labelId)
1129    suite.addTest("test bundle abilityInfo with descriptionId", test_abilityinfo_with_descriptionId)
1130    suite.addTest("test bundle abilityInfo with iconId", test_abilityinfo_with_iconId)
1131    suite.addTest("test bundle abilityInfo with moduleName", test_abilityinfo_with_moduleName)
1132    suite.addTest("test bundle abilityInfo with process", test_abilityinfo_with_process)
1133    suite.addTest("test bundle abilityInfo with targetAbility", test_abilityinfo_with_targetAbility)
1134    suite.addTest("test bundle abilityInfo with backgroundModes", test_abilityinfo_with_backgroundModes)
1135    suite.addTest("test bundle abilityInfo with isVisible", test_abilityinfo_with_isVisible)
1136    suite.addTest("test bundle abilityInfo with formEnabled", test_abilityinfo_with_formEnabled)
1137    suite.addTest("test bundle abilityInfo with permissions", test_abilityinfo_with_permissions)
1138    suite.addTest("test bundle abilityInfo with deviceTypes", test_abilityinfo_with_deviceTypes)
1139    suite.addTest("test bundle abilityInfo with deviceCapabilities", test_abilityinfo_with_deviceCapabilities)
1140    suite.addTest("test bundle abilityInfo with readPermission", test_abilityinfo_with_readPermission)
1141    suite.addTest("test bundle abilityInfo with writePermission", test_abilityinfo_with_writePermission)
1142    suite.addTest("test bundle abilityInfo with uri", test_abilityinfo_with_uri)
1143    suite.addTest("test bundle abilityInfo with enabled", test_abilityinfo_with_enabled)
1144
1145    //applicationInfo.d.ts
1146    suite.addTest("test applicationInfo interface with name", test_bundle_interface_applicationInfo_with_name);
1147    suite.addTest("test applicationInfo interface with description", test_bundle_interface_applicationInfo_with_description);
1148    suite.addTest("test applicationInfo interface with descriptionId", test_bundle_interface_applicationInfo_with_descriptionId);
1149    suite.addTest("test applicationInfo interface with systemApp", test_bundle_interface_applicationInfo_with_systemApp);
1150    suite.addTest("test applicationInfo interface with enabled", test_bundle_interface_applicationInfo_with_enabled);
1151    suite.addTest("test applicationInfo interface with label", test_bundle_interface_applicationInfo_with_label);
1152    suite.addTest("test applicationInfo interface with labelId", test_bundle_interface_applicationInfo_with_labelId);
1153    suite.addTest("test applicationInfo interface with icon", test_bundle_interface_applicationInfo_with_icon);
1154    suite.addTest("test applicationInfo interface with iconId", test_bundle_interface_applicationInfo_with_iconId);
1155    suite.addTest("test applicationInfo interface with process", test_bundle_interface_applicationInfo_with_process);
1156    suite.addTest("test applicationInfo interface with supportedModes", test_bundle_interface_applicationInfo_with_supportedModes);
1157    suite.addTest("test applicationInfo interface with moduleSourceDirs", test_bundle_interface_applicationInfo_with_moduleSourceDirs);
1158    suite.addTest("test applicationInfo interface with permissions", test_bundle_interface_applicationInfo_with_permissions);
1159    suite.addTest("test applicationInfo interface with entryDir", test_bundle_interface_applicationInfo_with_entryDir);
1160    suite.addTest("test applicationInfo interface with codePath", test_bundle_interface_applicationInfo_with_codePath);
1161    suite.addTest("test applicationInfo interface with removable", test_bundle_interface_applicationInfo_with_removable);
1162    suite.addTest("test applicationInfo interface with accessTokenId", test_bundle_interface_applicationInfo_with_accessTokenId);
1163    suite.addTest("test applicationInfo interface with uid", test_bundle_interface_applicationInfo_with_uid);
1164    suite.addTest("test applicationInfo interface with entityType", test_bundle_interface_applicationInfo_with_entityType);
1165
1166    //bundleInfo.d.ts
1167    suite.addTest("test bundle bundleInfo interface usedscene with when", test_bundleinfo_interface_usedScene_with_when)
1168    suite.addTest("test bundle bundleInfo interface usedscene with abilities", test_bundleinfo_interface_usedScene_with_abilities)
1169    suite.addTest("test bundle bundleInfo interface reqperdetail with name", test_bundleinfo_interface_reqperdetail_with_name)
1170    suite.addTest("test bundle bundleInfo interface reqperdetail with reason", test_bundleinfo_interface_reqperdetail_with_reason)
1171    suite.addTest("test bundle bundleInfo interface with when", test_bundleinfo_interface_with_name)
1172    suite.addTest("test bundle bundleInfo interface with type", test_bundleinfo_interface_with_type)
1173    suite.addTest("test bundle bundleInfo interface with appId", test_bundleinfo_interface_with_appId)
1174    suite.addTest("test bundle bundleInfo interface with uid", test_bundleinfo_interface_withuid)
1175    suite.addTest("test bundle bundleInfo interface with installTime", test_bundleinfo_interface_with_installTime)
1176    suite.addTest("test bundle bundleInfo interface with updateTime", test_bundleinfo_interface_with_updateTime)
1177    suite.addTest("test bundle bundleInfo interface with reqPermissions", test_bundleinfo_interface_with_reqPermissions)
1178    suite.addTest("test bundle bundleInfo interface with vendor", test_bundleinfo_interface_with_vendor)
1179    suite.addTest("test bundle bundleInfo interface with versionCode", test_bundleinfo_interface_with_versionCode)
1180    suite.addTest("test bundle bundleInfo interface with versionName", test_bundleinfo_interface_with_versionName)
1181    suite.addTest("test bundle bundleInfo interface with compatibleVersion", test_bundleinfo_interface_with_compatibleVersion)
1182    suite.addTest("test bundle bundleInfo interface with targetVersion", test_bundleinfo_interface_with_targetVersion)
1183    suite.addTest("test bundle bundleInfo interface with isCompressNativeLibs", test_bundleinfo_interface_with_isCompressNativeLibs)
1184    suite.addTest("test bundle bundleInfo interface with entryModuleName", test_bundleinfo_interface_with_entryModuleName)
1185    suite.addTest("test bundle bundleInfo interface with cpuAbi", test_bundleinfo_interface_with_cpuAbi)
1186    suite.addTest("test bundle bundleInfo interface with isSilentInstallation", test_bundleinfo_interface_with_isSilentInstallation)
1187    suite.addTest("test bundle bundleInfo interface with minCompatibleVersionCode", test_bundleinfo_interface_with_minCompatibleVersionCode)
1188    suite.addTest("test bundle bundleInfo interface with entryInstallationFree", test_bundleinfo_interface_with_entryInstallationFree)
1189    suite.addTest("test bundle bundleInfo interface with reqPermissionStates", test_bundleinfo_interface_with_reqPermissionStates)
1190
1191    //customizeData.d.ts
1192    suite.addTest("test bundle bundleInfo interface CustomizeData with name", test_bundleinfo_interface_custdata_with_name)
1193    suite.addTest("test bundle bundleInfo interface CustomizeData with value", test_bundleinfo_interface_custdata_with_value)
1194    suite.addTest("test bundle bundleInfo interface CustomizeData with extra", test_bundleinfo_interface_custdata_with_extra)
1195
1196    //elementName.d.ts
1197    suite.addTest("test elementName interface with deviceId", test_bundle_interface_elementName_with_deviceId);
1198    suite.addTest("test elementName interface with deviceId _noSet", test_bundle_interface_elementName_with_deviceId_noSet);
1199    suite.addTest("test elementName interface with bundleName", test_bundle_interface_elementName_with_bundleName);
1200    suite.addTest("test elementName interface with abilityName", test_bundle_interface_elementName_with_abilityName);
1201    suite.addTest("test elementName interface with uri _noSet", test_bundle_interface_elementName_with_uri_noSet);
1202    suite.addTest("test elementName interface with uri", test_bundle_interface_elementName_with_uri);
1203    suite.addTest("test elementName interface with shortName _noSet", test_bundle_interface_elementName_with_shortName_noSet);
1204    suite.addTest("test elementName interface with shortName", test_bundle_interface_elementName_with_shortName);
1205
1206    //hapModuleInfo.d.ts
1207    suite.addTest("test hapModuleInfo interface with name", test_bundle_interface_hapModuleInfo_with_name)
1208    suite.addTest("test hapModuleInfo interface with description", test_bundle_interface_hapModuleInfo_with_description)
1209    suite.addTest("test hapModuleInfo interface with descriptionId", test_bundle_interface_hapModuleInfo_with_descriptionid)
1210    suite.addTest("test hapModuleInfo interface with icon", test_bundle_interface_hapModuleInfo_with_icon)
1211    suite.addTest("test hapModuleInfo interface with label", test_bundle_interface_hapModuleInfo_with_label)
1212    suite.addTest("test hapModuleInfo interface with labelId", test_bundle_interface_hapModuleInfo_with_labelid)
1213    suite.addTest("test hapModuleInfo interface with iconId", test_bundle_interface_hapModuleInfo_with_iconid)
1214    suite.addTest("test hapModuleInfo interface with backgroundImg", test_bundle_interface_hapModuleInfo_with_backgroundImg)
1215    suite.addTest("test hapModuleInfo interface with supportedModes", test_bundle_interface_hapModuleInfo_with_supportedModes)
1216    suite.addTest("test hapModuleInfo interface with reqCapabilities", test_bundle_interface_hapModuleInfo_with_reqCapabilities)
1217    suite.addTest("test hapModuleInfo interface with deviceTypes", test_bundle_interface_hapModuleInfo_with_deviceTypes)
1218    suite.addTest("test hapModuleInfo interface with moduleName", test_bundle_interface_hapModuleInfo_with_moduleName)
1219    suite.addTest("test hapModuleInfo interface with mainAbilityName", test_bundle_interface_hapModuleInfo_with_mainAbilityName)
1220    suite.addTest("test hapModuleInfo interface with installationFree", test_bundle_interface_hapModuleInfo_with_installationFree)
1221
1222    //moduleInfo.d.ts
1223    suite.addTest("test ModuleInfo interface with moduleName", test_bundle_interface_moduleInfo_with_moduleName)
1224    suite.addTest("test ModuleInfo interface with moduleSourceDir", test_bundle_interface_moduleInfo_with_moduleSourceDir)
1225
1226    //shortcutInfo.d.ts
1227    suite.addTest("test shortcutInfo interface with id", test_bundle_interface_shortcutInfo_with_id)
1228    suite.addTest("test shortcutInfo interface with bundleName", test_bundle_interface_shortcutInfo_with_bundleName)
1229    suite.addTest("test shortcutInfo interface with hostAbility", test_bundle_interface_shortcutInfo_with_hostAbility)
1230    suite.addTest("test shortcutInfo interface with icon", test_bundle_interface_shortcutInfo_with_icon)
1231    suite.addTest("test shortcutInfo interface with iconId", test_bundle_interface_shortcutInfo_with_iconId)
1232    suite.addTest("test shortcutInfo interface with label", test_bundle_interface_shortcutInfo_with_label)
1233    suite.addTest("test shortcutInfo interface with labelId", test_bundle_interface_shortcutInfo_with_labelId)
1234    suite.addTest("test shortcutInfo interface with disableMessage", test_bundle_interface_shortcutInfo_with_disableMessage)
1235    suite.addTest("test shortcutInfo interface with isStatic", test_bundle_interface_shortcutInfo_with_isStatic)
1236    suite.addTest("test shortcutInfo interface with isHomeShortcut", test_bundle_interface_shortcutInfo_with_isHomeShortcut)
1237    suite.addTest("test shortcutInfo interface with isEnabled", test_bundle_interface_shortcutInfo_with_isEnabled)
1238
1239    //@ohos.bundle.d.ts
1240    suite.addTest("test bundle ohos bundle with BundleFlag _DEFAULT", test_bundle_enum_BundleFlag_with_DEFAULT)
1241    suite.addTest("test bundle ohos bundle with BundleFlag _DISABLE", test_bundle_enum_BundleFlag_with_DISABLE)
1242    suite.addTest("test bundle ohos bundle with BundleFlag _INFO", test_bundle_enum_BundleFlag_with_INFO)
1243    suite.addTest("test bundle ohos bundle with ColorMode", test_bundle_enum_with_colorMode)
1244    suite.addTest("test bundle ohos bundle with GrantStatus", test_bundle_enum_with_grantStatus)
1245    suite.addTest("test bundle ohos bundle with AbilityType", test_bundle_enum_with_abilityType)
1246    suite.addTest("test bundle ohos bundle with AbilitySubType", test_bundle_enum_with_abilitySubType)
1247    suite.addTest("test bundle ohos bundle with DisplayOrientation", test_bundle_enum_with_displayOrientation)
1248    suite.addTest("test bundle ohos bundle with LaunchMode", test_bundle_enum_with_launchMode)
1249    suite.addTest("test bundle ohos bundle with InstallErrorCode _FOUND", test_bundle_enum_with_installErrorCode_FOUND)
1250    suite.addTest("test bundle ohos bundle with InstallErrorCode _SUCCESS", test_bundle_enum_with_installErrorCode_SUCCESS)
1251    suite.addTest("test bundle ohos bundle with InstallErrorCode _TIMEOUT", test_bundle_enum_with_installErrorCode_TIMEOUT)
1252    suite.addTest("test bundle ohos bundle interface BundleOptions with userId _noSet", test_bundle_interface_bundleOptions_with_userId_noSet)
1253    suite.addTest("test bundle ohos bundle interface BundleOptions with userId", test_bundle_interface_bundleOptions_with_userId)
1254    suite.addTest("test bundle ohos bundle function with getBundleInfo", test_bundle_function_with_getBundleInfo)
1255    suite.addTest("test bundle ohos bundle function with getAbilityInfo", test_bundle_function_with_getAbilityInfo)
1256    suite.addTest("test bundle ohos bundle function with getApplicationInfo 3 param", test_bundle_function_with_getApplicationInfo3param)
1257    suite.addTest("test bundle ohos bundle function with getApplicationInfo 2 param", test_bundle_function_with_getApplicationInfo2param)
1258    suite.addTest("test bundle ohos bundle function with getApplicationInfo have Optional", test_bundle_function_with_getApplicationInfoOptional_1)
1259    suite.addTest("test bundle ohos bundle function with getApplicationInfo no Optional", test_bundle_function_with_getApplicationInfoOptional_2)
1260    suite.addTest("test bundle ohos bundle function with queryAbilityByWant", test_bundle_function_with_queryAbilityByWant)
1261    suite.addTest("test bundle ohos bundle function with getAllBundleInfo", test_bundle_function_with_getAllBundleInfo)
1262    suite.addTest("test bundle ohos bundle function with getAllApplicationInfo", test_bundle_function_with_getAllApplicationInfo)
1263    suite.addTest("test bundle ohos bundle function with getNameForUid", test_bundle_function_with_getNameForUid)
1264    suite.addTest("test bundle ohos bundle function with getBundleArchiveInfo", test_bundle_function_with_getBundleArchiveInfo)
1265    suite.addTest("test bundle ohos bundle function with getLaunchWantForBundle", test_bundle_function_with_getLaunchWantForBundle)
1266    suite.addTest("test bundle ohos bundle function with getAbilityLabel", test_bundle_function_with_getAbilityLabel)
1267    suite.addTest("test bundle ohos bundle function with getAbilityIcon", test_bundle_function_with_getAbilityIcon)
1268    suite.addTest("test bundle ohos bundle function with isAbilityEnabled", test_bundle_function_with_isAbilityEnabled)
1269    suite.addTest("test bundle ohos bundle function with isApplicationEnabled", test_bundle_function_with_isApplicationEnabled)
1270
1271    //ohos.app.ability.Want.d.ts
1272    suite.addTest("test applicatohos.app.ability.Want class with bundleName _noSet", test_bundle_class_want_with_bundleName_noSet);
1273    suite.addTest("test applicatohos.app.ability.Want class with bundleName", test_bundle_class_want_with_bundleName);
1274    suite.addTest("test applicatohos.app.ability.Want class with abilityName _noSet", test_bundle_class_want_with_abilityName_noSet);
1275    suite.addTest("test applicatohos.app.ability.Want class with abilityName", test_bundle_class_want_with_abilityName);
1276    suite.addTest("test applicatohos.app.ability.Want class with deviceId _noSet", test_bundle_class_want_with_deviceId_noSet);
1277    suite.addTest("test applicatohos.app.ability.Want class with deviceId", test_bundle_class_want_with_deviceId);
1278    suite.addTest("test applicatohos.app.ability.Want class with uri _noSet", test_bundle_class_want_with_uri_noSet);
1279    suite.addTest("test applicatohos.app.ability.Want class with uri", test_bundle_class_want_with_uri);
1280    suite.addTest("test applicatohos.app.ability.Want class with type _noSet", test_bundle_class_want_with_type_noSet);
1281    suite.addTest("test applicatohos.app.ability.Want class with type", test_bundle_class_want_with_type);
1282    suite.addTest("test applicatohos.app.ability.Want class with flags _noSet", test_bundle_class_want_with_flags_noSet);
1283    suite.addTest("test applicatohos.app.ability.Want class with flags", test_bundle_class_want_with_flags);
1284    suite.addTest("test applicatohos.app.ability.Want class with action _noSet", test_bundle_class_want_with_action_noSet);
1285    suite.addTest("test applicatohos.app.ability.Want class with action", test_bundle_class_want_with_action);
1286    suite.addTest("test applicatohos.app.ability.Want class with entities _noSet", test_bundle_class_want_with_entities_noSet);
1287    suite.addTest("test applicatohos.app.ability.Want class with entities", test_bundle_class_want_with_entities);
1288    suite.addTest("test applicatohos.app.ability.Want class with moduleName _noSet", test_bundle_class_want_with_moduleName_noSet);
1289    suite.addTest("test applicatohos.app.ability.Want class with moduleName", test_bundle_class_want_with_moduleName);
1290
1291    exit(suite.run());
1292}