diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 4301d2d4718507b2df574ac98a07d236ac1d6260..082b8bf2700938e841a704aaa688d0fe37a41609 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 5e9e17c9348f517de1cbbeca97f329cf9677c03c..6af8777635f3879a0f5b3300d15282fce72ee826 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 8cecdd34071364c51e1a1a52523ba0d76838243c..04db982eb401ae7dc42212f04be32c5360ba8689 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index d6dd1794b13ff616b84e0421e8db0759c680c4cf..d02336b79ccc858251b9b791f96adce2a5af9ca7 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index fa89922d593b8736cbd0ca3b57851247122d8f6a..0936beac7282dbbb3532f97b7f9c089c3deb5f01 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index c6abb03cf8f11545609396232d362a25cbdd4313..29fa22e2da11f983889f2982b99e59d5b70155ae 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 89ea4840831e61ba3c917d483bb0918a1caba6dd..c89e93b6b4da90d46f453d6d4e2fc480aa3c29af 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 5db5938070dd61cbeef312ded4487cfc9faa4530..e1ab4f62196555bae0c360143b378934af3a17bf 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 30148309fb0f10aaca15a5528f2788788dc5a3ae..180cc28d5981903b3f12cb3558f8d88319d96dff 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index a3775ae39d5a13062873e441d7152b906e20b602..c6a9e51fa7ed62ea0dfb555079d1a24965141f74 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import featureAbility from '@ohos.ability.featureability'
+import featureAbility from '@ohos.ability.featureAbility'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/BUILD.gn b/aafwk/aafwk_standard/actsfwkdataaccessortest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..8a0cb63e2257253be6570f26257eea4c35eb5db0
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/BUILD.gn
@@ -0,0 +1,24 @@
+# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+group("dataability") {
+ testonly = true
+ if (is_standard_system) {
+ deps = [
+ "actsdataabilityrelyhap:ActsDataAbilityRelyHap",
+ "actsfwkdataaccessortest:ActsFWKDataAccessorTest",
+ ]
+ }
+}
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..74400d3f39848e1081bad10ac982a0a30d898b78
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn
@@ -0,0 +1,39 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap("ActsDataAbilityRelyHap") {
+ hap_name = "ActsDataAbilityRelyHap"
+ hap_profile = "entry/src/main/config.json"
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
+ testonly = true
+ deps = [
+ ":dataability_resources",
+ ":dataability_ts_assets",
+ ]
+ certificate_profile = "signature/openharmony_sx.p7b"
+}
+
+ohos_js_assets("dataability_ts_assets") {
+ source_dir = "entry/src/main/ets"
+ hap_profile = "entry/src/main/config.json"
+ ets2abc = true
+}
+
+ohos_resources("dataability_resources") {
+ sources = [ "entry/src/main/resources" ]
+ hap_profile = "entry/src/main/config.json"
+}
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..ef953c581f15db7cc2c07bb3d7e1692c3af4c46d
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json
@@ -0,0 +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"
+ }
+ ]
+ }
+}
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d5ebbe661dc5aa73cb877d8a4c9d829ca6cf4b2b
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts
@@ -0,0 +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.AbilitySatage"
+
+export default class MyAbilityStage extends AbilityStage {
+ onCreate() {
+ console.log("MyAbilityStage onCreate");
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c89305ea6db4b5ac3f7286b9657f6f7ca8074c72
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +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(){
+
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..eef2fff6d169b8c305daa2acd8db6eb913b31f4e
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +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')
+ },
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6b4120bd91a94160e64b02ba8b7b89b413c39389
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +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%')
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
new file mode 100644
index 0000000000000000000000000000000000000000..65bb9463e1707757f7cb1cdca3d1b7da5dc63170
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import router from '@system.router';
+
+@Entry
+@Component
+struct Second {
+ private content: string = "Second Page"
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text(`${this.content}`)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Button() {
+ Text('back to index')
+ .fontSize(20)
+ .fontWeight(FontWeight.Bold)
+ }.type(ButtonType.Capsule)
+ .margin({
+ top: 20
+ })
+ .backgroundColor('#0D9FFB')
+ .onClick(() => {
+ router.back()
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bc472bcb26f454ccd2a9413f3a69a9ee3526bb69
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts
@@ -0,0 +1,253 @@
+/*
+ * 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', encryptKey: new Uint8Array([]) }
+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'
+
+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(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/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1efa7ced163d2d4edca3c4b7ad3c695babb1a888
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts
@@ -0,0 +1,253 @@
+/*
+ * 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', encryptKey: new Uint8Array([]) }
+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'
+
+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(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/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..22c139ebd13a685e9ce52a84ea2b625e18d8db40
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +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"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png differ
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b differ
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..f81adb5b97bbadd5672babdf4b62c14f8ecea652
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn
@@ -0,0 +1,31 @@
+# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_js_hap_suite("ActsFWKDataAccessorTest") {
+ hap_name = "ActsFWKDataAccessorTest"
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/js/default"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/js/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..26277c340b28cc78ab0fbd9ef45a8d97275228d0
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json
@@ -0,0 +1,19 @@
+{
+ "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
+ }
+ ]
+}
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..ba1f602704c7c4e9e762304de300f9da41f8cd69
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json
@@ -0,0 +1,62 @@
+{
+ "app": {
+ "bundleName": "com.amsst.fwkdataaccessor",
+ "vendor": "amsst",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 4,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.amsst.fwkdataaccessor",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home",
+ "flag.home.intent.from.system"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "com.amsst.fwkdataaccessor.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard",
+ "visible": true
+ }
+ ],
+ "js": [
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": "default",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js
@@ -0,0 +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');
+ }
+};
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6724ec055a554cf3f9c7be83780c30df2274875b
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,12 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
+.titleST {
+ font-size: 32px;
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..4f779dcdff4fa69413976fe7032ca3656758793a
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,8 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
+ STDataAbility
+
+
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..4bfa4f7e4a4085d7336a97befffb8d52882d281d
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import file from '@system.file'
+import app from '@system.app'
+import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ },
+ onShow() {
+ console.info('====onShow finish====<')
+ const core = Core.getInstance()
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ })
+ const reportExtend = new ReportExtend(file)
+ core.addService('expect', expectExtend)
+ core.addService('report', reportExtend)
+ core.init()
+ const configService = core.getDefaultService('config')
+ configService.setConfig(this)
+
+ require('../../../test/List.test')
+ core.execute()
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..baf5b3c1c2a555bed22561a88aca6d857522d425
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "STDataAbility"
+ },
+ {
+ "name": "mainability_description",
+ "value": "JS_Phone_Empty Feature Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png differ
diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..a0c94f156a0a475468797244a41c63748c040d15
--- /dev/null
+++ b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
@@ -0,0 +1,8524 @@
+/*
+ * 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');
+ }
+ } 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====