diff --git a/aafwk/aafwk_standard/fwkdataaccessor/BUILD.gn b/aafwk/aafwk_standard/fwkdataaccessor/BUILD.gn deleted file mode 100644 index 1610d41d42131fe966ac4f31c3140888f1cb66bd..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# 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("ActsFWKDataAccessorTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsFWKDataAccessorTest" -} -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/fwkdataaccessor/Test.json b/aafwk/aafwk_standard/fwkdataaccessor/Test.json deleted file mode 100644 index c29113c7491b592aae42a926ce0642a26d0938ab..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.amsst.fwkdataaccessor", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFWKDataAccessorTest.hap", - "./resource/appexecfwk/amsStDataAbility.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/config.json b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/config.json deleted file mode 100644 index ba1f602704c7c4e9e762304de300f9da41f8cd69..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.amsst.fwkdataaccessor", - "vendor": "amsst", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.amsst.fwkdataaccessor", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home", - "flag.home.intent.from.system" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.amsst.fwkdataaccessor.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/app.js deleted file mode 100644 index 4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6724ec055a554cf3f9c7be83780c30df2274875b..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,12 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} -.titleST { - font-size: 32px; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 4f779dcdff4fa69413976fe7032ca3656758793a..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,8 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - - - STDataAbility - -
diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 4bfa4f7e4a4085d7336a97befffb8d52882d281d..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 file from '@system.file' -import app from '@system.app' -import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('====onShow finish====<') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const reportExtend = new ReportExtend(file) - core.addService('expect', expectExtend) - core.addService('report', reportExtend) - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index baf5b3c1c2a555bed22561a88aca6d857522d425..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "STDataAbility" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js b/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js deleted file mode 100644 index 6bf56224918a9d4413ff60c10697135ff74d076c..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js +++ /dev/null @@ -1,4167 +0,0 @@ -/* - * 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 featureAbility from '@ohos.ability.featureAbility' -import ohosDataAbility from '@ohos.data.dataability' - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsDataAbilityHelperTest', function () { - let dataAbilityUri = ("dataability:///com.ix.VerifyActDataAbility"); - let dataAbilityUri2 = ("dataability:///com.ix.VerifyActDataAbility2"); - let DAHelper; - let gSetTimeout = 500 - - beforeAll(async (done) => { - console.debug('= ACTS_beforeAll ====: ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper)); - } catch (err) { - console.error('=ACTS_beforeAll acquireDataAbilityHelper catch(err)====>:' + err); - } - console.debug('= ACTS_beforeAll ==== { - console.debug('= ACTS_afterAll ====" + dataAbilityUri) - try { - var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri) - console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: ' - + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) - expect(typeof (abilityHelper)).assertEqual("object"); - } catch (err) { - console.error('=ACTS_GetDataAbilityHelper_0100 acquireDataAbilityHelper catch(err)====>:' + err); - expect(false).assertTrue(); - } - done(); - console.log('ACTS_AcquireDataAbilityHelper_0100====: ' - + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) - if (JSON.stringify(abilityHelper) == 'undefined' || JSON.stringify(abilityHelper) == 'null') - expect(true).assertTrue(); - else - expect(false).assertTrue(); - } catch (err) { - console.error('=ACTS_GetDataAbilityHelper_0200 acquireDataAbilityHelper catch(err)====>:' + err); - expect(false).assertTrue(); - } - done(); - console.log('ACTS_AcquireDataAbilityHelper_0200====: ' + DAHelper) - let valueBucket - try { - DAHelper.insert(dataAbilityUri, valueBucket) - .then(function (data) { - console.debug("=ACTS_Insert_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - ret = true; - done(); - }).catch(function (err) { - console.debug("=ACTS_Insert_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false; - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_Insert_0100 catch(err)====>:' + err); - ret = false; - expect(false).assertTrue(); - done(); - } - - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Insert_0100====: ' + DAHelper) - let valueBucket - try { - await DAHelper.insert(dataAbilityUri, valueBucket, - (err, data) => { - console.debug("=ACTS_Insert_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】data【") + data + (" 】;")); - expect(data).assertEqual(1); - ret = true; - done(); - } - ); - } catch (err) { - console.error('=ACTS_Insert_0200 catch(err)====>:' + err); - ret = false; - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Insert_0200==== { - console.debug("=ACTS_Insert_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number"); - ret = true; - done(); - }).catch((err) => { - console.debug("=ACTS_Insert_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false; - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_Insert_0300 catch(err)====>:' + err); - ret = false; - expect(false).assertTrue(); - done(); - } - - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Insert_0300====: ' + DAHelper) - const valueBucket = { - "name": "ACTS_Insert_0400_rose1", - "age": 221, - "salary": 20.5, - "blobType": "u8", - } - try { - await DAHelper.insert(dataAbilityUri, valueBucket, - (err, data) => { - console.debug("=ACTS_Insert_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(1); - ret = true; - done(); - } - ); - } catch (err) { - console.error('=ACTS_Insert_0400 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Insert_0400====: ' + DAHelper) - var valueBucket; - try { - DAHelper.batchInsert( - dataAbilityUri, - valueBucket - ).then((data) => { - console.debug("=ACTS_BatchInsert_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】; ====>")); - expect(data).assertEqual(0); - ret = true; - done(); - }).catch((err) => { - console.debug("=ACTS_BatchInsert_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_BatchInsert_0100 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_BatchInsert_0100====: ' + DAHelper) - var valueBucket; - try { - await DAHelper.batchInsert( - dataAbilityUri, - valueBucket, - (err, data) => { - console.debug("=ACTS_BatchInsert_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(0); - ret = true; - done(); - }, - ); - } catch (err) { - console.error('=ACTS_BatchInsert_0200 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_BatchInsert_0200====: ' + DAHelper) - var valueBucketArray = new Array({}, {}, {}) - try { - DAHelper.batchInsert( - dataAbilityUri, - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】; ====>")); - expect(data).assertEqual(3); - ret = true; - done(); - }).catch((err) => { - console.debug("=ACTS_BatchInsert_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_BatchInsert_0300 batchInsert AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_BatchInsert_0300====: ' + DAHelper) - var valueBucketArray = new Array({}, {}, {}) - try { - await DAHelper.batchInsert( - dataAbilityUri, - valueBucketArray, - (err, data) => { - console.debug("=ACTS_BatchInsert_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(3); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_BatchInsert_0400 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_BatchInsert_0400====: ' + DAHelper) - try { - const valueBucket = { - "name": "ACTS_BatchInsert_0500_roe1", - "age": 21, - "salary": 20.5, - } - var valueBucketArray = new Array({ "name": "BatchInsert_0500_roe11", "age": 21, "salary": 20.5, }, - { "name": "BatchInsert_0500_roe12", "age": 21, "salary": 20.5, }, - { "name": "BatchInsert_0500_roe13", "age": 21, "salary": 20.5, }) - - DAHelper.batchInsert( - dataAbilityUri, - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(3); - ret = true - done(); - }).catch((err) => { - console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_BatchInsert_0500 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_BatchInsert_0500====: ' + DAHelper) - const valueBucket = { - "name": "BatchInsert_0600_roe1", - "age": 21, - "salary": 20.5, - } - var valueBucketArray = new Array({ "name": "BatchInsert_0600_roe11", "age": 21, "salary": 20.5, }, - { "name": "BatchInsert_0600_roe12", "age": 21, "salary": 20.5, }, - { "name": "BatchInsert_0600_roe13", "age": 21, "salary": 20.5, }) - try { - await DAHelper.batchInsert( - dataAbilityUri, - valueBucketArray, - (err, data) => { - console.debug("=ACTS_BatchInsert_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(3); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_BatchInsert_0600 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_BatchInsert_0600====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - done(); - } catch (err) { - console.error('=ACTS_Query_0300 query catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Query_0300==== { - console.debug("=ACTS_Query_0400 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - ret = true - done(); - }); - } catch (err) { - console.error('=ACTS_Query_0400 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Query_0400====: ' + DAHelper) - try { - let valueBucketNull = {}; - let predicates = new ohosDataAbility.DataAbilityPredicates(); - console.debug("=ACTS_Update_0100 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - dataAbilityUri, - valueBucketNull, - predicates - ).then((data) => { - console.debug("=ACTS_Update_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number"); - ret = true - done(); - }).catch((err) => { - console.debug("=ACTS_Update_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_Update_0100 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Update_0100====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - dataAbilityUri, - valueBucketNull, - predicates, - (err, data) => { - console.debug("=ACTS_Update_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_Update_0200 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Update_0200====: ' + DAHelper) - const valueBucket = { "name": "ACTS_Update_0300_roe1", "age": 21, "salary": 20.5, } - try { - let predicates = new ohosDataAbility.DataAbilityPredicates(); - predicates.equalTo('contact_id', 1); - predicates.limitAs(10); - predicates.orderByAsc("order_by_class"); - predicates.offsetAs(1); - console.debug("=ACTS_Update_0300 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - dataAbilityUri, - valueBucket, - predicates - ).then((data) => { - console.debug("=ACTS_Update_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - ret = true - done(); - }).catch((err) => { - console.debug("=ACTS_Update_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_Update_0300 update catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Update_0300====: ' + DAHelper) - const valueBucket = { "name": "ACTS_Update_0400_roe1", "age": 21, "salary": 20.5, } - try { - let predicates = new ohosDataAbility.DataAbilityPredicates(); - predicates.equalTo('contact_id', 1); - predicates.limitAs(10); - predicates.orderByAsc("order_by_class"); - predicates.offsetAs(1); - console.debug("=ACTS_Update_0400 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - dataAbilityUri, - valueBucket, - predicates, - (err, data) => { - console.debug("=ACTS_Update_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(1); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_Update_0400 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Update_0400====: ' + DAHelper) - try { - let predicates = new ohosDataAbility.DataAbilityPredicates(); - console.debug("=ACTS_Delete_0100 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - dataAbilityUri, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number"); - ret = true - done(); - }).catch((err) => { - console.debug("=ACTS_Delete_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_Delete_0100 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Delete_0100====: ' + DAHelper) - try { - let predicates = new ohosDataAbility.DataAbilityPredicates(); - console.debug("=ACTS_Delete_0200 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - dataAbilityUri, - predicates, - (err, data) => { - console.debug("=ACTS_Delete_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - expect(data).assertEqual(1); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_Delete_0200 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Delete_0200====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - var datadelete = DAHelper.delete( - dataAbilityUri, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - ret = true - done(); - }).catch((err) => { - console.debug("=ACTS_Delete_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - console.debug("=ACTS_Delete_0300 datadelete====>" - + ("json datadelete 【") + JSON.stringify(datadelete) + (" 】") + " , " + datadelete); - } catch (err) { - console.error('=ACTS_Delete_0300 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Delete_0300====: ' + DAHelper) - try { - let predicates = new ohosDataAbility.DataAbilityPredicates(); - predicates.equalTo('contact_id', 1); - predicates.limitAs(10); - predicates.orderByAsc("order_by_class"); - predicates.offsetAs(1); - console.debug("=ACTS_Delete_0400 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - dataAbilityUri, - predicates, - (err, data) => { - console.debug("=ACTS_Delete_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(1); - ret = true - done(); - }); - } catch (err) { - console.error('=ACTS_Delete_0400 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Delete_0400==== { - console.debug("=ACTS_GetFileTypes_0100 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0100 for data[' + i + '] ====>: ' + data[i]) - expect(data[i]).assertEqual(""); - } - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_GetFileTypes_0100 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - console.log('featureAbility getFileTypes promise ====>: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0100 getFileTypes AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetFileTypes_0100====: ' + DAHelper) - let mimeTypeFilter = '*/*' - try { - await DAHelper.getFileTypes( - dataAbilityUri, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_0200 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_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 + - " data[" + i + "]: " + data[i]); - expect(data[i]).assertEqual(""); - } - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_GetFileTypes_0200 getFileTypes AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetFileTypes_0200==== { - console.debug("=ACTS_GetFileTypes_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('= =ACTS_GetFileTypes_0300 for data[' + i + '] ====>: ' + data[i]) - expect(data[i]).assertEqual(""); - } - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_GetFileTypes_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('DataAbilityHelper getFileTypes error ====>: ' + err) - ret = false - expect(false).assertTrue(); - done(); - }); - console.log('featureAbility getFileTypes promise ====>: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0300 getFileTypes AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetFileTypes_0300====: ' + DAHelper) - let mimeTypeFilter = 'image/*' - try { - await DAHelper.getFileTypes( - dataAbilityUri, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0400 for ====>: ' + err.code + " data[" + i + "]: " + data[i]); - expect(data[i]).assertEqual(""); - } - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_GetFileTypes_0400 getFileTypes AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetFileTypes_0400==== { - console.debug("=ACTS_GetFileTypes_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0500 for data [' + i + '] ====>: ' + data[i]) - expect(data[i]).assertEqual(""); - } - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_GetFileTypes_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('DataAbilityHelper getFileTypes error ====>: ' + err) - ret = false - done(); - }); - console.log('=ACTS_GetFileTypes_0500 promise ====>: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0500 getFileTypes AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetFileTypes_0500====: ' + DAHelper) - let mimeTypeFilter = '*/jpg' - try { - await DAHelper.getFileTypes( - dataAbilityUri, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_0600 data.length ====>: ' + data.length); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0600 for errCode ====>: ' + err.code + - " data[" + i + "]: " + data[i]); - expect(data[i]).assertEqual(""); - } - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_GetFileTypes_0600 catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetFileTypes_0600==== { - console.debug("=ACTS_GetType_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - //expect(typeof(data)).assertEqual("string") - expect(data).assertEqual(dataAbilityUri); - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_GetFileTypes_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - console.log('featureAbility getType promise ====>: ' + promise) - } catch (err) { - console.error('=ACTS_GetType_0100 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetType_0100====: ' + DAHelper) - try { - await DAHelper.getType( - dataAbilityUri, - (err, data) => { - console.debug("=ACTS_GetType_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - //expect(typeof(data)).assertEqual("string"); - expect(data).assertEqual(dataAbilityUri); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_GetType_0200 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_GetType_0200==== { - console.debug("=ACTS_OpenFile_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number") - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_0100 getType catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0100==== { - console.debug("=ACTS_OpenFile_0200 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number") - console.log('DataAbilityHelper ACTS_OpenFile_0200 OpenFile promise ====>: ' + data) - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_0200 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_0200 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0200==== { - console.debug("=ACTS_OpenFile_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number") - console.log('DataAbilityHelper ACTS_OpenFile_0300 OpenFile promise ====>: ' + data) - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_0300 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0300==== { - console.debug("=ACTS_OpenFile_0400 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number") - console.log('DataAbilityHelper ACTS_OpenFile_0400 OpenFile promise ====>: ' + data) - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_0400 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_0400 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0400==== { - console.debug("=ACTS_OpenFile_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number") - console.log('DataAbilityHelper ACTS_OpenFile_0500 OpenFile promise ====>: ' + data) - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_0500 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0500==== { - console.debug("=ACTS_OpenFile_0600 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(typeof (data)).assertEqual("number") - console.log('DataAbilityHelper ACTS_OpenFile_0600 OpenFile promise ====>: ' + data) - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_0600 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_0600 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0600====: ' + DAHelper) - var mode = "r"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_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 ====>: ' - + err.code + " data: " + data); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_0700 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0700====: ' + DAHelper) - var mode = "w"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - console.log('DataAbilityHelper ACTS_OpenFile_0800 OpenFile asyncCallback errCode ====>: ' - + err.code + " data: " + data); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_0800 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0800====: ' + DAHelper) - var mode = "wt"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_0900 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - console.log('DataAbilityHelper ACTS_OpenFile_0900 OpenFile asyncCallback errCode ====>: ' - + err.code + " data: " + data); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_0900 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_0900====: ' + DAHelper) - var mode = "wa"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_1000 err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - console.log('DataAbilityHelper ACTS_OpenFile_1000 OpenFile asyncCallback errCode ====>: ' - + err.code + " data: " + data); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_1000 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_1000====: ' + DAHelper) - var mode = "rw"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_1100 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_1100 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_1100====: ' + DAHelper) - var mode = "rwt"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_1200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("number"); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_1200 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_1200====: ' + DAHelper) - try { - DAHelper.release( - dataAbilityUri, - ).then((data) => { - console.debug("=ACTS_Release_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - // expect(typeof(data)).assertEqual("boolean") - expect(data).assertEqual(true); - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_Release_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_Release_0100 release promise catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Release_0100====: ' + DAHelper) - try { - DAHelper.release( - dataAbilityUri, - (err, data) => { - console.debug("=ACTS_Release_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('featureAbility getDataAbilityHelper ACTS_Release_0100 data: ' + data) - //expect(typeof(data)).assertEqual("boolean"); - expect(data).assertEqual(false); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_Release_0200 release AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_Release_0200====: ' + DAHelper) - try { - DAHelper.normalizeUri( - dataAbilityUri, - ).then((data) => { - console.debug("=ACTS_NormalizeUri_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - //expect(typeof(data)).assertEqual("string") - expect(data).assertEqual(dataAbilityUri); - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_NormalizeUri_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_NormalizeUri_0100 normalizeUri promise catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_NormalizeUri_0100====: ' + DAHelper) - try { - DAHelper.normalizeUri( - dataAbilityUri, - (err, data) => { - console.debug("=ACTS_NormalizeUri_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(typeof (data)).assertEqual("string"); - expect(data).assertEqual(dataAbilityUri); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_NormalizeUri_0200 normalizeUri AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_NormalizeUri_0200====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - dataAbilityUri, - ).then((data) => { - console.debug("=ACTS_DenormalizeUri_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - //expect(typeof(data)).assertEqual("string") - expect(data).assertEqual(dataAbilityUri); - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_DenormalizeUri_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_DenormalizeUri_0100 denormalizeUri promise catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_DenormalizeUri_0100====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - dataAbilityUri, - (err, data) => { - console.debug("=ACTS_DenormalizeUri_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - //expect(typeof(data)).assertEqual("string"); - expect(data).assertEqual(dataAbilityUri); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_DenormalizeUri_0200 denormalizeUri AsyncCallback catch(err)====>:' + err); - ret = true - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_DenormalizeUri_0200==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0100 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0100); - done(); - } else { - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_0100====< else true'); - done(); - }, gSetTimeout); - } - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0100 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0100===="); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - done(); - } - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback_0200); - - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0200); - - setTimeout(mySetTimeout, gSetTimeout); - function mySetTimeout() { - DAHelper.notifyChange( - dataAbilityUri, - (err) => { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0200 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - done(); - } else { - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_0200====:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0200====" + caller); - if (flagCallback01 == 1 && flagCallback02 == 1 && flagCallback03 == 1) { - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0301); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0302); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0303); - done(); - } else { - if (caller == "notifyChange") { - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_0300==== { - expect(err.code).assertEqual(0); - waitDone("notifyChange"); - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0300 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0300====" - + ("json flagCallback02【") + JSON.stringify(flagCallback02) + (" 】") + " , " + flagCallback02); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - done(); - } - function onAsyncCallback0403(err) { - expect(err.code).assertEqual(0); - flagCallback03++; - waitDone("onAsyncCallback0403"); - } - function waitDone(caller) { - console.debug("=ACTS_OnOff_0400 caller ====>" + caller); - if (flagCallback01 == 1 && flagCallback02 == 0 && flagCallback03 == 1) { - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0401); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0403); - done(); - } else { - if (caller == "notifyChange") { - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_0400==== { - expect(err.code).assertEqual(0); - waitDone("notifyChange"); - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0400 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0400====" - + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - done(); - } - function onAsyncCallback0502(err) { - console.debug("=ACTS_OnOff_0500 err ====>" - + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - done(); - } - function onAsyncCallback0503(err) { - console.debug("=ACTS_OnOff_0500 err ====>" - + ("json err") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - done(); - } - try { - expect(typeof (DAHelper)).assertEqual("object"); - - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0501); - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0502); - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0503); - - DAHelper.off("dataChange", dataAbilityUri); - - setTimeout(mySetTimeout, gSetTimeout); - function mySetTimeout() { - DAHelper.notifyChange( - dataAbilityUri, - (err) => { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0500 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0100); - done(); - } else { - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_0500====:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0500====" + caller); - if (flagCallback01 == 2) { - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0600); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0600); - done(); - } else { - if (caller == "notifyChange") { - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_0600==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0600 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0600); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0600); - done(); - } else { - DAHelper2.notifyChange( - dataAbilityUri2, - (err) => { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0600 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0600); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0600); - done(); - } else { - waitDone("notifyChange"); - } - } - ); - } - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0600 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0600==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0700 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0700); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0700); - done(); - } else { - DAHelper2.notifyChange( - dataAbilityUri2, - (err) => { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0700 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0700); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0700); - done(); - } else { - currentAlertTimeout = setTimeout(() => { - done(); - }, gSetTimeout); - } - } - ); - } - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0700 catch(err)====>:' + err); - expect(false).assertTrue(); - done(); - } - console.log('ACTS_OnOff_0700==== { - console.debug("=ACTS_ExecuteBatch_Insert_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); - expect(true).assertTrue(); - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Insert_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Insert_0100 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Insert_0100==== { - console.debug("=ACTS_ExecuteBatch_Insert_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); - expect(true).assertTrue(); - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Insert_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Insert_0200 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Insert_0200==== { - console.debug("=ACTS_ExecuteBatch_Insert_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); - expect(true).assertTrue(); - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Insert_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Insert_0300 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Insert_0300==== { - console.debug("=ACTS_ExecuteBatch_Insert_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(err.code).assertEqual(0); - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Insert_0400 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Insert_0400==== { - console.debug("=ACTS_ExecuteBatch_Insert_0500 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(err.code).assertEqual(0); - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Insert_0500 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Insert_0500==== { - console.debug("=ACTS_ExecuteBatch_Insert_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(err.code).assertEqual(0); - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Insert_0600 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Insert_0600==== { - console.debug("=ACTS_ExecuteBatch_Update_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0100 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Update_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Update_0100 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Update_0100==== { - console.debug("=ACTS_ExecuteBatch_Update_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0200 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Update_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Update_0200 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Update_0200==== { - console.debug("=ACTS_ExecuteBatch_Update_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Update_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Update_0300 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Update_0300==== { - console.debug("=ACTS_ExecuteBatch_Update_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Update_0400 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Update_0400==== { - console.debug("=ACTS_ExecuteBatch_Update_0500 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Update_0500 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Update_0500==== { - console.debug("=ACTS_ExecuteBatch_Update_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Update_0600 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Update_0600==== { - console.debug("=ACTS_ExecuteBatch_Assert_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0100 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Assert_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Assert_0100 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Assert_0100==== { - console.debug("=ACTS_ExecuteBatch_Assert_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0200 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Assert_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Assert_0200 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Assert_0200==== { - console.debug("=ACTS_ExecuteBatch_Assert_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0300 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Assert_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Assert_0300 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Assert_0300==== { - console.debug("=ACTS_ExecuteBatch_Assert_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0400 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Assert_0400 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Assert_0400==== { - console.debug("=ACTS_ExecuteBatch_Assert_0500 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0500 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Assert_0500 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Assert_0500==== { - console.debug("=ACTS_ExecuteBatch_Assert_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Assert_0600 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Assert_0600==== { - console.debug("=ACTS_ExecuteBatch_Delete_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0100 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Delete_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Delete_0100 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Delete_0100==== { - console.debug("=ACTS_ExecuteBatch_Delete_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0200 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Delete_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Delete_0200 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Delete_0200==== { - console.debug("=ACTS_ExecuteBatch_Delete_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0300 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_Delete_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Delete_0300 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Delete_0300==== { - console.debug("=ACTS_ExecuteBatch_Delete_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Delete_0400 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Delete_0400==== { - console.debug("=ACTS_ExecuteBatch_Delete_0500 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Delete_0500 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Delete_0500==== { - console.debug("=ACTS_ExecuteBatch_Delete_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_Delete_0600 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_Delete_0600==== { - console.debug("=ACTS_ExecuteBatch_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_0100 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_0100 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_0100==== { - console.debug("=ACTS_ExecuteBatch_0200 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_0200 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_0200 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_0200==== { - console.debug("=ACTS_ExecuteBatch_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_0300 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - }).catch((err) => { - console.debug("=ACTS_ExecuteBatch_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_ExecuteBatch_0300 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_0300==== { - console.debug("=ACTS_ExecuteBatch_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(true).assertTrue(); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_0400 for data[' + i + '].count ====>: ' + data[i].count) - expect(data[i].count).assertEqual(1); - } - done(); - } - ); - } catch (err) { - console.error('=ACTS_ExecuteBatch_0400 catch(err)====>:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - done(); - } - console.debug('ACTS_ExecuteBatch_0400====/data/test/amsStDataAbility.hap" - ] - - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/test/*.hap", - "bm install -p /data/test/amsStDataAbility.hap" - ] - } - ] -} diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/config.json b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/config.json deleted file mode 100644 index 42ac71c00faca82e6b53a9c1dd7a275a0a192cf5..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsparticleabilitytest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsparticleabilitytest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsparticleabilitytest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/app.js deleted file mode 100644 index 56256d2f8ccdb2936bd5d2ff28668d7a84f49a39..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } - -}; diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index cfd4c53e39aecb2d83a0fbdec971eca4041c8a3a..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,14 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} - -.btn { - width: 200px; - height: 80px; -} diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 83c5e0fcabbb1d5df26d69f4a5c2031c1e65b70a..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,6 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - - -
diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index f90bb8113e3aa0aff86222b3782b49c7e1aaaf86..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 03574a36c533357eef7fc0acc5e21af14f4e5f67..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "actsparticleabilitytest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js deleted file mode 100644 index 9741f6a5f8f66020c7de85feecc50d349113d117..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js +++ /dev/null @@ -1,393 +0,0 @@ -/* - * 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 commonEvent from "@ohos.commonevent" -import rpc from "@ohos.rpc" -import featureAbility from '@ohos.ability.featureAbility' -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -const START_ABILITY_TIMEOUT = 4000; -var subscriberInfoStartAbility_0100 = { - events: ["ACTS_Particle_StartAbility_0100_CommonEvent", "DISCONNECT_0100"], -}; -var subscriberInfoStartAbility_0200 = { - events: ["ACTS_Particle_StartAbility_0200_CommonEvent", "DISCONNECT_0200"], -}; - -var subscriberInfoAcquireDataHelper_0100 = { - events: ["ACTS_AcquireDataHelper_01001", "DISCONNECT_0300"], -}; - -var subscriberInfoAcquireDataHelper_0200 = { - events: ["ACTS_AcquireDataHelper_02000", "DISCONNECT_0400"], -}; - -describe('ActsParticleAbilityTest', function () { - let bundleName = "com.example.particletestserver"; - let abilityName = "com.example.particletestserver.MainAbility"; - var mRemote; - function onConnectCallback(element, remote) { - console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.deviceId : ' + element.deviceId) - console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.bundleName : ' + element.bundleName) - console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.abilityName : ' + element.abilityName) - console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.uri : ' + element.uri) - console.log('ACTS_featureAbilityTest ConnectAbility onConnect element.shortName : ' + element.shortName) - console.log('ACTS_featureAbilityTest ConnectAbility onConnect remote : ' + remote); - mRemote = remote; - console.log('ACTS_featureAbilityTest ConnectAbility onConnect remote 是否为proxy:' + (remote instanceof rpc.RemoteProxy)); - } - - function onDisconnectCallback1(element) { - commonEvent.publish("DISCONNECT_0100", ()=>{console.log('disconnect finish1')}); - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.uri : ' + element.uri) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.shortName : ' + element.shortName) - } - function onDisconnectCallback2(element) { - commonEvent.publish("DISCONNECT_0200", ()=>{console.log('disconnect finish2')}); - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.uri : ' + element.uri) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.shortName : ' + element.shortName) - } - function onDisconnectCallback3(element) { - commonEvent.publish("DISCONNECT_0300", ()=>{console.log('disconnect finish3')}); - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.uri : ' + element.uri) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.shortName : ' + element.shortName) - } - function onDisconnectCallback4(element) { - commonEvent.publish("DISCONNECT_0400", ()=>{console.log('disconnect finish4')}); - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.uri : ' + element.uri) - console.log('ACTS_featureAbilityTest ConnectAbility onDisconnect element.shortName : ' + element.shortName) - } - - - function onFailedCallback(code) { - console.log('ACTS_featureAbilityTest ConnectAbility onFailed errCode : ' + code) - } - - /* - * @tc.number: ACTS_ParticleAbility_startAbility_0100 - * @tc.name: ConnectAbility : Connects an ability to a Service ability and use service to test startAbiltiy. - * @tc.desc: Check the event of the interface startAbiltiy (by promise) - */ - it('ACTS_ParticleAbility_startAbility_0100', 0, async function (done) { - console.log('ACTS_ParticleAbility_startAbility_0100====Subscribe CallBack data:====>" + JSON.stringify(data)); - events.set(data.event, 0); - if(events.size == 1){ - if(data.event != "DISCONNECT_0100"){ - clearTimeout(id); - expect(data.event).assertEqual("ACTS_Particle_StartAbility_0100_CommonEvent"); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } else { - expect(data.event).assertEqual("DISCONNECT_0100"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } else { - expect(data.event).assertEqual("DISCONNECT_0100"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ParticleAbility_startAbility_0100 timeout'); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "StartAbilityPromise" - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback1, - onFailed: onFailedCallback, - }, - ); - console.log('StartConnectNative ConnectAbility connId : ' + connId); - }) - - /* - * @tc.number: ACTS_ParticleAbility_startAbility_0200 - * @tc.name: ConnectAbility : Connects an ability to a Service ability and use service to test startAbiltiy. - * @tc.desc: Check the event of the interface startAbiltiy (by callback) - */ - it('ACTS_ParticleAbility_startAbility_0200', 0, async function (done) { - console.log('ACTS_ParticleAbility_startAbility_0200====Subscribe CallBack data:====>" + JSON.stringify(data)); - events.set(data.event, 0); - if(events.size == 1){ - if(data.event != "DISCONNECT_0200"){ - clearTimeout(id); - expect(data.event).assertEqual("ACTS_Particle_StartAbility_0200_CommonEvent"); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } else { - expect(data.event).assertEqual("DISCONNECT_0200"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } else { - expect(data.event).assertEqual("DISCONNECT_0200"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ParticleAbility_startAbility_0200 timeout'); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "StartAbilityCallback" - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback2, - onFailed: onFailedCallback, - }, - ); - console.log('StartConnectNative ConnectAbility connId : ' + connId); - }) - - - /* - * @tc.number: ACTS_ParticleAbility_acquireDataAbilityHelper_0100 - * @tc.name: ConnectAbility : Connects an ability to a Service ability and - * use service to test acquireDataAbilityHelper. - * @tc.desc: Check the event of the interface - */ - it('ACTS_ParticleAbility_acquireDataAbilityHelper_0100', 0, async function (done) { - console.log('ACTS_ParticleAbility_acquireDataAbilityHelper_0100====Subscribe CallBack data:====>" + JSON.stringify(data)); - events.set(data.event, 0); - if(events.size == 1){ - if(data.event != "DISCONNECT_0300"){ - clearTimeout(id); - expect(data.event).assertEqual("ACTS_AcquireDataHelper_01001"); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } else { - expect(data.event).assertEqual("DISCONNECT_0300"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } else { - expect(data.event).assertEqual("DISCONNECT_0300"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - - } - - commonEvent.createSubscriber(subscriberInfoAcquireDataHelper_0100).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ParticleAbility_acquireDataAbilityHelper_0100 timeout'); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "AcquireDataHelper" - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback3, - onFailed: onFailedCallback, - }, - ); - console.log('StartConnectNative ConnectAbility connId : ' + connId); - }) - - /* - * @tc.number: ACTS_ParticleAbility_acquireDataAbilityHelper_0200 - * @tc.name: ConnectAbility : Connects an ability to a Service ability and - * use service to test acquireDataAbilityHelper. - * @tc.desc: Check the event of the interface - */ - it('ACTS_ParticleAbility_acquireDataAbilityHelper_0200', 0, async function (done) { - console.log('ACTS_ParticleAbility_acquireDataAbilityHelper_0200====Subscribe CallBack data:====>" + JSON.stringify(data)); - events.set(data.event, 0); - if(events.size == 1){ - if(data.event != "DISCONNECT_0400"){ - clearTimeout(id); - expect(data.event).assertEqual("ACTS_AcquireDataHelper_02000"); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } else { - expect(data.event).assertEqual("DISCONNECT_0400"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } else { - expect(data.event).assertEqual("DISCONNECT_0400"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } - - commonEvent.createSubscriber(subscriberInfoAcquireDataHelper_0200).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ParticleAbility_acquireDataAbilityHelper_0200 timeout'); - featureAbility.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }, - ); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "AcquireDataHelper_no" - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback4, - onFailed: onFailedCallback, - }, - ); - console.log('StartConnectNative ConnectAbility connId : ' + connId); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/List.test.js deleted file mode 100644 index d8d981f8f3222cb435202f5a37d7a05fb9d79eb8..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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. - */ -require('./ActsParticleAbilityTest.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/serviceability/actsparticleabilitytest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/BUILD.gn b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/BUILD.gn deleted file mode 100644 index 253657d2fd995799ddcf653398eef746f8f4ba59..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# 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("ActsAmsStServiceAbilityClientTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAmsStServiceAbilityClientTest" -} -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/serviceability/stserviceabilityclient/Test.json b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/Test.json deleted file mode 100644 index e40837fb873c5dafd38e0042add591bda0f4eadd..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.amsst.stserviceabilityclient", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAmsStServiceAbilityClientTest.hap", - "amsStServiceAilityServer.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/config.json b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/config.json deleted file mode 100644 index 0b7a94e75cd1344284ae889e56a94e4e13d922aa..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "app": { - "bundleName": "com.amsst.stserviceabilityclient", - "vendor": "amsst", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.amsst.stserviceabilityclient", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.amsst.stserviceabilityclient.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index ac39915c295d19be6b0c23ae374d30b8f13bc066..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,12 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} -.titleST { - font-size: 32px; -} diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 22cf7f2cc551020b093687fa5c15d59fd308de59..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,8 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - - - StServiceAbilityClient - -
diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 4bfa4f7e4a4085d7336a97befffb8d52882d281d..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 file from '@system.file' -import app from '@system.app' -import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('====onShow finish====<') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const reportExtend = new ReportExtend(file) - core.addService('expect', expectExtend) - core.addService('report', reportExtend) - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index a3d6946ded2ae6c810549377cc0c386ad257eb53..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "StSeAbClient" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/test/List.test.js deleted file mode 100644 index b95011487ce47ce48bb7b8b8f1bcee9e5f563cdc..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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. - */ -require('./StServiceAbilityClient.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/test/StServiceAbilityClient.test.js b/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/test/StServiceAbilityClient.test.js deleted file mode 100644 index 92c1af547e8408b35e2c90c587815497d3855518..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/serviceability/stserviceabilityclient/entry/src/main/js/test/StServiceAbilityClient.test.js +++ /dev/null @@ -1,836 +0,0 @@ -/* - * 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 featureAbility from '@ohos.ability.featureAbility' -import commonEvent from '@ohos.commonevent' - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsStServiceAbilityTest', function () { - let bundleName = "com.amsst.stserviceabilityserver"; - let abilityName = "com.amsst.stserviceabilityserver.MainAbility"; - - var subscriber_0100; - var CommonEventSubscribeInfo_0100 = { - events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0100", - ], - }; - var subscriber_0200; - var CommonEventSubscribeInfo_0200 = { - events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0200", - ], - }; - var subscriber_0300; - var CommonEventSubscribeInfo_0300 = { - events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0300", - "ACTS_SerivceAbilityServer_onCommand_PageStartService_0301", - ], - }; - var subscriber_0400; - var CommonEventSubscribeInfo_0400 = { - events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0400", - "ACTS_SerivceAbilityServer_onCommand_PageStartService_0401", - ], - }; - var subscriber_0500; - var CommonEventSubscribeInfo_0500 = { - events: ["ACTS_SerivceAbilityServer_onConnect_PageConnectService_0500", - "ACTS_SerivceAbilityServer_onDisConnect", - ], - }; - var subscriber_0600; - var CommonEventSubscribeInfo_0600 = { - events: ["ACTS_SerivceAbilityServer_onConnect_PageConnectService_0600", - "ACTS_SerivceAbilityServer_onDisConnect", - ], - }; - var subscriber_0900; - var CommonEventSubscribeInfo_0900 = { - events: ["ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_0900", - ], - }; - var subscriber_1000; - var CommonEventSubscribeInfo_1000 = { - events: ["ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_1000", - ], - }; - var subscriber_1300; - var CommonEventSubscribeInfo_1300 = { - events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1300", - "ACTS_SerivceAbilityServerSecond_onDisConnect", - ], - }; - var subscriber_1400; - var CommonEventSubscribeInfo_1400 = { - events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1400", - "ACTS_SerivceAbilityServerSecond_onDisConnect", - ], - }; - var subscriber_1500; - var CommonEventSubscribeInfo_1500 = { - events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1500", - "ACTS_SerivceAbilityServer_onDisConnect", - ], - }; - - function unsubscribe(caller, subscriber) { - commonEvent.unsubscribe(subscriber, (err, data) => { - console.debug("=ACTS_unsubscribe (err,data)=======>" - + (caller) - + (" , json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - }); - } - let g_setTimeout = 1000 - beforeAll(async (done) => { - console.debug('= ACTS_beforeAll ==== { - setTimeout(function () { - done(); - }, g_setTimeout); - }) - afterEach(async (done) => { - setTimeout(function () { - done(); - }, g_setTimeout); - }) - afterAll((done) => { - console.debug('= ACTS_afterAll ==== { - console.debug("=ACTS_JsServiceAbility_0100 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0100 = data; - await commonEvent.subscribe(subscriber_0100, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0100 subscribe (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0100").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_0100_unsubscribe", subscriber_0100); - console.debug('ACTS_JsServiceAbility_0100==== { - console.debug("=ACTS_JsServiceAbility_0100 .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - }).catch(err => { - expect(".catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0100==== { - console.debug("=ACTS_JsServiceAbility_0200 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0200 = data; - await commonEvent.subscribe(subscriber_0200, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0200 subscribe (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0200").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_0200_unsubscribe", subscriber_0200); - console.debug('ACTS_JsServiceAbility_0200==== { - console.debug("=ACTS_JsServiceAbility_0200 startAbility (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - } - ) - } catch (err) { - expect("catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0200==== { - console.debug("=ACTS_JsServiceAbility_0300 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0300 = data; - await commonEvent.subscribe(subscriber_0300, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0300 subscribe (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - if (data.event == "ACTS_SerivceAbilityServer_onCommand_PageStartService_0300") { - expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0300").assertEqual( - data.event); - featureAbility.startAbility( - { - want: - { - bundleName: bundleName, - abilityName: abilityName, - action: "PageStartService_0301", - }, - } - ).then(data => { - console.debug("=ACTS_JsServiceAbility_0300 .then(data) 2=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - }).catch(err => { - expect(".catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0300==== { - console.debug("=ACTS_JsServiceAbility_0300 .then(data) 1=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - }).catch(err => { - expect(".catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0300==== { - console.debug("=ACTS_JsServiceAbility_0400 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0400 = data; - await commonEvent.subscribe(subscriber_0400, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0400 subscribe (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - if (data.event == "ACTS_SerivceAbilityServer_onCommand_PageStartService_0400") { - expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0400").assertEqual( - data.event); - featureAbility.startAbility( - { - want: - { - bundleName: bundleName, - abilityName: abilityName, - action: "PageStartService_0401", - }, - }, (err, data) => { - console.debug("=ACTS_JsServiceAbility_0400 startAbility (err,data) 2=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - } - ) - } else { - expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0401").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_0400_unsubscribe", subscriber_0400); - console.debug('ACTS_JsServiceAbility_0400==== { - console.debug("=ACTS_JsServiceAbility_0400 startAbility (err,data) 1=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - } - ) - } catch (err) { - expect("catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0400==== { - console.debug("=ACTS_JsServiceAbility_0500 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0500 = data; - await commonEvent.subscribe(subscriber_0500, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0500 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_0500").assertEqual( - data.event); - featureAbility.disconnectAbility(mConnIdJsPromise).then(() => { - }).catch(err => { - expect(".catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0500==== mConnIdJsPromise=' - + JSON.stringify(mConnIdJsPromise) + " , " + mConnIdJsPromise); - console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> remote is proxy:' - + (remote instanceof rpc.RemoteProxy)); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_0500_onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - - function onFailedCallback(code) { - console.debug('ACTS_JsServiceAbility_0500_onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - - mConnIdJsPromise = featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "PageConnectService_0500", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, - ) - } catch (err) { - expect("catch").assertEqual(err); - console.log('ACTS_JsServiceAbility_0500==== { - console.debug("=ACTS_JsServiceAbility_0600 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0600 = data; - await commonEvent.subscribe(subscriber_0600, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_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( - data.event); - featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => { - console.debug("=ACTS_JsServiceAbility_0600 disconnectAbility err====>" - + ("json err=") + JSON.stringify(err)); - }) - } else { - expect("ACTS_SerivceAbilityServer_onDisConnect").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_0600_unsubscribe", subscriber_0600); - console.log('ACTS_JsServiceAbility_0600==== mConnIdJsAsyncCallback=' - + JSON.stringify(mConnIdJsAsyncCallback) + " , " + mConnIdJsAsyncCallback); - console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote is proxy:' - + (remote instanceof rpc.RemoteProxy)); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_0600_onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - - function onFailedCallback(code) { - console.debug('ACTS_JsServiceAbility_0600_onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - - mConnIdJsAsyncCallback = featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "PageConnectService_0600", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, - ) - } catch (err) { - expect("catch").assertEqual(err); - console.log('ACTS_JsServiceAbility_0600==== { - console.debug("=ACTS_JsServiceAbility_0900 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_0900 = data; - await commonEvent.subscribe(subscriber_0900, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_0900 subscribe (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - expect("ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_0900").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_0900_unsubscribe", subscriber_0900); - console.debug('ACTS_JsServiceAbility_0900==== { - console.debug("=ACTS_JsServiceAbility_0900 .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - }).catch(err => { - expect(".catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_0900==== { - console.debug("=ACTS_JsServiceAbility_1000 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_1000 = data; - await commonEvent.subscribe(subscriber_1000, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_1000 subscribe (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - expect("ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_1000").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_1000_unsubscribe", subscriber_1000); - console.debug('ACTS_JsServiceAbility_1000==== { - console.debug("=ACTS_JsServiceAbility_1000 startAbility (err,data)=======>" - + ("json err【") + JSON.stringify(err) + (" 】") - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,err=" + err + " ,data=" + data); - } - ) - } catch (err) { - expect("catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_1000==== { - console.debug("=ACTS_JsServiceAbility_1300 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_1300 = data; - await commonEvent.subscribe(subscriber_1300, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_1300 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_1300" - ).assertEqual(data.event); - featureAbility.disconnectAbility(mConnIdJsPromise).then((err) => { - console.debug("=ACTS_JsServiceAbility_1300 disconnectAbility err====>" - + ("json err=") + JSON.stringify(err)); - }) - } else { - expect("ACTS_SerivceAbilityServerSecond_onDisConnect").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_1300_unsubscribe", subscriber_1300); - console.log('ACTS_JsServiceAbility_1300==== mConnIdJsPromise=' - + JSON.stringify(mConnIdJsPromise) + " , " + mConnIdJsPromise); - console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> remote is proxy:' - + (remote instanceof rpc.RemoteProxy)); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_1300_onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - unsubscribe("ACTS_JsServiceAbility_1300_unsubscribe", subscriber_1300); - console.log('ACTS_JsServiceAbility_1300==== code=' - + JSON.stringify(code) + " , " + code) - } - - mConnIdJsPromise = featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "ServiceConnectService_1300", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, - ) - } catch (err) { - expect("catch").assertEqual(err); - console.log('ACTS_JsServiceAbility_1300==== { - console.debug("=ACTS_JsServiceAbility_1400 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_1400 = data; - await commonEvent.subscribe(subscriber_1400, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_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" - ).assertEqual(data.event); - featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => { - console.debug("=ACTS_JsServiceAbility_1400 disconnectAbility err====>" - + ("json err=") + JSON.stringify(err)); - }) - } else { - expect("ACTS_SerivceAbilityServerSecond_onDisConnect").assertEqual( - data.event); - unsubscribe("ACTS_JsServiceAbility_1400_unsubscribe", subscriber_1400); - console.log('ACTS_JsServiceAbility_1400==== mConnIdJsAsyncCallback=' - + JSON.stringify(mConnIdJsAsyncCallback) + " , " + mConnIdJsAsyncCallback); - console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote is proxy:' - + (remote instanceof rpc.RemoteProxy)); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_1400_onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - - function onFailedCallback(code) { - console.debug('ACTS_JsServiceAbility_1400_onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - - mConnIdJsAsyncCallback = featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "ServiceConnectService_1400", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, - ) - } catch (err) { - expect("catch").assertEqual(err); - console.log('ACTS_JsServiceAbility_1400==== { - console.debug("=ACTS_JsServiceAbility_1500 createSubscriber .then(data)=======>" - + ("json data【") + JSON.stringify(data) + (" 】") - + " ,data=" + data); - subscriber_1500 = data; - await commonEvent.subscribe(subscriber_1500, async (err, data) => { - console.debug("=ACTS_JsServiceAbility_1500 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_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1500").assertEqual( - data.event); - featureAbility.disconnectAbility(mConnIdJsPromise).then(() => { - }).catch(err => { - expect(".catch").assertEqual(err); - console.debug('ACTS_JsServiceAbility_1500==== mConnIdJsPromise=' - + JSON.stringify(mConnIdJsPromise) + " , " + mConnIdJsPromise); - console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_JsServiceAbility_1500_onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - unsubscribe("ACTS_JsServiceAbility_1500_unsubscribe", subscriber_1500); - console.log('ACTS_JsServiceAbility_1500==== code=' - + JSON.stringify(code) + " , " + code) - } - - mConnIdJsPromise = featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "ServiceConnectService_1500", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, - ) - } catch (err) { - expect("catch").assertEqual(err); - console.log('ACTS_JsServiceAbility_1500====div{ - width: 100%; - height: 200px; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.btn{ - margin-bottom: 20px; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 471a35dc3dd90c87071a587c446650aef2d35ffd..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,10 +0,0 @@ -
-
- - {{ title }} - -
-
- -
-
diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 92a52660c9b16a44f126f3486182f0f197f100ba..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/* -* 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 file from '@system.file' -import app from '@system.app' -import router from '@system.router'; -import featureAbility from '@ohos.ability.featureability' - -export default { - data: { - title: "AmsJsStMain" - }, - onInit() { - console.debug('====onInit()====<') - this.title = "AmsJsStMain"; - }, - onShow() { - console.debug('====onShow()====<') - }, - onReady() { - console.debug('====onReady finish====<') - }, - onBackPress(){ - console.debug('====onBackPress()====<') - }, - async stopAbility(){ - console.debug('====close====<') - await featureAbility.terminateAbility(); - }, - clickAction(){ - console.debug('====clickAction====<') - router.replace({ - uri: 'pages/permissionPage/permissionPage' - }) - }, - titleAction(){ - console.debug('====titleAction()====<') - this.title += "\nMyTest" - }, -} diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.css b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.css deleted file mode 100644 index e49abba2176b38ea45c94f6a5972118ad38d0e93..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.css +++ /dev/null @@ -1,50 +0,0 @@ -.container { - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 30px; - text-align: center; - width: 100%; - height: 80px; -} -div{ - flex-direction: column; - align-items: center; - justify-content: center; -} - -.btn{ - margin-bottom: 10px; - width: 200px; - height: 50px; - justify-content: center; -} -.log { - font-size: 20px; - text-align: center; - width: 100%; - height: 250px; -} -.todo-wraper { - width: 100%; - height: 600px; - justify-content: center; -} -.todo-item { - width: 100%; - justify-content: center; -} -.text { - margin: 20%; -} -.menu-wraper { - width: 100%; - height: 100px; - justify-content: center; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.hml b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.hml deleted file mode 100644 index f80defdf65aa4c37b4bf473b1a3e56b5b9cb6ba5..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.hml +++ /dev/null @@ -1,19 +0,0 @@ -
-
- - {{ title }} - -
-
- -
-
- - - - - -
-
diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.js b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.js deleted file mode 100644 index 940dec52ede9dd76d52f6ba3fcc4a308fbc6ac00..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -* 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 file from '@system.file' -import app from '@system.app' -import router from '@system.router'; -import featureAbility from '@ohos.ability.featureability' -import bundle from '@ohos.bundle' -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index' - -export default { - currentCase: "", - data: { - title: "AbilityA1", - logmessage: "this is log message", - testcase: [ - "ACTS_AppPermission_0100", - "ACTS_AppPermission_0200", - "ACTS_AppPermission_0300", - "ACTS_AppPermission_0400", - "ACTS_AppPermission_0500", - "ACTS_AppPermission_0600", - "ACTS_AppPermission_0700", - "ACTS_AppPermission_0800", - "ACTS_AppPermission_0900", - "ACTS_AppPermission_1000", - "ACTS_AppPermission_1100", - "ACTS_AppPermission_1200", - "ACTS_AppPermission_1300", - "ACTS_AppPermission_1400", - "ACTS_AppPermission_1500", - "ACTS_AppPermission_1600", - "ACTS_AppPermission_1700", - "ACTS_AppPermission_1800", - "ACTS_AppPermission_1900", - "ACTS_AppPermission_2000", - "ACTS_AppPermission_2100", - "ACTS_AppPermission_2200", - "ACTS_AppPermission_2300", - "ACTS_AppPermission_2400", - "ACTS_AppPermission_2500", - "ACTS_AppPermission_2600", - "ACTS_AppPermission_2700", - "ACTS_AppPermission_2800", - ], - }, - onInit() { - this.title = "AbilityA1"; - this.logmessage = "this is log message"; - }, - onShow() { - }, - onReady() { - console.info('====per onReady finish====>') - }, - onBackPress() { - }, - async stopAbility() { - console.info('===========per close===========>') - await featureAbility.terminateAbility(); - await app.killProcessesByBundleName(); - }, - clickAction() { - router.replace({ - uri: 'pages/index/index' - }) - }, - runCase(caseName) { - console.debug("======per runCase======>:" + JSON.stringify(caseName)) - this.logmessage += caseName + "\n" - console.debug("======per runallcase======<:") - let { runAllCase } = require('./permissioncase.js') - runAllCase(caseName, this) - - } -} diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissioncase.js b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissioncase.js deleted file mode 100644 index 9d9e27ef34d43bd1678ab8d465326d07b02914e5..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissioncase.js +++ /dev/null @@ -1,1000 +0,0 @@ -/* -* 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 bundle from '@ohos.bundle' -import featureAbility from '@ohos.ability.featureability' -import abilityManager from '@ohos.app.abilitymanager' - -export function runAllCase(caseName, obj) { - console.debug("====runAllCase1====>:" + JSON.stringify(caseName)) - console.debug("====runAllCase2====>:" + JSON.stringify(allCase)) - allCase[caseName].func(obj) -} -export function getCaseInfo(caseName) { - console.debug("====getCaseInfo====>:" + JSON.stringify(caseName)) - return allCase[caseName].info; -} - -var MY_PERMISSIONS_REQUEST_PERMISSION = 1; -var allCase = { - "ACTS_AppPermission_0100": { - func: ACTS_AppPermission_0100, - info: "Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_0200": { - func: ACTS_AppPermission_0200, - info: "Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_0300": { - func: ACTS_AppPermission_0300, - info: "Verify that a user_grant system`s permission(ohos.permission.CAMERA) " - + "is not automatically requested during installation." - }, - "ACTS_AppPermission_0400": { - func: ACTS_AppPermission_0400, - info: "Verify that a user_grant system`s permission(ohos.permission.CAMERA) " - + "is not automatically requested during installation." - }, - "ACTS_AppPermission_0500": { - func: ACTS_AppPermission_0500, - info: "Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_0600": { - func: ACTS_AppPermission_0600, - info: "Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_0700": { - func: ACTS_AppPermission_0700, - info: "Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_0800": { - func: ACTS_AppPermission_0800, - info: "Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_0900": { - func: ACTS_AppPermission_0900, - info: "Verify that a user_grant system`s permission(ohos.permission.CAMERA) " - + "is not automatically requested during installation." - }, - "ACTS_AppPermission_1000": { - func: ACTS_AppPermission_1000, - info: "Verify that a user_grant system`s permission(ohos.permission.CAMERA) " - + "is not automatically requested during installation." - }, - "ACTS_AppPermission_1100": { - func: ACTS_AppPermission_1100, - info: "Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_1200": { - func: ACTS_AppPermission_1200, - info: "Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) " - + "is automatically requested during installation." - }, - "ACTS_AppPermission_1300": { - func: ACTS_AppPermission_1300, - info: "Verify that calling application(different application in the same device) " - + "is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)" - }, - "ACTS_AppPermission_1400": { - func: ACTS_AppPermission_1400, - info: "Verify that calling application(different application in the same device) " - + "is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)" - }, - "ACTS_AppPermission_1500": { - func: ACTS_AppPermission_1500, - info: "Verify that calling application(different application in the same device) " - + "is not requested the user_grant system`s permission(ohos.permission.CAMERA)" - }, - "ACTS_AppPermission_1600": { - func: ACTS_AppPermission_1600, - info: "Verify that calling application(different application in the same device) " - + "is not requested the user_grant system`s permission(ohos.permission.CAMERA)" - }, - "ACTS_AppPermission_1700": { - func: ACTS_AppPermission_1700, - info: "Verify that calling application(different application in the same device) " - + "is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION)" - }, - "ACTS_AppPermission_1800": { - func: ACTS_AppPermission_1800, - info: "Verify that calling application(different application in the same device) " - + "is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION)" - }, - "ACTS_AppPermission_1900": { - func: ACTS_AppPermission_1900, - info: "Verify that application without calling application(other device) " - + "is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)" - }, - "ACTS_AppPermission_2000": { - func: ACTS_AppPermission_2000, - info: "Verify that application without calling application(other device) " - + "is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)" - }, - "ACTS_AppPermission_2100": { - func: ACTS_AppPermission_2100, - info: "Verify that application without calling application(other device) " - + "is not requested the system_grant system`s permission(ohos.permission.GET_WIFI_INFO)" - }, - "ACTS_AppPermission_2200": { - func: ACTS_AppPermission_2200, - info: "Verify that application without calling application(other device) " - + "is not requested the system_grant system`s permission(ohos.permission.GET_WIFI_INFO)" - }, - "ACTS_AppPermission_2300": { - func: ACTS_AppPermission_2300, - info: "Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) " - + "can not requested during runtime." - }, - "ACTS_AppPermission_2400": { - func: ACTS_AppPermission_2400, - info: "Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) " - + "can not requested during runtime." - }, - "ACTS_AppPermission_2500": { - func: ACTS_AppPermission_2500, - info: "Verify that a user_grant system`s permission(ohos.permission.CAMERA) " - + "can requested during runtime." - }, - "ACTS_AppPermission_2600": { - func: ACTS_AppPermission_2600, - info: "Verify that a user_grant system`s permission(ohos.permission.CAMERA) can requested during runtime." - }, - "ACTS_AppPermission_2700": { - func: ACTS_AppPermission_2700, - info: "Verify that a user_grant system`s permission(ohos.permission.PERMISSIOND) can requested during runtime." - }, - "ACTS_AppPermission_2800": { - func: ACTS_AppPermission_2800, - info: "Verify that a user_grant system`s permission(2 permissions) can requested during runtime." - }, -} - -async function getThisProcessInfo() { - console.debug("====getThisProcessInfo:begin====<"); - var processInfoArray = await abilityManager.getAllRunningProcesses(); - var thisProcessInfo = processInfoArray[0]; - for (let i = 0; i < processInfoArray.length; i++) { - if (processInfoArray[i].processName == "com.amsst.amsjsstmain") { - thisProcessInfo = processInfoArray[i] - break - } - } - console.debug("======getThisProcessInfo:end======<"); - return thisProcessInfo; -} - - -/* - * @tc.number : ACTS_AppPermission_0100 - * @tc.name : Verify that ohos.permission.GET_NETWORK_INFO is requested - * @tc.desc : Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0100(thisobj) { - var thisFunctionName = ACTS_AppPermission_0100.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - await context.verifyPermission("ohos.permission.GET_NETWORK_INFO", - { - options: { - pid: thisProcessInfo.pid, - uid: thisProcessInfo.uid, - } - }, - (err, data) => { - console.debug("====verifyPermission:data====>:" + JSON.stringify(data)) - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - } - ); -} - -/* - * @tc.number : ACTS_AppPermission_0200 - * @tc.name : Verify that ohos.permission.GET_NETWORK_INFO is requested - * @tc.desc : Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0200(thisobj) { - var thisFunctionName = ACTS_AppPermission_0200.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - var result = await context.verifyPermission("ohos.permission.GET_NETWORK_INFO", { - options: { - pid: thisProcessInfo.pid, - uid: thisProcessInfo.uid, - } - }); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - - -/* - * @tc.number : ACTS_AppPermission_0300 - * @tc.name : Verify that ohos.permission.CAMERA is not requested - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.CAMERA) - * is not automatically requested during installation. - */ -async function ACTS_AppPermission_0300(thisobj) { - var thisFunctionName = ACTS_AppPermission_0300.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - await context.verifyPermission("ohos.permission.CAMERA", - { - options: { - pid: thisProcessInfo.pid, - uid: thisProcessInfo.uid, - } - }, - (err, data) => { - console.debug("======verifyPermission:data======>:" + JSON.stringify(data)) - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == -1) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - } - ); -} - -/* - * @tc.number : ACTS_AppPermission_0400 - * @tc.name : Verify that ohos.permission.CAMERA is requested - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.CAMERA) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0400(thisobj) { - var thisFunctionName = ACTS_AppPermission_0400.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - var result = await context.verifyPermission("ohos.permission.CAMERA", { - options: { - pid: thisProcessInfo.pid, - uid: thisProcessInfo.uid, - } - }); - console.debug("======verifyPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == -1) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_0500 - * @tc.name : Verify that com.amsst.permission.SYSPERMISSION is requested - * @tc.desc : Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0500(thisobj) { - var thisFunctionName = ACTS_AppPermission_0500.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - await context.verifyPermission("com.amsst.permission.SYSPERMISSION", - { - options: { - pid: thisProcessInfo.pid, - uid: thisProcessInfo.uid, - } - }, - (err, data) => { - console.debug("======verifyPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_0600 - * @tc.name : Verify that com.amsst.permission.SYSPERMISSION is requested - * @tc.desc : Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0600(thisobj) { - var thisFunctionName = ACTS_AppPermission_0600.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - var result = await context.verifyPermission("com.amsst.permission.SYSPERMISSION", { - options: { - pid: thisProcessInfo.pid, - uid: thisProcessInfo.uid, - } - }); - console.debug("======verifyPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - - -/* - * @tc.number : ACTS_AppPermission_0700 - * @tc.name : Verify that ohos.permission.GET_NETWORK_INFO is requested - * @tc.desc : Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0700(thisobj) { - var thisFunctionName = ACTS_AppPermission_0700.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - await context.verifySelfPermission("ohos.permission.GET_NETWORK_INFO", - (err, data) => { - console.debug("======verifySelfPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_0800 - * @tc.name : Verify that ohos.permission.GET_NETWORK_INFO is requested by self - * @tc.desc : Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_0800(thisobj) { - var thisFunctionName = ACTS_AppPermission_0800.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - var result = await context.verifySelfPermission("ohos.permission.GET_NETWORK_INFO"); - console.debug("======verifySelfPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_0900 - * @tc.name : Verify that ohos.permission.CAMERA is not requested by self - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.CAMERA) - * is not automatically requested during installation. - */ -async function ACTS_AppPermission_0900(thisobj) { - var thisFunctionName = ACTS_AppPermission_0900.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - await context.verifySelfPermission("ohos.permission.CAMERA", - (err, data) => { - console.debug("======verifySelfPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == -1) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_1000 - * @tc.name : Verify that ohos.permission.CAMERA is requested by self - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.CAMERA) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_1000(thisobj) { - var thisFunctionName = ACTS_AppPermission_1000.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - var result = await context.verifySelfPermission("ohos.permission.CAMERA") - console.debug("======verifySelfPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == -1) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_1100 - * @tc.name : Verify that com.amsst.permission.SYSPERMISSION is requested by self - * @tc.desc : Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_1100(thisobj) { - var thisFunctionName = ACTS_AppPermission_1100.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - await context.verifySelfPermission("com.amsst.permission.SYSPERMISSION", - (err, data) => { - console.debug("======verifySelfPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_1200 - * @tc.name : Verify that com.amsst.permission.SYSPERMISSION is requested by self - * @tc.desc : Verify that a system_grant user`s permission(com.amsst.permission.SYSPERMISSION) - * is automatically requested during installation. - */ -async function ACTS_AppPermission_1200(thisobj) { - var thisFunctionName = ACTS_AppPermission_1200.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - var result = await context.verifySelfPermission("com.amsst.permission.SYSPERMISSION"); - console.debug("======verifySelfPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n" - return -1;; - } -} - -/* - * @tc.number : ACTS_AppPermission_1300 - * @tc.name : Verify that calling application(different application in the same device) - * have requested ohos.permission.GET_NETWORK_INFO - * @tc.desc : Verify that calling application(different application in the same device) is requested - * the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - */ -async function ACTS_AppPermission_1300(thisobj) { - var thisFunctionName = ACTS_AppPermission_1300.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - featureAbility.startAbility( - { - want: - { - bundleName: "com.amsst.amsjsstsubpermission", - abilityName: "com.amsst.amsjsstsubpermission.MainAbility" - } - } - ); - return 0; -} - -/* - * @tc.number : ACTS_AppPermission_1400 - * @tc.name : Verify that calling application(different application in the same device) - * have requested ohos.permission.GET_NETWORK_INFO - * @tc.desc : Verify that calling application(different application in the same device) is requested - * the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - */ -async function ACTS_AppPermission_1400(thisobj) { - var thisFunctionName = ACTS_AppPermission_1400.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - featureAbility.startAbility( - { - want: - { - bundleName: "com.amsst.amsjsstsubpermission", - abilityName: "com.amsst.amsjsstsubpermission.MainAbility" - } - } - ) - return 0; -} - -/* - * @tc.number : ACTS_AppPermission_1500 - * @tc.name : Verify that calling application(different application in the same device) - * have not requested ohos.permission.CAMERA - * @tc.desc : Verify that calling application(different application in the same device) - * is not requested the user_grant system`s permission(ohos.permission.CAMERA) - */ -async function ACTS_AppPermission_1500(thisobj) { - var thisFunctionName = ACTS_AppPermission_1500.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - featureAbility.startAbility( - { - want: - { - bundleName: "com.amsst.amsjsstsubpermission", - abilityName: "com.amsst.amsjsstsubpermission.MainAbility" - } - } - ) - return 0; -} - -/* - * @tc.number : ACTS_AppPermission_1600 - * @tc.name : Verify that calling application(different application in the same device) - * have not requested ohos.permission.CAMERA - * @tc.desc : Verify that calling application(different application in the same device) - * is not requested the user_grant system`s permission(ohos.permission.CAMERA) - */ -async function ACTS_AppPermission_1600(thisobj) { - var thisFunctionName = ACTS_AppPermission_1600.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - featureAbility.startAbility( - { - want: - { - bundleName: "com.amsst.amsjsstsubpermission", - abilityName: "com.amsst.amsjsstsubpermission.MainAbility" - } - } - ); - return 0; -} - -/* - * @tc.number : ACTS_AppPermission_1700 - * @tc.name : Verify that calling application(different application in the same device) - * have requested com.amsst.permission.SYSPERMISSION - * @tc.desc : Verify that calling application(different application in the same device) - * is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION) - */ -async function ACTS_AppPermission_1700(thisobj) { - var thisFunctionName = ACTS_AppPermission_1700.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - await featureAbility.startAbility( - { - want: - { - bundleName: "com.amsst.amsjsstsubpermission", - abilityName: "com.amsst.amsjsstsubpermission.MainAbility" - } - } - ); - return 0; -} - -/* - * @tc.number : ACTS_AppPermission_1800 - * @tc.name : Verify that calling application(different application in the same device) - * have requested com.amsst.permission.SYSPERMISSION - * @tc.desc : Verify that calling application(different application in the same device) - * is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION) - */ -async function ACTS_AppPermission_1800(thisobj) { - var thisFunctionName = ACTS_AppPermission_1800.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - await featureAbility.startAbility( - { - want: - { - bundleName: "com.amsst.amsjsstsubpermission", - abilityName: "com.amsst.amsjsstsubpermission.MainAbility" - } - } - ) - return 0; -} - -/* - * @tc.number : ACTS_AppPermission_1900 - * @tc.name : Verify that application without calling application(other device) - * have requested ohos.permission.GET_NETWORK_INFO - * @tc.desc : Verify that application without calling application(other device) - * is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - */ - -async function ACTS_AppPermission_1900(thisobj) { - var thisFunctionName = ACTS_AppPermission_1900.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - await context.verifyCallingOrSelfPermission("ohos.permission.GET_NETWORK_INFO", - (err, data) => { - console.debug("======verifyCallingOrSelfPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_2000 - * @tc.name : Verify that application without calling application(other device) - * have requested ohos.permission.GET_NETWORK_INFO - * @tc.desc : Verify that application without calling application(other device) - * is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - */ -async function ACTS_AppPermission_2000(thisobj) { - var thisFunctionName = ACTS_AppPermission_2000.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - var result = await context.verifyCallingOrSelfPermission("ohos.permission.GET_NETWORK_INFO"); - console.debug("======verifyCallingOrSelfPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_2100 - * @tc.name : Verify that application without calling application(other device) - * have not requested .GET_WIFI_INFO - * @tc.desc : Verify that application without calling application(other device) - * is requested the system_grant system`s permission(ohos.permission..GET_WIFI_INFO) - */ -async function ACTS_AppPermission_2100(thisobj) { - var thisFunctionName = ACTS_AppPermission_2100.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - await context.verifyCallingOrSelfPermission("ohos.permission.GET_WIFI_INFO", - (err, data) => { - console.debug("======verifyCallingOrSelfPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == -1) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_2200 - * @tc.name : Verify that application without calling application(other device) have not requested .GET_WIFI_INFO - * @tc.desc : Verify that application without calling application(other device) - * is requested the system_grant system`s permission(ohos.permission..GET_WIFI_INFO) - */ -async function ACTS_AppPermission_2200(thisobj) { - var thisFunctionName = ACTS_AppPermission_2200.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var thisProcessInfo = await getThisProcessInfo(); - var context = await featureAbility.getContext(); - var result = await context.verifyCallingOrSelfPermission("ohos.permission.GET_WIFI_INFO") - console.debug("======verifyCallingOrSelfPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == -1) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_2300 - * @tc.name : Verify that ohos.permission.GET_NETWORK_INFO can not requested by user - * @tc.desc : Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - * can not requested during runtime. - */ -async function ACTS_AppPermission_2300(thisobj) { - var thisFunctionName = ACTS_AppPermission_2300.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - await context.canRequestPermission("ohos.permission.GET_NETWORK_INFO", - (err, data) => { - console.debug("======canRequestPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n" - if (data == false) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_2400 - * @tc.name : Verify that ohos.permission.GET_NETWORK_INFO can not requested by user - * @tc.desc : Verify that a system_grant system`s permission(ohos.permission.GET_NETWORK_INFO) - * can not requested during runtime. - */ -async function ACTS_AppPermission_2400(thisobj) { - var thisFunctionName = ACTS_AppPermission_2400.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - var result = await context.canRequestPermission("ohos.permission.GET_NETWORK_INFO"); - console.debug("======canRequestPermission:result======>:" + JSON.stringify(result)); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n" - if (result == false) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_2500 - * @tc.name : Verify that ohos.permission.CAMERA can requested by user - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.CAMERA) - * can requested during runtime. - */ -async function ACTS_AppPermission_2500(thisobj) { - var thisFunctionName = ACTS_AppPermission_2500.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - await context.canRequestPermission("ohos.permission.CAMERA", - (err, data) => { - console.debug("======canRequestPermission:data======>:" + JSON.stringify(data));; - thisobj.logmessage += "result: " + JSON.stringify(data) + "\n"; - if (data == true) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } - }) -} - -/* - * @tc.number : ACTS_AppPermission_2600 - * @tc.name : Verify that ohos.permission.CAMERA can requested by user - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.CAMERA) - * can requested during runtime. - */ -async function ACTS_AppPermission_2600(thisobj) { - var thisFunctionName = ACTS_AppPermission_2600.name; - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - var result = await context.canRequestPermission("ohos.permission.CAMERA"); - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n" - if (result == true) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - return 0; - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_2700 - * @tc.name : Verify that ohos.permission.PERMISSIOND can requested by user - * @tc.desc : Verify that a user_grant system`s permission(ohos.permission.PERMISSIOND) - * can requested during runtime. - */ -async function ACTS_AppPermission_2700(thisobj) { - var thisFunctionName = ACTS_AppPermission_2700.name - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - var result = await context.canRequestPermission("ohos.permission.PERMISSIOND") - thisobj.logmessage += "result: " + JSON.stringify(result) + "\n"; - if (result == true) { - await context.requestPermissionsFromUser(["ohos.permission.PERMISSIOND"], - MY_PERMISSIONS_REQUEST_PERMISSION, - (err, data) => { - thisobj.logmessage += "data = " + JSON.stringify(data) + "\n"; - thisobj.logmessage += "err = " + JSON.stringify(err) + "\n"; - if (data.requestCode == MY_PERMISSIONS_REQUEST_PERMISSION - && data.authResults.length > 0 - && data.permissions.length > 0 - && data.permissions[0] == "ohos.permission.PERMISSIOND" - && data.authResults[0] == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - } else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - } - }); - return 0; - } else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} - -/* - * @tc.number : ACTS_AppPermission_2800 - * @tc.name : Verify that ohos.permission.PERMISSIONB, ohos.permission.PERMISSIONC, can requested by user - * @tc.desc : Verify that a user_grant system`s permission - * (ohos.permission.PERMISSIONB, ohos.permission.PERMISSIONC) can requested during runtime. - */ -async function ACTS_AppPermission_2800(thisobj) { - var thisFunctionName = ACTS_AppPermission_2800.name - thisobj.logmessage = ""; - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += getCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext(); - var result1 = await context.canRequestPermission("ohos.permission.PERMISSIONB"); - var result2 = await context.canRequestPermission("ohos.permission.PERMISSIONC"); - thisobj.logmessage += JSON.stringify(result1) + "\n"; - thisobj.logmessage += JSON.stringify(result2) + "\n"; - if (result1 && result2) { - await context.requestPermissionsFromUser(["ohos.permission.PERMISSIONB", "ohos.permission.PERMISSIONC"], - MY_PERMISSIONS_REQUEST_PERMISSION, - (err, data) => { - thisobj.logmessage += "data = " + JSON.stringify(data) + "\n"; - thisobj.logmessage += "err = " + JSON.stringify(err) + "\n"; - if (data.requestCode == MY_PERMISSIONS_REQUEST_PERMISSION - && data.authResults.length == 2 - && data.permissions.length == 2 - && data.permissions[0] == "ohos.permission.PERMISSIONB" - && data.authResults[0] == 0 - && data.permissions[1] == "ohos.permission.PERMISSIONC" - && data.authResults[1] == 0) { - thisobj.logmessage += "case " + thisFunctionName + " success\n"; - } else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - } - }); - return 0; - } else { - thisobj.logmessage += "case " + thisFunctionName + " failure\n"; - return -1; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/element/string.json deleted file mode 100644 index bba36b83508361433307c42ae3c17d990424f0d4..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AmsStMain" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "permreason_camera", - "value": "请求使用摄像头" - }, - { - "name": "permreason_sys", - "value": "自定义system_grand权限" - }, - { - "name": "permreason_getnetworkinfo", - "value": "请求访问网络信息" - }, - { - "name": "secondability_description", - "value": "JS_Empty Ability" - }, - { - "name": "entry_SecondAbility", - "value": "entry_SecondAbility" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/verifypermission/AmsJsStMain/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/verifypermission/AmsJsStMain/signature/openharmony_sx.p7b and /dev/null differ diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/BUILD.gn b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/BUILD.gn deleted file mode 100644 index d2567f50d3d9bf47561004210c8ebea22b6aed52..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# 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("ActsAmsJsStSubPermissionTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAmsJsStSubPermissionTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/Test.json b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/Test.json deleted file mode 100644 index 26909f2889de98a479f076f87725fed805c7a343..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/Test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} - diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/config.json b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/config.json deleted file mode 100644 index 6fca0db245a0cd5309f6f592f10f020470fa2d53..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/config.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "app": { - "bundleName": "com.amsst.amsjsstsubpermission", - "vendor": "amsst", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.amsst.amsjsstsubpermission", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.amsst.amsjsstsubpermission.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ], - "reqPermissions": [ - { - "name": "com.amsst.permission.SYSPERMISSION", - "reason": "$string:permreason_sys", - "usedScene": { - "ability": [ - "com.amsst.amsjsstmain.MainAbility" - ], - "when": "always" - } - }, - { - "name": "ohos.permission.GET_NETWORK_INFO", - "reason": "$string:permreason_getnetworkinfo", - "usedScene": { - "ability": [ - "com.amsst.amsjsstmain.MainAbility" - ], - "when": "always" - } - }] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/app.js deleted file mode 100644 index a66a245b33514363f81b281b0471ca426479e717..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* -* 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 { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4ddd1478116ffaa5d077e0de3aaf23e1c4fdb123..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,51 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("../../common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -.log { - font-size: 20px; - text-align: center; - width: 100%; - height: 400px; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index bbb6ec46657c664c146cac49106f3e667e350526..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,16 +0,0 @@ -
- {{title}} -
- -
-
- - - - - - -
-
diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 2715340964cd8b5e5aef77bd5821cac5afe1695e..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -* 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 file from '@system.file' -import app from '@system.app' -import router from '@system.router'; -import featureAbility from '@ohos.ability.featureability' - -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index' - -export default { - currentCase: "", - data: { - title: "AbilityA1", - logmessage: "this is log message", - testcase: [ - "ACTS_AppPermission_1300", - "ACTS_AppPermission_1400", - "ACTS_AppPermission_1500", - "ACTS_AppPermission_1600", - "ACTS_AppPermission_1700", - "ACTS_AppPermission_1800", - ], - }, - onInit() { - this.title = "AbilityA1"; - this.logmessage = "this is log message"; - - }, - onShow() { - }, - onReady() { - console.info('onReady finish') - }, - onBackPress() { - }, - async stopAbility() { - console.info('===========AmsJsStSubPermission close===========<') - await featureAbility.terminateAbility(); - await app.killProcessesByBundleName(); - }, - runCase(caseName) { - console.debug("======runCase======>:" + JSON.stringify(caseName)) - this.logmessage += caseName + "\n" - console.debug("======runallcase======<:") - let { runAllCase } = require('./permissioncase.js') - runAllCase(caseName, this) - - }, - CaseChange(newValue) { - let { GetCaseInfo } = require('./permissioncase.js') - this.logmessage = newValue.value - this.logmessage += GetCaseInfo(newValue.value) - this.currentCase = newValue.value - }, -} diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/permissioncase.js b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/permissioncase.js deleted file mode 100644 index e5009eef4bafb1abfb4f62c4ec0a0a7c54018136..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/permissioncase.js +++ /dev/null @@ -1,171 +0,0 @@ -/* -* 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 bundle from '@ohos.bundle' -import featureAbility from '@ohos.ability.featureability' -import abilityManager from '@ohos.app.abilitymanager' - -export function runAllCase(caseName, obj) { - console.debug("======runAllCase1======>:" + JSON.stringify(caseName)) - console.debug("======runAllCase2======>:" + JSON.stringify(allCase)) - allCase[caseName].func(obj) -} - -export function GetCaseInfo(caseName) { - console.debug("======GetCaseInfo======>:" + JSON.stringify(caseName)) - return allCase[caseName].info; -} - -var allCase = { - ACTS_AppPermission_1300: { - func: ACTS_AppPermission_1300, - info: "Verify that calling application(different application in the same device) is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)." - }, - ACTS_AppPermission_1400: { - func: ACTS_AppPermission_1400, - info: "Verify that calling application(different application in the same device) is requested the system_grant system`s permission(ohos.permission.GET_NETWORK_INFO)." - }, - ACTS_AppPermission_1500: { - func: ACTS_AppPermission_1500, - info: "Verify that calling application(different application in the same device) is not requested the user_grant system`s permission(ohos.permission.CAMERA)." - }, - ACTS_AppPermission_1600: { - func: ACTS_AppPermission_1600, - info: "Verify that calling application(different application in the same device) is not requested the user_grant system`s permission(ohos.permission.CAMERA)." - }, - ACTS_AppPermission_1700: { - func: ACTS_AppPermission_1700, - info: "Verify that calling application(different application in the same device) is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION)." - }, - ACTS_AppPermission_1800: { - func: ACTS_AppPermission_1800, - info: "Verify that calling application(different application in the same device) is requested the system_grant user`s permission(com.amsst.permission.SYSPERMISSION)." - }, - -} - -async function ACTS_AppPermission_1300(thisobj) { - var thisFunctionName = ACTS_AppPermission_1300.name - thisobj.logmessage = "" - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - await context.verifyCallingPermission("ohos.permission.GET_NETWORK_INFO", - (err, data) => { - console.debug("======verifyCallingPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += JSON.stringify(data) + "\n" - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " successed\n" - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failed\n" - } - }) -} - -async function ACTS_AppPermission_1400(thisobj) { - var thisFunctionName = ACTS_AppPermission_1400.name - thisobj.logmessage = "" - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - var result = await context.verifyCallingPermission("ohos.permission.GET_NETWORK_INFO") - console.debug("======verifyCallingPermission:result======>:" + JSON.stringify(result)) - thisobj.logmessage += JSON.stringify(result) + "\n" - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " successed\n" - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failed\n" - } -} - -async function ACTS_AppPermission_1500(thisobj) { - var thisFunctionName = ACTS_AppPermission_1500.name - thisobj.logmessage = "" - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - await context.verifyCallingPermission("ohos.permission.CAMERA", - (err, data) => { - console.debug("======verifyCallingPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += JSON.stringify(data) + "\n" - if (data == -1) { - thisobj.logmessage += "case " + thisFunctionName + " successed\n" - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failed\n" - } - }) -} - -async function ACTS_AppPermission_1600(thisobj) { - var thisFunctionName = ACTS_AppPermission_1600.name - thisobj.logmessage = "" - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - var result = await context.verifyCallingPermission("ohos.permission.CAMERA") - console.debug("======verifyCallingPermission:result======>:" + JSON.stringify(result)) - thisobj.logmessage += JSON.stringify(result) + "\n" - if (result == -1) { - thisobj.logmessage += "case " + thisFunctionName + " successed\n" - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failed\n" - } -} - -async function ACTS_AppPermission_1700(thisobj) { - var thisFunctionName = ACTS_AppPermission_1700.name - thisobj.logmessage = "" - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - await context.verifyCallingPermission("com.amsst.permission.SYSPERMISSION", - (err, data) => { - console.debug("======verifyCallingPermission:data======>:" + JSON.stringify(data)); - thisobj.logmessage += JSON.stringify(data) + "\n" - if (data == 0) { - thisobj.logmessage += "case " + thisFunctionName + " successed\n" - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failed\n" - } - }) -} - -async function ACTS_AppPermission_1800(thisobj) { - var thisFunctionName = ACTS_AppPermission_1800.name - thisobj.logmessage = "" - thisobj.logmessage += thisFunctionName + "\n"; - thisobj.logmessage += GetCaseInfo(thisFunctionName) + "\n"; - - var context = await featureAbility.getContext() - var result = await context.verifyCallingPermission("com.amsst.permission.SYSPERMISSION") - console.debug("======verifyCallingPermission:result======>:" + JSON.stringify(result)) - thisobj.logmessage += JSON.stringify(result) + "\n" - if (result == 0) { - thisobj.logmessage += "case " + thisFunctionName + " successed\n" - } - else { - thisobj.logmessage += "case " + thisFunctionName + " failed\n" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/element/string.json deleted file mode 100644 index bf48dbf23fb4a7f0d2a824be647f29f5f6130201..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Permission" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/signature/openharmony_sx.p7b and /dev/null differ diff --git a/aafwk/aafwk_standard/verifypermission/BUILD.gn b/aafwk/aafwk_standard/verifypermission/BUILD.gn deleted file mode 100644 index ebdda714cca84bce4d2566ee29630cf0585ec423..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/verifypermission/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# 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") - -group("verifypermission") { - testonly = true - if (is_standard_system) { - deps = [ - "AmsJsStMain:ActsAmsJsStMainTest", - "AmsJsStSubPermission:ActsAmsJsStSubPermissionTest", - ] - } -}