From 1f8032be027f6fc7044e8a8c653f4f58439708e7 Mon Sep 17 00:00:00 2001 From: inter515 Date: Wed, 22 Feb 2023 16:46:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eapi=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E5=92=8C=E9=9D=9E=E7=B3=BB=E7=BB=9Fapi=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: inter515 --- .../bundle_standard/bundlemanager/BUILD.gn | 1 + .../src/main/config.json | 4 +- .../actsbmsatomicserviceetstest/BUILD.gn | 25 + .../AppScope/app.json | 25 + .../resources/base/element/string.json | 8 + .../actsbmsatomicservicetest/BUILD.gn | 42 + .../actsbmsatomicservicetest/Test.json | 29 + .../src/main/ets/Application/AbilityStage.ts | 9 + .../src/main/ets/FormAbility/FormAbility.ts | 37 + .../src/main/ets/MainAbility/MainAbility.ts | 36 + .../ets/MainAbility/pages/index/index.ets | 57 + .../ets/MainAbility/pages/second/second.ets | 43 + .../main/ets/ServiceAbility/FormAbility.ts | 37 + .../src/main/ets/TestAbility/TestAbility.ts | 30 + .../src/main/ets/TestAbility/pages/index.ets | 48 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 58 + .../ets/test/GetBundleInfoForSelf.test.ets | 65 + .../entry/src/main/ets/test/List.test.ets | 20 + .../entry/src/main/ets/test/Utils.ets | 30 + .../entry/src/main/module.json | 394 ++++++ .../main/resources/base/element/string.json | 44 + .../src/main/resources/base/media/icon.png | Bin 0 -> 15458 bytes .../resources/base/profile/form_config.json | 6 + .../resources/base/profile/form_config1.txt | 1 + .../main/resources/base/profile/invalid.txt | 5 + .../resources/base/profile/main_pages.json | 6 + .../base/profile/shortcuts_config.json | 6 + .../signature/openharmony_sx.p7b | Bin 0 -> 3468 bytes .../bmsatomicserviceone/AppScope/app.json | 25 + .../resources/base/element/string.json | 8 + .../bmsatomicserviceone/BUILD.gn | 42 + .../bmsatomicserviceone/Test.json | 4 + .../src/main/ets/Application/AbilityStage.ts | 9 + .../src/main/ets/FormAbility/FormAbility.ts | 37 + .../src/main/ets/MainAbility/MainAbility.ts | 36 + .../ets/MainAbility/pages/index/index.ets | 57 + .../ets/MainAbility/pages/second/second.ets | 43 + .../main/ets/ServiceAbility/FormAbility.ts | 37 + .../ets/test/GetBundleInfoForSelf.test.ets | 1097 +++++++++++++++++ .../ets/test/GetProfileByAbility.test.ets | 423 +++++++ .../GetProfileByExtensionAbility.test.ets | 424 +++++++ .../main/ets/test/GetSecondModule.test.ets | 75 ++ .../entry/src/main/ets/test/List.test.ets | 26 + .../entry/src/main/ets/test/Utils.ets | 30 + .../entry/src/main/module.json | 39 + .../main/resources/base/element/string.json | 44 + .../src/main/resources/base/media/icon.png | Bin 0 -> 15458 bytes .../resources/base/profile/form_config.json | 6 + .../resources/base/profile/form_config1.txt | 1 + .../main/resources/base/profile/invalid.txt | 5 + .../resources/base/profile/main_pages.json | 6 + .../base/profile/shortcuts_config.json | 6 + .../signature/openharmony_sx.p7b | Bin 0 -> 3468 bytes .../bmsatomicserviceshared/AppScope/app.json | 25 + .../resources/base/element/string.json | 8 + .../bmsatomicserviceshared/BUILD.gn | 42 + .../bmsatomicserviceshared/Test.json | 4 + .../src/main/ets/Application/AbilityStage.ts | 9 + .../src/main/ets/FormAbility/FormAbility.ts | 37 + .../src/main/ets/MainAbility/MainAbility.ts | 36 + .../ets/MainAbility/pages/index/index.ets | 57 + .../ets/MainAbility/pages/second/second.ets | 43 + .../main/ets/ServiceAbility/FormAbility.ts | 37 + .../ets/test/GetBundleInfoForSelf.test.ets | 1097 +++++++++++++++++ .../ets/test/GetProfileByAbility.test.ets | 423 +++++++ .../GetProfileByExtensionAbility.test.ets | 424 +++++++ .../main/ets/test/GetSecondModule.test.ets | 75 ++ .../entry/src/main/ets/test/List.test.ets | 26 + .../entry/src/main/ets/test/Utils.ets | 30 + .../entry/src/main/module.json | 17 + .../main/resources/base/element/string.json | 44 + .../src/main/resources/base/media/icon.png | Bin 0 -> 15458 bytes .../resources/base/profile/form_config.json | 6 + .../resources/base/profile/form_config1.txt | 1 + .../main/resources/base/profile/invalid.txt | 5 + .../resources/base/profile/main_pages.json | 6 + .../base/profile/shortcuts_config.json | 6 + .../signature/openharmony_sx.p7b | Bin 0 -> 3468 bytes .../entry/src/main/config.json | 4 +- .../actsbmsgetinfostest/src/main/config.json | 4 +- .../actsbmshapmoduletest/src/main/config.json | 4 +- .../actsbmsjstest/src/main/config.json | 4 +- .../src/main/config.json | 4 +- .../actsbmsmetadatatest/src/main/config.json | 4 +- .../entry/src/main/config.json | 4 +- .../entry/src/main/ets/test/List.test.ets | 2 - .../AppScope/app.json | 6 +- .../actsbundlemanagerstagetest/Test.json | 20 +- .../ets/test/GetBundleInfoForSelf.test.ets | 7 +- .../ets/test/IsDefaultApplication.test.ets | 2 +- .../entry/src/main/ets/test/List.test.ets | 4 + .../main/ets/test/PublicApiEightTest.test.ets | 361 ++++++ .../entry/src/main/ets/test/Utils.ets | 7 + .../src/main/config.json | 4 +- 94 files changed, 6416 insertions(+), 29 deletions(-) create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/BUILD.gn create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/app.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/resources/base/element/string.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/BUILD.gn create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/Test.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/FormAbility/FormAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/index/index.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/second/second.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/ServiceAbility/FormAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/TestAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/pages/index.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/List.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/Utils.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/module.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/element/string.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/media/icon.png create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config1.txt create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/invalid.txt create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/main_pages.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/shortcuts_config.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/signature/openharmony_sx.p7b create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/AppScope/app.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/AppScope/resources/base/element/string.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/BUILD.gn create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/Test.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/FormAbility/FormAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/MainAbility/pages/index/index.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/MainAbility/pages/second/second.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/ServiceAbility/FormAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByAbility.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetSecondModule.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/List.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/Utils.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/module.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/element/string.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/media/icon.png create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config1.txt create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/invalid.txt create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/main_pages.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/shortcuts_config.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/signature/openharmony_sx.p7b create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/AppScope/app.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/AppScope/resources/base/element/string.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/BUILD.gn create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/Test.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/FormAbility/FormAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/MainAbility/pages/index/index.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/MainAbility/pages/second/second.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/ServiceAbility/FormAbility.ts create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByAbility.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetSecondModule.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/List.test.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/Utils.ets create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/module.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/element/string.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/media/icon.png create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config1.txt create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/invalid.txt create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/main_pages.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/shortcuts_config.json create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/signature/openharmony_sx.p7b rename bundlemanager/bundle_standard/bundlemanager/{actsbundlemanageretstest => actsbundlemanagerstagetest}/entry/src/main/ets/test/IsDefaultApplication.test.ets (97%) create mode 100644 bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiEightTest.test.ets diff --git a/bundlemanager/bundle_standard/bundlemanager/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/BUILD.gn index 853b08032..4e2522cf9 100644 --- a/bundlemanager/bundle_standard/bundlemanager/BUILD.gn +++ b/bundlemanager/bundle_standard/bundlemanager/BUILD.gn @@ -18,6 +18,7 @@ group("bundlemanager") { if (is_standard_system) { deps = [ "actsbmsaccesstokentest:ActsBmsAccessTokenTest", + "actsbmsatomicserviceetstest:actsbmsatomicserviceetstest", "actsbmsetsunpermissiontest:ActsBmsEtsUnPermissionTest", "actsbmsgetinfostest:ActsBmsGetInfosTest", "actsbmshapmoduletest:ActsBmsHapModuleTest", diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsaccesstokentest/src/main/config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsaccesstokentest/src/main/config.json index b18b87fb8..94ac99f1d 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbmsaccesstokentest/src/main/config.json +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsaccesstokentest/src/main/config.json @@ -7,8 +7,8 @@ "name": "1.0" }, "apiVersion": { - "compatible": 4, - "target": 5, + "compatible": 8, + "target": 8, "releaseType": "Beta1" } }, diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/BUILD.gn new file mode 100644 index 000000000..df78b91c1 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +group("actsbmsatomicserviceetstest") { + testonly = true + if (is_standard_system) { + deps = [ + "actsbmsatomicservicetest:ActsBmsAtomicServiceTest", + "bmsatomicserviceone:BmsAtomicService1", + "bmsatomicserviceshared:BmsAtomicServiceShared", + ] + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/app.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/app.json new file mode 100644 index 000000000..67dd7c880 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/app.json @@ -0,0 +1,25 @@ +{ + "app":{ + "bundleName":"ohos.acts.atomic.service.test", + "vendor":"huawei", + "versionCode":1000000, + "versionName":"1.0.0", + "debug":false, + "icon":"$media:icon", + "label":"$string:app_name", + "description":"$string:description_application", + "distributedNotificationEnabled":true, + "keepAlive":true, + "singleUser":true, + "minAPIVersion":9, + "targetAPIVersion":9, + "atomicService":{ + "split":true, + "main":"testModule" + }, + "car":{ + "apiCompatibleVersion":9, + "singleUser":false + } + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..ee69f9a86 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/BUILD.gn new file mode 100644 index 000000000..ebae923b2 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsBmsAtomicServiceTest") { + hap_profile = "entry/src/main/module.json" + deps = [ + ":actsbmsatomicservicetest_js_assets", + ":actsbmsatomicservicetest_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsBmsAtomicServiceTest" + subsystem_name = "bundlemanager" + part_name = "bundle_framework" +} + +ohos_app_scope("actsbmsatomicservicetest_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("actsbmsatomicservicetest_js_assets") { + source_dir = "entry/src/main/ets" +} + +ohos_resources("actsbmsatomicservicetest_resources") { + sources = [ "entry/src/main/resources" ] + deps = [ ":actsbmsatomicservicetest_app_profile" ] + hap_profile = "entry/src/main/module.json" +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/Test.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/Test.json new file mode 100644 index 000000000..725e6507d --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/Test.json @@ -0,0 +1,29 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "180000", + "bundle-name": "ohos.acts.atomic.service.test", + "module-name": "testModule", + "shell-timeout": "600000", + "testcase-timeout": 70000 + }, + "kits": [ + { + "test-file-name": [ + "BmsAtomicService1.hap", + "BmsAtomicServiceShared.hap", + "ActsBmsAtomicServiceTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "teardown-command":[ + "bm uninstall -n ohos.acts.atomic.service.test" + ] + } + ] +} + diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/Application/AbilityStage.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..cbcc939ff --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +import AbilityStage from "@ohos.app.ability.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/FormAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/FormAbility/FormAbility.ts new file mode 100644 index 000000000..d44363110 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/FormAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/MainAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..2fb66add2 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,36 @@ +import Ability from '@ohos.app.ability.UIAbility' + +export default class MainAbility extends Ability { + onCreate(want,launchParam){ + // Ability is creating, initialize resources for this ability + console.log("[Demo] MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("[Demo] MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null) + } + + onWindowStageDestroy() { + //Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/index/index.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 000000000..f172d89b0 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; + +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../../../test/List.test' + + +@Entry +@Component +struct Index { + + aboutToAppear(){ + console.info("start run testcase!!!!") + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + build() { + Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/second/second.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 000000000..f9009a3e8 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/ServiceAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/ServiceAbility/FormAbility.ts new file mode 100644 index 000000000..d44363110 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/ServiceAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/TestAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 000000000..3e2d601de --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,30 @@ +import Ability from '@ohos.app.ability.UIAbility' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + console.log('TestAbility onCreate') + } + + onDestroy() { + console.log('TestAbility onDestroy') + } + + onWindowStageCreate(windowStage) { + console.log('TestAbility onWindowStageCreate') + windowStage.setUIContent(this.context, 'TestAbility/pages/index', null) + + globalThis.abilityContext = this.context; + } + + onWindowStageDestroy() { + console.log('TestAbility onWindowStageDestroy') + } + + onForeground() { + console.log('TestAbility onForeground') + } + + onBackground() { + console.log('TestAbility onBackground') + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/pages/index.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/pages/index.ets new file mode 100644 index 000000000..b93567f96 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestAbility/pages/index.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@ohos.router'; + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info('TestAbility index aboutToAppear') + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 000000000..1417ad2f2 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,58 @@ +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + console.log("onAbilityCreateCallback"); +} + +async function addAbilityMonitorCallback(err: any) { + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + console.info("OpenHarmonyTestRunner OnPrepare ") + } + + async onRun() { + console.log('OpenHarmonyTestRunner onRun run') + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a ohos.acts.atomic.service.test.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }) + console.info('OpenHarmonyTestRunner onRun end') + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets new file mode 100644 index 000000000..af0200e80 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +export default function getBundleInfoForSelf() { + describe('getBundleInfoForSelf', function () { + + /* + * @tc.number: SUB_BMS_SERVICE_SPLIT_0031 + * @tc.name: getBundleInfoForSelfAtomicService + * @tc.desc: Test getBundleInfoForSelf with AtomicService + */ + it('getBundleInfoForSelfAtomicService', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE).then(data => { + let preloadItemTest: bundle.PreloadItem = data.hapModulesInfo[2].preloads[0]; + expect(typeof (preloadItemTest.moduleName)).assertEqual('string'); + let dependencyTest: bundle.Dependency = data.hapModulesInfo[2].dependencies[0]; + expect(typeof (dependencyTest.moduleName)).assertEqual('string'); + console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo)); + for (let i = 0; i < data.hapModulesInfo.length; i++) { + console.info("getBundleInfoForSelfApplicationPro : " + i + " ==" + JSON.stringify(data.hapModulesInfo[i])); + } + expect(data.appInfo.bundleType).assertEqual(bundle.BundleType.ATOMIC_SERVICE); + expect(data.appInfo.split).assertEqual(true); + expect(data.hapModulesInfo[0].type).assertEqual(bundle.ModuleType.FEATURE); + expect(data.hapModulesInfo[0].atomicServiceModuleType).assertEqual(bundle.AtomicServiceModuleType.NORMAL); + expect(data.hapModulesInfo[0].preloads.length).assertEqual(0); + expect(data.hapModulesInfo[0].dependencies.length).assertEqual(0); + expect(data.hapModulesInfo[1].type).assertEqual(bundle.ModuleType.SHARED); + expect(data.hapModulesInfo[1].preloads.length).assertEqual(0); + expect(data.hapModulesInfo[1].atomicServiceModuleType).assertEqual(bundle.AtomicServiceModuleType.NORMAL); + expect(data.hapModulesInfo[1].dependencies.length).assertEqual(0); + expect(data.hapModulesInfo[2].type).assertEqual(bundle.ModuleType.ENTRY); + expect(data.hapModulesInfo[2].atomicServiceModuleType).assertEqual(bundle.AtomicServiceModuleType.MAIN); + expect(data.hapModulesInfo[2].preloads.length).assertEqual(2); + expect(data.hapModulesInfo[2].preloads[0].moduleName).assertEqual("feature"); + expect(data.hapModulesInfo[2].preloads[1].moduleName).assertEqual("shared"); + expect(data.hapModulesInfo[2].dependencies.length).assertEqual(1); + expect(data.hapModulesInfo[2].dependencies[0].moduleName).assertEqual("feature"); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..258456bc0 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import getBundleInfoForSelf from './GetBundleInfoForSelf.test.ets'; + +export default function testsuite() { + getBundleInfoForSelf(); +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/Utils.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/Utils.ets new file mode 100644 index 000000000..f3b5fe7f6 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/ets/test/Utils.ets @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout((data) => { + resolve(data) + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } +} + + + + diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/module.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/module.json new file mode 100644 index 000000000..e04927a28 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/module.json @@ -0,0 +1,394 @@ +{ + "module": { + "name": "testModule", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:testModule_entry_dsc", + "mainElement": "ohos.acts.atomic.service.test.MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "dependencies":[ + { + "moduleName":"feature" + } + ], + "atomicService":{ + "preloads":[ + { + "moduleName":"feature" + }, + { + "moduleName":"shared" + } + ] + }, + "deliveryWithInstall": true, + "installationFree": true, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], + "abilities": [ + { + "name": "ohos.acts.atomic.service.test.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "singleton", + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities":[ + "entity.system.home" + ] + } + ], + "metadata": [ + { + "name": "ohos.ability.form", + "value": "", + "resource": "$profile:shortcuts_config" + }, + { + "name": "ohos.ability.form1", + "value": "", + "resource": "$profile:form_config" + }, + { + "name": "ohos.ability.form2", + "value": "", + "resource": "@profile:form_config" + }, + { + "name": "ohos.ability.form3", + "value": "", + "resource": "$profile:form_config1" + }, + { + "name": "ohos.ability.form4", + "value": "", + "resource": "$profile:invalid" + } + ] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility1", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "standard", + "orientation": "landscape", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility2", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "landscape_inverted", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility3", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "portrait_inverted", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility4", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility5", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_landscape", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility6", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_portrait", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility7", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_restricted", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility8", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_landscape_restricted", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility9", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "auto_rotation_portrait_restricted", + "skills": [] + }, + { + "name": "ohos.acts.atomic.service.test.MainAbility10", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "specified", + "orientation": "locked", + "skills": [] + } + ], + "extensionAbilities": [ + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "metadata": [ + { + "name": "ohos.extension.form", + "value": "", + "resource": "$profile:shortcuts_config" + }, + { + "name": "ohos.extension.form1", + "value": "", + "resource": "$profile:form_config" + }, + { + "name": "ohos.extension.form2", + "value": "", + "resource": "@profile:form_config" + }, + { + "name": "ohos.extension.form3", + "value": "", + "resource": "$profile:form_config1" + }, + { + "name": "ohos.extension.form4", + "value": "", + "resource": "$profile:invalid" + } + ], + "name": "Form", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "form", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "Form1", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "form", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "workScheduler", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "workScheduler", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "inputMethod", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "inputMethod", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "accessibility", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "accessibility", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "fileShare", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "fileShare", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "staticSubscriber", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "staticSubscriber", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "wallpaper", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "wallpaper", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "backup", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "backup", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "window", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "window", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "enterpriseAdmin", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "enterpriseAdmin", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "thumbnail", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "thumbnail", + "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "preview", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "preview", + "visible": true + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "$string:permission_reason", + "usedScene": { + "abilities": ["MainAbility"], + "when": "always" + } + }, + { + "name": "ohos.permission.READ_CALENDAR", + "reason": "$string:permission_reason", + "usedScene": { + "abilities": ["MainAbility"], + "when": "inuse" + } + } + ], + "metadata": [ + { + "name": "MetaData1", + "value": "MetaDataValue", + "resource": "$profile:shortcuts_config" + } + ] + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..a4e9ba5b8 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,44 @@ +{ + "string": [ + { + "name": "testModule_entry_dsc", + "value": "i am an entry for testModule" + }, + { + "name": "testModule_entry_main", + "value": "the testModule entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + }, + { + "name": "form_FormAbility_desc", + "value": "form_description" + }, + { + "name": "form_FormAbility_label", + "value": "form_label" + }, + { + "name": "permission_reason", + "value": "Need permission" + } + ] +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/media/icon.png b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 GIT binary patch literal 15458 zcm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F2*vpx(dgmuRWV_Q&1- Y0jIQKqpXab7ytkO07*qoM6N<$f;yQ2zW@LL literal 0 HcmV?d00001 diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 000000000..e892d4472 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config1.txt b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config1.txt new file mode 100644 index 000000000..32f9ff7dc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/form_config1.txt @@ -0,0 +1 @@ +{"src": ["MainAbility/pages/index/index","MainAbility/pages/second/second"]} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/invalid.txt b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/invalid.txt new file mode 100644 index 000000000..cdca51a17 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/invalid.txt @@ -0,0 +1,5 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/main_pages.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..02221db61 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/shortcuts_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/shortcuts_config.json new file mode 100644 index 000000000..02221db61 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/entry/src/main/resources/base/profile/shortcuts_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/signature/openharmony_sx.p7b b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/actsbmsatomicservicetest/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..616445c708cb010b974dcdfad16af541d40d2f6f GIT binary patch literal 3468 zcmcgvYj6|S6}BFhV~ntg0RsVSgu%RI-<2g>a$f98s~29$D@(TIh?cK#S^UnVxD6!5F+Pt6i9wDid*%W?j}!>`Jdn(s z{0PYFOlH0yOlB6$lC+YMXn>}qZrVdis$^3iIw&HN2*c)rIb*S04kSzy(FaM&`eu6H8?^BNg_&e4k8?udIC`<5^%+s)Ox)L zI@%bZ7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Qv9n`++>e{ { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/MainAbility/pages/second/second.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 000000000..f9009a3e8 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/ServiceAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/ServiceAbility/FormAbility.ts new file mode 100644 index 000000000..d44363110 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/ServiceAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets new file mode 100644 index 000000000..9e40c5b25 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets @@ -0,0 +1,1097 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle.bundleManager'; +import util from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const BUNDLE_NAME = "ohos.acts.bundle.stage.test"; +const VENDOR = "huawei"; +const MODULE_NAME = "testModule"; +const SOURCE_DIR = "/data/app/el1/bundle/public/ohos.acts.bundle.stage.test/testModule"; +const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility"; +const ABILITY_NAME1 = "ohos.acts.bundle.stage.test.MainAbility1"; +const APPID = "ohos.acts.bundle.stage.test_BNtg4JBClbl92Rgc3jm/RfcAdrHXaM8F0QO" + +"iwVEhnV5ebE5jNIYnAx+weFRT3QTyUjRNdhmc2aAzWyi+5t5CoBM="; +const FINGERPRINT = "8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"; +const PARAM_ERROR_CODE = 401; + +export default function getBundleInfoForSelf() { + describe('getBundleInfoForSelf', function () { + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0118 + * @tc.name: getBundleInfoForSelfPro + * @tc.desc: Test getBundleInfoForSelf with default flag(by promise). + */ + it('getBundleInfoForSelfPro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT).then(data => { + console.info("getBundleInfoForSelfPro" + JSON.stringify(data)); + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.vendor).assertEqual(VENDOR); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.targetVersion).assertEqual(8); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0119 + * @tc.name: getBundleInfoForSelfCal + * @tc.desc: Test getBundleInfoForSelf with default flag(by callback). + */ + it('getBundleInfoForSelfCal', 0, async function (done) { + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT, (err, data) => { + console.info("getBundleInfoForSelfCal" + JSON.stringify(data)); + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.vendor).assertEqual(VENDOR); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.targetVersion).assertEqual(8); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0120 + * @tc.name: getBundleInfoForSelfApplicationPro + * @tc.desc: Test getBundleInfoForSelf with application flag(by promise). + */ + it('getBundleInfoForSelfApplicationPro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then(data => { + console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.description).assertEqual("$string:description_application"); + expect(data.appInfo.descriptionId).assertLarger(0); + expect(data.appInfo.enabled).assertTrue(); + expect(data.appInfo.label).assertEqual("$string:app_name"); + expect(data.appInfo.labelId).assertLarger(0); + expect(data.appInfo.icon).assertEqual("$media:icon"); + expect(data.appInfo.iconId).assertLarger(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage.test"); + expect(data.appInfo.removable).assertTrue(0); + expect(data.appInfo.accessTokenId).assertLarger(0); + expect(data.appInfo.uid).assertLarger(0); + expect(data.appInfo.iconResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.iconResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.iconResource.id).assertEqual(data.appInfo.iconId); + expect(data.appInfo.labelResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.labelResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.labelResource.id).assertEqual(data.appInfo.labelId); + expect(data.appInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.descriptionResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.descriptionResource.id).assertEqual(data.appInfo.descriptionId); + expect(data.appInfo.appDistributionType).assertEqual("os_integration"); + expect(data.appInfo.appProvisionType).assertEqual("release"); + expect(data.appInfo.permissions.length).assertEqual(0); + expect(data.appInfo.systemApp).assertFalse(); + expect(JSON.stringify(data.appInfo.metadata)).assertEqual("{}"); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0121 + * @tc.name: getBundleInfoForSelfApplicationCal + * @tc.desc: Test getBundleInfoForSelf with application flag(by callback). + */ + it('getBundleInfoForSelfApplicationCal', 0, async function (done) { + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION, (err, data) => { + console.info("ApplicationCal" + JSON.stringify(data.appInfo)); + for (let i in data.appInfo) { + console.info("name" + JSON.stringify(i)); + console.info("name" + JSON.stringify(data.appInfo[i])); + } + checkCommonBundleInfo(data); + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.description).assertEqual("$string:description_application"); + expect(data.appInfo.descriptionId).assertLarger(0); + expect(data.appInfo.enabled).assertTrue(); + expect(data.appInfo.label).assertEqual("$string:app_name"); + expect(data.appInfo.labelId).assertLarger(0); + expect(data.appInfo.icon).assertEqual("$media:icon"); + expect(data.appInfo.iconId).assertLarger(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage.test"); + expect(data.appInfo.removable).assertTrue(0); + expect(data.appInfo.accessTokenId).assertLarger(0); + expect(data.appInfo.uid).assertLarger(0); + expect(data.appInfo.iconResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.iconResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.iconResource.id).assertEqual(data.appInfo.iconId); + expect(data.appInfo.labelResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.labelResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.labelResource.id).assertEqual(data.appInfo.labelId); + expect(data.appInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.descriptionResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.descriptionResource.id).assertEqual(data.appInfo.descriptionId); + expect(data.appInfo.appDistributionType).assertEqual("os_integration"); + expect(data.appInfo.appProvisionType).assertEqual("release"); + expect(data.appInfo.permissions.length).assertEqual(0); + expect(data.appInfo.systemApp).assertFalse(); + expect(JSON.stringify(data.appInfo.metadata)).assertEqual("{}"); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0122 + * @tc.name: getBundleInfoForSelfModulePro + * @tc.desc: Test getBundleInfoForSelf with hapModuleInfo flag(by promise). + */ + it('getBundleInfoForSelfModulePro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE).then(data => { + console.info("ModulePro" + JSON.stringify(data.hapModulesInfo[0])); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(1); + expect(data.hapModulesInfo[0].name).assertEqual("testModule"); + expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc"); + expect(data.hapModulesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2); + expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].installationFree).assertFalse(); + expect(data.hapModulesInfo[0].hashValue).assertEqual(""); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0123 + * @tc.name: getBundleInfoForSelfModuleCal + * @tc.desc: Test getBundleInfoForSelf with hapModuleInfo flag(by callback). + */ + it('getBundleInfoForSelfModuleCal', 0, async function (done) { + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE, (err, data) => { + console.info("getBundleInfoForSelfPro" + JSON.stringify(data.hapModulesInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(1); + expect(data.hapModulesInfo[0].name).assertEqual("testModule"); + expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc"); + expect(data.hapModulesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2); + expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].installationFree).assertFalse(); + expect(data.hapModulesInfo[0].hashValue).assertEqual(""); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0124 + * @tc.name: getBundleInfoForSelfAbilityPro + * @tc.desc: Test getBundleInfoForSelf with ability flag(by promise). + */ + it('getBundleInfoForSelfAbilityPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY + ).then(data => { + for (let count = 0; count < 11; count++) { + console.info(count + "AbilityPro::" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[count])); + } + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(11); + expect(data.hapModulesInfo[0].abilitiesInfo[0].bundleName).assertEqual(BUNDLE_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo[0].moduleName).assertEqual("testModule"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].description).assertEqual("$string:testModule_entry_main"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].process).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].exported).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].type).assertEqual(1); + expect(data.hapModulesInfo[0].abilitiesInfo[0].orientation).assertEqual(bundle.DisplayOrientation.PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].launchType).assertEqual(bundle.LaunchType.SINGLETON); + expect(data.hapModulesInfo[0].abilitiesInfo[0].permissions.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].readPermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].writePermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].uri).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes.length).assertEqual(2); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0])); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1])); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].applicationInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].enabled).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes.length).assertEqual(3); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[0]) + .assertEqual(bundle.SupportWindowMode.FULL_SCREEN); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[1]) + .assertEqual(bundle.SupportWindowMode.SPLIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[2]) + .assertEqual(bundle.SupportWindowMode.FLOATING); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[1].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility1"); + expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.MULTITON); + expect(data.hapModulesInfo[0].abilitiesInfo[1].orientation).assertEqual(bundle.DisplayOrientation.LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[2].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility10"); + expect(data.hapModulesInfo[0].abilitiesInfo[2].orientation).assertEqual(bundle.DisplayOrientation.LOCKED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility2"); + expect(data.hapModulesInfo[0].abilitiesInfo[3].launchType).assertEqual(bundle.LaunchType.SPECIFIED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].orientation) + .assertEqual(bundle.DisplayOrientation.LANDSCAPE_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[4].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility3"); + expect(data.hapModulesInfo[0].abilitiesInfo[4].orientation) + .assertEqual(bundle.DisplayOrientation.PORTRAIT_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[5].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility4"); + expect(data.hapModulesInfo[0].abilitiesInfo[5].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION); + expect(data.hapModulesInfo[0].abilitiesInfo[6].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility5"); + expect(data.hapModulesInfo[0].abilitiesInfo[6].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[7].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility6"); + expect(data.hapModulesInfo[0].abilitiesInfo[7].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[8].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility7"); + expect(data.hapModulesInfo[0].abilitiesInfo[8].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[9].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility8"); + expect(data.hapModulesInfo[0].abilitiesInfo[9].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[10].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility9"); + expect(data.hapModulesInfo[0].abilitiesInfo[10].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT_RESTRICTED); + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[1]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[2]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[3]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[4]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[5]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[6]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[7]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[8]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[9]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[10]) + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0125 + * @tc.name: getBundleInfoForSelfAbilityCal + * @tc.desc: Test getBundleInfoForSelf with ability flag(by callback). + */ + it('getBundleInfoForSelfAbilityCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY, + (err, data) => { + console.info("AbilityCal" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0])); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(11); + expect(data.hapModulesInfo[0].abilitiesInfo[0].bundleName).assertEqual(BUNDLE_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo[0].moduleName).assertEqual("testModule"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].description).assertEqual("$string:testModule_entry_main"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].process).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].exported).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].type).assertEqual(1); + expect(data.hapModulesInfo[0].abilitiesInfo[0].orientation).assertEqual(bundle.DisplayOrientation.PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].launchType).assertEqual(bundle.LaunchType.SINGLETON); + expect(data.hapModulesInfo[0].abilitiesInfo[0].permissions.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].readPermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].writePermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].uri).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes.length).assertEqual(2); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0])); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1])); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].applicationInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].enabled).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes.length).assertEqual(3); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[0]) + .assertEqual(bundle.SupportWindowMode.FULL_SCREEN); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[1]) + .assertEqual(bundle.SupportWindowMode.SPLIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[2]) + .assertEqual(bundle.SupportWindowMode.FLOATING); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[1].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility1"); + expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.MULTITON); + expect(data.hapModulesInfo[0].abilitiesInfo[1].orientation).assertEqual(bundle.DisplayOrientation.LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[2].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility10"); + expect(data.hapModulesInfo[0].abilitiesInfo[2].orientation).assertEqual(bundle.DisplayOrientation.LOCKED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility2"); + expect(data.hapModulesInfo[0].abilitiesInfo[3].launchType).assertEqual(bundle.LaunchType.SPECIFIED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].orientation) + .assertEqual(bundle.DisplayOrientation.LANDSCAPE_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[4].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility3"); + expect(data.hapModulesInfo[0].abilitiesInfo[4].orientation) + .assertEqual(bundle.DisplayOrientation.PORTRAIT_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[5].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility4"); + expect(data.hapModulesInfo[0].abilitiesInfo[5].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION); + expect(data.hapModulesInfo[0].abilitiesInfo[6].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility5"); + expect(data.hapModulesInfo[0].abilitiesInfo[6].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[7].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility6"); + expect(data.hapModulesInfo[0].abilitiesInfo[7].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[8].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility7"); + expect(data.hapModulesInfo[0].abilitiesInfo[8].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[9].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility8"); + expect(data.hapModulesInfo[0].abilitiesInfo[9].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[10].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility9"); + expect(data.hapModulesInfo[0].abilitiesInfo[10].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT_RESTRICTED); + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[1]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[2]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[3]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[4]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[5]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[6]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[7]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[8]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[9]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[10]) + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0126 + * @tc.name: getBundleInfoForSelfExtensionPro + * @tc.desc: Test getBundleInfoForSelf with extensionAbility flag(by promise). + */ + it('getBundleInfoForSelfExtensionPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY + ).then(data => { + console.info("ExtensionPro" + JSON.stringify(data.hapModulesInfo[0].extensionAbilitiesInfo)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + let extensionList = data.hapModulesInfo[0].extensionAbilitiesInfo + expect(extensionList.length).assertEqual(13); + let count = 0; + for (let i = 0;i < 13; i++) { + switch (extensionList[i].name) { + case "Form": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 1; + break; + case "Form1": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form1"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 2; + break; + case 'workScheduler': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WORK_SCHEDULER) + count = count + 3; + break; + case 'inputMethod': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.INPUT_METHOD) + count = count + 4; + break; + case 'accessibility': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ACCESSIBILITY) + count = count + 5; + break; + case 'fileShare': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FILE_SHARE) + count = count + 6; + break; + case 'staticSubscriber': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.STATIC_SUBSCRIBER) + count = count + 7; + break; + case 'wallpaper': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WALLPAPER) + count = count + 8; + break; + case 'backup': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.BACKUP) + count = count + 9; + break; + case 'window': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WINDOW) + count = count + 10; + break; + case 'enterpriseAdmin': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ENTERPRISE_ADMIN) + count = count + 11; + break; + case 'thumbnail': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.THUMBNAIL) + count = count + 12; + break; + case 'preview': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PREVIEW) + count = count + 13; + break; + } + console.info("count" + JSON.stringify(count)); + } + expect(count).assertEqual(91); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0127 + * @tc.name: getBundleInfoForSelfExtensionCal + * @tc.desc: Test getBundleInfoForSelf with extensionAbility flag(by callback). + */ + it('getBundleInfoForSelfExtensionCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY, + (err, data) => { + console.info("ExtensionCal" + JSON.stringify(data.hapModulesInfo[0].extensionAbilitiesInfo)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + let extensionList = data.hapModulesInfo[0].extensionAbilitiesInfo + let count = 0; + for (let i = 0;i < 13; i++) { + switch (extensionList[i].name) { + case "Form": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 1; + break; + case "Form1": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form1"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 2; + break; + case 'workScheduler': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WORK_SCHEDULER) + count = count + 3; + break; + case 'inputMethod': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.INPUT_METHOD) + count = count + 4; + break; + case 'accessibility': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ACCESSIBILITY) + count = count + 5; + break; + case 'fileShare': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FILE_SHARE) + count = count + 6; + break; + case 'staticSubscriber': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.STATIC_SUBSCRIBER) + count = count + 7; + break; + case 'wallpaper': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WALLPAPER) + count = count + 8; + break; + case 'backup': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.BACKUP) + count = count + 9; + break; + case 'window': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WINDOW) + count = count + 10; + break; + case 'enterpriseAdmin': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ENTERPRISE_ADMIN) + count = count + 11; + break; + case 'thumbnail': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.THUMBNAIL) + count = count + 12; + break; + case 'preview': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PREVIEW) + count = count + 13; + break; + } + console.info("count" + JSON.stringify(count)); + } + expect(count).assertEqual(91); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + expect(bundle.ExtensionAbilityType.SERVICE).assertEqual(3); + expect(bundle.ExtensionAbilityType.DATA_SHARE).assertEqual(5); + expect(bundle.ExtensionAbilityType.UNSPECIFIED).assertEqual(255); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0128 + * @tc.name: getBundleInfoForSelfPermissionPro + * @tc.desc: Test getBundleInfoForSelf with permission flag(by promise). + */ + it('getBundleInfoForSelfPermissionPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION).then(data => { + console.info("PermissionPro" + JSON.stringify(data.reqPermissionDetails)); + console.info("PermissionPro" + JSON.stringify(data.permissionGrantStates)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(2); + expect(data.reqPermissionDetails[0].name).assertEqual("ohos.permission.GET_BUNDLE_INFO"); + expect(data.reqPermissionDetails[0].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[0].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[0].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[0].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[0].usedScene.when).assertEqual("always"); + expect(data.permissionGrantStates[0]).assertEqual(bundle.PermissionGrantState.PERMISSION_GRANTED); + expect(data.reqPermissionDetails[1].name).assertEqual("ohos.permission.READ_CALENDAR"); + expect(data.reqPermissionDetails[1].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[1].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[1].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[1].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[1].usedScene.when).assertEqual("inuse"); + expect(data.permissionGrantStates[1]).assertEqual(bundle.PermissionGrantState.PERMISSION_DENIED); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0129 + * @tc.name: getBundleInfoForSelfPermissionCal + * @tc.desc: Test getBundleInfoForSelf with permission flag(by callback). + */ + it('getBundleInfoForSelfPermissionCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION, (err, data) => { + console.info("PermissionPro" + JSON.stringify(data.reqPermissionDetails)); + console.info("PermissionPro" + JSON.stringify(data.permissionGrantStates)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.reqPermissionDetails.length).assertEqual(2); + expect(data.reqPermissionDetails[0].name).assertEqual("ohos.permission.GET_BUNDLE_INFO"); + expect(data.reqPermissionDetails[0].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[0].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[0].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[0].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[0].usedScene.when).assertEqual("always"); + expect(data.permissionGrantStates[0]).assertEqual(bundle.PermissionGrantState.PERMISSION_GRANTED); + expect(data.reqPermissionDetails[1].name).assertEqual("ohos.permission.READ_CALENDAR"); + expect(data.reqPermissionDetails[1].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[1].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[1].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[1].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[1].usedScene.when).assertEqual("inuse"); + expect(data.permissionGrantStates[1]).assertEqual(bundle.PermissionGrantState.PERMISSION_DENIED); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0130 + * @tc.name: getBundleInfoForSelfMetaPro + * @tc.desc: Test getBundleInfoForSelf with metadata flag(by promise). + */ + it('getBundleInfoForSelfMetaPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA) + .then(data => { + console.info("MetaPro" + JSON.stringify(data.hapModulesInfo[0].metadata)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(1); + expect(data.hapModulesInfo[0].metadata[0].name).assertEqual("MetaData1"); + expect(data.hapModulesInfo[0].metadata[0].value).assertEqual("MetaDataValue"); + expect(data.hapModulesInfo[0].metadata[0].resource).assertEqual("$profile:shortcuts_config"); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }) + .catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0131 + * @tc.name: getBundleInfoForSelfMetaCal + * @tc.desc: Test getBundleInfoForSelf with metadata flag(by callback). + */ + it('getBundleInfoForSelfMetaCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA, + (err, data) => { + console.info("MetaPro" + JSON.stringify(data.hapModulesInfo[0].metadata)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(1); + expect(data.hapModulesInfo[0].metadata[0].name).assertEqual("MetaData1"); + expect(data.hapModulesInfo[0].metadata[0].value).assertEqual("MetaDataValue"); + expect(data.hapModulesInfo[0].metadata[0].resource).assertEqual("$profile:shortcuts_config"); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0132 + * @tc.name: getBundleInfoForSelfSigPro + * @tc.desc: Test getBundleInfoForSelf with signatureInfo flag(by promise). + */ + it('getBundleInfoForSelfSigPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO).then(data => { + console.info("SigPro" + JSON.stringify(data.signatureInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo.appId).assertEqual(APPID); + expect(data.signatureInfo.fingerprint).assertEqual(FINGERPRINT); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0133 + * @tc.name: getBundleInfoForSelfSigCal + * @tc.desc: Test getBundleInfoForSelf with signatureInfo flag(by callback). + */ + it('getBundleInfoForSelfSigCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO, (err, data) => { + console.info("SigCal" + JSON.stringify(data.signatureInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo.appId).assertEqual(APPID); + expect(data.signatureInfo.fingerprint).assertEqual(FINGERPRINT); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0134 + * @tc.name: getBundleInfoForSelfDisPro + * @tc.desc: Test getBundleInfoForSelf with disable flag(by promise). + */ + it('getBundleInfoForSelfDisPro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_DISABLE).then(data => { + console.info("DisPro" + JSON.stringify(data)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0135 + * @tc.name: getBundleInfoForSelfDisCal + * @tc.desc: Test getBundleInfoForSelf with disable flag(by callback). + */ + it('getBundleInfoForSelfDisCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_DISABLE, (err, data) => { + console.info("DisCal" + JSON.stringify(data)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0136 + * @tc.name: getBundleInfoForSelfParamErrPro + * @tc.desc: Test getBundleInfoForSelf with error param(by promise). + */ + it('getBundleInfoForSelfParamErrPro', 0, async function (done) { + try { + await bundle.getBundleInfoForSelf(null).then(data => { + console.info("ParamErrPro null success " + JSON.stringify(data)); + expect(data).assertFail(); + }).catch(err => { + console.info("ParamErrPro null fail1 " + JSON.stringify(err)); + expect(err).assertFail(); + }) + } catch (err) { + console.info("ParamErrPro null fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + } + try { + await bundle.getBundleInfoForSelf(undefined).then(data => { + console.info("ParamErrPro undefined success " + JSON.stringify(data)); + expect(data).assertFail(); + }).catch(err => { + console.info("ParamErrPro undefined fail1 " + JSON.stringify(err)); + expect(err).assertFail(); + }) + } catch (err) { + console.info("ParamErrPro undefined fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + done(); + } + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0137 + * @tc.name: getBundleInfoForSelfParamErrCal + * @tc.desc: Test getBundleInfoForSelf with error param(by callback). + */ + it('getBundleInfoForSelfParamErrCal', 0, async function (done) { + try { + bundle.getBundleInfoForSelf(null, (err, data) => { + console.info("ParamErrCal null success " + JSON.stringify(data)); + console.info("ParamErrCal null success " + JSON.stringify(err)); + expect(data).assertFail(); + }) + } catch (err) { + console.info("ParamErrCal null fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + } + await util.sleep(200); + try { + bundle.getBundleInfoForSelf(undefined, (err, data) => { + console.info("ParamErrCal undefined success " + JSON.stringify(data)); + console.info("ParamErrCal undefined success " + JSON.stringify(err)); + expect(data).assertFail(); + }) + } catch (err) { + console.info("ParamErrCal undefined fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + done(); + } + }) + + function checkCommonBundleInfo(data) { + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.vendor).assertEqual(VENDOR); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.targetVersion).assertEqual(8); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + console.info("checkCommonBundleInfo end"); + } + + function checkCommonApplicationInfo(data) { + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.description).assertEqual("$string:description_application"); + expect(data.appInfo.descriptionId).assertLarger(0); + expect(data.appInfo.enabled).assertTrue(); + expect(data.appInfo.label).assertEqual("$string:app_name"); + expect(data.appInfo.labelId).assertLarger(0); + expect(data.appInfo.icon).assertEqual("$media:icon"); + expect(data.appInfo.iconId).assertLarger(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage.test"); + expect(data.appInfo.removable).assertTrue(0); + expect(data.appInfo.accessTokenId).assertLarger(0); + expect(data.appInfo.uid).assertLarger(0); + expect(data.appInfo.iconResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.iconResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.iconResource.id).assertEqual(data.appInfo.iconId); + expect(data.appInfo.labelResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.labelResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.labelResource.id).assertEqual(data.appInfo.labelId); + expect(data.appInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.descriptionResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.descriptionResource.id).assertEqual(data.appInfo.descriptionId); + expect(data.appInfo.appDistributionType).assertEqual("os_integration"); + expect(data.appInfo.appProvisionType).assertEqual("release"); + expect(data.appInfo.systemApp).assertFalse(); + expect(JSON.stringify(data.appInfo.metadata)).assertEqual("{}"); + console.info("checkCommonApplicationInfo end"); + } + + function checkCommonHapModuleInfo(data) { + expect(data.hapModulesInfo.length).assertEqual(1); + expect(data.hapModulesInfo[0].name).assertEqual("testModule"); + expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc"); + expect(data.hapModulesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME); + expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2); + console.info("checkComm" + JSON.stringify(data.hapModulesInfo[0].deviceTypes[0])); + console.info("checkComm" + JSON.stringify(data.hapModulesInfo[0].deviceTypes[1])); + expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].installationFree).assertFalse(); + expect(data.hapModulesInfo[0].hashValue).assertEqual(""); + console.info("checkCommonHapModuleInfo end"); + } + + function checkCommonAbilityInfo(data) { + expect(data.bundleName).assertEqual(BUNDLE_NAME); + expect(data.moduleName).assertEqual("testModule"); + expect(data.label).assertEqual("$string:entry_label"); + expect(data.labelId).assertLarger(0); + expect(data.description).assertEqual("$string:testModule_entry_main"); + expect(data.descriptionId).assertLarger(0); + expect(data.icon).assertEqual("$media:icon"); + expect(data.iconId).assertLarger(0); + expect(data.process).assertEqual(""); + expect(data.exported).assertTrue(); + expect(data.type).assertEqual(1); + expect(data.permissions.length).assertEqual(0); + expect(data.readPermission).assertEqual(""); + expect(data.writePermission).assertEqual(""); + expect(data.uri).assertEqual(""); + expect(data.deviceTypes.length).assertEqual(2); + console.info("checkComm" + JSON.stringify(data.deviceTypes[0])); + console.info("checkComm" + JSON.stringify(data.deviceTypes[1])); + expect(data.deviceTypes[0]).assertEqual("default"); + expect(data.deviceTypes[1]).assertEqual("tablet"); + expect(data.applicationInfo).assertEqual(null); + expect(data.metadata.length).assertEqual(0); + expect(data.enabled).assertTrue(); + expect(data.supportWindowModes.length).assertEqual(3); + expect(data.supportWindowModes[0]).assertEqual(bundle.SupportWindowMode.FULL_SCREEN); + expect(data.supportWindowModes[1]).assertEqual(bundle.SupportWindowMode.SPLIT); + expect(data.supportWindowModes[2]).assertEqual(bundle.SupportWindowMode.FLOATING); + expect(data.windowSize.maxWindowRatio).assertEqual(0); + expect(data.windowSize.minWindowRatio).assertEqual(0); + expect(data.windowSize.maxWindowWidth).assertEqual(0); + expect(data.windowSize.minWindowWidth).assertEqual(0); + expect(data.windowSize.maxWindowHeight).assertEqual(0); + expect(data.windowSize.minWindowHeight).assertEqual(0); + console.info("checkCommonAbilityInfo end"); + } + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByAbility.test.ets new file mode 100644 index 000000000..8e5657b5e --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByAbility.test.ets @@ -0,0 +1,423 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import manager from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule" +const MODULE_NAME_TEST = "testModule1" +const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility" +const ABILITY_NAME1 = "ohos.acts.bundle.stage.test.MainAbility1" +const ABILITY_NAME_TEST = "ohos.acts.bundle.stage.test.MainAbilityTest" +const METADATA_NAME = "ohos.ability.form" +const METADATA_NAME1 = "ohos.ability.form1" +const METADATA_NAME2 = "ohos.ability.form2" +const METADATA_NAME3 = "ohos.ability.form3" +const METADATA_NAME4 = "ohos.ability.form4" +const METADATA_NAME_TEST = "ohos.test.form" +const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}" +const ERROR_ABILITY_NOT_EXIST = 17700003 +const ERROR_PROFILE_NOT_EXIST = 17700024 +const ERROR_MODULE_NOT_EXIST = 17700002 + +export default function getProfileByAbility() { + describe('getProfileByAbility', function () { + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0011 + * @tc.name: getProfileByAbilityInvalidModulePro + * @tc.desc: Check the invalid moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidModulePro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByAbilityInvalidModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityInvalidModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0015 + * @tc.name: getProfileByAbilityEmptyModulePro + * @tc.desc: Check the empty moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyModulePro', 0, async function (done) { + await manager.getProfileByAbility('', ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByAbilityEmptyModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityEmptyModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0017 + * @tc.name: getProfileByAbilityInvalidModuleCall + * @tc.desc: Check the invalid moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidModuleCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByAbilityInvalidModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0034 + * @tc.name: getProfileByAbilityEmptyModuleCall + * @tc.desc: Check the empty moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyModuleCall', 0, async function (done) { + manager.getProfileByAbility('', ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST); + console.error('[getProfileByAbilityEmptyModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0012 + * @tc.name: getProfileByAbilityInvalidAbilityPro + * @tc.desc: Check the invalid abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidAbilityPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME).then(data => { + console.info("getProfileByAbilityInvalidAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityInvalidAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByAbilityEmptyAbilityPro + * @tc.desc: Check the empty abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyAbilityPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, '', METADATA_NAME).then(data => { + console.info("getProfileByAbilityEmptyAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityEmptyAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0022 + * @tc.name: getProfileByAbilityInvalidAbilityCall + * @tc.desc: Check the invalid abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidAbilityCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByAbilityInvalidAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByAbilityEmptyAbilityCall + * @tc.desc: Check the empty abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyAbilityCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, '', METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByAbilityEmptyAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0024 + * @tc.name: getProfileByAbilityCallback + * @tc.desc: Check the valid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityCallback', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => { + console.info('[getProfileByAbilityCallback] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0026 + * @tc.name: getProfileByAbilityInvalidMetaDataCall + * @tc.desc: Check the invalid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidMetaDataCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByAbilityInvalidMetaDataCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0036 + * @tc.name: getProfileByAbilityEmptyMetaDataCall + * @tc.desc: Check the empty metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyMetaDataCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, '', (err, data) => { + console.info('[getProfileByAbilityEmptyMetaDataCall] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0002 + * @tc.name: getProfileByAbilityPromise + * @tc.desc: Check the valid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityPromise', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => { + console.info('[getProfileByAbilityPromise] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByAbilityPromise]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0004 + * @tc.name: getProfileByAbilityInvalidMetaDataPro + * @tc.desc: Check the invalid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidMetaDataPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST).then(data => { + console.info('[getProfileByAbilityInvalidMetaDataPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + done() + }).catch(err => { + console.error('[getProfileByAbilityInvalidMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0030 + * @tc.name: getProfileByAbilityEmptyMetaDataPro + * @tc.desc: Check the empty metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyMetaDataPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, '').then(data => { + console.info('[getProfileByAbilityEmptyMetaDataPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByAbilityEmptyMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0009 + * @tc.name: getProfileByAbilityNoMetaDataPro + * @tc.desc: without metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNoMetaDataPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME).then(data => { + console.info('[getProfileByAbilityNoMetaDataPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByAbilityNoMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0048 + * @tc.name: getProfileByAbilityNoProfilePro + * @tc.desc: no profile configured under the ability (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNoProfilePro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME1).then(data => { + console.info('[getProfileByAbilityNoProfilePro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(data).assertFail() + done(); + }).catch(err => { + console.error('[getProfileByAbilityNoProfilePro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0045 + * @tc.name: getProfileByAbilityNotPrefixPro + * @tc.desc: resource has no prefix '$profile:' (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNotPrefixPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2).then(data => { + console.info('[getProfileByAbilityNotPrefixPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(data).assertFail() + done(); + }).catch(err => { + console.error('[getProfileByAbilityNotPrefixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0044 + * @tc.name: getProfileByAbilityNotPrefixCall + * @tc.desc: resource has no prefix '$profile:' (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityNotPrefixCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByAbilityNotPrefixCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0007 + * @tc.name: getProfileByAbilityNotSuffixPro + * @tc.desc: profile is .txt suffix (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNotSuffixPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { + console.info('[getProfileByAbilityNotSuffixPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }).catch(err => { + console.error('[getProfileByAbilityNotSuffixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0040 + * @tc.name: getProfileByAbilityNotSuffixCall + * @tc.desc: profile is .txt suffix (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityNotSuffixCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { + console.info('[getProfileByAbilityNotSuffixCall] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0008 + * @tc.name: getProfileByAbilityNoJsonPro + * @tc.desc: profile is invalid json format (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNoJsonPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => { + console.info('[getProfileByAbilityNoJsonPro] data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByAbilityNoJsonPro] Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0046 + * @tc.name: getProfileByAbilityNoJsonCall + * @tc.desc: profile is invalid json format (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityNoJsonCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => { + console.info('[getProfileByAbilityNoJsonCall] err: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets new file mode 100644 index 000000000..c040c8f80 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets @@ -0,0 +1,424 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import manager from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule" +const MODULE_NAME_TEST = "testModule1" +const ABILITY_NAME = "Form" +const ABILITY_NAME1 = "Form1" +const ABILITY_NAME_TEST = "FromTest" +const METADATA_NAME = "ohos.extension.form" +const METADATA_NAME1 = "ohos.extension.form1" +const METADATA_NAME2 = "ohos.extension.form2" +const METADATA_NAME3 = "ohos.extension.form3" +const METADATA_NAME4 = "ohos.extension.form4" +const METADATA_NAME_TEST = "ohos.test.form" +const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}" +const ERROR_ABILITY_NOT_EXIST = 17700003 +const ERROR_PROFILE_NOT_EXIST = 17700024 +const ERROR_MODULE_NOT_EXIST = 17700002 + +export default function getProfileByExtensionAbility() { + describe('getProfileByExtensionAbility', function () { + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0011 + * @tc.name: getProfileByExtensionAbilityInvalidModulePro + * @tc.desc: Check the invalid moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidModulePro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityInvalidModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityInvalidModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0015 + * @tc.name: getProfileByExtensionAbilityEmptyModulePro + * @tc.desc: Check the empty moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyModulePro', 0, async function (done) { + await manager.getProfileByExtensionAbility('', ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityEmptyModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityEmptyModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0017 + * @tc.name: getProfileByExtensionAbilityInvalidModuleCall + * @tc.desc: Check the invalid moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidModuleCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByExtensionAbilityInvalidModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0034 + * @tc.name: getProfileByExtensionAbilityEmptyModuleCall + * @tc.desc: Check the empty moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyModuleCall', 0, async function (done) { + manager.getProfileByExtensionAbility('', ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST); + console.error('[getProfileByExtensionAbilityEmptyModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0012 + * @tc.name: getProfileByExtensionAbilityInvalidAbilityPro + * @tc.desc: Check the invalid abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidAbilityPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityInvalidAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityInvalidAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByExtensionAbilityEmptyAbilityPro + * @tc.desc: Check the empty abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyAbilityPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, '', METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityEmptyAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityEmptyAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0022 + * @tc.name: getProfileByExtensionAbilityInvalidAbilityCall + * @tc.desc: Check the invalid abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidAbilityCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByExtensionAbilityInvalidAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByExtensionAbilityEmptyAbilityCall + * @tc.desc: Check the empty abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyAbilityCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, '', METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByExtensionAbilityEmptyAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0024 + * @tc.name: getProfileByExtensionAbilityCallback + * @tc.desc: Check the valid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityCallback', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => { + console.info('[getProfileByExtensionAbilityCallback] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0026 + * @tc.name: getProfileByExtensionAbilityInvalidMetaDataCall + * @tc.desc: Check the invalid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidMetaDataCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByExtensionAbilityInvalidMetaDataCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0036 + * @tc.name: getProfileByExtensionAbilityEmptyMetaDataCall + * @tc.desc: Check the empty metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyMetaDataCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, '', (err, data) => { + console.info('[getProfileByExtensionAbilityEmptyMetaDataCall] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0002 + * @tc.name: getProfileByExtensionAbilityPromise + * @tc.desc: Check the valid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityPromise', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => { + console.info('[getProfileByExtensionAbilityPromise] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityPromise]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0004 + * @tc.name: getProfileByExtensionAbilityInvalidMetaDataPro + * @tc.desc: Check the invalid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidMetaDataPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST).then(data => { + console.info('[getProfileByExtensionAbilityInvalidMetaDataPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect().assertFail(); + done() + }).catch(err => { + console.error('[getProfileByExtensionAbilityInvalidMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0030 + * @tc.name: getProfileByExtensionAbilityEmptyMetaDataPro + * @tc.desc: Check the empty metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyMetaDataPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, '').then(data => { + console.info('[getProfileByExtensionAbilityEmptyMetaDataPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityEmptyMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0009 + * @tc.name: getProfileByExtensionAbilityNoMetaDataPro + * @tc.desc: without metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoMetaDataPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME).then(data => { + console.info('[getProfileByExtensionAbilityNoMetaDataPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNoMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0048 + * @tc.name: getProfileByExtensionAbilityNoProfilePro + * @tc.desc: no profile configured under the ability (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoProfilePro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1).then(data => { + console.info('[getProfileByExtensionAbilityNoProfilePro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNoProfilePro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0045 + * @tc.name: getProfileByExtensionAbilityNotPrefixPro + * @tc.desc: resource has no prefix '$profile:' (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotPrefixPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2).then(data => { + console.info('[getProfileByExtensionAbilityNotPrefixPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNotPrefixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0044 + * @tc.name: getProfileByExtensionAbilityNotPrefixCall + * @tc.desc: resource has no prefix '$profile:' (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotPrefixCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByExtensionAbilityNotPrefixCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0007 + * @tc.name: getProfileByExtensionAbilityNotSuffixPro + * @tc.desc: profile is .txt suffix (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotSuffixPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { + console.info('[getProfileByExtensionAbilityNotSuffixPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNotSuffixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0040 + * @tc.name: getProfileByExtensionAbilityNotSuffixCall + * @tc.desc: profile is .txt suffix (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotSuffixCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { + console.info('[getProfileByExtensionAbilityNotSuffixCall] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0008 + * @tc.name: getProfileByExtensionAbilityNoJsonPro + * @tc.desc: profile is invalid json format (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoJsonPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => { + console.info('[getProfileByExtensionAbilityNoJsonPro] data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNoJsonPro] Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0046 + * @tc.name: getProfileByExtensionAbilityNoJsonCall + * @tc.desc: profile is invalid json format (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoJsonCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => { + console.info('[getProfileByExtensionAbilityNoJsonCall] err: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetSecondModule.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetSecondModule.test.ets new file mode 100644 index 000000000..2c00ddfe0 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/GetSecondModule.test.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, it, expect } from '@ohos/hypium' + +export default function GetSecondModuleTest() { + describe('getSecondModuleTest', function () { + + /** + * @tc.number SUB_BMS_APPINFO_QUERY_0138 + * @tc.name GetSecondModuleTest + * @tc.desc Test the bundleManager secondary module + */ + it('GetSecondModuleTest', 0, async function (done) { + let bundleInfo = await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION) + let applicationInfoTest: bundle.ApplicationInfo = bundleInfo.appInfo; + expect(typeof (applicationInfoTest.name)).assertEqual('string'); + let metadataTest: bundle.Metadata = bundleInfo.hapModulesInfo[0].metadata[0]; + expect(typeof (metadataTest.name)).assertEqual('string'); + let bundleInfoTest: bundle.BundleInfo = bundleInfo; + expect(typeof (bundleInfoTest.name)).assertEqual('string'); + let usedSceneTest: bundle.UsedScene = bundleInfo.reqPermissionDetails[0].usedScene + expect(typeof (usedSceneTest.abilities[0])).assertEqual('string'); + let reqPermissionDetailsTest: bundle.ReqPermissionDetail = bundleInfo.reqPermissionDetails[0] + expect(typeof (reqPermissionDetailsTest.name)).assertEqual('string'); + let signatureInfoTest: bundle.SignatureInfo = bundleInfo.signatureInfo; + expect(typeof (signatureInfoTest.appId)).assertEqual('string'); + let hapModuleInfoTest: bundle.HapModuleInfo = bundleInfo.hapModulesInfo[0]; + expect(typeof (hapModuleInfoTest.name)).assertEqual('string'); + let abilityInfoTest: bundle.AbilityInfo = bundleInfo.hapModulesInfo[0].abilitiesInfo[0]; + expect(typeof (abilityInfoTest.bundleName)).assertEqual('string'); + let windowSizeTest: bundle.WindowSize = bundleInfo.hapModulesInfo[0].abilitiesInfo[0].windowSize; + expect(windowSizeTest.maxWindowRatio).assertEqual(0); + let extensionAbilityInfoTest: bundle.ExtensionAbilityInfo = bundleInfo.hapModulesInfo[0].extensionAbilitiesInfo[0]; + expect(typeof (extensionAbilityInfoTest.bundleName)).assertEqual('string'); + let elementNameExample = { + deviceId: "123456789", + bundleName: "bundleName", + moduleName:"moduleName", + abilityName: "abilityName", + uri:"uri", + shortName:"shortName" + } + let elementNameTest: bundle.ElementName = elementNameExample; + expect(elementNameTest.deviceId).assertEqual("123456789"); + expect(elementNameTest.bundleName).assertEqual("bundleName"); + expect(elementNameTest.moduleName).assertEqual("moduleName"); + expect(elementNameTest.abilityName).assertEqual("abilityName"); + expect(elementNameTest.uri).assertEqual("uri"); + expect(elementNameTest.shortName).assertEqual("shortName"); + done(); + }) + }) + +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..ee7616939 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import getProfileByAbility from './GetProfileByAbility.test.ets'; +import getProfileByExtensionAbility from './GetProfileByExtensionAbility.test.ets'; +import getBundleInfoForSelf from './GetBundleInfoForSelf.test.ets'; +import getSecondModuleTest from './GetSecondModule.test.ets'; + +export default function testsuite() { + getProfileByAbility(); + getProfileByExtensionAbility(); + getBundleInfoForSelf(); + getSecondModuleTest(); +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/Utils.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/Utils.ets new file mode 100644 index 000000000..f3b5fe7f6 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/ets/test/Utils.ets @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout((data) => { + resolve(data) + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } +} + + + + diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/module.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/module.json new file mode 100644 index 000000000..082abb9b6 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/module.json @@ -0,0 +1,39 @@ +{ + "module": { + "name": "feature", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:testModule_entry_dsc", + "mainElement": "ohos.acts.atomic.service.test.MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": true, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "ohos.acts.atomic.service.test.MainAbility1", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:testModule_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "launchType": "singleton", + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities":[ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..a4e9ba5b8 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/element/string.json @@ -0,0 +1,44 @@ +{ + "string": [ + { + "name": "testModule_entry_dsc", + "value": "i am an entry for testModule" + }, + { + "name": "testModule_entry_main", + "value": "the testModule entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + }, + { + "name": "form_FormAbility_desc", + "value": "form_description" + }, + { + "name": "form_FormAbility_label", + "value": "form_label" + }, + { + "name": "permission_reason", + "value": "Need permission" + } + ] +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/media/icon.png b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 GIT binary patch literal 15458 zcmV-oJe|XdP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXfJNHRMK~#8N)t$?W zZ`*d)f6uD@IOn2&LJ;lP6@!gHh#>Y1!r&0HL_gDqb&`3X(Z=GaQp8SP` z92In5!tr>lHv4nxKS1{J@p1P!+F4$_JksuYcRrnVr_*tFKEi|jF}%m8r`_Y_l6p^% z@+LnCznqL`mDBrry9$FzRWuxkQF=}GpwhbiR|yW zmfjQNx4tFelhpeM=s1qPZ}7VBtuHUqIh+_+IvN7$>(jXIa?55SEAd6rfw_FG^Ciq> zUAOb*d;6XH7UwzzrTnE1QtLJmPK4||=GS#JMbf8dX;2o^T+5qYx7QF%t86tY^M!6V zrngTY z1udv}ju^g5nNRXGgh*Bp3Mrd$sWa|p#az3e^Glh~4OYDwx?a*KW72*IFc`5a72{iM zp*N~%>#A7GyQ5CGc@5sreOI4Vr-jh46-ty$UgtlNS4u^>BKcJpW(i@*S9!$UCqmcd z(U6LQxPK-@LYcI@ROQlUqYfv9)@pP1D z^PGd_#Bn=j?h;(A2YP*^zO{q!-impmO*sshM)pxC{aRnxpLI$OVz(ElViw;?d~N$q$^VbIP>sa0q0)N~6iq!!fI>IcRGDdADCq?$^K61=g>C{IY# z;~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}R8!%NJeZ{_C?c;3;(Bhvgl9`1TUrhJs+)3eHTVN^Wtf9v1;w`bk-!U80# zPb4Nai`;Q4VyWJmBm(HGVb%x!$o9g(m z@BNm8)L5LW41ks^%nDsO9dc#n{!ihj%?OK8jS5s)q|ox6AsyuMaEws?(61<4>Dl&% z(AowWE}sZbd2$Fpd3X!W{44-|eRU%5z)~*gA?R**Vyu2$E5~BWM~PgBBq$=kqGE67 z`@|=dDkKs@MXyRk(q=Sb__5!7i&kaqd|~>q`yW64akf!;YC=W70<8l5tW13-+~|Y; zkOj7m+O z!5pPf&u5hW8I_=fD zD*;20N{)BIOQ{tj;NRl5w-|ch2}M5c{wK!f>CfqKoBq&WEM66PqkaN5`Y)t8TRI`--F?$f7FyF2*vpx(dgmuRWV_Q&1- Y0jIQKqpXab7ytkO07*qoM6N<$f;yQ2zW@LL literal 0 HcmV?d00001 diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 000000000..e892d4472 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config1.txt b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config1.txt new file mode 100644 index 000000000..32f9ff7dc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/form_config1.txt @@ -0,0 +1 @@ +{"src": ["MainAbility/pages/index/index","MainAbility/pages/second/second"]} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/invalid.txt b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/invalid.txt new file mode 100644 index 000000000..cdca51a17 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/invalid.txt @@ -0,0 +1,5 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/main_pages.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..02221db61 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/shortcuts_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/shortcuts_config.json new file mode 100644 index 000000000..02221db61 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/entry/src/main/resources/base/profile/shortcuts_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/signature/openharmony_sx.p7b b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceone/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..616445c708cb010b974dcdfad16af541d40d2f6f GIT binary patch literal 3468 zcmcgvYj6|S6}BFhV~ntg0RsVSgu%RI-<2g>a$f98s~29$D@(TIh?cK#S^UnVxD6!5F+Pt6i9wDid*%W?j}!>`Jdn(s z{0PYFOlH0yOlB6$lC+YMXn>}qZrVdis$^3iIw&HN2*c)rIb*S04kSzy(FaM&`eu6H8?^BNg_&e4k8?udIC`<5^%+s)Ox)L zI@%bZ7}6IZQeF<&N(2L*0MjO^nkAuVM(QHHbcCA=QmEw03WZFeoSOC%UWSZt?h2(! zURln$XHS*5Vw5LHN&}RaP7U{vtz?i6lM!i}x;aczdLj~{sWxt%eq`Kagb8>9Zh}d% zmZp9Psxz31)TqU3&>GaR6-|4c6lO4}v4mO;yGS3*8W7lLKnb(DETMrh#OG`AH#eDU za9jhkHW<@kadiSVB0f_c0z0g5v&qcOV8L0`=g`#Q_;i$IYTUZISglUm=Bii4NGsZa zA#NQE*-&*H!>#2=(ADhsyF*Z`i)!}O>FWGW%4J2HFg2P+!Euau9EIBv)};$JIqa6O zOD6Z>0A=-lw+U-PS*!_e<2YCiakCYR*K=Nzra6u^VeyB)CWOZDD67WP9Cavb)L5HP z8-^Hqc=@qvC-vBxah(;m_k3s6ilQpEpq>f zaJ|CoX?EyMaz!h!m&1A@4#}Eo5D%)Mqgsoh0V3_8xY?1Y)j266i+Q7Zzs;rss4{2( zR=cBtGKG8?6s22ZE)s8ntu$m{Z5r5{Vy>^nP@M*@_aRo7KjIEJDJ^5GrfsqE^4hw} zm>1Q02?JwEz~(d>S0b=ii6StjM&vN7Pi52s%n0H@wKYsU67vV0l-q*fQKN@-H?&m8 zRJ6%f=OZwf)v47jx>`)G;znx_9M%vp%r@YLIBaAHP=m|Da*ZKY7LGcpY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PXAI{@uaKEpx*5MaSm65Z>Fm z?Y%!+K>hyD*G#OaInedaM{7r}+j?u!qP$zDJH{@$J9p;(DTQ~hAHTf(N2zVI8xZ}P z(-SrFe`xH9&8^=FBk*Sck`F@Xf2N%G26J=nyLYSnjXRH3Y`A(P@7THgtFyg%=5D?1 zi$(1t{9T5BpS|8S^vv~hgSlpP^f{W{Sryr6>6#$Dcfh{u4z z%Oc&&iK}4;v&?rw{??11mqJP2G)`nMaTf>B{7km7_eAY`N9hcJ;ScX9*#d}*{qJVO z1EU@q*_lu-cPN&F)PczT^_NvNfU-wXAtVtN{pG}|Q)Lrpe)(0dt8DAF+_HU3^REp5 z&~slh2Y7Qv9n`++>e{ { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/MainAbility/pages/second/second.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 000000000..f9009a3e8 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/ServiceAbility/FormAbility.ts b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/ServiceAbility/FormAbility.ts new file mode 100644 index 000000000..d44363110 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/ServiceAbility/FormAbility.ts @@ -0,0 +1,37 @@ +import FormExtension from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formInfo from '@ohos.application.formInfo'; + +export default class FormAbility extends FormExtension { + onCreate(want) { + // Called to return a FormBindingData object. + let formData = {}; + return formBindingData.createFormBindingData(formData); + } + + onCastToNormal(formId) { + // Called when the form provider is notified that a temporary form is successfully + // converted to a normal form. + } + + onUpdate(formId) { + // Called to notify the form provider to update a specified form. + } + + onVisibilityChange(newStatus) { + // Called when the form provider receives form events from the system. + } + + onEvent(formId, message) { + // Called when a specified message event defined by the form provider is triggered. + } + + onDestroy(formId) { + // Called to notify the form provider that a specified form has been destroyed. + } + + onAcquireFormState(want) { + // Called to return a {@link FormState} object. + return formInfo.FormState.READY; + } +}; \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets new file mode 100644 index 000000000..9e40c5b25 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets @@ -0,0 +1,1097 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle.bundleManager'; +import util from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const BUNDLE_NAME = "ohos.acts.bundle.stage.test"; +const VENDOR = "huawei"; +const MODULE_NAME = "testModule"; +const SOURCE_DIR = "/data/app/el1/bundle/public/ohos.acts.bundle.stage.test/testModule"; +const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility"; +const ABILITY_NAME1 = "ohos.acts.bundle.stage.test.MainAbility1"; +const APPID = "ohos.acts.bundle.stage.test_BNtg4JBClbl92Rgc3jm/RfcAdrHXaM8F0QO" + +"iwVEhnV5ebE5jNIYnAx+weFRT3QTyUjRNdhmc2aAzWyi+5t5CoBM="; +const FINGERPRINT = "8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"; +const PARAM_ERROR_CODE = 401; + +export default function getBundleInfoForSelf() { + describe('getBundleInfoForSelf', function () { + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0118 + * @tc.name: getBundleInfoForSelfPro + * @tc.desc: Test getBundleInfoForSelf with default flag(by promise). + */ + it('getBundleInfoForSelfPro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT).then(data => { + console.info("getBundleInfoForSelfPro" + JSON.stringify(data)); + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.vendor).assertEqual(VENDOR); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.targetVersion).assertEqual(8); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0119 + * @tc.name: getBundleInfoForSelfCal + * @tc.desc: Test getBundleInfoForSelf with default flag(by callback). + */ + it('getBundleInfoForSelfCal', 0, async function (done) { + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT, (err, data) => { + console.info("getBundleInfoForSelfCal" + JSON.stringify(data)); + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.vendor).assertEqual(VENDOR); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.targetVersion).assertEqual(8); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0120 + * @tc.name: getBundleInfoForSelfApplicationPro + * @tc.desc: Test getBundleInfoForSelf with application flag(by promise). + */ + it('getBundleInfoForSelfApplicationPro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then(data => { + console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.description).assertEqual("$string:description_application"); + expect(data.appInfo.descriptionId).assertLarger(0); + expect(data.appInfo.enabled).assertTrue(); + expect(data.appInfo.label).assertEqual("$string:app_name"); + expect(data.appInfo.labelId).assertLarger(0); + expect(data.appInfo.icon).assertEqual("$media:icon"); + expect(data.appInfo.iconId).assertLarger(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage.test"); + expect(data.appInfo.removable).assertTrue(0); + expect(data.appInfo.accessTokenId).assertLarger(0); + expect(data.appInfo.uid).assertLarger(0); + expect(data.appInfo.iconResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.iconResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.iconResource.id).assertEqual(data.appInfo.iconId); + expect(data.appInfo.labelResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.labelResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.labelResource.id).assertEqual(data.appInfo.labelId); + expect(data.appInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.descriptionResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.descriptionResource.id).assertEqual(data.appInfo.descriptionId); + expect(data.appInfo.appDistributionType).assertEqual("os_integration"); + expect(data.appInfo.appProvisionType).assertEqual("release"); + expect(data.appInfo.permissions.length).assertEqual(0); + expect(data.appInfo.systemApp).assertFalse(); + expect(JSON.stringify(data.appInfo.metadata)).assertEqual("{}"); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0121 + * @tc.name: getBundleInfoForSelfApplicationCal + * @tc.desc: Test getBundleInfoForSelf with application flag(by callback). + */ + it('getBundleInfoForSelfApplicationCal', 0, async function (done) { + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION, (err, data) => { + console.info("ApplicationCal" + JSON.stringify(data.appInfo)); + for (let i in data.appInfo) { + console.info("name" + JSON.stringify(i)); + console.info("name" + JSON.stringify(data.appInfo[i])); + } + checkCommonBundleInfo(data); + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.description).assertEqual("$string:description_application"); + expect(data.appInfo.descriptionId).assertLarger(0); + expect(data.appInfo.enabled).assertTrue(); + expect(data.appInfo.label).assertEqual("$string:app_name"); + expect(data.appInfo.labelId).assertLarger(0); + expect(data.appInfo.icon).assertEqual("$media:icon"); + expect(data.appInfo.iconId).assertLarger(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage.test"); + expect(data.appInfo.removable).assertTrue(0); + expect(data.appInfo.accessTokenId).assertLarger(0); + expect(data.appInfo.uid).assertLarger(0); + expect(data.appInfo.iconResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.iconResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.iconResource.id).assertEqual(data.appInfo.iconId); + expect(data.appInfo.labelResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.labelResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.labelResource.id).assertEqual(data.appInfo.labelId); + expect(data.appInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.descriptionResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.descriptionResource.id).assertEqual(data.appInfo.descriptionId); + expect(data.appInfo.appDistributionType).assertEqual("os_integration"); + expect(data.appInfo.appProvisionType).assertEqual("release"); + expect(data.appInfo.permissions.length).assertEqual(0); + expect(data.appInfo.systemApp).assertFalse(); + expect(JSON.stringify(data.appInfo.metadata)).assertEqual("{}"); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0122 + * @tc.name: getBundleInfoForSelfModulePro + * @tc.desc: Test getBundleInfoForSelf with hapModuleInfo flag(by promise). + */ + it('getBundleInfoForSelfModulePro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE).then(data => { + console.info("ModulePro" + JSON.stringify(data.hapModulesInfo[0])); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(1); + expect(data.hapModulesInfo[0].name).assertEqual("testModule"); + expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc"); + expect(data.hapModulesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2); + expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].installationFree).assertFalse(); + expect(data.hapModulesInfo[0].hashValue).assertEqual(""); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0123 + * @tc.name: getBundleInfoForSelfModuleCal + * @tc.desc: Test getBundleInfoForSelf with hapModuleInfo flag(by callback). + */ + it('getBundleInfoForSelfModuleCal', 0, async function (done) { + bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE, (err, data) => { + console.info("getBundleInfoForSelfPro" + JSON.stringify(data.hapModulesInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(1); + expect(data.hapModulesInfo[0].name).assertEqual("testModule"); + expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc"); + expect(data.hapModulesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2); + expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].installationFree).assertFalse(); + expect(data.hapModulesInfo[0].hashValue).assertEqual(""); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0124 + * @tc.name: getBundleInfoForSelfAbilityPro + * @tc.desc: Test getBundleInfoForSelf with ability flag(by promise). + */ + it('getBundleInfoForSelfAbilityPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY + ).then(data => { + for (let count = 0; count < 11; count++) { + console.info(count + "AbilityPro::" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[count])); + } + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(11); + expect(data.hapModulesInfo[0].abilitiesInfo[0].bundleName).assertEqual(BUNDLE_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo[0].moduleName).assertEqual("testModule"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].description).assertEqual("$string:testModule_entry_main"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].process).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].exported).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].type).assertEqual(1); + expect(data.hapModulesInfo[0].abilitiesInfo[0].orientation).assertEqual(bundle.DisplayOrientation.PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].launchType).assertEqual(bundle.LaunchType.SINGLETON); + expect(data.hapModulesInfo[0].abilitiesInfo[0].permissions.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].readPermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].writePermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].uri).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes.length).assertEqual(2); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0])); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1])); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].applicationInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].enabled).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes.length).assertEqual(3); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[0]) + .assertEqual(bundle.SupportWindowMode.FULL_SCREEN); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[1]) + .assertEqual(bundle.SupportWindowMode.SPLIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[2]) + .assertEqual(bundle.SupportWindowMode.FLOATING); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[1].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility1"); + expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.MULTITON); + expect(data.hapModulesInfo[0].abilitiesInfo[1].orientation).assertEqual(bundle.DisplayOrientation.LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[2].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility10"); + expect(data.hapModulesInfo[0].abilitiesInfo[2].orientation).assertEqual(bundle.DisplayOrientation.LOCKED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility2"); + expect(data.hapModulesInfo[0].abilitiesInfo[3].launchType).assertEqual(bundle.LaunchType.SPECIFIED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].orientation) + .assertEqual(bundle.DisplayOrientation.LANDSCAPE_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[4].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility3"); + expect(data.hapModulesInfo[0].abilitiesInfo[4].orientation) + .assertEqual(bundle.DisplayOrientation.PORTRAIT_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[5].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility4"); + expect(data.hapModulesInfo[0].abilitiesInfo[5].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION); + expect(data.hapModulesInfo[0].abilitiesInfo[6].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility5"); + expect(data.hapModulesInfo[0].abilitiesInfo[6].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[7].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility6"); + expect(data.hapModulesInfo[0].abilitiesInfo[7].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[8].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility7"); + expect(data.hapModulesInfo[0].abilitiesInfo[8].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[9].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility8"); + expect(data.hapModulesInfo[0].abilitiesInfo[9].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[10].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility9"); + expect(data.hapModulesInfo[0].abilitiesInfo[10].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT_RESTRICTED); + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[1]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[2]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[3]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[4]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[5]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[6]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[7]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[8]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[9]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[10]) + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0125 + * @tc.name: getBundleInfoForSelfAbilityCal + * @tc.desc: Test getBundleInfoForSelf with ability flag(by callback). + */ + it('getBundleInfoForSelfAbilityCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY, + (err, data) => { + console.info("AbilityCal" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0])); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(11); + expect(data.hapModulesInfo[0].abilitiesInfo[0].bundleName).assertEqual(BUNDLE_NAME); + expect(data.hapModulesInfo[0].abilitiesInfo[0].moduleName).assertEqual("testModule"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].description).assertEqual("$string:testModule_entry_main"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].process).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].exported).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].type).assertEqual(1); + expect(data.hapModulesInfo[0].abilitiesInfo[0].orientation).assertEqual(bundle.DisplayOrientation.PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].launchType).assertEqual(bundle.LaunchType.SINGLETON); + expect(data.hapModulesInfo[0].abilitiesInfo[0].permissions.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].readPermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].writePermission).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].uri).assertEqual(""); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes.length).assertEqual(2); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0])); + console.info("AbilityPro" + JSON.stringify(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1])); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].abilitiesInfo[0].applicationInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo[0].metadata.length).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].enabled).assertTrue(); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes.length).assertEqual(3); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[0]) + .assertEqual(bundle.SupportWindowMode.FULL_SCREEN); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[1]) + .assertEqual(bundle.SupportWindowMode.SPLIT); + expect(data.hapModulesInfo[0].abilitiesInfo[0].supportWindowModes[2]) + .assertEqual(bundle.SupportWindowMode.FLOATING); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowRatio).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowWidth).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowHeight).assertEqual(0); + expect(data.hapModulesInfo[0].abilitiesInfo[1].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility1"); + expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.MULTITON); + expect(data.hapModulesInfo[0].abilitiesInfo[1].orientation).assertEqual(bundle.DisplayOrientation.LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[2].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility10"); + expect(data.hapModulesInfo[0].abilitiesInfo[2].orientation).assertEqual(bundle.DisplayOrientation.LOCKED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility2"); + expect(data.hapModulesInfo[0].abilitiesInfo[3].launchType).assertEqual(bundle.LaunchType.SPECIFIED); + expect(data.hapModulesInfo[0].abilitiesInfo[3].orientation) + .assertEqual(bundle.DisplayOrientation.LANDSCAPE_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[4].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility3"); + expect(data.hapModulesInfo[0].abilitiesInfo[4].orientation) + .assertEqual(bundle.DisplayOrientation.PORTRAIT_INVERTED); + expect(data.hapModulesInfo[0].abilitiesInfo[5].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility4"); + expect(data.hapModulesInfo[0].abilitiesInfo[5].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION); + expect(data.hapModulesInfo[0].abilitiesInfo[6].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility5"); + expect(data.hapModulesInfo[0].abilitiesInfo[6].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE); + expect(data.hapModulesInfo[0].abilitiesInfo[7].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility6"); + expect(data.hapModulesInfo[0].abilitiesInfo[7].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT); + expect(data.hapModulesInfo[0].abilitiesInfo[8].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility7"); + expect(data.hapModulesInfo[0].abilitiesInfo[8].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[9].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility8"); + expect(data.hapModulesInfo[0].abilitiesInfo[9].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); + expect(data.hapModulesInfo[0].abilitiesInfo[10].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility9"); + expect(data.hapModulesInfo[0].abilitiesInfo[10].orientation) + .assertEqual(bundle.DisplayOrientation.AUTO_ROTATION_PORTRAIT_RESTRICTED); + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[1]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[2]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[3]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[4]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[5]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[6]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[7]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[8]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[9]) + checkCommonAbilityInfo(data.hapModulesInfo[0].abilitiesInfo[10]) + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0126 + * @tc.name: getBundleInfoForSelfExtensionPro + * @tc.desc: Test getBundleInfoForSelf with extensionAbility flag(by promise). + */ + it('getBundleInfoForSelfExtensionPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY + ).then(data => { + console.info("ExtensionPro" + JSON.stringify(data.hapModulesInfo[0].extensionAbilitiesInfo)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + let extensionList = data.hapModulesInfo[0].extensionAbilitiesInfo + expect(extensionList.length).assertEqual(13); + let count = 0; + for (let i = 0;i < 13; i++) { + switch (extensionList[i].name) { + case "Form": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 1; + break; + case "Form1": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form1"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 2; + break; + case 'workScheduler': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WORK_SCHEDULER) + count = count + 3; + break; + case 'inputMethod': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.INPUT_METHOD) + count = count + 4; + break; + case 'accessibility': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ACCESSIBILITY) + count = count + 5; + break; + case 'fileShare': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FILE_SHARE) + count = count + 6; + break; + case 'staticSubscriber': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.STATIC_SUBSCRIBER) + count = count + 7; + break; + case 'wallpaper': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WALLPAPER) + count = count + 8; + break; + case 'backup': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.BACKUP) + count = count + 9; + break; + case 'window': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WINDOW) + count = count + 10; + break; + case 'enterpriseAdmin': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ENTERPRISE_ADMIN) + count = count + 11; + break; + case 'thumbnail': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.THUMBNAIL) + count = count + 12; + break; + case 'preview': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PREVIEW) + count = count + 13; + break; + } + console.info("count" + JSON.stringify(count)); + } + expect(count).assertEqual(91); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0127 + * @tc.name: getBundleInfoForSelfExtensionCal + * @tc.desc: Test getBundleInfoForSelf with extensionAbility flag(by callback). + */ + it('getBundleInfoForSelfExtensionCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY, + (err, data) => { + console.info("ExtensionCal" + JSON.stringify(data.hapModulesInfo[0].extensionAbilitiesInfo)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + let extensionList = data.hapModulesInfo[0].extensionAbilitiesInfo + let count = 0; + for (let i = 0;i < 13; i++) { + switch (extensionList[i].name) { + case "Form": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 1; + break; + case "Form1": + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].bundleName).assertEqual(BUNDLE_NAME); + expect(extensionList[i].moduleName).assertEqual("testModule"); + expect(extensionList[i].name).assertEqual("Form1"); + expect(extensionList[i].labelId).assertLarger(0); + expect(extensionList[i].descriptionId).assertLarger(0); + expect(extensionList[i].iconId).assertLarger(0); + expect(extensionList[i].exported).assertTrue(); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM); + expect(extensionList[i].permissions.length).assertEqual(0); + expect(extensionList[i].applicationInfo).assertEqual(null); + expect(extensionList[i].metadata.length).assertEqual(0); + expect(extensionList[i].enabled).assertTrue(); + expect(extensionList[i].readPermission).assertEqual(""); + expect(extensionList[i].writePermission).assertEqual(""); + count = count + 2; + break; + case 'workScheduler': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WORK_SCHEDULER) + count = count + 3; + break; + case 'inputMethod': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.INPUT_METHOD) + count = count + 4; + break; + case 'accessibility': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ACCESSIBILITY) + count = count + 5; + break; + case 'fileShare': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FILE_SHARE) + count = count + 6; + break; + case 'staticSubscriber': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.STATIC_SUBSCRIBER) + count = count + 7; + break; + case 'wallpaper': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WALLPAPER) + count = count + 8; + break; + case 'backup': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.BACKUP) + count = count + 9; + break; + case 'window': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.WINDOW) + count = count + 10; + break; + case 'enterpriseAdmin': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.ENTERPRISE_ADMIN) + count = count + 11; + break; + case 'thumbnail': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.THUMBNAIL) + count = count + 12; + break; + case 'preview': + console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PREVIEW) + count = count + 13; + break; + } + console.info("count" + JSON.stringify(count)); + } + expect(count).assertEqual(91); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + expect(bundle.ExtensionAbilityType.SERVICE).assertEqual(3); + expect(bundle.ExtensionAbilityType.DATA_SHARE).assertEqual(5); + expect(bundle.ExtensionAbilityType.UNSPECIFIED).assertEqual(255); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0128 + * @tc.name: getBundleInfoForSelfPermissionPro + * @tc.desc: Test getBundleInfoForSelf with permission flag(by promise). + */ + it('getBundleInfoForSelfPermissionPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION).then(data => { + console.info("PermissionPro" + JSON.stringify(data.reqPermissionDetails)); + console.info("PermissionPro" + JSON.stringify(data.permissionGrantStates)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(2); + expect(data.reqPermissionDetails[0].name).assertEqual("ohos.permission.GET_BUNDLE_INFO"); + expect(data.reqPermissionDetails[0].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[0].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[0].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[0].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[0].usedScene.when).assertEqual("always"); + expect(data.permissionGrantStates[0]).assertEqual(bundle.PermissionGrantState.PERMISSION_GRANTED); + expect(data.reqPermissionDetails[1].name).assertEqual("ohos.permission.READ_CALENDAR"); + expect(data.reqPermissionDetails[1].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[1].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[1].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[1].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[1].usedScene.when).assertEqual("inuse"); + expect(data.permissionGrantStates[1]).assertEqual(bundle.PermissionGrantState.PERMISSION_DENIED); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0129 + * @tc.name: getBundleInfoForSelfPermissionCal + * @tc.desc: Test getBundleInfoForSelf with permission flag(by callback). + */ + it('getBundleInfoForSelfPermissionCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION, (err, data) => { + console.info("PermissionPro" + JSON.stringify(data.reqPermissionDetails)); + console.info("PermissionPro" + JSON.stringify(data.permissionGrantStates)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.reqPermissionDetails.length).assertEqual(2); + expect(data.reqPermissionDetails[0].name).assertEqual("ohos.permission.GET_BUNDLE_INFO"); + expect(data.reqPermissionDetails[0].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[0].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[0].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[0].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[0].usedScene.when).assertEqual("always"); + expect(data.permissionGrantStates[0]).assertEqual(bundle.PermissionGrantState.PERMISSION_GRANTED); + expect(data.reqPermissionDetails[1].name).assertEqual("ohos.permission.READ_CALENDAR"); + expect(data.reqPermissionDetails[1].reason).assertEqual("$string:permission_reason"); + expect(data.reqPermissionDetails[1].reasonId).assertLarger(0); + expect(data.reqPermissionDetails[1].usedScene.abilities.length).assertEqual(1); + expect(data.reqPermissionDetails[1].usedScene.abilities[0]).assertEqual("MainAbility"); + expect(data.reqPermissionDetails[1].usedScene.when).assertEqual("inuse"); + expect(data.permissionGrantStates[1]).assertEqual(bundle.PermissionGrantState.PERMISSION_DENIED); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0130 + * @tc.name: getBundleInfoForSelfMetaPro + * @tc.desc: Test getBundleInfoForSelf with metadata flag(by promise). + */ + it('getBundleInfoForSelfMetaPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA) + .then(data => { + console.info("MetaPro" + JSON.stringify(data.hapModulesInfo[0].metadata)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(1); + expect(data.hapModulesInfo[0].metadata[0].name).assertEqual("MetaData1"); + expect(data.hapModulesInfo[0].metadata[0].value).assertEqual("MetaDataValue"); + expect(data.hapModulesInfo[0].metadata[0].resource).assertEqual("$profile:shortcuts_config"); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }) + .catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0131 + * @tc.name: getBundleInfoForSelfMetaCal + * @tc.desc: Test getBundleInfoForSelf with metadata flag(by callback). + */ + it('getBundleInfoForSelfMetaCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | bundle.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA, + (err, data) => { + console.info("MetaPro" + JSON.stringify(data.hapModulesInfo[0].metadata)); + checkCommonBundleInfo(data); + checkCommonHapModuleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].extensionAbilitiesInfo.length).assertEqual(0); + expect(data.hapModulesInfo[0].metadata.length).assertEqual(1); + expect(data.hapModulesInfo[0].metadata[0].name).assertEqual("MetaData1"); + expect(data.hapModulesInfo[0].metadata[0].value).assertEqual("MetaDataValue"); + expect(data.hapModulesInfo[0].metadata[0].resource).assertEqual("$profile:shortcuts_config"); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0132 + * @tc.name: getBundleInfoForSelfSigPro + * @tc.desc: Test getBundleInfoForSelf with signatureInfo flag(by promise). + */ + it('getBundleInfoForSelfSigPro', 0, async function (done) { + await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO).then(data => { + console.info("SigPro" + JSON.stringify(data.signatureInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo.appId).assertEqual(APPID); + expect(data.signatureInfo.fingerprint).assertEqual(FINGERPRINT); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0133 + * @tc.name: getBundleInfoForSelfSigCal + * @tc.desc: Test getBundleInfoForSelf with signatureInfo flag(by callback). + */ + it('getBundleInfoForSelfSigCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO, (err, data) => { + console.info("SigCal" + JSON.stringify(data.signatureInfo)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo.appId).assertEqual(APPID); + expect(data.signatureInfo.fingerprint).assertEqual(FINGERPRINT); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0134 + * @tc.name: getBundleInfoForSelfDisPro + * @tc.desc: Test getBundleInfoForSelf with disable flag(by promise). + */ + it('getBundleInfoForSelfDisPro', 0, async function (done) { + await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_DISABLE).then(data => { + console.info("DisPro" + JSON.stringify(data)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + done(); + }).catch(err => { + console.info("getBundleInfoForSelf fail" + JSON.stringify(err)); + expect(err).assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0135 + * @tc.name: getBundleInfoForSelfDisCal + * @tc.desc: Test getBundleInfoForSelf with disable flag(by callback). + */ + it('getBundleInfoForSelfDisCal', 0, async function (done) { + bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_DISABLE, (err, data) => { + console.info("DisCal" + JSON.stringify(data)); + checkCommonBundleInfo(data); + expect(data.appInfo).assertEqual(null); + expect(data.hapModulesInfo.length).assertEqual(0); + expect(data.reqPermissionDetails.length).assertEqual(0); + expect(data.permissionGrantStates.length).assertEqual(0); + expect(data.signatureInfo).assertEqual(null); + expect(err).assertEqual(null); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0136 + * @tc.name: getBundleInfoForSelfParamErrPro + * @tc.desc: Test getBundleInfoForSelf with error param(by promise). + */ + it('getBundleInfoForSelfParamErrPro', 0, async function (done) { + try { + await bundle.getBundleInfoForSelf(null).then(data => { + console.info("ParamErrPro null success " + JSON.stringify(data)); + expect(data).assertFail(); + }).catch(err => { + console.info("ParamErrPro null fail1 " + JSON.stringify(err)); + expect(err).assertFail(); + }) + } catch (err) { + console.info("ParamErrPro null fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + } + try { + await bundle.getBundleInfoForSelf(undefined).then(data => { + console.info("ParamErrPro undefined success " + JSON.stringify(data)); + expect(data).assertFail(); + }).catch(err => { + console.info("ParamErrPro undefined fail1 " + JSON.stringify(err)); + expect(err).assertFail(); + }) + } catch (err) { + console.info("ParamErrPro undefined fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + done(); + } + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERY_0137 + * @tc.name: getBundleInfoForSelfParamErrCal + * @tc.desc: Test getBundleInfoForSelf with error param(by callback). + */ + it('getBundleInfoForSelfParamErrCal', 0, async function (done) { + try { + bundle.getBundleInfoForSelf(null, (err, data) => { + console.info("ParamErrCal null success " + JSON.stringify(data)); + console.info("ParamErrCal null success " + JSON.stringify(err)); + expect(data).assertFail(); + }) + } catch (err) { + console.info("ParamErrCal null fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + } + await util.sleep(200); + try { + bundle.getBundleInfoForSelf(undefined, (err, data) => { + console.info("ParamErrCal undefined success " + JSON.stringify(data)); + console.info("ParamErrCal undefined success " + JSON.stringify(err)); + expect(data).assertFail(); + }) + } catch (err) { + console.info("ParamErrCal undefined fail2 " + JSON.stringify(err)); + expect(err.code).assertEqual(PARAM_ERROR_CODE); + done(); + } + }) + + function checkCommonBundleInfo(data) { + expect(data.name).assertEqual(BUNDLE_NAME); + expect(data.vendor).assertEqual(VENDOR); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + expect(data.minCompatibleVersionCode).assertEqual(1000000); + expect(data.targetVersion).assertEqual(8); + expect(data.installTime).assertLarger(0); + expect(data.updateTime).assertLarger(0); + console.info("checkCommonBundleInfo end"); + } + + function checkCommonApplicationInfo(data) { + expect(data.appInfo.name).assertEqual(BUNDLE_NAME); + expect(data.appInfo.description).assertEqual("$string:description_application"); + expect(data.appInfo.descriptionId).assertLarger(0); + expect(data.appInfo.enabled).assertTrue(); + expect(data.appInfo.label).assertEqual("$string:app_name"); + expect(data.appInfo.labelId).assertLarger(0); + expect(data.appInfo.icon).assertEqual("$media:icon"); + expect(data.appInfo.iconId).assertLarger(0); + expect(data.appInfo.process).assertEqual(BUNDLE_NAME); + expect(data.appInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage.test"); + expect(data.appInfo.removable).assertTrue(0); + expect(data.appInfo.accessTokenId).assertLarger(0); + expect(data.appInfo.uid).assertLarger(0); + expect(data.appInfo.iconResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.iconResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.iconResource.id).assertEqual(data.appInfo.iconId); + expect(data.appInfo.labelResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.labelResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.labelResource.id).assertEqual(data.appInfo.labelId); + expect(data.appInfo.descriptionResource.bundleName).assertEqual(BUNDLE_NAME); + expect(data.appInfo.descriptionResource.moduleName).assertEqual("testModule"); + expect(data.appInfo.descriptionResource.id).assertEqual(data.appInfo.descriptionId); + expect(data.appInfo.appDistributionType).assertEqual("os_integration"); + expect(data.appInfo.appProvisionType).assertEqual("release"); + expect(data.appInfo.systemApp).assertFalse(); + expect(JSON.stringify(data.appInfo.metadata)).assertEqual("{}"); + console.info("checkCommonApplicationInfo end"); + } + + function checkCommonHapModuleInfo(data) { + expect(data.hapModulesInfo.length).assertEqual(1); + expect(data.hapModulesInfo[0].name).assertEqual("testModule"); + expect(data.hapModulesInfo[0].icon).assertEqual("$media:icon"); + expect(data.hapModulesInfo[0].iconId).assertLarger(0); + expect(data.hapModulesInfo[0].label).assertEqual("$string:entry_label"); + expect(data.hapModulesInfo[0].labelId).assertLarger(0); + expect(data.hapModulesInfo[0].description).assertEqual("$string:testModule_entry_dsc"); + expect(data.hapModulesInfo[0].descriptionId).assertLarger(0); + expect(data.hapModulesInfo[0].mainElementName).assertEqual(ABILITY_NAME); + expect(data.hapModulesInfo[0].deviceTypes.length).assertEqual(2); + console.info("checkComm" + JSON.stringify(data.hapModulesInfo[0].deviceTypes[0])); + console.info("checkComm" + JSON.stringify(data.hapModulesInfo[0].deviceTypes[1])); + expect(data.hapModulesInfo[0].deviceTypes[0]).assertEqual("default"); + expect(data.hapModulesInfo[0].deviceTypes[1]).assertEqual("tablet"); + expect(data.hapModulesInfo[0].installationFree).assertFalse(); + expect(data.hapModulesInfo[0].hashValue).assertEqual(""); + console.info("checkCommonHapModuleInfo end"); + } + + function checkCommonAbilityInfo(data) { + expect(data.bundleName).assertEqual(BUNDLE_NAME); + expect(data.moduleName).assertEqual("testModule"); + expect(data.label).assertEqual("$string:entry_label"); + expect(data.labelId).assertLarger(0); + expect(data.description).assertEqual("$string:testModule_entry_main"); + expect(data.descriptionId).assertLarger(0); + expect(data.icon).assertEqual("$media:icon"); + expect(data.iconId).assertLarger(0); + expect(data.process).assertEqual(""); + expect(data.exported).assertTrue(); + expect(data.type).assertEqual(1); + expect(data.permissions.length).assertEqual(0); + expect(data.readPermission).assertEqual(""); + expect(data.writePermission).assertEqual(""); + expect(data.uri).assertEqual(""); + expect(data.deviceTypes.length).assertEqual(2); + console.info("checkComm" + JSON.stringify(data.deviceTypes[0])); + console.info("checkComm" + JSON.stringify(data.deviceTypes[1])); + expect(data.deviceTypes[0]).assertEqual("default"); + expect(data.deviceTypes[1]).assertEqual("tablet"); + expect(data.applicationInfo).assertEqual(null); + expect(data.metadata.length).assertEqual(0); + expect(data.enabled).assertTrue(); + expect(data.supportWindowModes.length).assertEqual(3); + expect(data.supportWindowModes[0]).assertEqual(bundle.SupportWindowMode.FULL_SCREEN); + expect(data.supportWindowModes[1]).assertEqual(bundle.SupportWindowMode.SPLIT); + expect(data.supportWindowModes[2]).assertEqual(bundle.SupportWindowMode.FLOATING); + expect(data.windowSize.maxWindowRatio).assertEqual(0); + expect(data.windowSize.minWindowRatio).assertEqual(0); + expect(data.windowSize.maxWindowWidth).assertEqual(0); + expect(data.windowSize.minWindowWidth).assertEqual(0); + expect(data.windowSize.maxWindowHeight).assertEqual(0); + expect(data.windowSize.minWindowHeight).assertEqual(0); + console.info("checkCommonAbilityInfo end"); + } + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByAbility.test.ets new file mode 100644 index 000000000..8e5657b5e --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByAbility.test.ets @@ -0,0 +1,423 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import manager from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule" +const MODULE_NAME_TEST = "testModule1" +const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility" +const ABILITY_NAME1 = "ohos.acts.bundle.stage.test.MainAbility1" +const ABILITY_NAME_TEST = "ohos.acts.bundle.stage.test.MainAbilityTest" +const METADATA_NAME = "ohos.ability.form" +const METADATA_NAME1 = "ohos.ability.form1" +const METADATA_NAME2 = "ohos.ability.form2" +const METADATA_NAME3 = "ohos.ability.form3" +const METADATA_NAME4 = "ohos.ability.form4" +const METADATA_NAME_TEST = "ohos.test.form" +const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}" +const ERROR_ABILITY_NOT_EXIST = 17700003 +const ERROR_PROFILE_NOT_EXIST = 17700024 +const ERROR_MODULE_NOT_EXIST = 17700002 + +export default function getProfileByAbility() { + describe('getProfileByAbility', function () { + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0011 + * @tc.name: getProfileByAbilityInvalidModulePro + * @tc.desc: Check the invalid moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidModulePro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByAbilityInvalidModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityInvalidModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0015 + * @tc.name: getProfileByAbilityEmptyModulePro + * @tc.desc: Check the empty moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyModulePro', 0, async function (done) { + await manager.getProfileByAbility('', ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByAbilityEmptyModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityEmptyModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0017 + * @tc.name: getProfileByAbilityInvalidModuleCall + * @tc.desc: Check the invalid moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidModuleCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByAbilityInvalidModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0034 + * @tc.name: getProfileByAbilityEmptyModuleCall + * @tc.desc: Check the empty moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyModuleCall', 0, async function (done) { + manager.getProfileByAbility('', ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST); + console.error('[getProfileByAbilityEmptyModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0012 + * @tc.name: getProfileByAbilityInvalidAbilityPro + * @tc.desc: Check the invalid abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidAbilityPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME).then(data => { + console.info("getProfileByAbilityInvalidAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityInvalidAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByAbilityEmptyAbilityPro + * @tc.desc: Check the empty abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyAbilityPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, '', METADATA_NAME).then(data => { + console.info("getProfileByAbilityEmptyAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByAbilityEmptyAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0022 + * @tc.name: getProfileByAbilityInvalidAbilityCall + * @tc.desc: Check the invalid abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidAbilityCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByAbilityInvalidAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByAbilityEmptyAbilityCall + * @tc.desc: Check the empty abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyAbilityCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, '', METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByAbilityEmptyAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0024 + * @tc.name: getProfileByAbilityCallback + * @tc.desc: Check the valid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityCallback', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => { + console.info('[getProfileByAbilityCallback] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0026 + * @tc.name: getProfileByAbilityInvalidMetaDataCall + * @tc.desc: Check the invalid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidMetaDataCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByAbilityInvalidMetaDataCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0036 + * @tc.name: getProfileByAbilityEmptyMetaDataCall + * @tc.desc: Check the empty metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyMetaDataCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, '', (err, data) => { + console.info('[getProfileByAbilityEmptyMetaDataCall] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0002 + * @tc.name: getProfileByAbilityPromise + * @tc.desc: Check the valid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityPromise', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => { + console.info('[getProfileByAbilityPromise] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByAbilityPromise]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0004 + * @tc.name: getProfileByAbilityInvalidMetaDataPro + * @tc.desc: Check the invalid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityInvalidMetaDataPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST).then(data => { + console.info('[getProfileByAbilityInvalidMetaDataPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + done() + }).catch(err => { + console.error('[getProfileByAbilityInvalidMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0030 + * @tc.name: getProfileByAbilityEmptyMetaDataPro + * @tc.desc: Check the empty metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityEmptyMetaDataPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, '').then(data => { + console.info('[getProfileByAbilityEmptyMetaDataPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByAbilityEmptyMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0009 + * @tc.name: getProfileByAbilityNoMetaDataPro + * @tc.desc: without metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNoMetaDataPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME).then(data => { + console.info('[getProfileByAbilityNoMetaDataPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByAbilityNoMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0048 + * @tc.name: getProfileByAbilityNoProfilePro + * @tc.desc: no profile configured under the ability (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNoProfilePro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME1).then(data => { + console.info('[getProfileByAbilityNoProfilePro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(data).assertFail() + done(); + }).catch(err => { + console.error('[getProfileByAbilityNoProfilePro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0045 + * @tc.name: getProfileByAbilityNotPrefixPro + * @tc.desc: resource has no prefix '$profile:' (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNotPrefixPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2).then(data => { + console.info('[getProfileByAbilityNotPrefixPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(data).assertFail() + done(); + }).catch(err => { + console.error('[getProfileByAbilityNotPrefixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0044 + * @tc.name: getProfileByAbilityNotPrefixCall + * @tc.desc: resource has no prefix '$profile:' (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityNotPrefixCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByAbilityNotPrefixCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0007 + * @tc.name: getProfileByAbilityNotSuffixPro + * @tc.desc: profile is .txt suffix (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNotSuffixPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { + console.info('[getProfileByAbilityNotSuffixPro] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }).catch(err => { + console.error('[getProfileByAbilityNotSuffixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0040 + * @tc.name: getProfileByAbilityNotSuffixCall + * @tc.desc: profile is .txt suffix (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityNotSuffixCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { + console.info('[getProfileByAbilityNotSuffixCall] getProfileByAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0008 + * @tc.name: getProfileByAbilityNoJsonPro + * @tc.desc: profile is invalid json format (by promise) + * @tc.level 0 + */ + it('getProfileByAbilityNoJsonPro', 0, async function (done) { + await manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => { + console.info('[getProfileByAbilityNoJsonPro] data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByAbilityNoJsonPro] Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0046 + * @tc.name: getProfileByAbilityNoJsonCall + * @tc.desc: profile is invalid json format (by callback) + * @tc.level 0 + */ + it('getProfileByAbilityNoJsonCall', 0, async function (done) { + manager.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => { + console.info('[getProfileByAbilityNoJsonCall] err: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets new file mode 100644 index 000000000..c040c8f80 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetProfileByExtensionAbility.test.ets @@ -0,0 +1,424 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import manager from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" + +const MODULE_NAME = "testModule" +const MODULE_NAME_TEST = "testModule1" +const ABILITY_NAME = "Form" +const ABILITY_NAME1 = "Form1" +const ABILITY_NAME_TEST = "FromTest" +const METADATA_NAME = "ohos.extension.form" +const METADATA_NAME1 = "ohos.extension.form1" +const METADATA_NAME2 = "ohos.extension.form2" +const METADATA_NAME3 = "ohos.extension.form3" +const METADATA_NAME4 = "ohos.extension.form4" +const METADATA_NAME_TEST = "ohos.test.form" +const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}" +const ERROR_ABILITY_NOT_EXIST = 17700003 +const ERROR_PROFILE_NOT_EXIST = 17700024 +const ERROR_MODULE_NOT_EXIST = 17700002 + +export default function getProfileByExtensionAbility() { + describe('getProfileByExtensionAbility', function () { + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0011 + * @tc.name: getProfileByExtensionAbilityInvalidModulePro + * @tc.desc: Check the invalid moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidModulePro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityInvalidModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityInvalidModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0015 + * @tc.name: getProfileByExtensionAbilityEmptyModulePro + * @tc.desc: Check the empty moduleName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyModulePro', 0, async function (done) { + await manager.getProfileByExtensionAbility('', ABILITY_NAME, METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityEmptyModulePro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityEmptyModulePro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0017 + * @tc.name: getProfileByExtensionAbilityInvalidModuleCall + * @tc.desc: Check the invalid moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidModuleCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME_TEST, ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByExtensionAbilityInvalidModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0034 + * @tc.name: getProfileByExtensionAbilityEmptyModuleCall + * @tc.desc: Check the empty moduleName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyModuleCall', 0, async function (done) { + manager.getProfileByExtensionAbility('', ABILITY_NAME, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_MODULE_NOT_EXIST); + console.error('[getProfileByExtensionAbilityEmptyModuleCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0012 + * @tc.name: getProfileByExtensionAbilityInvalidAbilityPro + * @tc.desc: Check the invalid abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidAbilityPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityInvalidAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityInvalidAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByExtensionAbilityEmptyAbilityPro + * @tc.desc: Check the empty abilityName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyAbilityPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, '', METADATA_NAME).then(data => { + console.info("getProfileByExtensionAbilityEmptyAbilityPro success" + JSON.stringify(data)) + expect(data).assertFail() + done() + }).catch(err => { + console.info("getProfileByExtensionAbilityEmptyAbilityPro failed" + JSON.stringify(err)) + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST) + done() + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0022 + * @tc.name: getProfileByExtensionAbilityInvalidAbilityCall + * @tc.desc: Check the invalid abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidAbilityCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME_TEST, METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByExtensionAbilityInvalidAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0029 + * @tc.name: getProfileByExtensionAbilityEmptyAbilityCall + * @tc.desc: Check the empty abilityName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyAbilityCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, '', METADATA_NAME, (err, data) => { + expect(err.code).assertEqual(ERROR_ABILITY_NOT_EXIST); + console.error('[getProfileByExtensionAbilityEmptyAbilityCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0024 + * @tc.name: getProfileByExtensionAbilityCallback + * @tc.desc: Check the valid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityCallback', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => { + console.info('[getProfileByExtensionAbilityCallback] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0026 + * @tc.name: getProfileByExtensionAbilityInvalidMetaDataCall + * @tc.desc: Check the invalid metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidMetaDataCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByExtensionAbilityInvalidMetaDataCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0036 + * @tc.name: getProfileByExtensionAbilityEmptyMetaDataCall + * @tc.desc: Check the empty metadataName (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyMetaDataCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, '', (err, data) => { + console.info('[getProfileByExtensionAbilityEmptyMetaDataCall] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0002 + * @tc.name: getProfileByExtensionAbilityPromise + * @tc.desc: Check the valid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityPromise', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => { + console.info('[getProfileByExtensionAbilityPromise] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityPromise]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0004 + * @tc.name: getProfileByExtensionAbilityInvalidMetaDataPro + * @tc.desc: Check the invalid metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityInvalidMetaDataPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME_TEST).then(data => { + console.info('[getProfileByExtensionAbilityInvalidMetaDataPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect().assertFail(); + done() + }).catch(err => { + console.error('[getProfileByExtensionAbilityInvalidMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0030 + * @tc.name: getProfileByExtensionAbilityEmptyMetaDataPro + * @tc.desc: Check the empty metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityEmptyMetaDataPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, '').then(data => { + console.info('[getProfileByExtensionAbilityEmptyMetaDataPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityEmptyMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0009 + * @tc.name: getProfileByExtensionAbilityNoMetaDataPro + * @tc.desc: without metadataName (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoMetaDataPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME).then(data => { + console.info('[getProfileByExtensionAbilityNoMetaDataPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(3); + expect(typeof data[0]).assertEqual("string"); + expect(data[0]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[1]).assertEqual("string"); + expect(data[1]).assertEqual(PROFILE_JSON_STRING); + expect(typeof data[2]).assertEqual("string"); + expect(data[2]).assertEqual(PROFILE_JSON_STRING); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNoMetaDataPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0048 + * @tc.name: getProfileByExtensionAbilityNoProfilePro + * @tc.desc: no profile configured under the ability (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoProfilePro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1).then(data => { + console.info('[getProfileByExtensionAbilityNoProfilePro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNoProfilePro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0045 + * @tc.name: getProfileByExtensionAbilityNotPrefixPro + * @tc.desc: resource has no prefix '$profile:' (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotPrefixPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2).then(data => { + console.info('[getProfileByExtensionAbilityNotPrefixPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNotPrefixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0044 + * @tc.name: getProfileByExtensionAbilityNotPrefixCall + * @tc.desc: resource has no prefix '$profile:' (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotPrefixCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME2, (err, data) => { + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + console.error('[getProfileByExtensionAbilityNotPrefixCall]Operation failed. Cause: ' + JSON.stringify(err)); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0007 + * @tc.name: getProfileByExtensionAbilityNotSuffixPro + * @tc.desc: profile is .txt suffix (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotSuffixPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3).then(data => { + console.info('[getProfileByExtensionAbilityNotSuffixPro] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNotSuffixPro]Operation failed. Cause: ' + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0040 + * @tc.name: getProfileByExtensionAbilityNotSuffixCall + * @tc.desc: profile is .txt suffix (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNotSuffixCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME3, (err, data) => { + console.info('[getProfileByExtensionAbilityNotSuffixCall] getProfileByExtensionAbility callback data is: ' + JSON.stringify(data)); + expect(Array.isArray(data)).assertTrue(); + expect(data.length).assertEqual(1); + expect(typeof data[0]).assertEqual("string"); + done(); + }); + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0008 + * @tc.name: getProfileByExtensionAbilityNoJsonPro + * @tc.desc: profile is invalid json format (by promise) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoJsonPro', 0, async function (done) { + await manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4).then(data => { + console.info('[getProfileByExtensionAbilityNoJsonPro] data is: ' + JSON.stringify(data)); + expect().assertFail(); + done(); + }).catch(err => { + console.error('[getProfileByExtensionAbilityNoJsonPro] Operation failed. Cause: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }) + }) + + /* + * @tc.number: SUB_BMS_APPINFO_QUERYMETAFILE_0046 + * @tc.name: getProfileByExtensionAbilityNoJsonCall + * @tc.desc: profile is invalid json format (by callback) + * @tc.level 0 + */ + it('getProfileByExtensionAbilityNoJsonCall', 0, async function (done) { + manager.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME4, (err, data) => { + console.info('[getProfileByExtensionAbilityNoJsonCall] err: ' + JSON.stringify(err)); + expect(err.code).assertEqual(ERROR_PROFILE_NOT_EXIST); + done(); + }); + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetSecondModule.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetSecondModule.test.ets new file mode 100644 index 000000000..2c00ddfe0 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/GetSecondModule.test.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle.bundleManager'; +import { describe, beforeAll, it, expect } from '@ohos/hypium' + +export default function GetSecondModuleTest() { + describe('getSecondModuleTest', function () { + + /** + * @tc.number SUB_BMS_APPINFO_QUERY_0138 + * @tc.name GetSecondModuleTest + * @tc.desc Test the bundleManager secondary module + */ + it('GetSecondModuleTest', 0, async function (done) { + let bundleInfo = await bundle.getBundleInfoForSelf( + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_HAP_MODULE | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_ABILITY | + bundle.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION) + let applicationInfoTest: bundle.ApplicationInfo = bundleInfo.appInfo; + expect(typeof (applicationInfoTest.name)).assertEqual('string'); + let metadataTest: bundle.Metadata = bundleInfo.hapModulesInfo[0].metadata[0]; + expect(typeof (metadataTest.name)).assertEqual('string'); + let bundleInfoTest: bundle.BundleInfo = bundleInfo; + expect(typeof (bundleInfoTest.name)).assertEqual('string'); + let usedSceneTest: bundle.UsedScene = bundleInfo.reqPermissionDetails[0].usedScene + expect(typeof (usedSceneTest.abilities[0])).assertEqual('string'); + let reqPermissionDetailsTest: bundle.ReqPermissionDetail = bundleInfo.reqPermissionDetails[0] + expect(typeof (reqPermissionDetailsTest.name)).assertEqual('string'); + let signatureInfoTest: bundle.SignatureInfo = bundleInfo.signatureInfo; + expect(typeof (signatureInfoTest.appId)).assertEqual('string'); + let hapModuleInfoTest: bundle.HapModuleInfo = bundleInfo.hapModulesInfo[0]; + expect(typeof (hapModuleInfoTest.name)).assertEqual('string'); + let abilityInfoTest: bundle.AbilityInfo = bundleInfo.hapModulesInfo[0].abilitiesInfo[0]; + expect(typeof (abilityInfoTest.bundleName)).assertEqual('string'); + let windowSizeTest: bundle.WindowSize = bundleInfo.hapModulesInfo[0].abilitiesInfo[0].windowSize; + expect(windowSizeTest.maxWindowRatio).assertEqual(0); + let extensionAbilityInfoTest: bundle.ExtensionAbilityInfo = bundleInfo.hapModulesInfo[0].extensionAbilitiesInfo[0]; + expect(typeof (extensionAbilityInfoTest.bundleName)).assertEqual('string'); + let elementNameExample = { + deviceId: "123456789", + bundleName: "bundleName", + moduleName:"moduleName", + abilityName: "abilityName", + uri:"uri", + shortName:"shortName" + } + let elementNameTest: bundle.ElementName = elementNameExample; + expect(elementNameTest.deviceId).assertEqual("123456789"); + expect(elementNameTest.bundleName).assertEqual("bundleName"); + expect(elementNameTest.moduleName).assertEqual("moduleName"); + expect(elementNameTest.abilityName).assertEqual("abilityName"); + expect(elementNameTest.uri).assertEqual("uri"); + expect(elementNameTest.shortName).assertEqual("shortName"); + done(); + }) + }) + +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..ee7616939 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import getProfileByAbility from './GetProfileByAbility.test.ets'; +import getProfileByExtensionAbility from './GetProfileByExtensionAbility.test.ets'; +import getBundleInfoForSelf from './GetBundleInfoForSelf.test.ets'; +import getSecondModuleTest from './GetSecondModule.test.ets'; + +export default function testsuite() { + getProfileByAbility(); + getProfileByExtensionAbility(); + getBundleInfoForSelf(); + getSecondModuleTest(); +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/Utils.ets b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/Utils.ets new file mode 100644 index 000000000..f3b5fe7f6 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/ets/test/Utils.ets @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout((data) => { + resolve(data) + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } +} + + + + diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/module.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/module.json new file mode 100644 index 000000000..13781bf03 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/module.json @@ -0,0 +1,17 @@ +{ + "module": { + "name": "shared", + "type": "shared", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:testModule_entry_dsc", + "mainElement": "ohos.acts.atomic.service.test.MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": true, + "uiSyntax": "ets", + "pages": "$profile:main_pages" + } +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/element/string.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..a4e9ba5b8 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/element/string.json @@ -0,0 +1,44 @@ +{ + "string": [ + { + "name": "testModule_entry_dsc", + "value": "i am an entry for testModule" + }, + { + "name": "testModule_entry_main", + "value": "the testModule entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + }, + { + "name": "form_FormAbility_desc", + "value": "form_description" + }, + { + "name": "form_FormAbility_label", + "value": "form_label" + }, + { + "name": "permission_reason", + "value": "Need permission" + } + ] +} diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/media/icon.png b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 GIT binary patch literal 15458 zcmV-oJe|XdP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXfJNHRMK~#8N)t$?W zZ`*d)f6uD@IOn2&LJ;lP6@!gHh#>Y1!r&0HL_gDqb&`3X(Z=GaQp8SP` z92In5!tr>lHv4nxKS1{J@p1P!+F4$_JksuYcRrnVr_*tFKEi|jF}%m8r`_Y_l6p^% z@+LnCznqL`mDBrry9$FzRWuxkQF=}GpwhbiR|yW zmfjQNx4tFelhpeM=s1qPZ}7VBtuHUqIh+_+IvN7$>(jXIa?55SEAd6rfw_FG^Ciq> zUAOb*d;6XH7UwzzrTnE1QtLJmPK4||=GS#JMbf8dX;2o^T+5qYx7QF%t86tY^M!6V zrngTY z1udv}ju^g5nNRXGgh*Bp3Mrd$sWa|p#az3e^Glh~4OYDwx?a*KW72*IFc`5a72{iM zp*N~%>#A7GyQ5CGc@5sre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$S$x+vP6FXyZt}- z{r}3!ysV$w#X1$JZl72G@wkTCr@<`VBT++f{`d+4%SsK_oWS!)h$X)7Iw5YwMUI%|DP($<}KZ+-u>XG?b9I5f47B0;%?P3__l;YH& z`92CVO`RCVP#y-H@nJZgr1<2a{xBQ-lIK~pAH?^`km{I01IzdD7@r|t*_4y`9@NA5 zq$<1;c6}R8!%NJeZ{_C?c;3;(Bhvgl9`1TUrhJs+)3eHTVN^Wtf9v1;w`bk-!U80# zPb4Nai`;Q4VyWJmBm(HGVb%x!$o9g(m z@BNm8)L5LW41ks^%nDsO9dc#n{!ihj%?OK8jS5s)q|ox6AsyuMaEws?(61<4>Dl&% z(AowWE}sZbd2$Fpd3X!W{44-|eRU%5z)~*gA?R**Vyu2$E5~BWM~PgBBq$=kqGE67 z`@|=dDkKs@MXyRk(q=Sb__5!7i&kaqd|~>q`yW64akf!;YC=W70<8l5tW13-+~|Y; zkOj7m+O z!5pPf&u5hW8I_=fD zD*;20N{)BIOQ{tj;NRl5w-|ch2}M5c{wK!f>CfqKoBq&WEM66PqkaN5`Y)t8TRI`--F?$f7FyF2*vpx(dgmuRWV_Q&1- Y0jIQKqpXab7ytkO07*qoM6N<$f;yQ2zW@LL literal 0 HcmV?d00001 diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 000000000..e892d4472 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config1.txt b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config1.txt new file mode 100644 index 000000000..32f9ff7dc --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/form_config1.txt @@ -0,0 +1 @@ +{"src": ["MainAbility/pages/index/index","MainAbility/pages/second/second"]} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/invalid.txt b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/invalid.txt new file mode 100644 index 000000000..cdca51a17 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/invalid.txt @@ -0,0 +1,5 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/main_pages.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..02221db61 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/shortcuts_config.json b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/shortcuts_config.json new file mode 100644 index 000000000..02221db61 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/entry/src/main/resources/base/profile/shortcuts_config.json @@ -0,0 +1,6 @@ +{ + "src": [ + "MainAbility/pages/index/index", + "MainAbility/pages/second/second" + ] +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/signature/openharmony_sx.p7b b/bundlemanager/bundle_standard/bundlemanager/actsbmsatomicserviceetstest/bmsatomicserviceshared/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..616445c708cb010b974dcdfad16af541d40d2f6f GIT binary patch literal 3468 zcmcgvYj6|S6}BFhV~ntg0RsVSgu%RI-<2g>a$f98s~29$D@(TIh?cK#S^UnVxD6!5F+Pt6i9wDid*%W?j}!>`Jdn(s z{0PYFOlH0yOlB6$lC+YMXn>}qZrVdis$^3iIw&HN2*c)rIb*S04kSzy(FaM&`eu6H8?^BNg_&e4k8?udIC`<5^%+s)Ox)L zI@%bZ7}6IZQeF<&N(2L*0MjO^nkAuVM(QHHbcCA=QmEw03WZFeoSOC%UWSZt?h2(! zURln$XHS*5Vw5LHN&}RaP7U{vtz?i6lM!i}x;aczdLj~{sWxt%eq`Kagb8>9Zh}d% zmZp9Psxz31)TqU3&>GaR6-|4c6lO4}v4mO;yGS3*8W7lLKnb(DETMrh#OG`AH#eDU za9jhkHW<@kadiSVB0f_c0z0g5v&qcOV8L0`=g`#Q_;i$IYTUZISglUm=Bii4NGsZa zA#NQE*-&*H!>#2=(ADhsyF*Z`i)!}O>FWGW%4J2HFg2P+!Euau9EIBv)};$JIqa6O zOD6Z>0A=-lw+U-PS*!_e<2YCiakCYR*K=Nzra6u^VeyB)CWOZDD67WP9Cavb)L5HP z8-^Hqc=@qvC-vBxah(;m_k3s6ilQpEpq>f zaJ|CoX?EyMaz!h!m&1A@4#}Eo5D%)Mqgsoh0V3_8xY?1Y)j266i+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*Sj;!yH0nM z?Coe^2YuRq_XNHS;Nb(dfh~bP{hrjDcLq)*{OjCs}7Bs-#%H9aBkf= zO1k0f$Fy)7bmyrp&hy4zq)i+N?+ zx$OmKr))c^8@?cu(-FbxsJmB3W5^F)?$6{I?p~i}1S!g8eRY&FpG`-6iiE~)`1;uT zcM24{7oXVD_|I$b_!8mOk#F7ljG3q2vqN-e_sx=#pPXAI{@uaKEpx*5MaSm65Z>Fm z?Y%!+K>hyD*G#OaInedaM{7r}+j?u!qP$zDJH{@$J9p;(DTQ~hAHTf(N2zVI8xZ}P z(-SrFe`xH9&8^=FBk*Sck`F@Xf2N%G26J=nyLYSnjXRH3Y`A(P@7THgtFyg%=5D?1 zi$(1t{9T5BpS|8S^vv~hgSlpP^f{W{Sryr6>6#$Dcfh{u4z z%Oc&&iK}4;v&?rw{??11mqJP2G)`nMaTf>B{7km7_eAY`N9hcJ;ScX9*#d}*{qJVO z1EU@q*_lu-cPN&F)PczT^_NvNfU-wXAtVtN{pG}|Q)Lrpe)(0dt8DAF+_HU3^REp5 z&~slh2Y7Qv9n`++>e{ /data/test/bmsJstest1.hap" + ] + }, { "type": "ShellKit", "teardown-command":[ - "bm uninstall -n ohos.acts.bundle.stage.test" + "bm uninstall -n ohos.acts.bundle.stage.test", + "rm -rf /data/test/" ] } ] diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets index 9e40c5b25..63bb17078 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets @@ -43,7 +43,7 @@ export default function getBundleInfoForSelf() { expect(data.versionCode).assertEqual(1000000); expect(data.versionName).assertEqual("1.0.0"); expect(data.minCompatibleVersionCode).assertEqual(1000000); - expect(data.targetVersion).assertEqual(8); + expect(data.targetVersion).assertEqual(9); expect(data.installTime).assertLarger(0); expect(data.updateTime).assertLarger(0); expect(data.appInfo).assertEqual(null); @@ -72,7 +72,7 @@ export default function getBundleInfoForSelf() { expect(data.versionCode).assertEqual(1000000); expect(data.versionName).assertEqual("1.0.0"); expect(data.minCompatibleVersionCode).assertEqual(1000000); - expect(data.targetVersion).assertEqual(8); + expect(data.targetVersion).assertEqual(9); expect(data.installTime).assertLarger(0); expect(data.updateTime).assertLarger(0); expect(data.appInfo).assertEqual(null); @@ -94,6 +94,7 @@ export default function getBundleInfoForSelf() { await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then(data => { console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo)); checkCommonBundleInfo(data); + expect(data.appInfo.bundleType).assertEqual(bundle.BundleType.APP); expect(data.appInfo.name).assertEqual(BUNDLE_NAME); expect(data.appInfo.description).assertEqual("$string:description_application"); expect(data.appInfo.descriptionId).assertLarger(0); @@ -1001,7 +1002,7 @@ export default function getBundleInfoForSelf() { expect(data.versionCode).assertEqual(1000000); expect(data.versionName).assertEqual("1.0.0"); expect(data.minCompatibleVersionCode).assertEqual(1000000); - expect(data.targetVersion).assertEqual(8); + expect(data.targetVersion).assertEqual(9); expect(data.installTime).assertLarger(0); expect(data.updateTime).assertLarger(0); console.info("checkCommonBundleInfo end"); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsDefaultApplication.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/IsDefaultApplication.test.ets similarity index 97% rename from bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsDefaultApplication.test.ets rename to bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/IsDefaultApplication.test.ets index f4ee1226b..638d42c8d 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/IsDefaultApplication.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/IsDefaultApplication.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import defaultAppMgr from '@ohos.bundle.defaultAppManager' export default function isDefaultApplicationTest() { diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets index ee7616939..684f45db0 100755 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets @@ -17,10 +17,14 @@ import getProfileByAbility from './GetProfileByAbility.test.ets'; import getProfileByExtensionAbility from './GetProfileByExtensionAbility.test.ets'; import getBundleInfoForSelf from './GetBundleInfoForSelf.test.ets'; import getSecondModuleTest from './GetSecondModule.test.ets'; +import isDefaultApplicationTest from './IsDefaultApplication.test.ets'; +import PublicApiEightTest from './PublicApiEightTest.test.ets'; export default function testsuite() { getProfileByAbility(); getProfileByExtensionAbility(); getBundleInfoForSelf(); getSecondModuleTest(); + isDefaultApplicationTest(); + PublicApiEightTest(); } \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiEightTest.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiEightTest.test.ets new file mode 100644 index 000000000..a42de3204 --- /dev/null +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiEightTest.test.ets @@ -0,0 +1,361 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impligetProfileByAbilityEmptyAbilityCalled. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import bundle from '@ohos.bundle'; +import image from '@ohos.multimedia.image'; +import util from "./Utils"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; + +const BUNDLE_NAME = "ohos.acts.bundle.stage.test"; +const BUNDLE_NAME1 = "com.example.myapplication1"; +const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility"; +const PATH = "/data/test/"; +const BMSJSTEST1 = "bmsJstest1.hap"; + +export default function PublicApiEightTest() { + describe('PublicApiEightTest', function () { + + /* + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNING_0083 + * @tc.name: getBundleInfoTest + * @tc.desc: Test getBundleInfo of API8 in version9 normal project + */ + it('getBundleInfoTest', 0, async function (done) { + await bundle.getBundleInfo(BUNDLE_NAME , bundle.BundleFlag.GET_BUNDLE_DEFAULT).then(data => { + util.info("getBundleInfoTest" + JSON.stringify(data)); + expect(data.name).assertEqual(""); + }).catch(err => { + util.info("getBundleInfoTest fail" + JSON.stringify(err)); + expect().assertFail(); + }); + bundle.getBundleInfo(BUNDLE_NAME ,bundle.BundleFlag.GET_BUNDLE_DEFAULT, (err, data) => { + util.info("getBundleInfoTest" + JSON.stringify(data)); + util.info("getBundleInfoTest fail" + JSON.stringify(err)); + expect(data.name).assertEqual(""); + expect(err).assertEqual(0); + done(); + }) + }); + + /* + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNING_0084 + * @tc.name: getAbilityInfoTest + * @tc.desc: Test getAbilityInfo of API8 in version9 normal project + */ + it('getAbilityInfoTest', 0, async function (done) { + await bundle.getAbilityInfo(BUNDLE_NAME, ABILITY_NAME).then((data) => { + util.info('getAbilityInfoTest promise data is: ' + JSON.stringify(data)); + expect(data.name).assertEqual(""); + }).catch((error) => { + util.info('getAbilityInfoTest failed. Cause: ' + JSON.stringify(error)); + expect().assertFail(); + }); + bundle.getAbilityInfo(BUNDLE_NAME, ABILITY_NAME, (err, data) => { + util.info('getAbilityInfoTest promise data is: ' + JSON.stringify(data)); + util.info('getAbilityInfoTest failed. Cause: ' + JSON.stringify(err)); + expect(data.name).assertEqual(""); + expect(err).assertEqual(0); + done(); + }) + }); + + /* + * @tc.number: SUB_BMS_SYSTEMAPI_RUNNING_0085 + * @tc.name: getApplicationInfoTest + * @tc.desc: Test getApplicationInfo of API8 in version9 normal project + */ + it('getApplicationInfoTest', 0, async function (done) { + await bundle.getApplicationInfo(BUNDLE_NAME, bundle.BundleFlag.GET_BUNDLE_DEFAULT).then(data => { + util.info("getApplicationInfoTest result" + JSON.stringify(data)); + expect(data.name).assertEqual(""); + }).catch(err => { + util.info("getBundleInfoTest fail" + JSON.stringify(err)); + expect().assertFail(); + }); + bundle.getApplicationInfo(BUNDLE_NAME, bundle.BundleFlag.GET_BUNDLE_DEFAULT, (err, data) => { + util.info("getApplicationInfoTest result" + JSON.stringify(data)); + util.info("getApplicationInfoTest fail" + JSON.stringify(err)); + expect(data.name).assertEqual(""); + expect(err.code).assertEqual(0); + done(); + }); + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0086 + * @tc.name queryAbilityByWantTest + * @tc.desc Test queryAbilityByWant of API8 in version9 normal project + */ + it('queryAbilityByWantTest', 0, async function (done) { + await bundle.queryAbilityByWant( + { + "bundleName": BUNDLE_NAME, + "abilityName": ABILITY_NAME, + }, bundle.BundleFlag.GET_BUNDLE_DEFAULT).then(data => { + util.info("queryAbilityByWantTest success:" + JSON.stringify(data)); + expect(data.length).assertEqual(0); + }).catch(err => { + util.info("queryAbilityByWantTest err" + JSON.stringify(err)); + expect().assertFail(); + }) + bundle.queryAbilityByWant( + { + "bundleName": BUNDLE_NAME, + "abilityName": ABILITY_NAME, + }, bundle.BundleFlag.GET_BUNDLE_DEFAULT ,(err,data) => { + util.info("queryAbilityByWantTest success:" + JSON.stringify(data)); + util.info("queryAbilityByWantTest err" + JSON.stringify(err)); + expect(data.length).assertEqual(0); + expect(err).assertEqual(0); + done(); + }) + }) + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0087 + * @tc.name getAllBundleInfoTest + * @tc.desc Test getAllBundleInfo of API8 in version9 normal project + */ + it('getAllBundleInfoTest', 0, async function (done) { + await bundle.getAllBundleInfo(bundle.BundleFlag.GET_BUNDLE_DEFAULT).then(data => { + util.info("getAllBundleInfoTest success:" + JSON.stringify(data)); + expect(data.length).assertEqual(0); + }).catch(err => { + util.info("getAllBundleInfoTest err" + JSON.stringify(err)); + expect().assertFail(); + }) + bundle.getAllBundleInfo(bundle.BundleFlag.GET_BUNDLE_DEFAULT,(err,data) => { + util.info("getAllBundleInfoTest success:" + JSON.stringify(data)); + util.info("getAllBundleInfoTest err" + JSON.stringify(err)); + expect(data.length).assertEqual(0); + expect(err).assertEqual(0); + done(); + }) + }) + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0088 + * @tc.name getAllApplicationInfoTest + * @tc.desc Test getAllApplicationInfo of API8 in version9 normal project + */ + it('getAllApplicationInfoTest', 0, async function (done) { + await bundle.getAllApplicationInfo(bundle.BundleFlag.GET_BUNDLE_DEFAULT).then(data => { + util.info("getAllApplicationInfoTest success:" + JSON.stringify(data)); + expect(data.length).assertEqual(0); + }).catch(err => { + util.info("getAllApplicationInfoTest err" + JSON.stringify(err)); + expect().assertFail(); + }) + bundle.getAllApplicationInfo(bundle.BundleFlag.GET_BUNDLE_DEFAULT,(err,data) => { + util.info("getAllApplicationInfoTest success:" + JSON.stringify(data)); + util.info("getAllApplicationInfoTest err" + JSON.stringify(err)); + expect(data.length).assertEqual(0); + expect(err.code).assertEqual(0); + done(); + }) + }) + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0089 + * @tc.name getNameForUidTest + * @tc.desc Test getNameForUid of API8 in version9 normal project + */ + it('getNameForUidTest', 0, async function (done) { + let dataInfo = await bundle.getBundleInfo(BUNDLE_NAME, bundle.BundleFlag.GET_BUNDLE_DEFAULT); + await bundle.getNameForUid(dataInfo.uid).then(data => { + expect(data).assertFail(); + }).catch(err => { + expect(err).assertEqual(1); + }); + bundle.getNameForUid(dataInfo.uid, (err, data) => { + util.info("getNameForUidTest result:" + JSON.stringify(data)); + expect(data).assertEqual(undefined); + expect(err).assertEqual(1); + done(); + }); + }); + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0090 + * @tc.name getBundleArchiveInfoTest + * @tc.desc Test getBundleArchiveInfo of API8 in version9 normal project + */ + it('getBundleArchiveInfoTest', 0, async function (done) { + await bundle.getBundleArchiveInfo(PATH + BMSJSTEST1, bundle.BundleFlag.GET_BUNDLE_DEFAULT).then(data => { + util.info("getBundleArchiveInfoTest success:" + JSON.stringify(data)); + expect(data.name).assertEqual(""); + }) .catch(err => { + util.info("getBundleArchiveInfoTest err" + JSON.stringify(err)); + expect().assertFail(); + }) + bundle.getBundleArchiveInfo(PATH + BMSJSTEST1, bundle.BundleFlag.GET_BUNDLE_DEFAULT,(err,data) => { + util.info("getBundleArchiveInfoTest success:" + JSON.stringify(data)); + util.info("getBundleArchiveInfoTest err" + JSON.stringify(err)); + expect(data.name).assertEqual(""); + expect(err.code).assertEqual(0); + done(); + }) + }) + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0091 + * @tc.name getLaunchWantForBundleTest + * @tc.desc Test getLaunchWantForBundle of API8 in version9 normal project + */ + it('getLaunchWantForBundleTest', 0, async function (done) { + await bundle.getLaunchWantForBundle(BUNDLE_NAME).then(data => { + util.info("getLaunchWantForBundleTest success:" + JSON.stringify(data)); + expect().assertFail(); + }).catch(err => { + util.info("getLaunchWantForBundleTest err" + JSON.stringify(err)); + expect(err.code).assertEqual(1); + }); + bundle.getLaunchWantForBundle(BUNDLE_NAME, (err, data) => { + util.info("getLaunchWantForBundleTest success:" + JSON.stringify(data)); + util.info("getLaunchWantForBundleTest err" + JSON.stringify(err)); + expect(err.code).assertEqual(1); + expect(data).assertEqual(undefined); + done(); + }); + }); + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0092 + * @tc.name getAbilityLabelTest + * @tc.desc Test getAbilityLabel of API8 in version9 normal project + */ + it('getAbilityLabelTest', 0, async function (done) { + await bundle.getAbilityLabel(BUNDLE_NAME, ABILITY_NAME).then((data) => { + util.info("getAbilityLabelTest success:" + JSON.stringify(data)); + expect(data).assertFail(); + }).catch((error) => { + util.info("getAbilityLabelTest err" + JSON.stringify(error)); + expect(error).assertEqual(1); + }); + bundle.getAbilityLabel(BUNDLE_NAME, ABILITY_NAME, (error, data) => { + util.info("getAbilityLabelTest success:" + JSON.stringify(data)); + util.info("getAbilityLabelTest err" + JSON.stringify(error)); + expect(error).assertEqual(1); + done(); + }); + }); + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0093 + * @tc.name getAbilityIconTest + * @tc.desc Test getAbilityIcon of API8 in version9 normal project + */ + it('getAbilityIconTest', 0, async function (done) { + await bundle.getAbilityIcon(BUNDLE_NAME, ABILITY_NAME).then(data => { + util.info("getAbilityIconTest success:" + JSON.stringify(data)); + expect(data).assertFail(); + }).catch((error) => { + util.info("getAbilityIconTest err" + JSON.stringify(error)); + expect(error).assertEqual(1); + }); + bundle.getAbilityIcon(BUNDLE_NAME, ABILITY_NAME, (error, data) => { + util.info("getAbilityIconTest success:" + JSON.stringify(data)); + util.info("getAbilityIconTest err" + JSON.stringify(error)); + expect(error).assertEqual(1); + done(); + }); + }); + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0094 + * @tc.name isAbilityEnabledTest + * @tc.desc Test isAbilityEnabled of API8 in version9 normal project + */ + it('isAbilityEnabledTest', 0, async function (done) { + let abilityInfo = generateAbilityInfoForTest(BUNDLE_NAME,ABILITY_NAME); + await bundle.isAbilityEnabled(abilityInfo).then((data) => { + expect(data).assertFalse(); + }).catch((error) => { + expect(error).assertFail(); + }); + bundle.isAbilityEnabled(abilityInfo, (error, data) => { + expect(error.code).assertEqual(0); + expect(data).assertFalse(); + done(); + }) + }) + + /** + * @tc.number SUB_BMS_SYSTEMAPI_RUNNING_0095 + * @tc.name isApplicationEnabledTest + * @tc.desc Test isApplicationEnabled of API8 in version9 normal project + */ + it('isApplicationEnabledTest', 0, async function (done) { + await bundle.isApplicationEnabled(BUNDLE_NAME).then((data) => { + expect(data).assertFalse(); + }).catch((error) => { + expect(error).assertFail(); + }); + bundle.isApplicationEnabled(BUNDLE_NAME, (error, data) => { + expect(error.code).assertEqual(0); + expect(data).assertFalse(); + done(); + }); + }); + + function generateAbilityInfoForTest(bundleName, name) { + let map1 = new Map([ + ["", [{ + "name": "", "value": "", "extra": "" + }]] + ]); + let map2 = new Map([ + ["", [{ + "name": "", "value": "", "resource": "" + }]] + ]); + let resource = { + "bundleName": "", "moduleName": "", "id": 0 + } + let abilityInfo = { + bundleName: bundleName, + name: name, + label: "", + description: "", + icon: "", + labelId: 0, + descriptionId: 0, + iconId: 0, + moduleName: "", + process: "", + targetAbility: "", + backgroundModes: 0, + isVisible: true, + formEnabled: true, + type: 0, + subType: 0, + orientation: 0, + launchMode: 0, + permissions: [], deviceTypes: [], deviceCapabilities: [], readPermission: "", writePermission: "", + applicationInfo: { + name: "", description: "", descriptionId: 0, systemApp: true, enabled: true, label: "", + labelId: "", labelIndex: 0, icon: "", iconId: "", iconIndex: 0, process: "", supportedModes: 0, moduleSourceDirs: [], + permissions: [], moduleInfos: [], entryDir: "", codePath: "", metaData: map1, metadata: map2, + removable: true, accessTokenId: 0, uid: 0, entityType: "", fingerprint: "", + iconResource: resource, labelResource: resource, descriptionResource: resource, + appDistributionType :"" ,appProvisionType :"" + }, + uri: "", metaData: [], metadata: [], enabled: true, supportWindowMode: [], + maxWindowRatio: 0, minWindowRatio: 0, maxWindowWidth: 0, minWindowWidth: 0, maxWindowHeight: 0, minWindowHeight: 0 + }; + return abilityInfo; + } + }) + }) +} \ No newline at end of file diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/Utils.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/Utils.ets index f3b5fe7f6..7609914ba 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/Utils.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/Utils.ets @@ -13,7 +13,14 @@ * limitations under the License. */ +import hiLog from '@ohos.hilog'; + export default class Utils { + + static info(str) { + hiLog.info(0 , "BMSTEST" , str); + } + static sleep(time) { return new Promise((resolve, reject) => { setTimeout((data) => { diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/config.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/config.json index e9248d320..247924873 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/config.json +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagertest/src/main/config.json @@ -7,8 +7,8 @@ "name": "1.0" }, "apiVersion": { - "compatible": 5, - "target": 5, + "compatible": 8, + "target": 8, "releaseType": "Beta1" } }, -- GitLab