From 973dc775b21b5d436a18a541d49c8c4e44f50f0b Mon Sep 17 00:00:00 2001 From: "kirl.liu" Date: Fri, 11 Mar 2022 18:23:35 +0800 Subject: [PATCH] CoverageRate Info Signed-off-by: kirl.liu --- .../ActsAbilityLifecycleStateNewTest/BUILD.gn | 31 ++ .../Test.json | 18 + .../entry/src/main/config.json | 91 +++++ .../signature/openharmony_sx.p7b | Bin 0 -> 3443 bytes .../entry/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../js/test/ActsDataAbilityJsTest.test.js | 326 +++++++++--------- .../entry/src/main/js/test/List.test.js | 2 +- .../BUILD.gn | 2 +- .../entry/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../main/js/test/ActsKillProcessTest.test.js | 2 +- .../entry/src/main/js/test/List.test.js | 2 +- .../BUILD.gn | 2 +- .../src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../ActsKillProcessWithAccountApi7/BUILD.gn | 2 +- .../entry/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- ...ActsStServiceAbilityClientCaseTest.test.js | 310 +++++++++++------ .../entry/src/main/js/test/List.test.js | 2 +- aafwk/aafwk_standard/BUILD.gn | 1 + .../amsgetabilityprocessinfo/BUILD.gn | 4 +- .../BUILD.gn | 2 +- .../Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 2 +- .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 2 +- .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../js/test/ActsProcessManageJsTest.test.js | 11 +- .../entry/src/main/js/test/List.test.js | 2 +- .../signature/openharmony_sx.p7b | Bin .../amsprocessmanageapi7/BUILD.gn | 2 +- .../actsprocessmanagejstest/BUILD.gn | 2 +- .../entry/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../js/test/ActsProcessManageJsTest.test.js | 2 +- .../entry/src/main/js/test/List.test.js | 2 +- .../pmsystemappa/BUILD.gn | 2 +- .../pmsystemappa/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../pmsystemappamulti/BUILD.gn | 2 +- .../src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../pmsystemappb/BUILD.gn | 2 +- .../pmsystemappb/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../pmvendorappa/BUILD.gn | 2 +- .../pmvendorappa/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../ActslanguageconfigAppATest/BUILD.gn | 4 +- .../src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../aafwk_standard/lanuageConfigapi7/BUILD.gn | 4 +- .../LanguageConfigTestApi7/BUILD.gn | 4 +- .../entry/src/main/js/default/app.js | 2 +- .../src/main/js/default/pages/index/index.css | 2 +- .../src/main/js/default/pages/index/index.hml | 14 - .../src/main/js/default/pages/index/index.js | 2 +- .../entry/src/main/js/test/List.test.js | 2 +- .../main/js/test/lanuageConfigapi7.test.js | 2 +- 66 files changed, 581 insertions(+), 325 deletions(-) create mode 100644 aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/BUILD.gn create mode 100644 aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/Test.json create mode 100644 aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/entry/src/main/config.json create mode 100644 aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/signature/openharmony_sx.p7b rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/BUILD.gn (96%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/Test.json (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/config.json (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/default/app.js (95%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/default/i18n/en-US.json (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/default/i18n/zh-CN.json (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/default/pages/index/index.css (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/default/pages/index/index.hml (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/default/pages/index/index.js (98%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/resources/base/element/string.json (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/resources/base/media/icon.png (100%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/test/ActsProcessManageJsTest.test.js (86%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/entry/src/main/js/test/List.test.js (86%) rename aafwk/aafwk_standard/amsgetabilityprocessinfo/{actsprocessmanagejstest => actsgetabilityprocessinfotest}/signature/openharmony_sx.p7b (100%) diff --git a/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/BUILD.gn b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/BUILD.gn new file mode 100644 index 000000000..6d054cbb5 --- /dev/null +++ b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/BUILD.gn @@ -0,0 +1,31 @@ +# 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. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAbilityLifecycleStateNewTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsAbilityLifecycleStateNewTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/Test.json b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/Test.json new file mode 100644 index 000000000..5d50464ea --- /dev/null +++ b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.amsst.actsabilitylifecyclestatenewtest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAbilityLifecycleStateNewTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/entry/src/main/config.json b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/entry/src/main/config.json new file mode 100644 index 000000000..6edeb0cfb --- /dev/null +++ b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/entry/src/main/config.json @@ -0,0 +1,91 @@ +{ + "app": { + "bundleName": "com.amsst.actsabilitylifecyclestatenewtest", + "vendor": "amsst", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.amsst.actsabilitylifecyclestatenewtest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.amsst.actsabilitylifecyclestatenewtest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} diff --git a/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858 GIT binary patch literal 3443 zcmcgvYj6|S8MPj^V?bbHu)zUrguxV$eOH!j$tfhe(&~j*^2(BJ8Bw#6Ru5a+m8F$e z7KKoe&=>-grhpq>=4Bu;(DE|wG>}Juk_0FTWjZM)HPlI=G?d~bG!)vE?SRd|k4|RL z5AA&4J@@X}@1F16xgaj0Q_^NE(=Gc(#7pJ3#zhN2Tx93-c#sGTPf1&_OvfVyLOu_~ zlSe%S@>=7`Ny51BKMTc;WGL*TDT$MIk>XNl)`J8^1h|A4DgXsQJWCvj_*`5l2htLU zQb|hWZthQ3EO$wia-fh9N)kXtGPj$A6damq3MM9pNIyx0NiIPIgA$i7%!GW72$Oi< z0D=zJ`Y49^Lr|^Wn5#m~7QIHVf-PuY)=pu1y$Xw|RIr2ez^opDJ$jTdsS0Ci7(+as25)_x zsT{}EFl&V|Ef!V9U<2YYRwA&?0@oW&+zMu#MLjlkC63QUS*F~nt&CJ?HBF8xWrVb# zH5lU5!jKhJMKRn`g!moxUavC%H9DwzPo=ifYo{C*v<_3DeJD7J5s#wqYJ_!Y{dKl# zbI>7`d2oQTI#itWjMb#pQF0&==*tju`)aL$UCE23tZj*onZ@#D%qMUx!zW7U>s7pT(2?vZB-yTR}BaHF_^_p z>A)i>RKq&8(V$JL0R&eIy~f~oaNp~cTG=WKY(YHEf$Hj!M5XOif2}bDVT~#nwm57i z6^;k1BfkI#2a7>4e42{8g?g`>nbo*tA?vQh{fRzIem6Y!&u8`Yow^C zqOv67Mm26i&zNJdsSk}S5ZJ9i5g1b;GMLpRDryEM1hJu-awZyzc>Q+DX-4p{!Nodj z8p@BoYeJz0+)sJZt zuEPepall8Mbf92R2NrOKP{5F3h655oKi75PrZ7VWYMqI0@AnHgNidN_?~A>hO$>~4 z^Tb@Mb6p+qg%i#dPPBT6TPfsoGNel~WMtla4$I*p39k?b>wSH06QT&ecu{LS5j7WKgGt{%Qg#tlx5^zGpL0XEyDon}XtBlYX@N6O&mN9(L z$3WvjRw6q*BYjXd*Fq8jXbPB|7!qV;4<3SpL4U$-IR3dR7);6%Ng*HwQb@`@>Ox+;D8{>7P%3W3Q%Usi-A~_qV+>e)rntOWl*O-6dZMKE8F5;?K0akaPU^t@xU> z%=cfHofS|kPL6wHyBU;&9FES!DZ+6ebIF)LFY6Fz{&D!$xgA|o7k1uCUbIc31tSxH zQ9Ry%g+c*8bqSc5h(`)Dg=0P>uD!i0X1s82?ZKCCB;WhGR>U(8-7|qN3Ap)CQv0fX zX>mu>K3(2u5yPDS2i~g-k`cK-?+g}k~KDu+;-P*Btr{$~&b>;qGA|AHs7nh`J|G6Cj zFM?4Cp=2b4lMDphW2lmNDT9=hRhqu_t?@tZNiwycZ^=K%z>ov)XaXk~tj_oQ`@1 zbTo;4XZBDgPjUAKnGqx}k`C5UB78cI_yh?}-u&gMP5ZOtdzXK(qxOqy@YH| zKVg=t_U%sjdhgBr><=%#F8a;Uk{yeK)y=0CKNmdE*mmS2GpIWB>H6u#<%c`=zqcWK z9HF5KQ#7Oa~pEP2)s#v~d&wROM>gVs@EXK<+yLWhcgU&n0TfndfCpllJ0~-G1 zq|eQ>U0Y7f|Lt@0PS { - console.debug('= ACTS_beforeAll 1425 ====: ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper)); + console.debug('ACTS_AbeforeAll DAHelper ====>: ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper)); if(DAHelper == null){ - console.debug('ACTS_beforeAll DAHelper ====>: DAHelper == null'); + console.debug('ACTS_AbeforeAll DAHelper ====>: DAHelper == null'); } } catch (err) { - console.error('=ACTS_beforeAll acquireDataAbilityHelper catch(err)====>:' + err); + console.error('=ACTS_AbeforeAll acquireDataAbilityHelper catch(err)====>:' + err); } - console.debug('= ACTS_beforeAll ==== { - console.debug('= ACTS_beforeEach ==== { - console.debug('= ACTS_afterEach ==== { - console.debug('= ACTS_afterAll ====: ' + DAHelper) + var currentAlertTimeout; try { + function onAsyncCallbackInsert0800(err) { + clearTimeout(currentAlertTimeout); + expect(err.code).assertEqual(0); + console.log('ACTS_AInsert_0800==== { - console.debug("=ACTS_Insert_0400 err,data=======>" + console.debug("=ACTS_AInsert_0800 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(data).assertEqual(1); - console.log('ACTS_Insert_0400====:' + err); - console.log('ACTS_Insert_0400====:' + err); + console.log('ACTS_AInsert_0800====: ' + DAHelper) var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, @@ -129,27 +141,27 @@ it('ACTS_BatchInsert_0600', 0, async function (done) { dataAbilityUri, valueBucketArray, (err, data) => { - console.debug("=ACTS_BatchInsert_0600 err,data=======>" + console.debug("=ACTS_ABatchInsert_0600 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(data).assertEqual(3); - console.log('ACTS_BatchInsert_0600====:' + err); - console.log('ACTS_BatchInsert_0600====:' + err); + console.log('ACTS_ABatchInsert_0600==== { - console.debug("=ACTS_Query_0400 query err,data=======>" + console.debug("=ACTS_AQuery_0400 query err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + " , " + data); expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_0400====:' + err); - console.log('ACTS_Query_0400====:' + err); + console.log('ACTS_AQuery_0400====: ' + DAHelper) try { let predicates = new ohosDataAbility.DataAbilityPredicates(); @@ -190,34 +202,34 @@ it('ACTS_Update_0400', 0, async function (done) { predicates.limitAs(10); predicates.orderByAsc("order_by_class"); predicates.offsetAs(1); - console.debug("=ACTS_Update_0400 predicates====>" + console.debug("=ACTS_AUpdate_0400 predicates====>" + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); await DAHelper.update( dataAbilityUri, valueBucket, predicates, (err, data) => { - console.debug("=ACTS_Update_0400 err,data=======>" + console.debug("=ACTS_AUpdate_0400 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(data).assertEqual(1); - console.log('ACTS_Update_0400====:' + err); - console.log('ACTS_Update_0400====:' + err); + console.log('ACTS_AUpdate_0400====: ' + DAHelper) try { let predicates = new ohosDataAbility.DataAbilityPredicates(); @@ -225,32 +237,32 @@ it('ACTS_Delete_0400', 0, async function (done) { predicates.limitAs(10); predicates.orderByAsc("order_by_class"); predicates.offsetAs(1); - console.debug("=ACTS_Delete_0400 predicates====>" + console.debug("=ACTS_ADelete_0400 predicates====>" + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); await DAHelper.delete( dataAbilityUri, predicates, (err, data) => { - console.debug("=ACTS_Delete_0400 err,data=======>" + console.debug("=ACTS_ADelete_0400 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(data).assertEqual(0); - console.log('ACTS_Delete_0400====:' + err); - console.log('ACTS_Delete_0400====:' + err); + console.log('ACTS_ADelete_0400====: ' + DAHelper) let mimeTypeFilter = '*/*' try { @@ -258,12 +270,12 @@ it('ACTS_GetFileTypes_0200', 0, async function (done) { dataAbilityUri, mimeTypeFilter, (err, data) => { - console.debug("=ACTS_GetFileTypes_0200 getFileTypes err,data=======>" + console.debug("=ACTS_AGetFileTypes_0200 getFileTypes err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_0200 data.length ====>: ' + data.length); + console.log('=ACTS_AGetFileTypes_0200 data.length ====>: ' + data.length); for (var i = 0; i < data.length; i++) { expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0200 for data ====>: ' + err.code + + console.log('=ACTS_AGetFileTypes_0200 for data ====>: ' + err.code + " data[" + i + "]: " + data[i]); if (i == 0) { expect(data[i]).assertEqual("hap"); @@ -273,147 +285,147 @@ it('ACTS_GetFileTypes_0200', 0, async function (done) { expect(data[i]).assertEqual("image/png"); } } - console.log('ACTS_GetFileTypes_0200====:' + err); - console.log('ACTS_GetFileTypes_0200====:' + err); + console.log('ACTS_AGetFileTypes_0200====: ' + DAHelper) try { await DAHelper.getType( dataAbilityUri, (err, data) => { - console.debug("=ACTS_GetType_0200 err,data=======>" + console.debug("=ACTS_AGetType_0200 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(dataAbilityUri); - console.log('ACTS_GetType_0200====:' + err); - console.log('ACTS_GetType_0200====:' + err); + console.log('ACTS_AGetType_0200====: ' + DAHelper) + console.log('featureAbility ACTS_AOpenFile_0700 OpenFile getDataAbilityHelper ====>: ' + DAHelper) var mode = "r"; try { DAHelper.openFile( dataAbilityUri, mode, (err, data) => { - console.debug("=ACTS_OpenFile_0700 err,data=======>" + console.debug("=ACTS_AOpenFile_0700 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(typeof (data)).assertEqual("number"); - console.log('DataAbilityHelper ACTS_OpenFile_0700 OpenFile asyncCallback errCode ====>: ' + console.log('DataAbilityHelper ACTS_AOpenFile_0700 OpenFile asyncCallback errCode ====>: ' + err.code + " data: " + data); ret = true done(); }, ); } catch (err) { - console.error('=ACTS_OpenFile_0700 getType AsyncCallback catch(err)====>:' + err); + console.error('=ACTS_AOpenFile_0700 getType AsyncCallback catch(err)====>:' + err); ret = false done(); } setTimeout(function () { console.log('setTimeout function====<'); }, gSetTimeout); - console.log('ACTS_OpenFile_0700====: ' + DAHelper) try { DAHelper.normalizeUri( dataAbilityUri, (err, data) => { - console.debug("=ACTS_NormalizeUri_0200 err,data=======>" + console.debug("=ACTS_ANormalizeUri_0200 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(data).assertEqual(dataAbilityUri); - console.log('ACTS_NormalizeUri_0200====:' + err); - console.log('ACTS_NormalizeUri_0200====:' + err); + console.log('ACTS_ANormalizeUri_0200====: ' + DAHelper) try { DAHelper.denormalizeUri( dataAbilityUri, (err, data) => { - console.debug("=ACTS_DenormalizeUri_0200 err,data=======>" + console.debug("=ACTS_ADenormalizeUri_0200 err,data=======>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); expect(data).assertEqual(dataAbilityUri); - console.log('ACTS_DenormalizeUri_0200====:' + err); - console.log('ACTS_DenormalizeUri_0200====:' + err); + console.log('ACTS_ADenormalizeUri_0200==== { - console.debug("=ACTS_OnOff_0100 err=======>" + console.debug("=ACTS_AOnOff_0100 err=======>" + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); expect(err.code).assertEqual(0); } ); } } catch (err) { - console.error('=ACTS_OnOff_0100 catch(err)====>:' + err); - console.log('ACTS_OnOff_0100====:' + err); + console.log('ACTS_AOnOff_0100===="); + console.debug("=ACTS_AOnOff_0200 onAsyncCallback0200=======>"); expect(false).assertTrue(); clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_0200==== { if (err.code != 0) { - console.debug("=ACTS_OnOff_0200 err=======>" + console.debug("=ACTS_AOnOff_0200 err=======>" + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); expect(false).assertTrue(); - console.log('ACTS_OnOff_0200==== { expect(err.code).assertEqual(0); - console.log('ACTS_OnOff_0200====:' + err); - console.log('ACTS_OnOff_0200====:' + err); + console.log('ACTS_AOnOff_0200==== { - console.debug("=ACTS_ExecuteBatch_Insert_0400 executeBatch err,data====>" + console.debug("=ACTS_AExecuteBatch_Insert_0400 executeBatch err,data====>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length); expect(err.code).assertEqual(0); expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0400====:' + console.error('=ACTS_AExecuteBatch_Insert_0400 catch(err)====>:' + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - console.debug('ACTS_ExecuteBatch_Insert_0400==== { - console.debug("=ACTS_ExecuteBatch_Update_0400 executeBatch err,data====>" + console.debug("=ACTS_AExecuteBatch_Update_0400 executeBatch err,data====>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + (" 】;") + DataAbilityResult.length); for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].uri ====>: ' + console.debug('=ACTS_AExecuteBatch_Update_0400 for data[' + i + '].uri ====>: ' + DataAbilityResult[i].uri) expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].count ====>: ' + console.debug('=ACTS_AExecuteBatch_Update_0400 for data[' + i + '].count ====>: ' + DataAbilityResult[i].count) expect(DataAbilityResult[i].count).assertEqual(1); } - console.debug('ACTS_ExecuteBatch_Update_0400====:' + console.error('=ACTS_AExecuteBatch_Update_0400 catch(err)====>:' + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - console.debug('ACTS_ExecuteBatch_Update_0400==== { - console.debug("=ACTS_ExecuteBatch_Assert_0400 executeBatch err,data====>" + console.debug("=ACTS_AExecuteBatch_Assert_0400 executeBatch err,data====>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length); expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Assert_0400====:' + console.error('=ACTS_AExecuteBatch_Assert_0400 catch(err)====>:' + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - console.debug('ACTS_ExecuteBatch_Assert_0400==== { - console.debug("=ACTS_ExecuteBatch_Delete_0400 executeBatch err,data====>" + console.debug("=ACTS_AExecuteBatch_Delete_0400 executeBatch err,data====>" + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + (" 】;") + DataAbilityResult.length); for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].uri ====>: ' + console.debug('=ACTS_AExecuteBatch_Delete_0400 for data[' + i + '].uri ====>: ' + DataAbilityResult[i].uri) expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].count ====>: ' + console.debug('=ACTS_AExecuteBatch_Delete_0400 for data[' + i + '].count ====>: ' + DataAbilityResult[i].count) expect(DataAbilityResult[i].count).assertEqual(1); } - console.debug('ACTS_ExecuteBatch_Delete_0400====:' + console.error('=ACTS_AExecuteBatch_Delete_0400 catch(err)====>:' + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - console.debug('ACTS_ExecuteBatch_Delete_0400====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); + console.debug('ACTS_AbeforeAll rDAHelper ====>: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); expect(typeof (rDAHelper)).assertEqual("object"); rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0100 then data====>" + console.debug("=ACTS_ARelease_0100 then data====>" + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); expect(data).assertEqual(true); - console.log('ACTS_Release_0100==== { - console.debug("=ACTS_Release_0100 catch err ====>" + console.debug("=ACTS_ARelease_0100 catch err ====>" + ("json err 【") + JSON.stringify(err) + (" 】 ")); expect(false).assertTrue(); - console.log('ACTS_Release_0100====:' + err); - console.log('ACTS_Release_0100====:' + err); + console.log('ACTS_ARelease_0100==== { - console.debug("=ACTS_unsubscribe (err,data)=======>" + console.debug("=ACTS_Aunsubscribe (err,data)=======>" + (caller) + (" , json err【") + JSON.stringify(err) + (" 】") + ("json data【") + JSON.stringify(data) + (" 】") @@ -97,8 +49,8 @@ describe('ActsStServiceAbilityTest', function () { } let gSetTimeout = 1000 beforeAll(async (done) => { - console.debug('= ACTS_beforeAll 1127 ==== { @@ -112,22 +64,22 @@ describe('ActsStServiceAbilityTest', function () { }, gSetTimeout); }) afterAll((done) => { - console.debug('= ACTS_afterAll ===={ - console.log('ACTS_AbilityStartSetting_0100 asyncCallback errCode : ' + JSON.stringify(err) + console.log('ACTS_AAbilityStartSetting_0100 asyncCallback errCode : ' + JSON.stringify(err) + " data: " + JSON.stringify(data)); expect(2097152).assertEqual(err.code); done(); }); }catch(error){ - console.log("ACTS_AbilityStartSetting_0100 : error = " + error); + console.log("ACTS_AAbilityStartSetting_0100 : error = " + error); done(); } }) + /* + * @tc.number ACTS_AAbilityStartSettingNew_0200 + * @tc.name The configured URI is started and the page is not configured + * @tc.desc Function test + * @tc.level 0 + */ + it("ACTS_AAbilityStartSettingNew_0200",0, async function(done){ + console.info("ACTS_logMessage 1 ACTS_AAbilityStartSettingNew_0200-------------------"); + try{ + let Want = { + bundleName: "com.example.abilityStartSettingApp2", + abilityName: "com.example.abilityStartSettingApp.MainAbility", + } + + let abilityStartSetting ={ + [featureAbility.AbilityStartSetting.BOUNDS_KEY] : [100,200,300,400], + [featureAbility.AbilityStartSetting.WINDOW_MODE_KEY] : + featureAbility.AbilityWindowConfiguration.WINDOW_MODE_UNDEFINED, + [featureAbility.AbilityStartSetting.DISPLAY_ID_KEY] : 1, + } + + var StartAbilityParameter = { + want:Want, + abilityStartSetting:abilityStartSetting + } + + featureAbility.startAbility(StartAbilityParameter,(err,data)=>{ + console.log('ACTS_AAbilityStartSettingNew_0200 asyncCallback errCode : ' + JSON.stringify(err) + + " data: " + JSON.stringify(data)); + expect(2097152).assertEqual(err.code); + done(); + }); + }catch(error){ + console.log("ACTS_AAbilityStartSettingNew_0200 : error = " + error); + done(); + } +}) + +/* + * @tc.number ACTS_AAbilityStartSettingNew_0300 + * @tc.name The configured URI is started and the page is not configured + * @tc.desc Function test + * @tc.level 0 + */ +it("ACTS_AAbilityStartSettingNew_0300",0, async function(done){ + console.info("ACTS_logMessage 1 ACTS_AAbilityStartSettingNew_0300-------------------"); + try{ + let Want = { + bundleName: "com.example.abilityStartSettingApp", + abilityName: "com.example.abilityStartSettingApp.MainAbility2", + } + + let abilityStartSetting ={ + [featureAbility.AbilityStartSetting.BOUNDS_KEY] : [100,200,300,400], + [featureAbility.AbilityStartSetting.WINDOW_MODE_KEY] : + featureAbility.AbilityWindowConfiguration.WINDOW_MODE_SPLIT_PRIMARY, + [featureAbility.AbilityStartSetting.DISPLAY_ID_KEY] : 1, + } + + var StartAbilityParameter = { + want:Want, + abilityStartSetting:abilityStartSetting + } + + featureAbility.startAbility(StartAbilityParameter,(err,data)=>{ + console.log('ACTS_AAbilityStartSettingNew_0300 asyncCallback errCode : ' + JSON.stringify(err) + + " data: " + JSON.stringify(data)); + expect(2097152).assertEqual(err.code); + done(); + }); + }catch(error){ + console.log("ACTS_AAbilityStartSettingNew_0300 : error = " + error); + done(); + } +}) + +/* + * @tc.number ACTS_AAbilityStartSettingNew_0400 + * @tc.name The configured URI is started and the page is not configured + * @tc.desc Function test + * @tc.level 0 + */ +it("ACTS_AAbilityStartSettingNew_0400",0, async function(done){ + console.info("ACTS_logMessage 1 ACTS_AAbilityStartSettingNew_0400-------------------"); + try{ + let Want = { + bundlame: "com.example.abilityStartSettingApp", + abilityName: "com.example.abilityStartSettingApp.MainAbility", + } + + let abilityStartSetting ={ + [featureAbility.AbilityStartSetting.BOUNDS_KEY] : [100,200,300,400], + [featureAbility.AbilityStartSetting.WINDOW_MODE_KEY] : + featureAbility.AbilityWindowConfiguration.WINDOW_MODE_SPLIT_SECONDARY, + [featureAbility.AbilityStartSetting.DISPLAY_ID_KEY] : 1, + } + + var StartAbilityParameter = { + want:Want, + abilityStartSetting:abilityStartSetting + } + + featureAbility.startAbility(StartAbilityParameter,(err,data)=>{ + console.log('ACTS_AAbilityStartSettingNew_0400 asyncCallback errCode : ' + JSON.stringify(err) + + " data: " + JSON.stringify(data)); + expect(2097152).assertEqual(err.code); + done(); + }); + }catch(error){ + console.log("ACTS_AAbilityStartSettingNew_0400 : error = " + error); + done(); + } +}) + +/* + * @tc.number ACTS_AAbilityStartSettingNew_0500 + * @tc.name The configured URI is started and the page is not configured + * @tc.desc Function test + * @tc.level 0 + */ +it("ACTS_AAbilityStartSettingNew_0500",0, async function(done){ + console.info("ACTS_--------ACTS_AAbilityStartSettingNew_0500------"); + try{ + let Want = { + bundleName: "com.example.abilityStartSettingApp", + abilityName: "com.example.abilityStartSettingApp.MainAbility", + } + + let abilityStartSetting ={ + [featureAbility.AbilityStartSetting.BOUNDS_KEY] : [100,200,300,400], + [featureAbility.AbilityStartSetting.WINDOW_MODE_KEY] : + featureAbility.AbilityWindowConfiguration.WINDOW_MODE_FLOATING, + [featureAbility.AbilityStartSetting.DISPLAY_ID_KEY] : 1, + } + + var StartAbilityParameter = { + want:Want, + abilityStartSetting:abilityStartSetting + } + + featureAbility.startAbility(StartAbilityParameter,(err,data)=>{ + console.log('ACTS_AAbilityStartSettingNew_0500 asyncCallback errCode : ' + JSON.stringify(err) + + " data: " + JSON.stringify(data)); + expect(2097152).assertEqual(err.code); + done(); + }); + }catch(error){ + console.log("ACTS_AAbilityStartSettingNew_0500 : error = " + error); + done(); + } +}) + /* - * @tc.number: ACTS_JsServiceAbility_0600 + * @tc.number: ACTS_AJsServiceAbility_0600 * @tc.name: featureAbility.ConnectAbility : Connects an ability to a Service ability. * @tc.desc: Check the return value of the interface (by AsyncCallback) */ - it('ACTS_JsServiceAbility_0600', 0, async function (done) { - console.log('ACTS_JsServiceAbility_0600==== { - console.debug("=ACTS_JsServiceAbility_0600 createSubscriber .then(data)=======>" + console.debug("=ACTS_AJsServiceAbility_0600 createSubscriber .then(data)=======>" + ("json data【") + JSON.stringify(data) + (" 】") + " ,data=" + data); subscriber0600 = data; await commonEvent.subscribe(subscriber0600, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0600 subscribe (err,data)=======>" + console.debug("=ACTS_AJsServiceAbility_0600 subscribe (err,data)=======>" + ("json err【") + JSON.stringify(err) + (" 】") + ("json data【") + JSON.stringify(data) + (" 】") + " ,err=" + err + " ,data=" + data); - if (data.event != "ACTS_SerivceAbilityServer_onDisConnect") { - expect("ACTS_SerivceAbilityServer_onConnect_PageConnectService_0600").assertEqual( + if (data.event != "ACTS_ASerivceAbilityServer_onDisConnect") { + expect("ACTS_ASerivceAbilityServer_onConnect_PageConnectService_0600").assertEqual( data.event); featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => { - console.debug("=ACTS_JsServiceAbility_0600 disconnectAbility err====>" + console.debug("=ACTS_AJsServiceAbility_0600 disconnectAbility err====>" + ("json err=") + JSON.stringify(err)); }) } else { clearTimeout(currentAlertTimeout); - expect("ACTS_SerivceAbilityServer_onDisConnect").assertEqual( + expect("ACTS_ASerivceAbilityServer_onDisConnect").assertEqual( data.event); - unsubscribe("ACTS_JsServiceAbility_0600_unsubscribe", subscriber0600); - console.log('ACTS_JsServiceAbility_0600==== mConnIdJsAsyncCallback=' + console.debug('ACTS_AJsServiceAbility_0600_onConnectCallback ====> mConnIdJsAsyncCallback=' + JSON.stringify(mConnIdJsAsyncCallback) + " , " + mConnIdJsAsyncCallback); - console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> element=' + console.debug('ACTS_AJsServiceAbility_0600_onConnectCallback ====> element=' + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote=' + console.debug('ACTS_AJsServiceAbility_0600_onConnectCallback ====> remote=' + JSON.stringify(remote) + " , " + remote); - console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote is proxy:' + console.debug('ACTS_AJsServiceAbility_0600_onConnectCallback ====> remote is proxy:' + (remote instanceof rpc.RemoteProxy)); } function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_0600_onDisconnectCallback ====> element=' + console.debug('ACTS_AJsServiceAbility_0600_onDisconnectCallback ====> element=' + JSON.stringify(element) + " , " + element); } function onFailedCallback(code) { - console.debug('ACTS_JsServiceAbility_0600_onFailedCallback ====> code=' + console.debug('ACTS_AJsServiceAbility_0600_onFailedCallback ====> code=' + JSON.stringify(code) + " , " + code) expect(code==featureAbility.ErrorCode.ABILITY_NOT_FOUND || (code!=featureAbility.ErrorCode.NO_ERROR @@ -234,71 +338,71 @@ describe('ActsStServiceAbilityTest', function () { ) currentAlertTimeout = setTimeout(mySetTimeout, gSetTimeout); function mySetTimeout() { - console.log('ACTS_JsServiceAbility_1400==== { - console.debug("=ACTS_JsServiceAbility_1400 createSubscriber .then(data)=======>" + console.debug("=ACTS_AJsServiceAbility_1400 createSubscriber .then(data)=======>" + ("json data【") + JSON.stringify(data) + (" 】") + " ,data=" + data); subscriber1400 = data; await commonEvent.subscribe(subscriber1400, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_1400 subscribe (err,data)=======>" + console.debug("=ACTS_AJsServiceAbility_1400 subscribe (err,data)=======>" + ("json err【") + JSON.stringify(err) + (" 】") + ("json data【") + JSON.stringify(data) + (" 】") + " ,err=" + err + " ,data=" + data); - if (data.event != "ACTS_SerivceAbilityServerSecond_onDisConnect") { - expect("ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1400" + if (data.event != "ACTS_ASerivceAbilityServerSecond_onDisConnect") { + expect("ACTS_ASerivceAbilityServerSecond_onConnect_ServiceConnectService_1400" ).assertEqual(data.event); featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => { - console.debug("=ACTS_JsServiceAbility_1400 disconnectAbility err====>" + console.debug("=ACTS_AJsServiceAbility_1400 disconnectAbility err====>" + ("json err=") + JSON.stringify(err)); }) } else { clearTimeout(currentAlertTimeout); - expect("ACTS_SerivceAbilityServerSecond_onDisConnect").assertEqual( + expect("ACTS_ASerivceAbilityServerSecond_onDisConnect").assertEqual( data.event); - unsubscribe("ACTS_JsServiceAbility_1400_unsubscribe", subscriber1400); - console.log('ACTS_JsServiceAbility_1400==== mConnIdJsAsyncCallback=' + console.debug('ACTS_AJsServiceAbility_1400_onConnectCallback ====> mConnIdJsAsyncCallback=' + JSON.stringify(mConnIdJsAsyncCallback) + " , " + mConnIdJsAsyncCallback); - console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> element=' + console.debug('ACTS_AJsServiceAbility_1400_onConnectCallback ====> element=' + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote=' + console.debug('ACTS_AJsServiceAbility_1400_onConnectCallback ====> remote=' + JSON.stringify(remote) + " , " + remote); - console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote is proxy:' + console.debug('ACTS_AJsServiceAbility_1400_onConnectCallback ====> remote is proxy:' + (remote instanceof rpc.RemoteProxy)); } function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_1400_onDisconnectCallback ====> element=' + console.debug('ACTS_AJsServiceAbility_1400_onDisconnectCallback ====> element=' + JSON.stringify(element) + " , " + element); } function onFailedCallback(code) { - console.debug('ACTS_JsServiceAbility_1400_onFailedCallback ====> code=' + console.debug('ACTS_AJsServiceAbility_1400_onFailedCallback ====> code=' + JSON.stringify(code) + " , " + code) } @@ -317,12 +421,12 @@ describe('ActsStServiceAbilityTest', function () { currentAlertTimeout = setTimeout(mySetTimeout, gSetTimeout); function mySetTimeout() { - console.log('ACTS_JsServiceAbility_1400==== {{ $t('strings.hello') }} {{ title }} diff --git a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/default/pages/index/index.js index ee3a7077b..a6d4c3ea6 100644 --- a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/List.test.js index 3fe075052..2da59da1b 100644 --- a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/lanuageConfigapi7.test.js b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/lanuageConfigapi7.test.js index 6a6de95cb..7449100aa 100644 --- a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/lanuageConfigapi7.test.js +++ b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/lanuageConfigapi7.test.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 -- GitLab