diff --git a/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn index 8a0cb63e2257253be6570f26257eea4c35eb5db0..1c6bcd4b946192377fa618ac7672cdeae9f887ed 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn +++ b/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//test/xts/tools/build/suite.gni") diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn index ca77e7bbf333596244b0cbbae2068128e83c231e..b185801f219f2ca1326f40e541e83cfec0c1b158 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//test/xts/tools/build/suite.gni") diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json index ef953c581f15db7cc2c07bb3d7e1692c3af4c46d..32e59a4bf17b9e3633802259f02a69431bae741c 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json @@ -1,97 +1,97 @@ -{ - "app": { - "bundleName": "com.amsst.stdataability", - "vendor": "test", - "version": { - "code": 1000110, - "name": "1.1.1" - }, - "apiVersion": { - "compatible": 9, - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.amsst.stdataability", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "srcPath": "TestDataAbility", - "name": ".TestDataAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_testdataability", - "type": "data", - "visible": true, - "uri": "dataability://com.example.myapplication.DataAbility" - }, - { - "srcPath": "TestDataAbility2", - "name": ".TestDataAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_testdataability", - "type": "data", - "visible": true, - "uri": "dataability://com.example.myapplication.DataAbility2" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "name": "com.ohos.screenlock.DataAbilityShellProvider.PROVIDER" - } - ] - } -} +{ + "app": { + "bundleName": "com.amsst.stdataability", + "vendor": "test", + "version": { + "code": 1000110, + "name": "1.1.1" + }, + "apiVersion": { + "compatible": 9, + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.amsst.stdataability", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "srcPath": "TestDataAbility", + "name": ".TestDataAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_testdataability", + "type": "data", + "visible": true, + "uri": "dataability://com.example.myapplication.DataAbility" + }, + { + "srcPath": "TestDataAbility2", + "name": ".TestDataAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_testdataability", + "type": "data", + "visible": true, + "uri": "dataability://com.example.myapplication.DataAbility2" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "name": "com.ohos.screenlock.DataAbilityShellProvider.PROVIDER" + } + ] + } +} diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts index e2e06d6d3bddbd886d2f6554f50021d73235cfcc..07ad14f5f75a15d1a7cce6eaee825e65d58e5752 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts @@ -1,21 +1,21 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate"); - } +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate"); + } } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts index c89305ea6db4b5ac3f7286b9657f6f7ca8074c72..5f8551ea9c615a693294aa3fc84136a333c3b859 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -1,44 +1,44 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("jws onCreate"); - } - - onDestroy() { - console.log("jws onDestroy"); - } - - onWindowStageCreate(windowStage) { - console.log("jws onWindowStageCreate"); - } - - onWindowStageDestroy() { - console.log("jws onWindowStageDestroy"); - } - - onForeground() { - console.log("jws onForeground"); - } - - onBackground() { - console.log("jws onBackground"); - } - - call(){ - - } +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + console.log("jws onCreate"); + } + + onDestroy() { + console.log("jws onDestroy"); + } + + onWindowStageCreate(windowStage) { + console.log("jws onWindowStageCreate"); + } + + onWindowStageDestroy() { + console.log("jws onWindowStageDestroy"); + } + + onForeground() { + console.log("jws onForeground"); + } + + onBackground() { + console.log("jws onBackground"); + } + + call(){ + + } } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets index eef2fff6d169b8c305daa2acd8db6eb913b31f4e..d0d2a5cd47ed5a1092788289ae2a48953d89be88 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets @@ -1,22 +1,22 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets index 6b4120bd91a94160e64b02ba8b7b89b413c39389..a8919c82aee6af5b231acdd2a2c6f6237a79f7d9 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,38 +1,38 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {Core} from 'deccjsunit/index' - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('onShow finish') - const core = Core.getInstance() - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - core.execute() - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {Core} from 'deccjsunit/index' + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info('onShow finish') + const core = Core.getInstance() + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + core.execute() + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets index 65bb9463e1707757f7cb1cdca3d1b7da5dc63170..359eb5ab9c068706363fa2938cccd40d7df25264 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets @@ -1,43 +1,43 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts index a7b0c3975269419cbd995732561411bf502e6a1b..1a20eee46467aae73e076eb589ac0d4f36a1e61f 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts @@ -1,254 +1,254 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import dataAbility from '@ohos.data.dataAbility' -import featureAbility from '@ohos.ability.featureAbility' -import fileio from '@ohos.fileio' -import dataRdb from '@ohos.data.rdb' - -const TABLE_NAME = 'book' -const STORE_CONFIG = {name: 'book.db'} -const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + - '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' -let rdbStore: any = undefined -const TAG = 'ACTS_ DataAbility.data' -const context = featureAbility.getContext() - -let defaultReturn = 1; -let returnError = 0; -let returnError1 = -1; -let returnError2 = -2; -let returnError3 = -3; -let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility"); - -export default { - - onInitialized(abilityInfo) { - console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) - dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => { - console.debug('ACTS_ [data]getRdbStoreThen') - store.executeSql(SQL_CREATE_TABLE, []) - rdbStore = store - }); - }, - - insert(uri, valueBucket, callback) { - console.debug(TAG + ' insert start 1121') - console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error insert" - console.debug(TAG + ' rdbStore.insert ') - rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - query(uri, columns, predicates, callback) { - console.debug(TAG + ' query start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.query(rdbPredicates, columns, callback) - }, - - update(uri, valueBucket, predicates, callback) { - console.debug(TAG + 'update start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error update" - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - delete(uri, predicates, callback) { - console.debug(TAG + 'delete start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.delete(rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - call(uri, method, arg, extras, callback) { - console.debug(TAG + 'call start') - console.debug(TAG + 'uri---->' + uri) - console.debug(TAG + 'method---->' + uri) - }, - - batchInsert(uri, values, callback) { - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - for (var j = 0; j < values.length; j++) { - rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { - console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) - }) - } - console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) - callback(err, values.length); - }, - - getType(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by getType ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - callback("success", uri); - }, - - getFileTypes(uri, mimeTypeFilter, callback) { - console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - let type1 = " "; - let type2 = " "; - let type3 = " "; - let types; - if (mimeTypeFilter == "*/*") { - type1 = ("hap"); - type2 = ("jpg"); - type3 = ("image/png"); - types = [type1, type2, type3]; - } else if (mimeTypeFilter == "image/*") { - type1 = ("image/png"); - types = [type1]; - } else if (mimeTypeFilter == "*/jpg") { - type1 = ("jpg"); - types = [type1]; - } - - console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) - callback("success", types); - }, - - openFile(uri, mode, callback) { - console.info(TAG + '==================== DataAbility test interface by openFile ================'); - let defaultReturn = 1; - let returnError1 = -1; - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || - mode == ("rw") || mode == ("rwt"))) { - if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { - defaultReturn = returnError2; - } else - defaultReturn = returnError3; - } - console.info(TAG + " path = /data/test "); - let path = "/data/test" - fileio.stat(path).then(function (stat) { - console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); - }).catch(function (err) { - console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); - defaultReturn = returnError1; - }); - console.info(TAG + " path ==>" + path); - callback("success", defaultReturn); - }, - - normalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - }, - - denormalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); - console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - } +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import dataAbility from '@ohos.data.dataAbility' +import featureAbility from '@ohos.ability.featureAbility' +import fileio from '@ohos.fileio' +import dataRdb from '@ohos.data.rdb' + +const TABLE_NAME = 'book' +const STORE_CONFIG = {name: 'book.db'} +const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' +let rdbStore: any = undefined +const TAG = 'ACTS_ DataAbility.data' +const context = featureAbility.getContext() + +let defaultReturn = 1; +let returnError = 0; +let returnError1 = -1; +let returnError2 = -2; +let returnError3 = -3; +let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility"); + +export default { + + onInitialized(abilityInfo) { + console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) + dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => { + console.debug('ACTS_ [data]getRdbStoreThen') + store.executeSql(SQL_CREATE_TABLE, []) + rdbStore = store + }); + }, + + insert(uri, valueBucket, callback) { + console.debug(TAG + ' insert start 1121') + console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error insert" + console.debug(TAG + ' rdbStore.insert ') + rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + query(uri, columns, predicates, callback) { + console.debug(TAG + ' query start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.query(rdbPredicates, columns, callback) + }, + + update(uri, valueBucket, predicates, callback) { + console.debug(TAG + 'update start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error update" + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + delete(uri, predicates, callback) { + console.debug(TAG + 'delete start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.delete(rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + call(uri, method, arg, extras, callback) { + console.debug(TAG + 'call start') + console.debug(TAG + 'uri---->' + uri) + console.debug(TAG + 'method---->' + uri) + }, + + batchInsert(uri, values, callback) { + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + for (var j = 0; j < values.length; j++) { + rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { + console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) + }) + } + console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) + callback(err, values.length); + }, + + getType(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by getType ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + callback("success", uri); + }, + + getFileTypes(uri, mimeTypeFilter, callback) { + console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + let type1 = " "; + let type2 = " "; + let type3 = " "; + let types; + if (mimeTypeFilter == "*/*") { + type1 = ("hap"); + type2 = ("jpg"); + type3 = ("image/png"); + types = [type1, type2, type3]; + } else if (mimeTypeFilter == "image/*") { + type1 = ("image/png"); + types = [type1]; + } else if (mimeTypeFilter == "*/jpg") { + type1 = ("jpg"); + types = [type1]; + } + + console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) + callback("success", types); + }, + + openFile(uri, mode, callback) { + console.info(TAG + '==================== DataAbility test interface by openFile ================'); + let defaultReturn = 1; + let returnError1 = -1; + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || + mode == ("rw") || mode == ("rwt"))) { + if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { + defaultReturn = returnError2; + } else + defaultReturn = returnError3; + } + console.info(TAG + " path = /data/test "); + let path = "/data/test" + fileio.stat(path).then(function (stat) { + console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); + }).catch(function (err) { + console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); + defaultReturn = returnError1; + }); + console.info(TAG + " path ==>" + path); + callback("success", defaultReturn); + }, + + normalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + }, + + denormalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); + console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + } }; \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts index cd2464a1f5bad522f0e129fd654c9e92927baa36..f84642cbb8dcc82295cb720eaf2affb061edee4a 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts @@ -1,254 +1,254 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import dataAbility from '@ohos.data.dataAbility' -import featureAbility from '@ohos.ability.featureAbility' -import fileio from '@ohos.fileio' -import dataRdb from '@ohos.data.rdb' - -const TABLE_NAME = 'book' -const STORE_CONFIG = {name: 'book.db'} -const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + - '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' -let rdbStore: any = undefined -const TAG = 'ACTS_ DataAbility.data' -const context = featureAbility.getContext() - -let defaultReturn = 1; -let returnError = 0; -let returnError1 = -1; -let returnError2 = -2; -let returnError3 = -3; -let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility2"); - -export default { - - onInitialized(abilityInfo) { - console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) - dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => { - console.debug('ACTS_ [data]getRdbStoreThen') - store.executeSql(SQL_CREATE_TABLE, []) - rdbStore = store - }); - }, - - insert(uri, valueBucket, callback) { - console.debug(TAG + ' insert start 1121') - console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error insert" - console.debug(TAG + ' rdbStore.insert ') - rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - query(uri, columns, predicates, callback) { - console.debug(TAG + ' query start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.query(rdbPredicates, columns, callback) - }, - - update(uri, valueBucket, predicates, callback) { - console.debug(TAG + 'update start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error update" - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - delete(uri, predicates, callback) { - console.debug(TAG + 'delete start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.delete(rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - call(uri, method, arg, extras, callback) { - console.debug(TAG + 'call start') - console.debug(TAG + 'uri---->' + uri) - console.debug(TAG + 'method---->' + uri) - }, - - batchInsert(uri, values, callback) { - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - for (var j = 0; j < values.length; j++) { - rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { - console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) - }) - } - console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) - callback(err, values.length); - }, - - getType(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by getType ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - callback("success", uri); - }, - - getFileTypes(uri, mimeTypeFilter, callback) { - console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - let type1 = " "; - let type2 = " "; - let type3 = " "; - let types; - if (mimeTypeFilter == "*/*") { - type1 = ("hap"); - type2 = ("jpg"); - type3 = ("image/png"); - types = [type1, type2, type3]; - } else if (mimeTypeFilter == "image/*") { - type1 = ("image/png"); - types = [type1]; - } else if (mimeTypeFilter == "*/jpg") { - type1 = ("jpg"); - types = [type1]; - } - - console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) - callback("success", types); - }, - - openFile(uri, mode, callback) { - console.info(TAG + '==================== DataAbility test interface by openFile ================'); - let defaultReturn = 1; - let returnError1 = -1; - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || - mode == ("rw") || mode == ("rwt"))) { - if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { - defaultReturn = returnError2; - } else - defaultReturn = returnError3; - } - console.info(TAG + " path = /data/test "); - let path = "/data/test" - fileio.stat(path).then(function (stat) { - console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); - }).catch(function (err) { - console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); - defaultReturn = returnError1; - }); - console.info(TAG + " path ==>" + path); - callback("success", defaultReturn); - }, - - normalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - }, - - denormalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); - console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - } +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import dataAbility from '@ohos.data.dataAbility' +import featureAbility from '@ohos.ability.featureAbility' +import fileio from '@ohos.fileio' +import dataRdb from '@ohos.data.rdb' + +const TABLE_NAME = 'book' +const STORE_CONFIG = {name: 'book.db'} +const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' +let rdbStore: any = undefined +const TAG = 'ACTS_ DataAbility.data' +const context = featureAbility.getContext() + +let defaultReturn = 1; +let returnError = 0; +let returnError1 = -1; +let returnError2 = -2; +let returnError3 = -3; +let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility2"); + +export default { + + onInitialized(abilityInfo) { + console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) + dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => { + console.debug('ACTS_ [data]getRdbStoreThen') + store.executeSql(SQL_CREATE_TABLE, []) + rdbStore = store + }); + }, + + insert(uri, valueBucket, callback) { + console.debug(TAG + ' insert start 1121') + console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error insert" + console.debug(TAG + ' rdbStore.insert ') + rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + query(uri, columns, predicates, callback) { + console.debug(TAG + ' query start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.query(rdbPredicates, columns, callback) + }, + + update(uri, valueBucket, predicates, callback) { + console.debug(TAG + 'update start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error update" + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + delete(uri, predicates, callback) { + console.debug(TAG + 'delete start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.delete(rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + call(uri, method, arg, extras, callback) { + console.debug(TAG + 'call start') + console.debug(TAG + 'uri---->' + uri) + console.debug(TAG + 'method---->' + uri) + }, + + batchInsert(uri, values, callback) { + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + for (var j = 0; j < values.length; j++) { + rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { + console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) + }) + } + console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) + callback(err, values.length); + }, + + getType(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by getType ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + callback("success", uri); + }, + + getFileTypes(uri, mimeTypeFilter, callback) { + console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + let type1 = " "; + let type2 = " "; + let type3 = " "; + let types; + if (mimeTypeFilter == "*/*") { + type1 = ("hap"); + type2 = ("jpg"); + type3 = ("image/png"); + types = [type1, type2, type3]; + } else if (mimeTypeFilter == "image/*") { + type1 = ("image/png"); + types = [type1]; + } else if (mimeTypeFilter == "*/jpg") { + type1 = ("jpg"); + types = [type1]; + } + + console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) + callback("success", types); + }, + + openFile(uri, mode, callback) { + console.info(TAG + '==================== DataAbility test interface by openFile ================'); + let defaultReturn = 1; + let returnError1 = -1; + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || + mode == ("rw") || mode == ("rwt"))) { + if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { + defaultReturn = returnError2; + } else + defaultReturn = returnError3; + } + console.info(TAG + " path = /data/test "); + let path = "/data/test" + fileio.stat(path).then(function (stat) { + console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); + }).catch(function (err) { + console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); + defaultReturn = returnError1; + }); + console.info(TAG + " path ==>" + path); + callback("success", defaultReturn); + }, + + normalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + }, + + denormalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); + console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + } }; \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json index 22c139ebd13a685e9ce52a84ea2b625e18d8db40..a1d7bcf7e03db4e2f2124a1b6eefe1e8908d25c4 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json @@ -1,36 +1,36 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "ServiceExtAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceextability", - "value": "hap sample empty service" - }, - { - "name": "description_dataability", - "value": "hap sample empty provider" - }, - { - "name": "description_mainability2", - "value": "eTS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_testdataability", - "value": "hap sample empty provider" - }, - { - "name": "permreason_dataability", - "value": "request dataability premission" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "ServiceExtAbility" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceextability", + "value": "hap sample empty service" + }, + { + "name": "description_dataability", + "value": "hap sample empty provider" + }, + { + "name": "description_mainability2", + "value": "eTS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_testdataability", + "value": "hap sample empty provider" + }, + { + "name": "permreason_dataability", + "value": "request dataability premission" + } + ] } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn index f81adb5b97bbadd5672babdf4b62c14f8ecea652..19f712b1a510fc5374f094495d3e7188de6a2f99 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn @@ -9,13 +9,13 @@ # 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. +# limitations under the License. import("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("ActsFWKDataAccessorTest") { + hap_profile = "./src/main/config.json" hap_name = "ActsFWKDataAccessorTest" - hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", @@ -23,9 +23,11 @@ ohos_js_hap_suite("ActsFWKDataAccessorTest") { certificate_profile = "./signature/openharmony_sx.p7b" } ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" + js2abc = true + hap_profile = "./src/main/config.json" + source_dir = "./src/main/js" } ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" + sources = [ "./src/main/resources" ] + hap_profile = "./src/main/config.json" } diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json index 26277c340b28cc78ab0fbd9ef45a8d97275228d0..1502913530c01523b9422c47af7e41cacc0486da 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json @@ -1,19 +1,20 @@ -{ - "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", - "ActsDataAbilityRelyHap.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "180000", + "shell-timeout": "180000", + "bundle-name": "com.amsst.fwkdataaccessor", + "package-name": "com.amsst.fwkdataaccessor" + }, + "kits": [ + { + "test-file-name": [ + "ActsFWKDataAccessorTest.hap", + "ActsDataAbilityRelyHap.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json deleted file mode 100644 index ba1f602704c7c4e9e762304de300f9da41f8cd69..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/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/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index baf5b3c1c2a555bed22561a88aca6d857522d425..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/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/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..ce2f9da5d496fd6773569b37047c519e6cc0920b --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json @@ -0,0 +1,94 @@ +{ + "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": ".entry", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "formsEnabled": false, + "name": ".MainAbility", + "srcLanguage": "js", + "srcPath": "MainAbility", + "icon": "$media:icon", + "description": "$string:MainAbility_desc", + "label": "$string:MainAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + }, + { + "orientation": "unspecified", + "formsEnabled": false, + "name": ".TestAbility", + "srcLanguage": "js", + "srcPath": "TestAbility", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "label": "$string:TestAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "testRunner": { + "name": "OpenHarmonyTestRunner", + "srcPath": "TestRunner" + }, + "mainAbility": ".MainAbility", + "srcPath": "" + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/app.js similarity index 97% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/app.js index 4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5..3ee099f58926b1a7c42f02bb88ebb4998f9e4ac4 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/app.js @@ -1,22 +1,22 @@ -/* - * 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'); - } -}; +/* + * 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/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/i18n/en-US.json similarity index 91% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/i18n/en-US.json index e63c70d978a3a53be988388c87182f81785e170c..a4c13dcbdc39c537073f638393d7726ac9a5cdc4 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/i18n/en-US.json @@ -1,6 +1,6 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } +{ + "strings": { + "hello": "Hello", + "world": "World" + } } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/i18n/zh-CN.json similarity index 91% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/i18n/zh-CN.json index de6ee5748322f44942c1b003319d8e66c837675f..b1c02368f72f929e4375a43170444de95dcc5984 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/i18n/zh-CN.json @@ -1,6 +1,6 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } +{ + "strings": { + "hello": "您好", + "world": "世界" + } } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.css similarity index 93% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.css index 6724ec055a554cf3f9c7be83780c30df2274875b..47154598b65e9ac944ff730b4d0a0bf80c1efb1f 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.css @@ -1,12 +1,12 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} -.titleST { - font-size: 32px; +.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/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.hml similarity index 95% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.hml index 4f779dcdff4fa69413976fe7032ca3656758793a..f1562cec5bd17d111abae5b7e02ead32e6d58eb5 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.hml @@ -1,8 +1,8 @@ -
- - {{ $t('strings.hello') }} {{ title }} - - - STDataAbility - -
+
+ + {{ $t('strings.hello') }} {{ title }} + + + STDataAbility + +
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.js similarity index 62% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.js index 4bfa4f7e4a4085d7336a97befffb8d52882d281d..f3d755a64cd60aad5af3d8c90f253f76abb80f71 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/MainAbility/pages/index/index.js @@ -1,44 +1,30 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -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() { - }, +/* + * 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' + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + console.info('====onShow finish====<') + }, + onReady() { + }, } \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/app.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..cdc31f3dcf031e2f6a7665d9653e53bb649e21c5 --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/app.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' + +export default { + onCreate() { + console.info('TestApplication onCreate') + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, + onDestroy() { + console.info("TestApplication onDestroy"); + } +}; diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/i18n/en-US.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..3cb24b374b1d919ca8eac0638f361692b603a900 --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/i18n/zh-CN.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..c804e32c0c3103929baca5617cdac70be11fdba1 --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.css b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..b1bcd43387ba131cc1d30975ff7508a6f8084a4b --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.css @@ -0,0 +1,30 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +@media screen and (device-type: phone) and (orientation: landscape) { + .title { + font-size: 60px; + } +} + +@media screen and (device-type: tablet) and (orientation: landscape) { + .title { + font-size: 100px; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.hml b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f629c71a9be857db6cdf94149652a191b9b272ea --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..88b083a7f6b979019d6a2c5ad20b19c5fd43286b --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestAbility/pages/index/index.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} + + + diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestRunner/OpenHarmonyTestRunner.js new file mode 100644 index 0000000000000000000000000000000000000000..c5fa8620ca77d381f20b65a903b833e6e3378c97 --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/TestRunner/OpenHarmonyTestRunner.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package', '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key] + } + } + return targetParams.trim() +} + + export default { + onPrepare() { + console.info('OpenHarmonyTestRunner OnPrepare') + }, + onRun() { + console.log('OpenHarmonyTestRunner onRun run') + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + console.info('debug value : '+debug) + if (debug == 'true') + { + cmd += ' -D' + } + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + data.stdResult); + console.info('executeShellCommand : data : ' + data.exitCode); + }) + } +}; diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js similarity index 97% rename from ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js index e5533cd5e2fefa45a3fc02e3fb408fdd8a30c013..4b13f8ccfd86edf623d24b98c1c03104acc03d37 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js @@ -1,8525 +1,8526 @@ -/* - * 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.example.myapplication.DataAbility"); - let dataAbilityUri2 = ("dataability:///com.example.myapplication.DataAbility2"); - let dataAbilityUri3 = ("dataability:///com.example.myapplication.DataAbility3"); - let DAHelper; - let gSetTimeout = 500; - var valueBucket = { - "name": "ActsDataAbilityHelperTest", - "age": 24, - "salary": 2024.20, - } - - beforeAll(async (done) => { - console.debug('= ACTS_beforeAll ====: ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper)); - if(DAHelper == null){ - console.debug('ACTS_beforeAll DAHelper ====>: DAHelper == null'); - return; - } - } 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)) - if(DAHelper == null){ - DAHelper = 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)) - expect(abilityHelper).assertEqual(null); - } catch (err) { - console.error('=ACTS_GetDataAbilityHelper_0200 acquireDataAbilityHelper catch(err)====>:' + err); - expect(false).assertTrue(); - } - done(); - console.log('ACTS_AcquireDataAbilityHelper_0200====: ' - + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) - expect(abilityHelper).assertEqual(null); - } catch (err) { - console.error('=ACTS_GetDataAbilityHelper_0300 acquireDataAbilityHelper catch(err)====>:' + err); - expect(false).assertTrue(); - } - done(); - console.log('ACTS_AcquireDataAbilityHelper_0300====: ' - + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) - expect(JSON.stringify(abilityHelper)).assertEqual("null"); - } catch (err) { - console.error('=ACTS_GetDataAbilityHelper_0400 acquireDataAbilityHelper catch(err)====>:' + err); - expect(false).assertTrue(); - } - done(); - console.log('ACTS_AcquireDataAbilityHelper_0400====: ' - + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) - expect(JSON.stringify(abilityHelper)).assertEqual("null"); - } catch (err) { - console.error('=ACTS_GetDataAbilityHelper_0500 acquireDataAbilityHelper catch(err)====>:' + err); - expect(false).assertTrue(); - } - done(); - console.log('ACTS_AcquireDataAbilityHelper_0500====: ' + DAHelper) - let valueBucketM - try { - DAHelper.insert(dataAbilityUri, valueBucketM) - .then(function (data) { - console.debug("=ACTS_Insert_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-2); - console.log('ACTS_Insert_0100====" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Insert_0100====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Insert_0100====: ' + DAHelper) - let valueBucketM = 'undefined'; - try { - await DAHelper.insert(dataAbilityUri, valueBucketM, - (err, data) => { - console.debug("=ACTS_Insert_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】data【") + data + (" 】;")); - expect(data).assertEqual(-2); - console.log('ACTS_Insert_0200====:' + err); - console.log('ACTS_Insert_0200==== { - console.debug("=ACTS_Insert_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - console.log('ACTS_Insert_0300==== { - console.debug("=ACTS_Insert_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_0300====:' + err); - console.log('ACTS_Insert_0300====: ' + DAHelper) - 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); - console.log('ACTS_Insert_0400====:' + err); - console.log('ACTS_Insert_0400==== { - console.debug("=ACTS_Insert_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_Insert_0500==== { - console.debug("=ACTS_Insert_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_0500====:' + err); - console.log('ACTS_Insert_0500====: ' + DAHelper) - try { - await DAHelper.insert(undefined, valueBucket, - (err, data) => { - console.debug("=ACTS_Insert_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - expect(data).assertEqual(0); - console.log('ACTS_Insert_0600====:' + err); - console.log('ACTS_Insert_0600==== { - console.debug("=ACTS_Insert_0700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_Insert_0700==== { - console.debug("=ACTS_Insert_0700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_0700====:' + err); - console.log('ACTS_Insert_0700====: ' + DAHelper) - var currentAlertTimeout; - try { - function onAsyncCallbackInsert0800(err) { - clearTimeout(currentAlertTimeout); - expect(err.code).assertEqual(0); - console.log('ACTS_Insert_0800==== { - console.debug("=ACTS_Insert_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(1); - - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_Insert_0800====:' + err); - console.log('ACTS_Insert_0800==== { - console.debug("=ACTS_Insert_0900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_Insert_0900==== { - console.debug("=ACTS_Insert_0900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_0900====:' + err); - console.log('ACTS_Insert_0900====: ' + DAHelper) - try { - await DAHelper.insert(123456, valueBucket, - (err, data) => { - console.debug("=ACTS_Insert_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - expect(data).assertEqual(0); - console.log('ACTS_Insert_1000====:' + err); - console.log('ACTS_Insert_1000==== { - console.debug("=ACTS_Insert_1100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_Insert_1100==== { - console.debug("=ACTS_Insert_1100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_1100====:' + err); - console.log('ACTS_Insert_1100====: ' + DAHelper) - try { - await DAHelper.insert(dataAbilityUri2, valueBucket, - (err, data) => { - console.debug("=ACTS_Insert_1200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_Insert_1200====:' + err); - console.log('ACTS_Insert_1200==== { - console.debug("=ACTS_Insert_1300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_Insert_1300==== { - console.debug("=ACTS_Insert_1300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_1300====:' + err); - console.log('ACTS_Insert_1300====: ' + DAHelper) - try { - await DAHelper.insert("errorUri", valueBucket, - (err, data) => { - console.debug("=ACTS_Insert_1400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_Insert_1400====:' + err); - console.log('ACTS_Insert_1400==== { - console.debug("=ACTS_Insert_1500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-2); - console.log('ACTS_Insert_1500==== { - console.debug("=ACTS_Insert_1500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Insert_1500====:' + err); - console.log('ACTS_Insert_1500====: ' + DAHelper) - var valueBucketK = {}; - try { - await DAHelper.insert(dataAbilityUri, valueBucketK, - (err, data) => { - console.debug("=ACTS_Insert_1600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-2); - console.log('ACTS_Insert_1600====:' + err); - console.log('ACTS_Insert_1600====: ' + DAHelper) - var valueBucketM; - try { - DAHelper.batchInsert( - dataAbilityUri, - valueBucketM - ).then((data) => { - console.debug("=ACTS_BatchInsert_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】; ====>")); - expect(data).assertEqual(0); - console.log('ACTS_BatchInsert_0100==== { - console.debug("=ACTS_BatchInsert_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_0100====:' + err); - console.log('ACTS_BatchInsert_0100====: ' + DAHelper) - var valueBucketM; - try { - await DAHelper.batchInsert( - dataAbilityUri, - valueBucketM, - (err, data) => { - console.debug("=ACTS_BatchInsert_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(0); - console.log('ACTS_BatchInsert_0200====:' + err); - 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); - console.log('ACTS_BatchInsert_0300==== { - console.debug("=ACTS_BatchInsert_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_0300====:' + err); - 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); - console.log('ACTS_BatchInsert_0400====:' + err); - console.log('ACTS_BatchInsert_0400====: ' + DAHelper) - try { - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - - DAHelper.batchInsert( - dataAbilityUri, - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(3); - console.log('ACTS_BatchInsert_0500==== { - console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_0500====:' + err); - console.log('ACTS_BatchInsert_0500====: ' + DAHelper) - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - 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); - console.log('ACTS_BatchInsert_0600====:' + err); - console.log('ACTS_BatchInsert_0600====: ' + DAHelper) - try { - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - - DAHelper.batchInsert( - dataAbilityUri2, - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_0700 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_BatchInsert_0700==== { - console.debug("=ACTS_BatchInsert_0700 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_0700====:' + err); - console.log('ACTS_BatchInsert_0700====: ' + DAHelper) - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - try { - await DAHelper.batchInsert( - dataAbilityUri2, - valueBucketArray, - (err, data) => { - console.debug("=ACTS_BatchInsert_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_BatchInsert_0800====:' + err); - console.log('ACTS_BatchInsert_0800====: ' + DAHelper) - try { - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - - DAHelper.batchInsert( - undefined, - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_0900 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_BatchInsert_0900==== { - console.debug("=ACTS_BatchInsert_0900 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_0900====:' + err); - console.log('ACTS_BatchInsert_0900====: ' + DAHelper) - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - try { - await DAHelper.batchInsert( - undefined, - valueBucketArray, - (err, data) => { - console.debug("=ACTS_BatchInsert_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - console.log('ACTS_BatchInsert_1000====:' + err); - console.log('ACTS_BatchInsert_1000====: ' + DAHelper) - try { - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - - DAHelper.batchInsert( - "error", - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_1100 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_BatchInsert_1100==== { - console.debug("=ACTS_BatchInsert_1100 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_1100====:' + err); - console.log('ACTS_BatchInsert_1100====: ' + DAHelper) - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - try { - await DAHelper.batchInsert( - "error", - valueBucketArray, - (err, data) => { - console.debug("=ACTS_BatchInsert_1200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_BatchInsert_1200====:' + err); - console.log('ACTS_BatchInsert_1200====: ' + DAHelper) - try { - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - - DAHelper.batchInsert( - 123456, - valueBucketArray, - ).then((data) => { - console.debug("=ACTS_BatchInsert_1300 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_BatchInsert_1300==== { - console.debug("=ACTS_BatchInsert_1300 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_1300====:' + err); - console.log('ACTS_BatchInsert_1300====: ' + DAHelper) - var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, - { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) - try { - await DAHelper.batchInsert( - 123456, - valueBucketArray, - (err, data) => { - console.debug("=ACTS_BatchInsert_1400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - console.log('ACTS_BatchInsert_1400====:' + err); - console.log('ACTS_BatchInsert_1400====: ' + DAHelper) - try { - DAHelper.batchInsert( - dataAbilityUri, - valueBucket, - ).then((data) => { - console.debug("=ACTS_BatchInsert_1500 BatchInsert Promise then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_BatchInsert_1500==== { - console.debug("=ACTS_BatchInsert_1500 BatchInsert Promise catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_BatchInsert_1500====:' + err); - console.log('ACTS_BatchInsert_1500====: ' + DAHelper) - try { - await DAHelper.batchInsert( - dataAbilityUri, - valueBucket, - (err, data) => { - console.debug("=ACTS_BatchInsert_1600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(0); - console.log('ACTS_BatchInsert_1600====:' + err); - console.log('ACTS_BatchInsert_1600====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_0100====:' + err); - console.log('ACTS_Query_0100==== { - console.debug("=ACTS_Query_0200 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_0200====:' + err); - console.log('ACTS_Query_0200====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_0300====:' + err); - 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"); - console.log('ACTS_Query_0400====:' + err); - console.log('ACTS_Query_0400====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_0500====:' + err); - console.log('ACTS_Query_0500==== { - console.debug("=ACTS_Query_0600 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_0600====:' + err); - console.log('ACTS_Query_0600====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_0700====:' + err); - console.log('ACTS_Query_0700==== { - console.debug("=ACTS_Query_0800 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_0800====:' + err); - console.log('ACTS_Query_0800====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_0900====:' + err); - console.log('ACTS_Query_0900==== { - console.debug("=ACTS_Query_1000 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_1000====:' + err); - console.log('ACTS_Query_1000====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_1100====:' + err); - console.log('ACTS_Query_1100==== { - console.debug("=ACTS_Query_1200 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_1200====:' + err); - console.log('ACTS_Query_1200====" - + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); - expect(typeof (queryPromise)).assertEqual("object"); - console.log('ACTS_Query_1300====:' + err); - console.log('ACTS_Query_1300==== { - console.debug("=ACTS_Query_1400 query err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(data) + (" 】;") + " , " + data); - expect(typeof (data)).assertEqual("object"); - console.log('ACTS_Query_1400====:' + err); - console.log('ACTS_Query_1400====: ' + 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(data).assertEqual(-2); - console.log('ACTS_Update_0100==== { - console.debug("=ACTS_Update_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Update_0100====:' + err); - expect(false).assertTrue(); - 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(data).assertEqual(-2); - console.log('ACTS_Update_0200====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Update_0200====: ' + 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_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); - console.log('ACTS_Update_0300==== { - console.debug("=ACTS_Update_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Update_0300====:' + err); - console.log('ACTS_Update_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_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); - console.log('ACTS_Update_0400====:' + err); - console.log('ACTS_Update_0400====: ' + 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_Update_0500 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - undefined, - valueBucket, - predicates - ).then((data) => { - console.debug("=ACTS_Update_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_Update_0500==== { - console.debug("=ACTS_Update_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Update_0500====:' + err); - console.log('ACTS_Update_0500====: ' + 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_Update_0600 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - undefined, - valueBucket, - predicates, - (err, data) => { - console.debug("=ACTS_Update_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - expect(data).assertEqual(0); - console.log('ACTS_Update_0600====:' + err); - console.log('ACTS_Update_0600====: ' + DAHelper) - var currentAlertTimeout; - try { - function onAsyncCallbackUpdate0700(err) { - expect(err.code).assertEqual(0); - clearTimeout(currentAlertTimeout); - console.log('ACTS_Update_0700====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - dataAbilityUri, - valueBucket, - predicates - ).then((data) => { - console.debug("=ACTS_Update_0700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_Update_0700==== { - console.debug("=ACTS_Update_0700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + err); - console.log('ACTS_Update_0700====:' + err); - console.log('ACTS_Update_0700====: ' + DAHelper) - var currentAlertTimeout; - try { - function onAsyncCallbackUpdate0800(err) { - expect(err.code).assertEqual(0); - clearTimeout(currentAlertTimeout); - console.log('ACTS_Update_0800====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - dataAbilityUri, - valueBucket, - predicates, - (err, data) => { - console.debug("=ACTS_Update_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(1); - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_Update_0800====:' + err); - console.log('ACTS_Update_0800====: ' + 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_Update_0900 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - 123456, - valueBucket, - predicates - ).then((data) => { - console.debug("=ACTS_Update_0900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_Update_0900==== { - console.debug("=ACTS_Update_0900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Update_0900====:' + err); - console.log('ACTS_Update_0900====: ' + 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_Update_1000 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - 123456, - valueBucket, - predicates, - (err, data) => { - console.debug("=ACTS_Update_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - expect(data).assertEqual(0); - console.log('ACTS_Update_1000====:' + err); - console.log('ACTS_Update_1000====: ' + 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_Update_1100 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - dataAbilityUri2, - valueBucket, - predicates - ).then((data) => { - console.debug("=ACTS_Update_1100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_Update_1100==== { - console.debug("=ACTS_Update_1100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Update_1100====:' + err); - console.log('ACTS_Update_1100====: ' + 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_Update_1200 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - dataAbilityUri2, - valueBucket, - predicates, - (err, data) => { - console.debug("=ACTS_Update_1200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_Update_1200====:' + err); - console.log('ACTS_Update_1200====: ' + 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_Update_1300 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.update( - "error_uri", - valueBucket, - predicates - ).then((data) => { - console.debug("=ACTS_Update_1300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_Update_1300==== { - console.debug("=ACTS_Update_1300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Update_1300====:' + err); - console.log('ACTS_Update_1300====: ' + 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_Update_1400 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.update( - "error_uri", - valueBucket, - predicates, - (err, data) => { - console.debug("=ACTS_Update_1400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_Update_1400====:' + err); - console.log('ACTS_Update_1400====: ' + 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(data).assertEqual(1); - console.log('ACTS_Delete_0100==== { - console.debug("=ACTS_Delete_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Delete_0100====:' + err); - expect(false).assertTrue(); - 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(data).assertEqual(1); - console.log('ACTS_Delete_0200====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Delete_0200====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - dataAbilityUri, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - console.log('ACTS_Delete_0300==== { - console.debug("=ACTS_Delete_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Delete_0300====:' + err); - expect(false).assertTrue(); - 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); - console.log('ACTS_Delete_0400====:' + err); - console.log('ACTS_Delete_0400====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - undefined, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_Delete_0500==== { - console.debug("=ACTS_Delete_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Delete_0500====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Delete_0500====: ' + 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_0600 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - undefined, - predicates, - (err, data) => { - console.debug("=ACTS_Delete_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - expect(data).assertEqual(0); - console.log('ACTS_Delete_0600====:' + err); - console.log('ACTS_Delete_0600====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - dataAbilityUri, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_0700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(1); - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_Delete_0700==== { - console.debug("=ACTS_Delete_0700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Delete_0700====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Delete_0700====: ' + DAHelper) - var currentAlertTimeout; - try { - function onAsyncCallbackDelete0800(err) { - expect(err.code).assertEqual(0); - clearTimeout(currentAlertTimeout); - console.log('ACTS_Delete_0800====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - dataAbilityUri, - predicates, - (err, data) => { - console.debug("=ACTS_Delete_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(1); - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_Delete_0800====:' + err); - console.log('ACTS_Delete_0800====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - dataAbilityUri2, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_0900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_Delete_0900==== { - console.debug("=ACTS_Delete_0900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Delete_0900====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Delete_0900====: ' + 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_1000 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - dataAbilityUri2, - predicates, - (err, data) => { - console.debug("=ACTS_Delete_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_Delete_1000====:' + err); - console.log('ACTS_Delete_1000====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - "error", - predicates - ).then((data) => { - console.debug("=ACTS_Delete_1100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1); - console.log('ACTS_Delete_1100==== { - console.debug("=ACTS_Delete_1100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Delete_1100====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Delete_1100====: ' + 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_1200 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - "error", - predicates, - (err, data) => { - console.debug("=ACTS_Delete_1200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_Delete_1200====:' + err); - console.log('ACTS_Delete_1200====" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - DAHelper.delete( - 123456, - predicates - ).then((data) => { - console.debug("=ACTS_Delete_1300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0); - console.log('ACTS_Delete_1300==== { - console.debug("=ACTS_Delete_1300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_Delete_1300====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Delete_1300====: ' + 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_1400 predicates====>" - + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); - await DAHelper.delete( - 123456, - predicates, - (err, data) => { - console.debug("=ACTS_Delete_1400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - console.log('ACTS_Delete_1400====:' + err); - console.log('ACTS_Delete_1400==== { - console.debug("=ACTS_GetFileTypes_0100 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - expect(data.length).assertEqual(3); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0100 for data[' + i + '] ====>: ' + data[i]) - if (i == 0) { - expect(data[i]).assertEqual("hap"); - } else if (i == 1) { - expect(data[i]).assertEqual("jpg"); - } else if (i == 2) { - expect(data[i]).assertEqual("image/png"); - } - } - console.log('ACTS_GetFileTypes_0100==== { - console.debug("=ACTS_GetFileTypes_0100 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_0100====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0100 getFileTypes AsyncCallback catch(err)====>:' + err); - 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); - expect(data.length).assertEqual(3); - 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]); - if (i == 0) { - expect(data[i]).assertEqual("hap"); - } else if (i == 1) { - expect(data[i]).assertEqual("jpg"); - } else if (i == 2) { - expect(data[i]).assertEqual("image/png"); - } - } - console.log('ACTS_GetFileTypes_0200====:' + err); - 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); - expect(data.length).assertEqual(1); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('= =ACTS_GetFileTypes_0300 for data[' + i + '] ====>: ' + data[i]) - if (i == 0) { - expect(data[i]).assertEqual("image/png"); - } - } - console.log('ACTS_GetFileTypes_0300==== { - console.debug("=ACTS_GetFileTypes_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('DataAbilityHelper getFileTypes error ====>: ' + err) - console.log('ACTS_GetFileTypes_0300====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0300 getFileTypes AsyncCallback catch(err)====>:' + err); - 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); - expect(data.length).assertEqual(1); - 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]); - if (i == 0) { - expect(data[i]).assertEqual("image/png"); - } - } - console.log('ACTS_GetFileTypes_0400====:' + err); - 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); - expect(data.length).assertEqual(1); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_0500 for data [' + i + '] ====>: ' + data[i]) - if (i == 0) { - expect(data[i]).assertEqual("jpg"); - } - } - console.log('ACTS_GetFileTypes_0500==== { - console.debug("=ACTS_GetFileTypes_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('DataAbilityHelper getFileTypes error ====>: ' + err) - console.log('ACTS_GetFileTypes_0500====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0500 getFileTypes AsyncCallback catch(err)====>:' + err); - 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); - expect(data.length).assertEqual(1); - for (var i = 0; i < data.length; i++) { - console.log('=ACTS_GetFileTypes_0600 for errCode ====>: ' + err.code + - " data[" + i + "]: " + data[i]); - if (i == 0) - expect(data[i]).assertEqual("jpg"); - } - console.log('ACTS_GetFileTypes_0600====:' + err); - console.log('ACTS_GetFileTypes_0600==== { - console.debug("=ACTS_GetFileTypes_0700 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_0700==== { - console.debug("=ACTS_GetFileTypes_0700 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_0700====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0700 getFileTypes AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetFileTypes_0700====: ' + DAHelper) - let mimeTypeFilter = '*/*' - try { - await DAHelper.getFileTypes( - undefined, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_0800 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_0800 data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_0800====:' + err); - console.log('ACTS_GetFileTypes_0800==== { - console.debug("=ACTS_GetFileTypes_0900 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_0900 for data[' + i + '] ====>: ' + data[i]) - if (i == 0) { - expect(data[i]).assertEqual(""); - } - } - console.log('ACTS_GetFileTypes_0900==== { - console.debug("=ACTS_GetFileTypes_0900 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_0900====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_0900 getFileTypes AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetFileTypes_0900====: ' + DAHelper) - try { - await DAHelper.getFileTypes( - dataAbilityUri, - undefined, - (err, data) => { - console.debug("=ACTS_GetFileTypes_1000 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_1000 data.length ====>: ' + data.length); - for (var i = 0; i < data.length; i++) { - expect(typeof (data[i])).assertEqual("string"); - console.log('=ACTS_GetFileTypes_1000 for data ====>: ' + err.code + - " data[" + i + "]: " + data[i]); - if (i == 0) { - expect(data[i]).assertEqual(""); - } - } - console.log('ACTS_GetFileTypes_1000====:' + err); - console.log('ACTS_GetFileTypes_1000==== { - console.debug("=ACTS_GetFileTypes_1100 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1100==== { - console.debug("=ACTS_GetFileTypes_1100 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_1100====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_1100 getFileTypes AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetFileTypes_1100====: ' + DAHelper) - let mimeTypeFilter = '*/*' - try { - await DAHelper.getFileTypes( - "error_uri", - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_1200 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_1200 data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1200====:' + err); - console.log('ACTS_GetFileTypes_1200==== { - console.debug("=ACTS_GetFileTypes_1300 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1300==== { - console.debug("=ACTS_GetFileTypes_1300 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_1300====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_1300 getFileTypes AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetFileTypes_1300====: ' + DAHelper) - let mimeTypeFilter = '*/*' - try { - await DAHelper.getFileTypes( - 123456, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_1400 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_1400 data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1400====:' + err); - console.log('ACTS_GetFileTypes_1400==== { - console.debug("=ACTS_GetFileTypes_1500 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1500==== { - console.debug("=ACTS_GetFileTypes_1500 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_1500====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_1500 getFileTypes AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetFileTypes_1500====: ' + DAHelper) - let mimeTypeFilter = 'asdfasdEDF)(#@*7fasdf546546a1ds3v16a4sd6v54@*(e7'; - try { - await DAHelper.getFileTypes( - dataAbilityUri, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_1600 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_1600 data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1600====:' + err); - console.log('ACTS_GetFileTypes_1600==== { - console.debug("=ACTS_GetFileTypes_1700 getFileTypes then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1700==== { - console.debug("=ACTS_GetFileTypes_1700 getFileTypes catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetFileTypes_1700====: ' + promise) - } catch (err) { - console.error('=ACTS_GetFileTypes_1700 getFileTypes AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetFileTypes_1700====: ' + DAHelper) - let mimeTypeFilter = 'returnUndefined'; - try { - await DAHelper.getFileTypes( - dataAbilityUri, - mimeTypeFilter, - (err, data) => { - console.debug("=ACTS_GetFileTypes_1800 getFileTypes err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('=ACTS_GetFileTypes_1800 data.length ====>: ' + data.length); - expect(data.length).assertEqual(0); - console.log('ACTS_GetFileTypes_1800====:' + err); - console.log('ACTS_GetFileTypes_1800==== { - console.debug("=ACTS_GetType_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(dataAbilityUri); - console.log('ACTS_GetType_0100==== { - console.debug("=ACTS_GetType_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetType_0100====: ' + promise) - } catch (err) { - console.error('=ACTS_GetType_0100 getType AsyncCallback catch(err)====>:' + err); - 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(data).assertEqual(dataAbilityUri); - console.log('ACTS_GetType_0200====:' + err); - console.log('ACTS_GetType_0200==== { - console.debug("=ACTS_GetType_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0300==== { - console.debug("=ACTS_GetType_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetType_0300====: ' + promise) - } catch (err) { - console.error('=ACTS_GetType_0300 getType AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetType_0300====: ' + DAHelper) - try { - await DAHelper.getType( - undefined, - (err, data) => { - console.debug("=ACTS_GetType_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0400====:' + err); - console.log('ACTS_GetType_0400==== { - console.debug("=ACTS_GetType_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0500==== { - console.debug("=ACTS_GetType_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetType_0500====: ' + promise) - } catch (err) { - console.error('=ACTS_GetType_0500 getType AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetType_0500====: ' + DAHelper) - try { - await DAHelper.getType( - 123456, - (err, data) => { - console.debug("=ACTS_GetType_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0600====:' + err); - console.log('ACTS_GetType_0600==== { - console.debug("=ACTS_GetType_0700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0700==== { - console.debug("=ACTS_GetType_0700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetType_0700====: ' + promise) - } catch (err) { - console.error('=ACTS_GetType_0700 getType AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetType_0700====: ' + DAHelper) - try { - await DAHelper.getType( - "error_uri", - (err, data) => { - console.debug("=ACTS_GetType_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0800====:' + err); - console.log('ACTS_GetType_0800==== { - console.debug("=ACTS_GetType_0900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_0900==== { - console.debug("=ACTS_GetType_0900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_GetType_0900====: ' + promise) - } catch (err) { - console.error('=ACTS_GetType_0900 getType AsyncCallback catch(err)====>:' + err); - console.log('ACTS_GetType_0900====: ' + DAHelper) - try { - await DAHelper.getType( - dataAbilityUri3, - (err, data) => { - console.debug("=ACTS_GetType_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_GetType_1000====:' + err); - console.log('ACTS_GetType_1000==== { - 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==== { - console.debug("=ACTS_OpenFile_1300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(0) - ret = true - done(); - }).catch(err => { - console.debug("=ACTS_OpenFile_1300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - ret = false - expect(false).assertTrue(); - done(); - }); - } catch (err) { - console.error('=ACTS_OpenFile_1300 getType catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_1300====: ' + DAHelper) - var mode = "rwt"; - try { - DAHelper.openFile( - undefined, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_1400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - ret = true - done(); - }, - ); - } catch (err) { - console.error('=ACTS_OpenFile_1400 getType AsyncCallback catch(err)====>:' + err); - ret = false - expect(false).assertTrue(); - done(); - } - setTimeout(function () { - console.log('setTimeout function====<'); - }, gSetTimeout); - console.log('ACTS_OpenFile_1400==== { - console.debug("=ACTS_OpenFile_1500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1) - console.log('ACTS_OpenFile_1500==== { - console.debug("=ACTS_OpenFile_1500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_OpenFile_1500====:' + err); - console.log('ACTS_OpenFile_1500====: ' + DAHelper) - try { - DAHelper.openFile( - dataAbilityUri, - undefined, - (err, data) => { - console.debug("=ACTS_OpenFile_1600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_OpenFile_1600====:' + err); - console.log('ACTS_OpenFile_1600==== { - console.debug("=ACTS_OpenFile_1700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1) - console.log('ACTS_OpenFile_1700==== { - console.debug("=ACTS_OpenFile_1700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_OpenFile_1700====:' + err); - console.log('ACTS_OpenFile_1700====: ' + DAHelper) - var mode = "A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7"; - try { - DAHelper.openFile( - dataAbilityUri, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_1800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_OpenFile_1800====:' + err); - console.log('ACTS_OpenFile_1800==== { - console.debug("=ACTS_OpenFile_1900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(-1) - console.log('ACTS_OpenFile_1900==== { - console.debug("=ACTS_OpenFile_1900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_OpenFile_1900====:' + err); - console.log('ACTS_OpenFile_1900====: ' + DAHelper) - var mode = "rwt"; - try { - DAHelper.openFile( - dataAbilityUri2, - mode, - (err, data) => { - console.debug("=ACTS_OpenFile_2000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(-1); - console.log('ACTS_OpenFile_2000====:' + err); - console.log('ACTS_OpenFile_2000====: ' + DAHelper) - try { - DAHelper.normalizeUri( - dataAbilityUri, - ).then((data) => { - console.debug("=ACTS_NormalizeUri_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(dataAbilityUri); - console.log('ACTS_NormalizeUri_0100==== { - console.debug("=ACTS_NormalizeUri_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_NormalizeUri_0100====:' + err); - 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); - console.log('ACTS_NormalizeUri_0200====:' + err); - console.log('ACTS_NormalizeUri_0200====: ' + DAHelper) - try { - DAHelper.normalizeUri( - undefined, - ).then((data) => { - console.debug("=ACTS_NormalizeUri_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_NormalizeUri_0300==== { - console.debug("=ACTS_NormalizeUri_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_NormalizeUri_0300====:' + err); - console.log('ACTS_NormalizeUri_0300====: ' + DAHelper) - try { - DAHelper.normalizeUri( - undefined, - (err, data) => { - console.debug("=ACTS_NormalizeUri_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - console.log('ACTS_NormalizeUri_0400====:' + err); - console.log('ACTS_NormalizeUri_0400====: ' + DAHelper) - try { - DAHelper.normalizeUri( - 123456, - ).then((data) => { - console.debug("=ACTS_NormalizeUri_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_NormalizeUri_0500==== { - console.debug("=ACTS_NormalizeUri_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_NormalizeUri_0500====:' + err); - console.log('ACTS_NormalizeUri_0500====: ' + DAHelper) - try { - DAHelper.normalizeUri( - 123456, - (err, data) => { - console.debug("=ACTS_NormalizeUri_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(err.code).assertEqual(-1); - console.log('ACTS_NormalizeUri_0600====:' + err); - console.log('ACTS_NormalizeUri_0600====: ' + DAHelper) - try { - DAHelper.normalizeUri( - "errorUri", - ).then((data) => { - console.debug("=ACTS_NormalizeUri_0700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_NormalizeUri_0700==== { - console.debug("=ACTS_NormalizeUri_0700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_NormalizeUri_0700====:' + err); - console.log('ACTS_NormalizeUri_0700====: ' + DAHelper) - try { - DAHelper.normalizeUri( - "errorUri", - (err, data) => { - console.debug("=ACTS_NormalizeUri_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_NormalizeUri_0800====:' + err); - console.log('ACTS_NormalizeUri_0800====: ' + DAHelper) - try { - DAHelper.normalizeUri( - dataAbilityUri3, - ).then((data) => { - console.debug("=ACTS_NormalizeUri_0900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_NormalizeUri_0900==== { - console.debug("=ACTS_NormalizeUri_0900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_NormalizeUri_0900====:' + err); - console.log('ACTS_NormalizeUri_0900====: ' + DAHelper) - try { - DAHelper.normalizeUri( - dataAbilityUri3, - (err, data) => { - console.debug("=ACTS_NormalizeUri_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_NormalizeUri_1000====:' + err); - console.log('ACTS_NormalizeUri_1000====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - dataAbilityUri, - ).then((data) => { - console.debug("=ACTS_DenormalizeUri_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(dataAbilityUri); - console.log('ACTS_DenormalizeUri_0100==== { - console.debug("=ACTS_DenormalizeUri_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_DenormalizeUri_0100====:' + err); - 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(data).assertEqual(dataAbilityUri); - console.log('ACTS_DenormalizeUri_0200====:' + err); - console.log('ACTS_DenormalizeUri_0200====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - undefined, - ).then((data) => { - console.debug("=ACTS_DenormalizeUri_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0300==== { - console.debug("=ACTS_DenormalizeUri_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_DenormalizeUri_0300====:' + err); - console.log('ACTS_DenormalizeUri_0300====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - undefined, - (err, data) => { - console.debug("=ACTS_DenormalizeUri_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0400====:' + err); - console.log('ACTS_DenormalizeUri_0400====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - "error", - ).then((data) => { - console.debug("=ACTS_DenormalizeUri_0500 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0500==== { - console.debug("=ACTS_DenormalizeUri_0500 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_DenormalizeUri_0500====:' + err); - console.log('ACTS_DenormalizeUri_0500====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - "error", - (err, data) => { - console.debug("=ACTS_DenormalizeUri_0600 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0600====:' + err); - console.log('ACTS_DenormalizeUri_0600====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - 123456, - ).then((data) => { - console.debug("=ACTS_DenormalizeUri_0700 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0700==== { - console.debug("=ACTS_DenormalizeUri_0700 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_DenormalizeUri_0700====:' + err); - console.log('ACTS_DenormalizeUri_0700====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - 123456, - (err, data) => { - console.debug("=ACTS_DenormalizeUri_0800 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0800====:' + err); - console.log('ACTS_DenormalizeUri_0800====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - dataAbilityUri3, - ).then((data) => { - console.debug("=ACTS_DenormalizeUri_0900 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_0900==== { - console.debug("=ACTS_DenormalizeUri_0900 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - console.log('ACTS_DenormalizeUri_0900====:' + err); - console.log('ACTS_DenormalizeUri_0900====: ' + DAHelper) - try { - DAHelper.denormalizeUri( - dataAbilityUri3, - (err, data) => { - console.debug("=ACTS_DenormalizeUri_1000 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - expect(data).assertEqual(""); - console.log('ACTS_DenormalizeUri_1000====:' + err); - console.log('ACTS_DenormalizeUri_1000==== { - console.debug("=ACTS_OnOff_0100 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(err.code).assertEqual(0); - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0100 catch(err)====>:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0100===="); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_0200==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0200 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0200==== { - expect(err.code).assertEqual(0); - console.log('ACTS_OnOff_0200====:' + err); - expect(false).assertTrue(); - 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); - console.log('ACTS_OnOff_0300==== { - console.debug('ACTS_OnOff_0300====" - + flagCallback01 + flagCallback02 + flagCallback03); - } - } - try { - expect(typeof (DAHelper)).assertEqual("object"); - - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0301); - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0302); - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0303); - - setTimeout(mySetTimeout, gSetTimeout); - function mySetTimeout() { - DAHelper.notifyChange( - dataAbilityUri, - (err) => { - expect(err.code).assertEqual(0); - waitDone("notifyChange"); - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0300 catch(err)====>:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0300====" - + ("json flagCallback02【") + JSON.stringify(flagCallback02) + (" 】") + " , " + flagCallback02); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_0400====" + caller); - if (flagCallback01 == 1 && flagCallback02 == 0 && flagCallback03 == 1) { - clearTimeout(currentAlertTimeout); - function mySetTimeout() { - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0401); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0403); - console.log('ACTS_OnOff_0400==== { - console.debug('ACTS_OnOff_0400====" - + flagCallback01 + flagCallback02 + flagCallback03); - } - } - try { - expect(typeof (DAHelper)).assertEqual("object"); - - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0401); - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0402); - DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0403); - - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0402); - - setTimeout(mySetTimeout, gSetTimeout); - function mySetTimeout() { - DAHelper.notifyChange( - dataAbilityUri, - (err) => { - expect(err.code).assertEqual(0); - waitDone("notifyChange"); - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0400 catch(err)====>:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0400====" - + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_0500====" - + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_0500====" - + ("json err") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_0500==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0500 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0501); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0502); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0503); - console.log('ACTS_OnOff_0500==== { - console.debug('ACTS_OnOff_0500====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0500====" + caller); - if (flagCallback01 == 2) { - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0600); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0600); - console.log('ACTS_OnOff_0600====" + flagCallback01); - } - } - - setTimeout(mySetTimeout, gSetTimeout); - function mySetTimeout() { - DAHelper.notifyChange( - dataAbilityUri, - (err) => { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0600 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0600); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0600); - console.log('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, onAsyncCallback0600); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0600); - console.log('ACTS_OnOff_0600====:' + err); - expect(false).assertTrue(); - 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, onAsyncCallback0700); - DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0700); - console.log('ACTS_OnOff_0700==== { - console.debug("=ACTS_OnOff_0700 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(err.code).assertEqual(0); - done(); - } - ); - } - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_0700 catch(err)====>:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0700==== { - expect(err.code).assertEqual(0); - currentAlertTimeout = setTimeout(() => { - console.log('ACTS_OnOff_0800====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0800==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_0900 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0900==== { - console.debug('ACTS_OnOff_0900====< else true'); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0900====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_0900==== { - currentAlertTimeout = setTimeout(() => { - expect(err.code).assertEqual(0); - console.log('ACTS_OnOff_1000====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1000===="); - expect(err.code).assertEqual(0); - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1100); - console.log('ACTS_OnOff_1100==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_1100 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1100==== { - console.debug('ACTS_OnOff_1100====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1100===="); - expect(false).assertTrue(); - clearTimeout(currentAlertTimeout); - console.log('ACTS_OnOff_1200==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_1200 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1200); - console.log('ACTS_OnOff_1200==== { - console.debug('ACTS_OnOff_1200====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1200==== { - expect(err.code).assertEqual(0); - setTimeout(() => { - console.log('ACTS_OnOff_1300====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1300===="); - expect(err.code).assertEqual(0); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1400); - console.log('ACTS_OnOff_1400==== { - console.debug("=ACTS_OnOff_1400 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - } - ); - } - } catch (err) { - console.error('=ACTS_OnOff_1400 catch(err)====>:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1400===="); - expect(false).assertTrue(); - } - DAHelper.on(undefined, dataAbilityUri, onAsyncCallback1500); - - setTimeout(mySetTimeout, gSetTimeout); - function mySetTimeout() { - DAHelper.notifyChange( - dataAbilityUri, - (err) => { - expect(err.code).assertEqual(0); - currentAlertTimeout = setTimeout(() => { - console.debug('ACTS_OnOff_1500====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1500===="); - expect(err.code).assertEqual(0); - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1600); - console.log('ACTS_OnOff_1600==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_1600 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1600==== { - console.debug('ACTS_OnOff_1600====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1600==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_1700 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1700); - gSetTimeout = 500; - done(); - } else { - currentAlertTimeout = setTimeout(() => { - expect(err.code).assertEqual(0); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1700); - console.log('ACTS_OnOff_1700====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1700===="); - expect(err.code).assertEqual(0); - clearTimeout(currentAlertTimeout); - DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1800); - console.log('ACTS_OnOff_1800==== { - if (err.code != 0) { - console.debug("=ACTS_OnOff_1800 err=======>" - + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1800==== { - console.debug('ACTS_OnOff_1800====:' + err); - expect(false).assertTrue(); - console.log('ACTS_OnOff_1800==== { - console.debug("=ACTS_ExecuteBatch_Insert_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0100==== { - console.debug("=ACTS_ExecuteBatch_Insert_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Insert_0100====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Insert_0100==== { - console.debug("=ACTS_ExecuteBatch_Insert_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0200==== { - console.debug("=ACTS_ExecuteBatch_Insert_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Insert_0200====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Insert_0200==== { - console.debug("=ACTS_ExecuteBatch_Insert_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0300==== { - console.debug("=ACTS_ExecuteBatch_Insert_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Insert_0300====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - 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); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0400====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - 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); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0500====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - 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(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Insert_0600====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Insert_0600==== { - console.debug("=ACTS_ExecuteBatch_Update_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) - + (" 】") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0100 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0100 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Update_0100==== { - console.debug("=ACTS_ExecuteBatch_Update_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0100====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0100==== { - console.debug("=ACTS_ExecuteBatch_Update_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(2); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0200 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0200 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Update_0200==== { - console.debug("=ACTS_ExecuteBatch_Update_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0200====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0200==== { - console.debug("=ACTS_ExecuteBatch_Update_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") - + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Update_0300==== { - console.debug("=ACTS_ExecuteBatch_Update_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0300====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0300==== { - console.debug("=ACTS_ExecuteBatch_Update_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") - + JSON.stringify(DataAbilityResult) + (" 】;") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Update_0400====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0400==== { - console.debug("=ACTS_ExecuteBatch_Update_0500 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(2); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0500 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0500 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Update_0500====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0500==== { - console.debug("=ACTS_ExecuteBatch_Update_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Update_0600 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Update_0600 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Update_0600====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Update_0600==== { - console.debug("=ACTS_ExecuteBatch_Assert_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Assert_0100==== { - console.debug("=ACTS_ExecuteBatch_Assert_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Assert_0100====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Assert_0100==== { - console.debug("=ACTS_ExecuteBatch_Assert_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Assert_0200==== { - console.debug("=ACTS_ExecuteBatch_Assert_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Assert_0200====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Assert_0200==== { - console.debug("=ACTS_ExecuteBatch_Assert_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") - + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0300 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(""); - console.debug('=ACTS_ExecuteBatch_Assert_0300 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(0); - } - console.debug('ACTS_ExecuteBatch_Assert_0300==== { - console.debug("=ACTS_ExecuteBatch_Assert_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Assert_0300====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - 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(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Assert_0400====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - 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(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_Assert_0500====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - 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(data.length).assertEqual(1); - for (var i = 0; i < data.length; i++) { - console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].uri ====>: ' - + data[i].uri) - expect(data[i].uri).assertEqual(""); - console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].count ====>: ' - + data[i].count) - expect(data[i].count).assertEqual(0); - } - console.debug('ACTS_ExecuteBatch_Assert_0600====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Assert_0600==== { - console.debug("=ACTS_ExecuteBatch_Delete_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0100 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0100 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Delete_0100==== { - console.debug("=ACTS_ExecuteBatch_Delete_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0100====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0100==== { - console.debug("=ACTS_ExecuteBatch_Delete_0200 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(2); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0200 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0200 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Delete_0200==== { - console.debug("=ACTS_ExecuteBatch_Delete_0200 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0200====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0200==== { - console.debug("=ACTS_ExecuteBatch_Delete_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0300 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0300 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Delete_0300==== { - console.debug("=ACTS_ExecuteBatch_Delete_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0300====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0300==== { - console.debug("=ACTS_ExecuteBatch_Delete_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Delete_0400====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0400==== { - console.debug("=ACTS_ExecuteBatch_Delete_0500 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(2); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Delete_0500====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0500==== { - console.debug("=ACTS_ExecuteBatch_Delete_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - expect(DataAbilityResult.length).assertEqual(1); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_Delete_0600====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_Delete_0600==== { - console.debug("=ACTS_ExecuteBatch_0100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_0100 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_0100 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_0100==== { - console.debug("=ACTS_ExecuteBatch_0100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0100====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0100==== { - console.debug("=ACTS_ExecuteBatch_0200 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_0200 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - console.debug('=ACTS_ExecuteBatch_0200 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - expect(DataAbilityResult[i].count).assertEqual(1); - } - console.debug('ACTS_ExecuteBatch_0200====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0200==== { - console.debug("=ACTS_ExecuteBatch_0300 executeBatch then data====>" - + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_0300 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - console.debug('=ACTS_ExecuteBatch_0300 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - if (i == 2) { - expect(DataAbilityResult[i].uri).assertEqual(""); - expect(DataAbilityResult[i].count).assertEqual(0); - } else { - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - expect(DataAbilityResult[i].count).assertEqual(1); - } - } - console.debug('ACTS_ExecuteBatch_0300==== { - console.debug("=ACTS_ExecuteBatch_0300 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0300====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0300==== { - console.debug("=ACTS_ExecuteBatch_0400 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) - + (" 】;") + DataAbilityResult.length); - for (var i = 0; i < DataAbilityResult.length; i++) { - console.debug('=ACTS_ExecuteBatch_0400 for data[' + i + '].uri ====>: ' - + DataAbilityResult[i].uri) - console.debug('=ACTS_ExecuteBatch_0400 for data[' + i + '].count ====>: ' - + DataAbilityResult[i].count) - if (i == 2) { - expect(DataAbilityResult[i].uri).assertEqual(""); - expect(DataAbilityResult[i].count).assertEqual(0); - } else { - expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); - expect(DataAbilityResult[i].count).assertEqual(1); - } - } - console.debug('ACTS_ExecuteBatch_0400====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0400==== { - console.debug("=ACTS_ExecuteBatch_0500 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_0500==== { - console.debug("=ACTS_ExecuteBatch_0500 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0500====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0500==== { - console.debug("=ACTS_ExecuteBatch_0600 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_0600====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0600==== { - console.debug("=ACTS_ExecuteBatch_0700 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_0700==== { - console.debug("=ACTS_ExecuteBatch_0700 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0700====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0700==== { - console.debug("=ACTS_ExecuteBatch_0800 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_0800====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0800==== { - console.debug("=ACTS_ExecuteBatch_0900 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_0900==== { - console.debug("=ACTS_ExecuteBatch_0900 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0900====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_0900==== { - console.debug("=ACTS_ExecuteBatch_1000 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_1000====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_1000==== { - console.debug("=ACTS_ExecuteBatch_1100 executeBatch then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_1100==== { - console.debug("=ACTS_ExecuteBatch_1100 executeBatch catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_1100====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_1100==== { - console.debug("=ACTS_ExecuteBatch_1200 executeBatch err,data====>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) - + (" 】;") + data.length); - expect(data.length).assertEqual(0); - console.debug('ACTS_ExecuteBatch_1200====:' - + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); - expect(false).assertTrue(); - console.debug('ACTS_ExecuteBatch_1200====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - expect(data).assertEqual(true); - console.log('ACTS_Release_0100==== { - console.debug("=ACTS_Release_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Release_0100====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0100====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release((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_0200 data: ' + data) - expect(data).assertEqual(true); - console.log('ACTS_Release_0200====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0200====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - expect(data).assertEqual(true); - rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - expect(data).assertEqual(false); - console.log('ACTS_Release_0300==== { - console.debug("=ACTS_Release_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Release_0300==== { - console.debug("=ACTS_Release_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Release_0300====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0300====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release((err, data) => { - console.debug("=ACTS_Release_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data) - expect(data).assertEqual(true); - rDAHelper.release((err, data) => { - console.debug("=ACTS_Release_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" ,") + JSON.stringify(data) + (" 】;")); - console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data) - expect(data).assertEqual(false); - console.log('ACTS_Release_0400====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0400==== { + console.debug('= ACTS_beforeAll ====: ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper)); + if(DAHelper == null){ + console.debug('ACTS_beforeAll DAHelper ====>: DAHelper == null'); + return; + } + } 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)) + if(DAHelper == null){ + DAHelper = 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)) + expect(abilityHelper).assertEqual(null); + } catch (err) { + console.error('=ACTS_GetDataAbilityHelper_0200 acquireDataAbilityHelper catch(err)====>:' + err); + expect(false).assertTrue(); + } + done(); + console.log('ACTS_AcquireDataAbilityHelper_0200====: ' + + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) + expect(abilityHelper).assertEqual(null); + } catch (err) { + console.error('=ACTS_GetDataAbilityHelper_0300 acquireDataAbilityHelper catch(err)====>:' + err); + expect(false).assertTrue(); + } + done(); + console.log('ACTS_AcquireDataAbilityHelper_0300====: ' + + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) + expect(JSON.stringify(abilityHelper)).assertEqual("null"); + } catch (err) { + console.error('=ACTS_GetDataAbilityHelper_0400 acquireDataAbilityHelper catch(err)====>:' + err); + expect(false).assertTrue(); + } + done(); + console.log('ACTS_AcquireDataAbilityHelper_0400====: ' + + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) + expect(JSON.stringify(abilityHelper)).assertEqual("null"); + } catch (err) { + console.error('=ACTS_GetDataAbilityHelper_0500 acquireDataAbilityHelper catch(err)====>:' + err); + expect(false).assertTrue(); + } + done(); + console.log('ACTS_AcquireDataAbilityHelper_0500====: ' + DAHelper) + let valueBucketM + try { + DAHelper.insert(dataAbilityUri, valueBucketM) + .then(function (data) { + console.debug("=ACTS_Insert_0100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-2); + console.log('ACTS_Insert_0100====" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.log('ACTS_Insert_0100====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Insert_0100====: ' + DAHelper) + let valueBucketM = 'undefined'; + try { + await DAHelper.insert(dataAbilityUri, valueBucketM, + (err, data) => { + console.debug("=ACTS_Insert_0200 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】data【") + data + (" 】;")); + expect(data).assertEqual(-2); + console.log('ACTS_Insert_0200====:' + err); + console.log('ACTS_Insert_0200==== { + console.debug("=ACTS_Insert_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(1); + console.log('ACTS_Insert_0300==== { + console.debug("=ACTS_Insert_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_0300====:' + err); + console.log('ACTS_Insert_0300====: ' + DAHelper) + 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); + console.log('ACTS_Insert_0400====:' + err); + console.log('ACTS_Insert_0400==== { + console.debug("=ACTS_Insert_0500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_Insert_0500==== { + console.debug("=ACTS_Insert_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_0500====:' + err); + console.log('ACTS_Insert_0500====: ' + DAHelper) + try { + await DAHelper.insert(undefined, valueBucket, + (err, data) => { + console.debug("=ACTS_Insert_0600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + expect(data).assertEqual(0); + console.log('ACTS_Insert_0600====:' + err); + console.log('ACTS_Insert_0600==== { + console.debug("=ACTS_Insert_0700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(1); + + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_Insert_0700==== { + console.debug("=ACTS_Insert_0700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_0700====:' + err); + console.log('ACTS_Insert_0700====: ' + DAHelper) + var currentAlertTimeout; + try { + function onAsyncCallbackInsert0800(err) { + clearTimeout(currentAlertTimeout); + expect(err.code).assertEqual(0); + console.log('ACTS_Insert_0800==== { + console.debug("=ACTS_Insert_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(1); + + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_Insert_0800====:' + err); + console.log('ACTS_Insert_0800==== { + console.debug("=ACTS_Insert_0900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_Insert_0900==== { + console.debug("=ACTS_Insert_0900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_0900====:' + err); + console.log('ACTS_Insert_0900====: ' + DAHelper) + try { + await DAHelper.insert(123456, valueBucket, + (err, data) => { + console.debug("=ACTS_Insert_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + expect(data).assertEqual(0); + console.log('ACTS_Insert_1000====:' + err); + console.log('ACTS_Insert_1000==== { + console.debug("=ACTS_Insert_1100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_Insert_1100==== { + console.debug("=ACTS_Insert_1100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_1100====:' + err); + console.log('ACTS_Insert_1100====: ' + DAHelper) + try { + await DAHelper.insert(dataAbilityUri2, valueBucket, + (err, data) => { + console.debug("=ACTS_Insert_1200 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_Insert_1200====:' + err); + console.log('ACTS_Insert_1200==== { + console.debug("=ACTS_Insert_1300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_Insert_1300==== { + console.debug("=ACTS_Insert_1300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_1300====:' + err); + console.log('ACTS_Insert_1300====: ' + DAHelper) + try { + await DAHelper.insert("errorUri", valueBucket, + (err, data) => { + console.debug("=ACTS_Insert_1400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_Insert_1400====:' + err); + console.log('ACTS_Insert_1400==== { + console.debug("=ACTS_Insert_1500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-2); + console.log('ACTS_Insert_1500==== { + console.debug("=ACTS_Insert_1500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Insert_1500====:' + err); + console.log('ACTS_Insert_1500====: ' + DAHelper) + var valueBucketK = {}; + try { + await DAHelper.insert(dataAbilityUri, valueBucketK, + (err, data) => { + console.debug("=ACTS_Insert_1600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-2); + console.log('ACTS_Insert_1600====:' + err); + console.log('ACTS_Insert_1600====: ' + DAHelper) + var valueBucketM; + try { + DAHelper.batchInsert( + dataAbilityUri, + valueBucketM + ).then((data) => { + console.debug("=ACTS_BatchInsert_0100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】; ====>")); + expect(data).assertEqual(0); + console.log('ACTS_BatchInsert_0100==== { + console.debug("=ACTS_BatchInsert_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_0100====:' + err); + console.log('ACTS_BatchInsert_0100====: ' + DAHelper) + var valueBucketM; + try { + await DAHelper.batchInsert( + dataAbilityUri, + valueBucketM, + (err, data) => { + console.debug("=ACTS_BatchInsert_0200 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(0); + console.log('ACTS_BatchInsert_0200====:' + err); + 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); + console.log('ACTS_BatchInsert_0300==== { + console.debug("=ACTS_BatchInsert_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_0300====:' + err); + 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); + console.log('ACTS_BatchInsert_0400====:' + err); + console.log('ACTS_BatchInsert_0400====: ' + DAHelper) + try { + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + + DAHelper.batchInsert( + dataAbilityUri, + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(3); + console.log('ACTS_BatchInsert_0500==== { + console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_0500====:' + err); + console.log('ACTS_BatchInsert_0500====: ' + DAHelper) + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + 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); + console.log('ACTS_BatchInsert_0600====:' + err); + console.log('ACTS_BatchInsert_0600====: ' + DAHelper) + try { + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + + DAHelper.batchInsert( + dataAbilityUri2, + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_0700 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_BatchInsert_0700==== { + console.debug("=ACTS_BatchInsert_0700 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_0700====:' + err); + console.log('ACTS_BatchInsert_0700====: ' + DAHelper) + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + try { + await DAHelper.batchInsert( + dataAbilityUri2, + valueBucketArray, + (err, data) => { + console.debug("=ACTS_BatchInsert_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_BatchInsert_0800====:' + err); + console.log('ACTS_BatchInsert_0800====: ' + DAHelper) + try { + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + + DAHelper.batchInsert( + undefined, + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_0900 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_BatchInsert_0900==== { + console.debug("=ACTS_BatchInsert_0900 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_0900====:' + err); + console.log('ACTS_BatchInsert_0900====: ' + DAHelper) + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + try { + await DAHelper.batchInsert( + undefined, + valueBucketArray, + (err, data) => { + console.debug("=ACTS_BatchInsert_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + console.log('ACTS_BatchInsert_1000====:' + err); + console.log('ACTS_BatchInsert_1000====: ' + DAHelper) + try { + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + + DAHelper.batchInsert( + "error", + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_1100 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_BatchInsert_1100==== { + console.debug("=ACTS_BatchInsert_1100 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_1100====:' + err); + console.log('ACTS_BatchInsert_1100====: ' + DAHelper) + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + try { + await DAHelper.batchInsert( + "error", + valueBucketArray, + (err, data) => { + console.debug("=ACTS_BatchInsert_1200 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_BatchInsert_1200====:' + err); + console.log('ACTS_BatchInsert_1200====: ' + DAHelper) + try { + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + + DAHelper.batchInsert( + 123456, + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_1300 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_BatchInsert_1300==== { + console.debug("=ACTS_BatchInsert_1300 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_1300====:' + err); + console.log('ACTS_BatchInsert_1300====: ' + DAHelper) + var valueBucketArray = new Array({ "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }, + { "name": "ActsDataAbilityHelperTest", "age": 24, "salary": 2024.20, }) + try { + await DAHelper.batchInsert( + 123456, + valueBucketArray, + (err, data) => { + console.debug("=ACTS_BatchInsert_1400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + console.log('ACTS_BatchInsert_1400====:' + err); + console.log('ACTS_BatchInsert_1400====: ' + DAHelper) + try { + DAHelper.batchInsert( + dataAbilityUri, + valueBucket, + ).then((data) => { + console.debug("=ACTS_BatchInsert_1500 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_BatchInsert_1500==== { + console.debug("=ACTS_BatchInsert_1500 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_BatchInsert_1500====:' + err); + console.log('ACTS_BatchInsert_1500====: ' + DAHelper) + try { + await DAHelper.batchInsert( + dataAbilityUri, + valueBucket, + (err, data) => { + console.debug("=ACTS_BatchInsert_1600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(0); + console.log('ACTS_BatchInsert_1600====:' + err); + console.log('ACTS_BatchInsert_1600====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_0100====:' + err); + console.log('ACTS_Query_0100==== { + console.debug("=ACTS_Query_0200 query err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(data) + (" 】;") + " , " + data); + expect(typeof (data)).assertEqual("object"); + console.log('ACTS_Query_0200====:' + err); + console.log('ACTS_Query_0200====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_0300====:' + err); + 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"); + console.log('ACTS_Query_0400====:' + err); + console.log('ACTS_Query_0400====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_0500====:' + err); + console.log('ACTS_Query_0500==== { + console.debug("=ACTS_Query_0600 query err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(data) + (" 】;") + " , " + data); + expect(typeof (data)).assertEqual("object"); + console.log('ACTS_Query_0600====:' + err); + console.log('ACTS_Query_0600====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_0700====:' + err); + console.log('ACTS_Query_0700==== { + console.debug("=ACTS_Query_0800 query err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(data) + (" 】;") + " , " + data); + expect(typeof (data)).assertEqual("object"); + console.log('ACTS_Query_0800====:' + err); + console.log('ACTS_Query_0800====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_0900====:' + err); + console.log('ACTS_Query_0900==== { + console.debug("=ACTS_Query_1000 query err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(data) + (" 】;") + " , " + data); + expect(typeof (data)).assertEqual("object"); + console.log('ACTS_Query_1000====:' + err); + console.log('ACTS_Query_1000====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_1100====:' + err); + console.log('ACTS_Query_1100==== { + console.debug("=ACTS_Query_1200 query err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(data) + (" 】;") + " , " + data); + expect(typeof (data)).assertEqual("object"); + console.log('ACTS_Query_1200====:' + err); + console.log('ACTS_Query_1200====" + + ("json queryPromise 【") + JSON.stringify(queryPromise) + (" 】 ") + " , " + queryPromise); + expect(typeof (queryPromise)).assertEqual("object"); + console.log('ACTS_Query_1300====:' + err); + console.log('ACTS_Query_1300==== { + console.debug("=ACTS_Query_1400 query err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(data) + (" 】;") + " , " + data); + expect(typeof (data)).assertEqual("object"); + console.log('ACTS_Query_1400====:' + err); + console.log('ACTS_Query_1400====: ' + 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(data).assertEqual(-2); + console.log('ACTS_Update_0100==== { + console.debug("=ACTS_Update_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.log('ACTS_Update_0100====:' + err); + expect(false).assertTrue(); + 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(data).assertEqual(-2); + console.log('ACTS_Update_0200====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Update_0200====: ' + 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_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); + console.log('ACTS_Update_0300==== { + console.debug("=ACTS_Update_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Update_0300====:' + err); + console.log('ACTS_Update_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_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); + console.log('ACTS_Update_0400====:' + err); + console.log('ACTS_Update_0400====: ' + 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_Update_0500 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.update( + undefined, + valueBucket, + predicates + ).then((data) => { + console.debug("=ACTS_Update_0500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_Update_0500==== { + console.debug("=ACTS_Update_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Update_0500====:' + err); + console.log('ACTS_Update_0500====: ' + 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_Update_0600 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.update( + undefined, + valueBucket, + predicates, + (err, data) => { + console.debug("=ACTS_Update_0600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + expect(data).assertEqual(0); + console.log('ACTS_Update_0600====:' + err); + console.log('ACTS_Update_0600====: ' + DAHelper) + var currentAlertTimeout; + try { + function onAsyncCallbackUpdate0700(err) { + expect(err.code).assertEqual(0); + clearTimeout(currentAlertTimeout); + console.log('ACTS_Update_0700====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.update( + dataAbilityUri, + valueBucket, + predicates + ).then((data) => { + console.debug("=ACTS_Update_0700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(1); + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_Update_0700==== { + console.debug("=ACTS_Update_0700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ") + err); + console.log('ACTS_Update_0700====:' + err); + console.log('ACTS_Update_0700====: ' + DAHelper) + var currentAlertTimeout; + try { + function onAsyncCallbackUpdate0800(err) { + expect(err.code).assertEqual(0); + clearTimeout(currentAlertTimeout); + console.log('ACTS_Update_0800====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.update( + dataAbilityUri, + valueBucket, + predicates, + (err, data) => { + console.debug("=ACTS_Update_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(1); + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_Update_0800====:' + err); + console.log('ACTS_Update_0800====: ' + 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_Update_0900 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.update( + 123456, + valueBucket, + predicates + ).then((data) => { + console.debug("=ACTS_Update_0900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_Update_0900==== { + console.debug("=ACTS_Update_0900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Update_0900====:' + err); + console.log('ACTS_Update_0900====: ' + 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_Update_1000 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.update( + 123456, + valueBucket, + predicates, + (err, data) => { + console.debug("=ACTS_Update_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + expect(data).assertEqual(0); + console.log('ACTS_Update_1000====:' + err); + console.log('ACTS_Update_1000====: ' + 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_Update_1100 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.update( + dataAbilityUri2, + valueBucket, + predicates + ).then((data) => { + console.debug("=ACTS_Update_1100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_Update_1100==== { + console.debug("=ACTS_Update_1100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Update_1100====:' + err); + console.log('ACTS_Update_1100====: ' + 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_Update_1200 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.update( + dataAbilityUri2, + valueBucket, + predicates, + (err, data) => { + console.debug("=ACTS_Update_1200 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_Update_1200====:' + err); + console.log('ACTS_Update_1200====: ' + 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_Update_1300 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.update( + "error_uri", + valueBucket, + predicates + ).then((data) => { + console.debug("=ACTS_Update_1300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_Update_1300==== { + console.debug("=ACTS_Update_1300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Update_1300====:' + err); + console.log('ACTS_Update_1300====: ' + 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_Update_1400 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.update( + "error_uri", + valueBucket, + predicates, + (err, data) => { + console.debug("=ACTS_Update_1400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_Update_1400====:' + err); + console.log('ACTS_Update_1400====: ' + 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(data).assertEqual(1); + console.log('ACTS_Delete_0100==== { + console.debug("=ACTS_Delete_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.log('ACTS_Delete_0100====:' + err); + expect(false).assertTrue(); + 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(data).assertEqual(1); + console.log('ACTS_Delete_0200====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Delete_0200====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.delete( + dataAbilityUri, + predicates + ).then((data) => { + console.debug("=ACTS_Delete_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(1); + console.log('ACTS_Delete_0300==== { + console.debug("=ACTS_Delete_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Delete_0300====:' + err); + expect(false).assertTrue(); + 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); + console.log('ACTS_Delete_0400====:' + err); + console.log('ACTS_Delete_0400====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.delete( + undefined, + predicates + ).then((data) => { + console.debug("=ACTS_Delete_0500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_Delete_0500==== { + console.debug("=ACTS_Delete_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Delete_0500====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Delete_0500====: ' + 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_0600 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.delete( + undefined, + predicates, + (err, data) => { + console.debug("=ACTS_Delete_0600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + expect(data).assertEqual(0); + console.log('ACTS_Delete_0600====:' + err); + console.log('ACTS_Delete_0600====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.delete( + dataAbilityUri, + predicates + ).then((data) => { + console.debug("=ACTS_Delete_0700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(1); + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_Delete_0700==== { + console.debug("=ACTS_Delete_0700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Delete_0700====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Delete_0700====: ' + DAHelper) + var currentAlertTimeout; + try { + function onAsyncCallbackDelete0800(err) { + expect(err.code).assertEqual(0); + clearTimeout(currentAlertTimeout); + console.log('ACTS_Delete_0800====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.delete( + dataAbilityUri, + predicates, + (err, data) => { + console.debug("=ACTS_Delete_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(1); + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_Delete_0800====:' + err); + console.log('ACTS_Delete_0800====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.delete( + dataAbilityUri2, + predicates + ).then((data) => { + console.debug("=ACTS_Delete_0900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_Delete_0900==== { + console.debug("=ACTS_Delete_0900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Delete_0900====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Delete_0900====: ' + 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_1000 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.delete( + dataAbilityUri2, + predicates, + (err, data) => { + console.debug("=ACTS_Delete_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_Delete_1000====:' + err); + console.log('ACTS_Delete_1000====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.delete( + "error", + predicates + ).then((data) => { + console.debug("=ACTS_Delete_1100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1); + console.log('ACTS_Delete_1100==== { + console.debug("=ACTS_Delete_1100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Delete_1100====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Delete_1100====: ' + 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_1200 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.delete( + "error", + predicates, + (err, data) => { + console.debug("=ACTS_Delete_1200 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_Delete_1200====:' + err); + console.log('ACTS_Delete_1200====" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + DAHelper.delete( + 123456, + predicates + ).then((data) => { + console.debug("=ACTS_Delete_1300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0); + console.log('ACTS_Delete_1300==== { + console.debug("=ACTS_Delete_1300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_Delete_1300====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Delete_1300====: ' + 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_1400 predicates====>" + + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates); + await DAHelper.delete( + 123456, + predicates, + (err, data) => { + console.debug("=ACTS_Delete_1400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + console.log('ACTS_Delete_1400====:' + err); + console.log('ACTS_Delete_1400==== { + console.debug("=ACTS_GetFileTypes_0100 getFileTypes then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); + expect(data.length).assertEqual(3); + for (var i = 0; i < data.length; i++) { + expect(typeof (data[i])).assertEqual("string"); + console.log('=ACTS_GetFileTypes_0100 for data[' + i + '] ====>: ' + data[i]) + if (i == 0) { + expect(data[i]).assertEqual("hap"); + } else if (i == 1) { + expect(data[i]).assertEqual("jpg"); + } else if (i == 2) { + expect(data[i]).assertEqual("image/png"); + } + } + console.log('ACTS_GetFileTypes_0100==== { + console.debug("=ACTS_GetFileTypes_0100 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_0100====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_0100 getFileTypes AsyncCallback catch(err)====>:' + err); + 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); + expect(data.length).assertEqual(3); + 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]); + if (i == 0) { + expect(data[i]).assertEqual("hap"); + } else if (i == 1) { + expect(data[i]).assertEqual("jpg"); + } else if (i == 2) { + expect(data[i]).assertEqual("image/png"); + } + } + console.log('ACTS_GetFileTypes_0200====:' + err); + 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); + expect(data.length).assertEqual(1); + for (var i = 0; i < data.length; i++) { + expect(typeof (data[i])).assertEqual("string"); + console.log('= =ACTS_GetFileTypes_0300 for data[' + i + '] ====>: ' + data[i]) + if (i == 0) { + expect(data[i]).assertEqual("image/png"); + } + } + console.log('ACTS_GetFileTypes_0300==== { + console.debug("=ACTS_GetFileTypes_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('DataAbilityHelper getFileTypes error ====>: ' + err) + console.log('ACTS_GetFileTypes_0300====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_0300 getFileTypes AsyncCallback catch(err)====>:' + err); + 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); + expect(data.length).assertEqual(1); + 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]); + if (i == 0) { + expect(data[i]).assertEqual("image/png"); + } + } + console.log('ACTS_GetFileTypes_0400====:' + err); + 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); + expect(data.length).assertEqual(1); + for (var i = 0; i < data.length; i++) { + expect(typeof (data[i])).assertEqual("string"); + console.log('=ACTS_GetFileTypes_0500 for data [' + i + '] ====>: ' + data[i]) + if (i == 0) { + expect(data[i]).assertEqual("jpg"); + } + } + console.log('ACTS_GetFileTypes_0500==== { + console.debug("=ACTS_GetFileTypes_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('DataAbilityHelper getFileTypes error ====>: ' + err) + console.log('ACTS_GetFileTypes_0500====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_0500 getFileTypes AsyncCallback catch(err)====>:' + err); + 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); + expect(data.length).assertEqual(1); + for (var i = 0; i < data.length; i++) { + console.log('=ACTS_GetFileTypes_0600 for errCode ====>: ' + err.code + + " data[" + i + "]: " + data[i]); + if (i == 0) + expect(data[i]).assertEqual("jpg"); + } + console.log('ACTS_GetFileTypes_0600====:' + err); + console.log('ACTS_GetFileTypes_0600==== { + console.debug("=ACTS_GetFileTypes_0700 getFileTypes then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_0700==== { + console.debug("=ACTS_GetFileTypes_0700 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_0700====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_0700 getFileTypes AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetFileTypes_0700====: ' + DAHelper) + let mimeTypeFilter = '*/*' + try { + await DAHelper.getFileTypes( + undefined, + mimeTypeFilter, + (err, data) => { + console.debug("=ACTS_GetFileTypes_0800 getFileTypes err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('=ACTS_GetFileTypes_0800 data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_0800====:' + err); + console.log('ACTS_GetFileTypes_0800==== { + console.debug("=ACTS_GetFileTypes_0900 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_0900 for data[' + i + '] ====>: ' + data[i]) + if (i == 0) { + expect(data[i]).assertEqual(""); + } + } + console.log('ACTS_GetFileTypes_0900==== { + console.debug("=ACTS_GetFileTypes_0900 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_0900====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_0900 getFileTypes AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetFileTypes_0900====: ' + DAHelper) + try { + await DAHelper.getFileTypes( + dataAbilityUri, + undefined, + (err, data) => { + console.debug("=ACTS_GetFileTypes_1000 getFileTypes err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('=ACTS_GetFileTypes_1000 data.length ====>: ' + data.length); + for (var i = 0; i < data.length; i++) { + expect(typeof (data[i])).assertEqual("string"); + console.log('=ACTS_GetFileTypes_1000 for data ====>: ' + err.code + + " data[" + i + "]: " + data[i]); + if (i == 0) { + expect(data[i]).assertEqual(""); + } + } + console.log('ACTS_GetFileTypes_1000====:' + err); + console.log('ACTS_GetFileTypes_1000==== { + console.debug("=ACTS_GetFileTypes_1100 getFileTypes then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1100==== { + console.debug("=ACTS_GetFileTypes_1100 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_1100====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_1100 getFileTypes AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetFileTypes_1100====: ' + DAHelper) + let mimeTypeFilter = '*/*' + try { + await DAHelper.getFileTypes( + "error_uri", + mimeTypeFilter, + (err, data) => { + console.debug("=ACTS_GetFileTypes_1200 getFileTypes err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('=ACTS_GetFileTypes_1200 data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1200====:' + err); + console.log('ACTS_GetFileTypes_1200==== { + console.debug("=ACTS_GetFileTypes_1300 getFileTypes then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1300==== { + console.debug("=ACTS_GetFileTypes_1300 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_1300====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_1300 getFileTypes AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetFileTypes_1300====: ' + DAHelper) + let mimeTypeFilter = '*/*' + try { + await DAHelper.getFileTypes( + 123456, + mimeTypeFilter, + (err, data) => { + console.debug("=ACTS_GetFileTypes_1400 getFileTypes err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('=ACTS_GetFileTypes_1400 data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1400====:' + err); + console.log('ACTS_GetFileTypes_1400==== { + console.debug("=ACTS_GetFileTypes_1500 getFileTypes then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1500==== { + console.debug("=ACTS_GetFileTypes_1500 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_1500====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_1500 getFileTypes AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetFileTypes_1500====: ' + DAHelper) + let mimeTypeFilter = 'asdfasdEDF)(#@*7fasdf546546a1ds3v16a4sd6v54@*(e7'; + try { + await DAHelper.getFileTypes( + dataAbilityUri, + mimeTypeFilter, + (err, data) => { + console.debug("=ACTS_GetFileTypes_1600 getFileTypes err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('=ACTS_GetFileTypes_1600 data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1600====:' + err); + console.log('ACTS_GetFileTypes_1600==== { + console.debug("=ACTS_GetFileTypes_1700 getFileTypes then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + console.log('DataAbilityHelper getFileTypes data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1700==== { + console.debug("=ACTS_GetFileTypes_1700 getFileTypes catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetFileTypes_1700====: ' + promise) + } catch (err) { + console.error('=ACTS_GetFileTypes_1700 getFileTypes AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetFileTypes_1700====: ' + DAHelper) + let mimeTypeFilter = 'returnUndefined'; + try { + await DAHelper.getFileTypes( + dataAbilityUri, + mimeTypeFilter, + (err, data) => { + console.debug("=ACTS_GetFileTypes_1800 getFileTypes err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('=ACTS_GetFileTypes_1800 data.length ====>: ' + data.length); + expect(data.length).assertEqual(0); + console.log('ACTS_GetFileTypes_1800====:' + err); + console.log('ACTS_GetFileTypes_1800==== { + console.debug("=ACTS_GetType_0100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(dataAbilityUri); + console.log('ACTS_GetType_0100==== { + console.debug("=ACTS_GetType_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetType_0100====: ' + promise) + } catch (err) { + console.error('=ACTS_GetType_0100 getType AsyncCallback catch(err)====>:' + err); + 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(data).assertEqual(dataAbilityUri); + console.log('ACTS_GetType_0200====:' + err); + console.log('ACTS_GetType_0200==== { + console.debug("=ACTS_GetType_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0300==== { + console.debug("=ACTS_GetType_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetType_0300====: ' + promise) + } catch (err) { + console.error('=ACTS_GetType_0300 getType AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetType_0300====: ' + DAHelper) + try { + await DAHelper.getType( + undefined, + (err, data) => { + console.debug("=ACTS_GetType_0400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0400====:' + err); + console.log('ACTS_GetType_0400==== { + console.debug("=ACTS_GetType_0500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0500==== { + console.debug("=ACTS_GetType_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetType_0500====: ' + promise) + } catch (err) { + console.error('=ACTS_GetType_0500 getType AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetType_0500====: ' + DAHelper) + try { + await DAHelper.getType( + 123456, + (err, data) => { + console.debug("=ACTS_GetType_0600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0600====:' + err); + console.log('ACTS_GetType_0600==== { + console.debug("=ACTS_GetType_0700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0700==== { + console.debug("=ACTS_GetType_0700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetType_0700====: ' + promise) + } catch (err) { + console.error('=ACTS_GetType_0700 getType AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetType_0700====: ' + DAHelper) + try { + await DAHelper.getType( + "error_uri", + (err, data) => { + console.debug("=ACTS_GetType_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0800====:' + err); + console.log('ACTS_GetType_0800==== { + console.debug("=ACTS_GetType_0900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_0900==== { + console.debug("=ACTS_GetType_0900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_GetType_0900====: ' + promise) + } catch (err) { + console.error('=ACTS_GetType_0900 getType AsyncCallback catch(err)====>:' + err); + console.log('ACTS_GetType_0900====: ' + DAHelper) + try { + await DAHelper.getType( + dataAbilityUri3, + (err, data) => { + console.debug("=ACTS_GetType_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_GetType_1000====:' + err); + console.log('ACTS_GetType_1000==== { + 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==== { + console.debug("=ACTS_OpenFile_1300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(0) + ret = true + done(); + }).catch(err => { + console.debug("=ACTS_OpenFile_1300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + ret = false + expect(false).assertTrue(); + done(); + }); + } catch (err) { + console.error('=ACTS_OpenFile_1300 getType catch(err)====>:' + err); + ret = false + expect(false).assertTrue(); + done(); + } + setTimeout(function () { + console.log('setTimeout function====<'); + }, gSetTimeout); + console.log('ACTS_OpenFile_1300====: ' + DAHelper) + var mode = "rwt"; + try { + DAHelper.openFile( + undefined, + mode, + (err, data) => { + console.debug("=ACTS_OpenFile_1400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + ret = true + done(); + }, + ); + } catch (err) { + console.error('=ACTS_OpenFile_1400 getType AsyncCallback catch(err)====>:' + err); + ret = false + expect(false).assertTrue(); + done(); + } + setTimeout(function () { + console.log('setTimeout function====<'); + }, gSetTimeout); + console.log('ACTS_OpenFile_1400==== { + console.debug("=ACTS_OpenFile_1500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1) + console.log('ACTS_OpenFile_1500==== { + console.debug("=ACTS_OpenFile_1500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_OpenFile_1500====:' + err); + console.log('ACTS_OpenFile_1500====: ' + DAHelper) + try { + DAHelper.openFile( + dataAbilityUri, + undefined, + (err, data) => { + console.debug("=ACTS_OpenFile_1600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_OpenFile_1600====:' + err); + console.log('ACTS_OpenFile_1600==== { + console.debug("=ACTS_OpenFile_1700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1) + console.log('ACTS_OpenFile_1700==== { + console.debug("=ACTS_OpenFile_1700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_OpenFile_1700====:' + err); + console.log('ACTS_OpenFile_1700====: ' + DAHelper) + var mode = "A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7"; + try { + DAHelper.openFile( + dataAbilityUri, + mode, + (err, data) => { + console.debug("=ACTS_OpenFile_1800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_OpenFile_1800====:' + err); + console.log('ACTS_OpenFile_1800==== { + console.debug("=ACTS_OpenFile_1900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(-1) + console.log('ACTS_OpenFile_1900==== { + console.debug("=ACTS_OpenFile_1900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_OpenFile_1900====:' + err); + console.log('ACTS_OpenFile_1900====: ' + DAHelper) + var mode = "rwt"; + try { + DAHelper.openFile( + dataAbilityUri2, + mode, + (err, data) => { + console.debug("=ACTS_OpenFile_2000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(-1); + console.log('ACTS_OpenFile_2000====:' + err); + console.log('ACTS_OpenFile_2000====: ' + DAHelper) + try { + DAHelper.normalizeUri( + dataAbilityUri, + ).then((data) => { + console.debug("=ACTS_NormalizeUri_0100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(dataAbilityUri); + console.log('ACTS_NormalizeUri_0100==== { + console.debug("=ACTS_NormalizeUri_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_NormalizeUri_0100====:' + err); + 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); + console.log('ACTS_NormalizeUri_0200====:' + err); + console.log('ACTS_NormalizeUri_0200====: ' + DAHelper) + try { + DAHelper.normalizeUri( + undefined, + ).then((data) => { + console.debug("=ACTS_NormalizeUri_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_NormalizeUri_0300==== { + console.debug("=ACTS_NormalizeUri_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_NormalizeUri_0300====:' + err); + console.log('ACTS_NormalizeUri_0300====: ' + DAHelper) + try { + DAHelper.normalizeUri( + undefined, + (err, data) => { + console.debug("=ACTS_NormalizeUri_0400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + console.log('ACTS_NormalizeUri_0400====:' + err); + console.log('ACTS_NormalizeUri_0400====: ' + DAHelper) + try { + DAHelper.normalizeUri( + 123456, + ).then((data) => { + console.debug("=ACTS_NormalizeUri_0500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_NormalizeUri_0500==== { + console.debug("=ACTS_NormalizeUri_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_NormalizeUri_0500====:' + err); + console.log('ACTS_NormalizeUri_0500====: ' + DAHelper) + try { + DAHelper.normalizeUri( + 123456, + (err, data) => { + console.debug("=ACTS_NormalizeUri_0600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(err.code).assertEqual(-1); + console.log('ACTS_NormalizeUri_0600====:' + err); + console.log('ACTS_NormalizeUri_0600====: ' + DAHelper) + try { + DAHelper.normalizeUri( + "errorUri", + ).then((data) => { + console.debug("=ACTS_NormalizeUri_0700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_NormalizeUri_0700==== { + console.debug("=ACTS_NormalizeUri_0700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_NormalizeUri_0700====:' + err); + console.log('ACTS_NormalizeUri_0700====: ' + DAHelper) + try { + DAHelper.normalizeUri( + "errorUri", + (err, data) => { + console.debug("=ACTS_NormalizeUri_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_NormalizeUri_0800====:' + err); + console.log('ACTS_NormalizeUri_0800====: ' + DAHelper) + try { + DAHelper.normalizeUri( + dataAbilityUri3, + ).then((data) => { + console.debug("=ACTS_NormalizeUri_0900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_NormalizeUri_0900==== { + console.debug("=ACTS_NormalizeUri_0900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_NormalizeUri_0900====:' + err); + console.log('ACTS_NormalizeUri_0900====: ' + DAHelper) + try { + DAHelper.normalizeUri( + dataAbilityUri3, + (err, data) => { + console.debug("=ACTS_NormalizeUri_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_NormalizeUri_1000====:' + err); + console.log('ACTS_NormalizeUri_1000====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + dataAbilityUri, + ).then((data) => { + console.debug("=ACTS_DenormalizeUri_0100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(dataAbilityUri); + console.log('ACTS_DenormalizeUri_0100==== { + console.debug("=ACTS_DenormalizeUri_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_DenormalizeUri_0100====:' + err); + 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(data).assertEqual(dataAbilityUri); + console.log('ACTS_DenormalizeUri_0200====:' + err); + console.log('ACTS_DenormalizeUri_0200====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + undefined, + ).then((data) => { + console.debug("=ACTS_DenormalizeUri_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0300==== { + console.debug("=ACTS_DenormalizeUri_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_DenormalizeUri_0300====:' + err); + console.log('ACTS_DenormalizeUri_0300====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + undefined, + (err, data) => { + console.debug("=ACTS_DenormalizeUri_0400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0400====:' + err); + console.log('ACTS_DenormalizeUri_0400====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + "error", + ).then((data) => { + console.debug("=ACTS_DenormalizeUri_0500 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0500==== { + console.debug("=ACTS_DenormalizeUri_0500 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_DenormalizeUri_0500====:' + err); + console.log('ACTS_DenormalizeUri_0500====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + "error", + (err, data) => { + console.debug("=ACTS_DenormalizeUri_0600 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0600====:' + err); + console.log('ACTS_DenormalizeUri_0600====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + 123456, + ).then((data) => { + console.debug("=ACTS_DenormalizeUri_0700 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0700==== { + console.debug("=ACTS_DenormalizeUri_0700 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_DenormalizeUri_0700====:' + err); + console.log('ACTS_DenormalizeUri_0700====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + 123456, + (err, data) => { + console.debug("=ACTS_DenormalizeUri_0800 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0800====:' + err); + console.log('ACTS_DenormalizeUri_0800====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + dataAbilityUri3, + ).then((data) => { + console.debug("=ACTS_DenormalizeUri_0900 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_0900==== { + console.debug("=ACTS_DenormalizeUri_0900 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + console.log('ACTS_DenormalizeUri_0900====:' + err); + console.log('ACTS_DenormalizeUri_0900====: ' + DAHelper) + try { + DAHelper.denormalizeUri( + dataAbilityUri3, + (err, data) => { + console.debug("=ACTS_DenormalizeUri_1000 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + expect(data).assertEqual(""); + console.log('ACTS_DenormalizeUri_1000====:' + err); + console.log('ACTS_DenormalizeUri_1000==== { + console.debug("=ACTS_OnOff_0100 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(err.code).assertEqual(0); + } + ); + } + } catch (err) { + console.error('=ACTS_OnOff_0100 catch(err)====>:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0100===="); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + console.log('ACTS_OnOff_0200==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_0200 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0200==== { + expect(err.code).assertEqual(0); + console.log('ACTS_OnOff_0200====:' + err); + expect(false).assertTrue(); + 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); + console.log('ACTS_OnOff_0300==== { + console.debug('ACTS_OnOff_0300====" + + flagCallback01 + flagCallback02 + flagCallback03); + } + } + try { + expect(typeof (DAHelper)).assertEqual("object"); + + DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0301); + DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0302); + DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0303); + + setTimeout(mySetTimeout, gSetTimeout); + function mySetTimeout() { + DAHelper.notifyChange( + dataAbilityUri, + (err) => { + expect(err.code).assertEqual(0); + waitDone("notifyChange"); + } + ); + } + } catch (err) { + console.error('=ACTS_OnOff_0300 catch(err)====>:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0300====" + + ("json flagCallback02【") + JSON.stringify(flagCallback02) + (" 】") + " , " + flagCallback02); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + console.log('ACTS_OnOff_0400====" + caller); + if (flagCallback01 == 1 && flagCallback02 == 0 && flagCallback03 == 1) { + clearTimeout(currentAlertTimeout); + function mySetTimeout() { + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0401); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0403); + console.log('ACTS_OnOff_0400==== { + console.debug('ACTS_OnOff_0400====" + + flagCallback01 + flagCallback02 + flagCallback03); + } + } + try { + expect(typeof (DAHelper)).assertEqual("object"); + + DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0401); + DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0402); + DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0403); + + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0402); + + setTimeout(mySetTimeout, gSetTimeout); + function mySetTimeout() { + DAHelper.notifyChange( + dataAbilityUri, + (err) => { + expect(err.code).assertEqual(0); + waitDone("notifyChange"); + } + ); + } + } catch (err) { + console.error('=ACTS_OnOff_0400 catch(err)====>:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0400====" + + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + console.log('ACTS_OnOff_0500====" + + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + console.log('ACTS_OnOff_0500====" + + ("json err") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + console.log('ACTS_OnOff_0500==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_0500 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0501); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0502); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0503); + console.log('ACTS_OnOff_0500==== { + console.debug('ACTS_OnOff_0500====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0500====" + caller); + if (flagCallback01 == 2) { + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0600); + DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0600); + console.log('ACTS_OnOff_0600====" + flagCallback01); + } + } + + setTimeout(mySetTimeout, gSetTimeout); + function mySetTimeout() { + DAHelper.notifyChange( + dataAbilityUri, + (err) => { + if (err.code != 0) { + console.debug("=ACTS_OnOff_0600 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0600); + DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0600); + console.log('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, onAsyncCallback0600); + DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0600); + console.log('ACTS_OnOff_0600====:' + err); + expect(false).assertTrue(); + 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, onAsyncCallback0700); + DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback0700); + console.log('ACTS_OnOff_0700==== { + console.debug("=ACTS_OnOff_0700 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(err.code).assertEqual(0); + done(); + } + ); + } + } + ); + } + } catch (err) { + console.error('=ACTS_OnOff_0700 catch(err)====>:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0700==== { + expect(err.code).assertEqual(0); + currentAlertTimeout = setTimeout(() => { + console.log('ACTS_OnOff_0800====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0800==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_0900 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0900==== { + console.debug('ACTS_OnOff_0900====< else true'); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0900====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_0900==== { + currentAlertTimeout = setTimeout(() => { + expect(err.code).assertEqual(0); + console.log('ACTS_OnOff_1000====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1000===="); + expect(err.code).assertEqual(0); + clearTimeout(currentAlertTimeout); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1100); + console.log('ACTS_OnOff_1100==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_1100 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1100==== { + console.debug('ACTS_OnOff_1100====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1100===="); + expect(false).assertTrue(); + clearTimeout(currentAlertTimeout); + console.log('ACTS_OnOff_1200==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_1200 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1200); + console.log('ACTS_OnOff_1200==== { + console.debug('ACTS_OnOff_1200====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1200==== { + expect(err.code).assertEqual(0); + setTimeout(() => { + console.log('ACTS_OnOff_1300====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1300===="); + expect(err.code).assertEqual(0); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1400); + console.log('ACTS_OnOff_1400==== { + console.debug("=ACTS_OnOff_1400 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + } + ); + } + } catch (err) { + console.error('=ACTS_OnOff_1400 catch(err)====>:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1400===="); + expect(false).assertTrue(); + } + DAHelper.on(undefined, dataAbilityUri, onAsyncCallback1500); + + setTimeout(mySetTimeout, gSetTimeout); + function mySetTimeout() { + DAHelper.notifyChange( + dataAbilityUri, + (err) => { + expect(err.code).assertEqual(0); + currentAlertTimeout = setTimeout(() => { + console.debug('ACTS_OnOff_1500====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1500===="); + expect(err.code).assertEqual(0); + clearTimeout(currentAlertTimeout); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1600); + console.log('ACTS_OnOff_1600==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_1600 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1600==== { + console.debug('ACTS_OnOff_1600====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1600==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_1700 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1700); + gSetTimeout = 500; + done(); + } else { + currentAlertTimeout = setTimeout(() => { + expect(err.code).assertEqual(0); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1700); + console.log('ACTS_OnOff_1700====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1700===="); + expect(err.code).assertEqual(0); + clearTimeout(currentAlertTimeout); + DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback1800); + console.log('ACTS_OnOff_1800==== { + if (err.code != 0) { + console.debug("=ACTS_OnOff_1800 err=======>" + + ("err【") + JSON.stringify(err) + (" 】") + " , " + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1800==== { + console.debug('ACTS_OnOff_1800====:' + err); + expect(false).assertTrue(); + console.log('ACTS_OnOff_1800==== { + console.debug("=ACTS_ExecuteBatch_Insert_0100 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Insert_0100==== { + console.debug("=ACTS_ExecuteBatch_Insert_0100 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Insert_0100====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Insert_0100==== { + console.debug("=ACTS_ExecuteBatch_Insert_0200 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Insert_0200==== { + console.debug("=ACTS_ExecuteBatch_Insert_0200 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Insert_0200====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Insert_0200==== { + console.debug("=ACTS_ExecuteBatch_Insert_0300 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Insert_0300==== { + console.debug("=ACTS_ExecuteBatch_Insert_0300 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ") + " , " + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Insert_0300====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + 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); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Insert_0400====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + 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); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Insert_0500====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + 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(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Insert_0600====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Insert_0600==== { + console.debug("=ACTS_ExecuteBatch_Update_0100 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + + (" 】") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Update_0100 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Update_0100 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Update_0100==== { + console.debug("=ACTS_ExecuteBatch_Update_0100 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0100====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0100==== { + console.debug("=ACTS_ExecuteBatch_Update_0200 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(2); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Update_0200 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Update_0200 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Update_0200==== { + console.debug("=ACTS_ExecuteBatch_Update_0200 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0200====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0200==== { + console.debug("=ACTS_ExecuteBatch_Update_0300 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Update_0300==== { + console.debug("=ACTS_ExecuteBatch_Update_0300 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0300====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0300==== { + console.debug("=ACTS_ExecuteBatch_Update_0400 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + + JSON.stringify(DataAbilityResult) + (" 】;") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Update_0400====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0400==== { + console.debug("=ACTS_ExecuteBatch_Update_0500 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(2); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Update_0500 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Update_0500 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Update_0500====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0500==== { + console.debug("=ACTS_ExecuteBatch_Update_0600 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Update_0600 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Update_0600 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Update_0600====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Update_0600==== { + console.debug("=ACTS_ExecuteBatch_Assert_0100 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Assert_0100==== { + console.debug("=ACTS_ExecuteBatch_Assert_0100 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Assert_0100====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Assert_0100==== { + console.debug("=ACTS_ExecuteBatch_Assert_0200 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Assert_0200==== { + console.debug("=ACTS_ExecuteBatch_Assert_0200 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Assert_0200====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Assert_0200==== { + console.debug("=ACTS_ExecuteBatch_Assert_0300 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Assert_0300 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(""); + console.debug('=ACTS_ExecuteBatch_Assert_0300 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(0); + } + console.debug('ACTS_ExecuteBatch_Assert_0300==== { + console.debug("=ACTS_ExecuteBatch_Assert_0300 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Assert_0300====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + 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(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Assert_0400====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + 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(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_Assert_0500====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + 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(data.length).assertEqual(1); + for (var i = 0; i < data.length; i++) { + console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].uri ====>: ' + + data[i].uri) + expect(data[i].uri).assertEqual(""); + console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].count ====>: ' + + data[i].count) + expect(data[i].count).assertEqual(0); + } + console.debug('ACTS_ExecuteBatch_Assert_0600====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Assert_0600==== { + console.debug("=ACTS_ExecuteBatch_Delete_0100 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Delete_0100 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Delete_0100 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Delete_0100==== { + console.debug("=ACTS_ExecuteBatch_Delete_0100 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0100====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0100==== { + console.debug("=ACTS_ExecuteBatch_Delete_0200 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(2); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Delete_0200 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Delete_0200 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Delete_0200==== { + console.debug("=ACTS_ExecuteBatch_Delete_0200 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0200====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0200==== { + console.debug("=ACTS_ExecuteBatch_Delete_0300 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Delete_0300 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Delete_0300 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Delete_0300==== { + console.debug("=ACTS_ExecuteBatch_Delete_0300 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0300====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0300==== { + console.debug("=ACTS_ExecuteBatch_Delete_0400 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Delete_0400====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0400==== { + console.debug("=ACTS_ExecuteBatch_Delete_0500 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(2); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Delete_0500====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0500==== { + console.debug("=ACTS_ExecuteBatch_Delete_0600 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + expect(DataAbilityResult.length).assertEqual(1); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_Delete_0600====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_Delete_0600==== { + console.debug("=ACTS_ExecuteBatch_0100 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_0100 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_0100 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_0100==== { + console.debug("=ACTS_ExecuteBatch_0100 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0100====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0100==== { + console.debug("=ACTS_ExecuteBatch_0200 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_0200 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + console.debug('=ACTS_ExecuteBatch_0200 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + expect(DataAbilityResult[i].count).assertEqual(1); + } + console.debug('ACTS_ExecuteBatch_0200====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0200==== { + console.debug("=ACTS_ExecuteBatch_0300 executeBatch then data====>" + + ("json data 【") + JSON.stringify(DataAbilityResult) + (" 】") + DataAbilityResult.length); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_0300 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + console.debug('=ACTS_ExecuteBatch_0300 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + if (i == 2) { + expect(DataAbilityResult[i].uri).assertEqual(""); + expect(DataAbilityResult[i].count).assertEqual(0); + } else { + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + expect(DataAbilityResult[i].count).assertEqual(1); + } + } + console.debug('ACTS_ExecuteBatch_0300==== { + console.debug("=ACTS_ExecuteBatch_0300 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0300====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0300==== { + console.debug("=ACTS_ExecuteBatch_0400 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(DataAbilityResult) + + (" 】;") + DataAbilityResult.length); + for (var i = 0; i < DataAbilityResult.length; i++) { + console.debug('=ACTS_ExecuteBatch_0400 for data[' + i + '].uri ====>: ' + + DataAbilityResult[i].uri) + console.debug('=ACTS_ExecuteBatch_0400 for data[' + i + '].count ====>: ' + + DataAbilityResult[i].count) + if (i == 2) { + expect(DataAbilityResult[i].uri).assertEqual(""); + expect(DataAbilityResult[i].count).assertEqual(0); + } else { + expect(DataAbilityResult[i].uri).assertEqual(dataAbilityUri); + expect(DataAbilityResult[i].count).assertEqual(1); + } + } + console.debug('ACTS_ExecuteBatch_0400====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0400==== { + console.debug("=ACTS_ExecuteBatch_0500 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_0500==== { + console.debug("=ACTS_ExecuteBatch_0500 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0500====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0500==== { + console.debug("=ACTS_ExecuteBatch_0600 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + + (" 】;") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_0600====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0600==== { + console.debug("=ACTS_ExecuteBatch_0700 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_0700==== { + console.debug("=ACTS_ExecuteBatch_0700 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0700====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0700==== { + console.debug("=ACTS_ExecuteBatch_0800 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + + (" 】;") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_0800====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0800==== { + console.debug("=ACTS_ExecuteBatch_0900 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_0900==== { + console.debug("=ACTS_ExecuteBatch_0900 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0900====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_0900==== { + console.debug("=ACTS_ExecuteBatch_1000 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + + (" 】;") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_1000====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_1000==== { + console.debug("=ACTS_ExecuteBatch_1100 executeBatch then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_1100==== { + console.debug("=ACTS_ExecuteBatch_1100 executeBatch catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_1100====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_1100==== { + console.debug("=ACTS_ExecuteBatch_1200 executeBatch err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + + (" 】;") + data.length); + expect(data.length).assertEqual(0); + console.debug('ACTS_ExecuteBatch_1200====:' + + ("json err 【") + JSON.stringify(err) + (" 】 ,") + err); + expect(false).assertTrue(); + console.debug('ACTS_ExecuteBatch_1200====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); + expect(typeof (rDAHelper)).assertEqual("object"); + rDAHelper.release().then((data) => { + console.debug("=ACTS_Release_0100 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); + expect(data).assertEqual(true); + console.log('ACTS_Release_0100==== { + console.debug("=ACTS_Release_0100 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.log('ACTS_Release_0100====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Release_0100====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); + expect(typeof (rDAHelper)).assertEqual("object"); + rDAHelper.release((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_0200 data: ' + data) + expect(data).assertEqual(true); + console.log('ACTS_Release_0200====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Release_0200====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); + expect(typeof (rDAHelper)).assertEqual("object"); + rDAHelper.release().then((data) => { + console.debug("=ACTS_Release_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); + expect(data).assertEqual(true); + rDAHelper.release().then((data) => { + console.debug("=ACTS_Release_0300 then data====>" + + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); + expect(data).assertEqual(false); + console.log('ACTS_Release_0300==== { + console.debug("=ACTS_Release_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.log('ACTS_Release_0300==== { + console.debug("=ACTS_Release_0300 catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + expect(false).assertTrue(); + console.log('ACTS_Release_0300====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Release_0300====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); + expect(typeof (rDAHelper)).assertEqual("object"); + rDAHelper.release((err, data) => { + console.debug("=ACTS_Release_0400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); + console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data) + expect(data).assertEqual(true); + rDAHelper.release((err, data) => { + console.debug("=ACTS_Release_0400 err,data=======>" + + ("json err【") + JSON.stringify(err) + (" ,") + JSON.stringify(data) + (" 】;")); + console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data) + expect(data).assertEqual(false); + console.log('ACTS_Release_0400====:' + err); + expect(false).assertTrue(); + console.log('ACTS_Release_0400====