diff --git a/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/BUILD.gn b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..6d054cbb5d6f2de2fc981ff270c14d088e2f9651 --- /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 0000000000000000000000000000000000000000..5d50464ea29f7c7969e7d6dda089c2049a1807c1 --- /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 0000000000000000000000000000000000000000..6edeb0cfb52c2bc2225d8cc2de304c79b76b1c98 --- /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 Binary files /dev/null and b/aafwk/aafwk_standard/ActsAbilityLifecycleStateNewTest/signature/openharmony_sx.p7b differ diff --git a/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/default/app.js index 042038cfc6360ed972035a85e944904021ffb1d6..11ca2c1d6428bbb29c4a01126536132868c5df26 100644 --- a/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/default/app.js +++ b/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/default/app.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/ActsDataAbilityJsTest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/default/pages/index/index.js index 8d0e011ec04e9ffc7bf198f067f8768141aa2c9a..c98a171401e54e045871dd4f7c141b7ef7ed3cfe 100644 --- a/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/ActsDataAbilityJsTest/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/ActsDataAbilityJsTest/entry/src/main/js/test/ActsDataAbilityJsTest.test.js b/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/test/ActsDataAbilityJsTest.test.js index 29f1944296fffe47b945f07dc69afe36ff879dcc..01e2bfe05765e82f99e9105fa24807692a2d6f0e 100644 --- a/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/test/ActsDataAbilityJsTest.test.js +++ b/aafwk/aafwk_standard/ActsDataAbilityJsTest/entry/src/main/js/test/ActsDataAbilityJsTest.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 @@ -27,49 +27,49 @@ var valueBucket = { } beforeAll(async (done) => { - 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 ee3a7077b7d52935d3f70b5cb70e38ea9d0e33f1..a6d4c3ea607cf4251f2008ad271f48a0874e1ba2 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 3fe0750522ac92a3e9feb711aeaeee21ffd18b48..2da59da1b342f8c6db78527e89d0bc13e7e424a9 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 6a6de95cbdfb28b3fc34e469139d546441041831..7449100aaec47648d93789b5c83e49415628a5bb 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