From 6b3724e525684805e2402b56e6f18f806d8d76e4 Mon Sep 17 00:00:00 2001 From: zhaiyanni Date: Tue, 30 Nov 2021 19:25:25 +0800 Subject: [PATCH] Signed-off-by: zhaiyanni --- .../test/RdbstorePredicatesJsunit.test.js | 219 +++++++++--------- .../test/StorageCallBackJsunit.test.js | 44 ++-- 2 files changed, 129 insertions(+), 134 deletions(-) mode change 100755 => 100644 distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstorePredicatesJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstorePredicatesJsunit.test.js index 24336eef0..33ee7b59e 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstorePredicatesJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstorePredicatesJsunit.test.js @@ -13,8 +13,7 @@ * limitations under the License. */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -import ohos_data_rdb from '@ohos.data.rdb'; -import ability_featureAbility from '@ohos.ability.featureAbility'; +import dataRdb from '@ohos.data.rdb'; const TAG = "[RDB_JSKITS _TEST]" const CREATE_TABLE_ALL_DATA_TYPE_SQL = "CREATE TABLE IF NOT EXISTS AllDataType " @@ -30,13 +29,11 @@ const STORE_CONFIG = { name: "Predicates.db", } var rdbStore = undefined; -var context = undefined; var DOUBLE_MAX = 9223372036854775807; describe('rdbPredicatesTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') - context = await ability_featureAbility.getContext(); - rdbStore = await ohos_data_rdb.getRdbStore(context, STORE_CONFIG, 1); + rdbStore = await dataRdb.getRdbStore(STORE_CONFIG, 1); await rdbStore.executeSql(CREATE_TABLE_ALL_DATA_TYPE_SQL, null); await buildAllDataType1(); await buildAllDataType2(); @@ -54,7 +51,7 @@ describe('rdbPredicatesTest', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await ohos_data_rdb.deleteRdbStore(context, "Predicates.db"); + await dataRdb.deleteRdbStore("Predicates.db"); }) function resultSize(resultSet) { @@ -137,7 +134,7 @@ describe('rdbPredicatesTest', function () { */ it('testEqualTo0001', 0, async function (done) { console.log(TAG + "************* testEqualTo0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); { predicates.equalTo("booleanValue", true); let result = await rdbStore.query(predicates); @@ -156,7 +153,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0002', 0, async function (done) { console.log(TAG + "************* testEqualTo0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("byteValue", -128).or().equalTo("byteValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -174,7 +171,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0003', 0, async function (done) { console.log(TAG + "************* testEqualTo0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -192,7 +189,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0004', 0, async function (done) { console.log(TAG + "************* testEqualTo0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("doubleValue", DOUBLE_MAX); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -210,7 +207,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0005', 0, async function (done) { console.log(TAG + "************* testEqualTo0005 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("shortValue", -32768.0); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -228,7 +225,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0006', 0, async function (done) { console.log(TAG + "************* testEqualTo0006 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("integerValue", 1); let result = await rdbStore.query(predicates); expect(true).assertEqual(result.goToFirstRow()); @@ -246,7 +243,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0007', 0, async function (done) { console.log(TAG + "************* testEqualTo0007 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("longValue", 1); let result = await rdbStore.query(predicates); expect(true).assertEqual(result.goToFirstRow()); @@ -264,7 +261,7 @@ describe('rdbPredicatesTest', function () { it('testEqualTo0008', 0, async function (done) { console.log(TAG + "************* testEqualTo0008 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("floatValue", -0.123); let result = await rdbStore.query(predicates); expect(true).assertEqual(result.goToFirstRow()); @@ -283,7 +280,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0001', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("booleanValue", true); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -301,7 +298,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0002', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("byteValue", -128); predicates.notEqualTo("byteValue", 1); let result = await rdbStore.query(predicates); @@ -320,7 +317,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0003', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("stringValue", "ABCDEFGHIJKLMN"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -338,7 +335,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0004', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("doubleValue", DOUBLE_MAX); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -356,7 +353,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0005', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0005 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("shortValue", -32768); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -374,7 +371,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0006', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0006 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("integerValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -392,7 +389,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0007', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0007 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("longValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -410,7 +407,7 @@ describe('rdbPredicatesTest', function () { it('testNotEqualTo0008', 0, async function (done) { console.log(TAG + "************* testNotEqualTo0008 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.notEqualTo("floatValue", -0.123); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -427,7 +424,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNull0001', 0, async function (done) { console.log(TAG + "************* testIsNull001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNull("primLongValue"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -443,7 +440,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNull0002', 0, async function (done) { console.log(TAG + "************* testIsNull0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNull("longValue"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -459,7 +456,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNull0003', 0, async function (done) { console.log(TAG + "************* testIsNull0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNull("stringValue"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -475,7 +472,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNull0004', 0, async function (done) { console.log(TAG + "************* testIsNull0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNull("stringValueX"); let result = await rdbStore.query(predicates); expect(-1).assertEqual(result.rowCount); @@ -491,7 +488,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNotNull0001', 0, async function (done) { console.log(TAG + "************* testIsNotNull0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNotNull("primLongValue"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -507,7 +504,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNotNull0002', 0, async function (done) { console.log(TAG + "************* testIsNotNull0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNotNull("longValue"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -523,7 +520,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNotNull0003', 0, async function (done) { console.log(TAG + "************* testIsNotNull0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNotNull("stringValue"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -539,7 +536,7 @@ describe('rdbPredicatesTest', function () { */ it('testIsNotNull0004', 0, async function (done) { console.log(TAG + "************* testIsNotNull0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.isNotNull("stringValueX"); let result = await rdbStore.query(predicates); expect(-1).assertEqual(result.rowCount); @@ -556,7 +553,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0001', 0, async function (done) { console.log(TAG + "************* testGreaterThan0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("stringValue", "ABC"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -574,7 +571,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0002', 0, async function (done) { console.log(TAG + "************* testGreaterThan0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("doubleValue", 0.0); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -592,7 +589,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0003', 0, async function (done) { console.log(TAG + "************* testGreaterThan0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("integerValue", 1); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -610,7 +607,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0004', 0, async function (done) { console.log(TAG + "************* testGreaterThan0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("longValue", 1); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -628,7 +625,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0005', 0, async function (done) { console.log(TAG + "************* testGreaterThan0005 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("stringValue", "ZZZ"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -646,7 +643,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0006', 0, async function (done) { console.log(TAG + "************* testGreaterThan0006 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("doubleValue", 999.0); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -664,7 +661,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0007', 0, async function (done) { console.log(TAG + "************* testGreaterThan0007 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("integerValue", -999); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -682,7 +679,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThan0008', 0, async function (done) { console.log(TAG + "************* testGreaterThan0008 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThan("longValue", -999); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -700,7 +697,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThanOrEqualTo0001', 0, async function (done) { console.log(TAG + "************* testGreaterThanOrEqualTo0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThanOrEqualTo("stringValue", "ABC"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -718,7 +715,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThanOrEqualTo0002', 0, async function (done) { console.log(TAG + "************* testGreaterThanOrEqualTo0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThanOrEqualTo("doubleValue", 0.0); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -736,7 +733,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThanOrEqualTo0003', 0, async function (done) { console.log(TAG + "************* testGreaterThanOrEqualTo0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThanOrEqualTo("integerValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -754,7 +751,7 @@ describe('rdbPredicatesTest', function () { it('testGreaterThanOrEqualTo0004', 0, async function (done) { console.log(TAG + "************* testGreaterThanOrEqualTo0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.greaterThanOrEqualTo("longValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -772,7 +769,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0001', 0, async function (done) { console.log(TAG + "************* testLessThan0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("stringValue", "ABD"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -790,7 +787,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0002', 0, async function (done) { console.log(TAG + "************* testLessThan0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("doubleValue", 0.0); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -808,7 +805,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0003', 0, async function (done) { console.log(TAG + "************* testLessThan0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("integerValue", 1); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -826,7 +823,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0004', 0, async function (done) { console.log(TAG + "************* testLessThan0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("longValue", 1); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -844,7 +841,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0005', 0, async function (done) { console.log(TAG + "************* testLessThan0005 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("stringValue", "ABD"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -862,7 +859,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0006', 0, async function (done) { console.log(TAG + "************* testLessThan0006 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("doubleValue", 1.0); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -880,7 +877,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0007', 0, async function (done) { console.log(TAG + "************* testLessThan0007 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("integerValue", -2147483648); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -898,7 +895,7 @@ describe('rdbPredicatesTest', function () { it('testLessThan0008', 0, async function (done) { console.log(TAG + "************* testLessThan0008 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThan("longValue", -9223372036854775808); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -916,7 +913,7 @@ describe('rdbPredicatesTest', function () { it('testLessThanOrEqualTo0001', 0, async function (done) { console.log(TAG + "************* testLessThanOrEqualTo0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThanOrEqualTo("stringValue", "ABD"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -934,7 +931,7 @@ describe('rdbPredicatesTest', function () { it('testLessThanOrEqualTo0002', 0, async function (done) { console.log(TAG + "************* testLessThanOrEqualTo0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThanOrEqualTo("doubleValue", 0.0); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -952,7 +949,7 @@ describe('rdbPredicatesTest', function () { it('testLessThanOrEqualTo0003', 0, async function (done) { console.log(TAG + "************* testLessThanOrEqualTo0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThanOrEqualTo("integerValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -970,7 +967,7 @@ describe('rdbPredicatesTest', function () { it('testLessThanOrEqualTo0004', 0, async function (done) { console.log(TAG + "************* testLessThanOrEqualTo0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.lessThanOrEqualTo("longValue", 1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -988,7 +985,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0001', 0, async function (done) { console.log(TAG + "************* testBetween0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("stringValue", "ABB", "ABD"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1006,7 +1003,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0002', 0, async function (done) { console.log(TAG + "************* testBetween0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("doubleValue", 0.0, DOUBLE_MAX); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1024,7 +1021,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0003', 0, async function (done) { console.log(TAG + "************* testBetween0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("integerValue", 0, 1); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1042,7 +1039,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0004', 0, async function (done) { console.log(TAG + "************* testBetween0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("longValue", 0, 2); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1060,7 +1057,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0005', 0, async function (done) { console.log(TAG + "************* testBetween0005 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("stringValue", "ABB", "ABB"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1078,7 +1075,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0006', 0, async function (done) { console.log(TAG + "************* testBetween0006 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("doubleValue", DOUBLE_MAX, DOUBLE_MAX); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1096,7 +1093,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0007', 0, async function (done) { console.log(TAG + "************* testBetween0007 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("integerValue", 1, 0); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1114,7 +1111,7 @@ describe('rdbPredicatesTest', function () { it('testBetween0008', 0, async function (done) { console.log(TAG + "************* testBetween0008 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.between("longValue", 2, -1); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1131,7 +1128,7 @@ describe('rdbPredicatesTest', function () { */ it('testContains0001', 0, async function (done) { console.log(TAG + "************* testContains0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.contains("stringValue", "DEF"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1147,7 +1144,7 @@ describe('rdbPredicatesTest', function () { */ it('testContains0002', 0, async function (done) { console.log(TAG + "************* testContains0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.contains("stringValue", "DEFX"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1163,7 +1160,7 @@ describe('rdbPredicatesTest', function () { */ it('testContains0003', 0, async function (done) { console.log(TAG + "************* testContains0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.contains("characterValue", "中"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1179,7 +1176,7 @@ describe('rdbPredicatesTest', function () { */ it('testContains0004', 0, async function (done) { console.log(TAG + "************* testContains0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.contains("characterValue", "#"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1195,7 +1192,7 @@ describe('rdbPredicatesTest', function () { */ it('testBeginsWith0001', 0, async function (done) { console.log(TAG + "************* testBeginsWith0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.beginsWith("stringValue", "ABC"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1211,7 +1208,7 @@ describe('rdbPredicatesTest', function () { */ it('testBeginsWith0002', 0, async function (done) { console.log(TAG + "************* testBeginsWith0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.beginsWith("stringValue", "ABCX"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1227,7 +1224,7 @@ describe('rdbPredicatesTest', function () { */ it('testBeginsWith0003', 0, async function (done) { console.log(TAG + "************* testBeginsWith0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.beginsWith("characterValue", "中"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1243,7 +1240,7 @@ describe('rdbPredicatesTest', function () { */ it('testBeginsWith0004', 0, async function (done) { console.log(TAG + "************* testBeginsWith0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.beginsWith("characterValue", "#"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1259,7 +1256,7 @@ describe('rdbPredicatesTest', function () { */ it('testEndsWith0001', 0, async function (done) { console.log(TAG + "************* testEndsWith0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.endsWith("stringValue", "LMN"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1275,7 +1272,7 @@ describe('rdbPredicatesTest', function () { */ it('testEndsWith0002', 0, async function (done) { console.log(TAG + "************* testEndsWith0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.endsWith("stringValue", "LMNX"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1291,7 +1288,7 @@ describe('rdbPredicatesTest', function () { */ it('testEndsWith0003', 0, async function (done) { console.log(TAG + "************* testEndsWith0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.endsWith("characterValue", "中"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1307,7 +1304,7 @@ describe('rdbPredicatesTest', function () { */ it('testEndsWith0004', 0, async function (done) { console.log(TAG + "************* testEndsWith0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.endsWith("characterValue", "#"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1323,7 +1320,7 @@ describe('rdbPredicatesTest', function () { */ it('testLike0001', 0, async function (done) { console.log(TAG + "************* testLike0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "%LMN%"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1339,7 +1336,7 @@ describe('rdbPredicatesTest', function () { */ it('testLike0002', 0, async function (done) { console.log(TAG + "************* testLike0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "%LMNX%"); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1355,7 +1352,7 @@ describe('rdbPredicatesTest', function () { */ it('testLike0003', 0, async function (done) { console.log(TAG + "************* testLike0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("characterValue", "%中%"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1371,7 +1368,7 @@ describe('rdbPredicatesTest', function () { */ it('testLike0004', 0, async function (done) { console.log(TAG + "************* testLike0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("characterValue", "%#%"); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1388,7 +1385,7 @@ describe('rdbPredicatesTest', function () { it('testBeginWrap0001', 0, async function (done) { console.log(TAG + "************* testBeginWrap0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .beginWrap() .equalTo("integerValue", 1) @@ -1411,7 +1408,7 @@ describe('rdbPredicatesTest', function () { it('testBeginWrap0002', 0, async function (done) { console.log(TAG + "************* testBeginWrap0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .beginWrap() .equalTo("characterValue", ' ') @@ -1432,7 +1429,7 @@ describe('rdbPredicatesTest', function () { it('testBeginWrap0003', 0, async function (done) { console.log(TAG + "************* testBeginWrap0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .beginWrap() .equalTo("characterValue", '中') @@ -1453,7 +1450,7 @@ describe('rdbPredicatesTest', function () { it('testBeginWrap0004', 0, async function (done) { console.log(TAG + "************* testBeginWrap0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .equalTo("characterValue", '中') .endWrap(); @@ -1473,7 +1470,7 @@ describe('rdbPredicatesTest', function () { it('testBeginWrap0005', 0, async function (done) { console.log(TAG + "************* testBeginWrap0005 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .beginWrap() .equalTo("characterValue", '中'); @@ -1493,7 +1490,7 @@ describe('rdbPredicatesTest', function () { it('testAnd0001', 0, async function (done) { console.log(TAG + "************* testAnd0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .and() .equalTo("integerValue", 1); @@ -1513,7 +1510,7 @@ describe('rdbPredicatesTest', function () { it('testAnd0002', 0, async function (done) { console.log(TAG + "************* testAnd0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN") .beginWrap() .equalTo("integerValue", 1) @@ -1536,7 +1533,7 @@ describe('rdbPredicatesTest', function () { it('testAnd0003', 0, async function (done) { console.log(TAG + "************* testAnd0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").or().and().equalTo("integerValue", 1); console.log(TAG + "you should not start a request" + " with \"and\" or use or() before this function"); } @@ -1552,7 +1549,7 @@ describe('rdbPredicatesTest', function () { it('testAnd0004', 0, async function (done) { console.log(TAG + "************* testAnd0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").or().or().equalTo("integerValue", 1); console.log(TAG + "you are starting a sql request with predicate or or," + "using function or() immediately after another or(). that is ridiculous."); @@ -1569,7 +1566,7 @@ describe('rdbPredicatesTest', function () { it('testOrder0001', 0, async function (done) { console.log(TAG + "************* testOrder0001 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").orderByAsc("integerValue").distinct(); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1593,7 +1590,7 @@ describe('rdbPredicatesTest', function () { it('testOrder0002', 0, async function (done) { console.log(TAG + "************* testOrder0002 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").orderByDesc("integerValue").distinct(); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1617,7 +1614,7 @@ describe('rdbPredicatesTest', function () { it('testOrder0003', 0, async function (done) { console.log(TAG + "************* testOrder0003 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").orderByDesc("integerValueX").distinct(); let result = await rdbStore.query(predicates); expect(-1).assertEqual(result.rowCount); @@ -1635,7 +1632,7 @@ describe('rdbPredicatesTest', function () { it('testOrder0004', 0, async function (done) { console.log(TAG + "************* testOrder0004 start *************"); { - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.equalTo("stringValue", "ABCDEFGHIJKLMN").orderByAsc("integerValueX").distinct(); let result = await rdbStore.query(predicates); expect(-1).assertEqual(result.rowCount); @@ -1652,7 +1649,7 @@ describe('rdbPredicatesTest', function () { */ it('testLimit0001', 0, async function (done) { console.log(TAG + "************* testLimit0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(1); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1668,7 +1665,7 @@ describe('rdbPredicatesTest', function () { */ it('testLimit0002', 0, async function (done) { console.log(TAG + "************* testLimit0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(3); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1684,7 +1681,7 @@ describe('rdbPredicatesTest', function () { */ it('testLimit0003', 0, async function (done) { console.log(TAG + "************* testLimit0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(100); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1700,7 +1697,7 @@ describe('rdbPredicatesTest', function () { */ it('testLimit0004', 0, async function (done) { console.log(TAG + "************* testLimit0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "中").limitAs(1); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1716,7 +1713,7 @@ describe('rdbPredicatesTest', function () { */ it('testLimit0005', 0, async function (done) { console.log(TAG + "************* testLimit0005 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(0); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1732,7 +1729,7 @@ describe('rdbPredicatesTest', function () { */ it('testLimit0006', 0, async function (done) { console.log(TAG + "************* testLimit0006 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(-1); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1748,7 +1745,7 @@ describe('rdbPredicatesTest', function () { */ it('testOffset0001', 0, async function (done) { console.log(TAG + "************* testOffset0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(3).offsetAs(1); let result = await rdbStore.query(predicates); expect(2).assertEqual(result.rowCount); @@ -1764,7 +1761,7 @@ describe('rdbPredicatesTest', function () { */ it('testOffset0002', 0, async function (done) { console.log(TAG + "************* testOffset0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(3).offsetAs(0); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1780,7 +1777,7 @@ describe('rdbPredicatesTest', function () { */ it('testOffset0003', 0, async function (done) { console.log(TAG + "************* testOffset0003 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(3).offsetAs(5); let result = await rdbStore.query(predicates); expect(0).assertEqual(result.rowCount); @@ -1796,7 +1793,7 @@ describe('rdbPredicatesTest', function () { */ it('testOffset0004', 0, async function (done) { console.log(TAG + "************* testOffset0004 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").limitAs(3).offsetAs(-1); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1813,7 +1810,7 @@ describe('rdbPredicatesTest', function () { it('testIn0001', 0, async function (done) { console.log(TAG + "************* testIn0001 start *************"); var values = [Number.MIN_VALUE.toString()]; - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.in("doubleValue", values); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1829,7 +1826,7 @@ describe('rdbPredicatesTest', function () { it('testIn0002', 0, async function (done) { console.log(TAG + "************* testIn0002 start *************"); var values = ["1.0"]; - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.in("doubleValue", values); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1845,7 +1842,7 @@ describe('rdbPredicatesTest', function () { it('testIn0003', 0, async function (done) { console.log(TAG + "************* testIn0003 start *************"); var values = [DOUBLE_MAX.toString()]; - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.in("doubleValue", values); let result = await rdbStore.query(predicates); expect(1).assertEqual(result.rowCount); @@ -1861,7 +1858,7 @@ describe('rdbPredicatesTest', function () { it('testIn0004', 0, async function (done) { console.log(TAG + "************* testIn0004 start *************"); var values = [Number.MIN_VALUE.toString(), "1.0", DOUBLE_MAX.toString()]; - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.in("doubleValue", values); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1876,7 +1873,7 @@ describe('rdbPredicatesTest', function () { */ it('testCreate0001', 0, async function (done) { console.log(TAG + "************* testCreate0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); done(); @@ -1890,7 +1887,7 @@ describe('rdbPredicatesTest', function () { */ it('testCreate0002', 0, async function (done) { console.log(TAG + "************* testCreate0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("test"); + let predicates = await new dataRdb.RdbPredicates("test"); let result = await rdbStore.query(predicates); expect(-1).assertEqual(result.rowCount); done(); @@ -1904,7 +1901,7 @@ describe('rdbPredicatesTest', function () { */ it('testGroupBy0001', 0, async function (done) { console.log(TAG + "************* testGroupBy0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").groupBy(["characterValue"]); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1920,7 +1917,7 @@ describe('rdbPredicatesTest', function () { */ it('testGroupBy0002', 0, async function (done) { console.log(TAG + "************* testGroupBy0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").groupBy(["characterValueX"]); let result = await rdbStore.query(predicates); expect(-1).assertEqual(result.rowCount); @@ -1936,7 +1933,7 @@ describe('rdbPredicatesTest', function () { */ it('testIndexedBy0001', 0, async function (done) { console.log(TAG + "************* testIndexedBy0001 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").indexedBy(["characterValue"]); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); @@ -1952,7 +1949,7 @@ describe('rdbPredicatesTest', function () { */ it('testIndexedBy0002', 0, async function (done) { console.log(TAG + "************* testIndexedBy0002 start *************"); - let predicates = await new ohos_data_rdb.RdbPredicates("AllDataType"); + let predicates = await new dataRdb.RdbPredicates("AllDataType"); predicates.like("stringValue", "ABCDEFGHIJKLMN").indexedBy(["characterValueX"]); let result = await rdbStore.query(predicates); expect(3).assertEqual(result.rowCount); diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js old mode 100755 new mode 100644 index 8b3695a36..c2ee1f36d --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageCallBackJsunit.test.js @@ -44,8 +44,8 @@ describe('storageTest', function () { mPref.flushSync(); await mPref.clear(function (err, ret) { expect("defaultvalue").assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue")); + done(); }); - done(); }) /** @@ -57,8 +57,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_STRING_ELEMENT, "test"); await mPref.has(KEY_TEST_STRING_ELEMENT, function (err, ret) { expect(true).assertEqual(ret); + done(); }) - done(); }) /** @@ -70,8 +70,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_INT_ELEMENT, 1); await mPref.has(KEY_TEST_INT_ELEMENT, function (err, ret) { expect(true).assertEqual(ret); + done(); }) - done(); }) /** @@ -83,8 +83,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_FLOAT_ELEMENT, 1.1); await mPref.has(KEY_TEST_FLOAT_ELEMENT, function (err, ret) { expect(true).assertEqual(ret); + done(); }) - done(); }) /** @@ -96,8 +96,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_LONG_ELEMENT, 0); await mPref.has(KEY_TEST_LONG_ELEMENT, function (err, ret) { expect(true).assertEqual(ret); + done(); }) - done(); }) /** @@ -109,8 +109,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_BOOLEAN_ELEMENT, false); await mPref.has(KEY_TEST_BOOLEAN_ELEMENT, function (err, ret) { expect(true).assertEqual(ret); + done(); }) - done(); }) /** @@ -122,8 +122,8 @@ describe('storageTest', function () { mPref.clearSync(); await mPref.get(KEY_TEST_STRING_ELEMENT, "defaultValue", function (err, ret) { expect('defaultValue').assertEqual(ret); + done(); }) - done(); }) /** @@ -136,8 +136,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_FLOAT_ELEMENT, 3.0); await mPref.get(KEY_TEST_FLOAT_ELEMENT, 0.0, function (err, ret) { expect(3.0).assertEqual(ret); + done(); }) - done(); }) /** @@ -150,8 +150,8 @@ describe('storageTest', function () { mPref.putSync(KEY_TEST_INT_ELEMENT, 3); await mPref.get(KEY_TEST_INT_ELEMENT, 0.0, function (err, ret) { expect(3).assertEqual(ret); + done(); }) - done(); }) /** @@ -165,8 +165,8 @@ describe('storageTest', function () { expect(3).assertEqual(mPref.getSync(KEY_TEST_LONG_ELEMENT, 0)); await mPref.get(KEY_TEST_LONG_ELEMENT, 0, function (err, ret) { expect(3).assertEqual(ret); + done(); }); - done(); }) /** @@ -180,8 +180,8 @@ describe('storageTest', function () { mPref.flushSync(); await mPref.get(KEY_TEST_STRING_ELEMENT, "defaultvalue", function (err, ret) { expect('test').assertEqual(ret); + done(); }); - done(); }) /** @@ -195,8 +195,8 @@ describe('storageTest', function () { expect(true).assertEqual(mPref.getSync(KEY_TEST_BOOLEAN_ELEMENT, false)); mPref.flushSync(); expect(true).assertEqual(mPref.getSync(KEY_TEST_BOOLEAN_ELEMENT, false)); + done(); }); - done(); }) /** @@ -210,8 +210,8 @@ describe('storageTest', function () { expect(4.0).assertEqual(mPref.getSync(KEY_TEST_FLOAT_ELEMENT, 0.0)); mPref.flushSync(); expect(4.0).assertEqual(mPref.getSync(KEY_TEST_FLOAT_ELEMENT, 0.0)); + done(); }); - done(); }) /** @@ -225,8 +225,8 @@ describe('storageTest', function () { expect(4).assertEqual(mPref.getSync(KEY_TEST_INT_ELEMENT, 0)); mPref.flushSync(); expect(4).assertEqual(mPref.getSync(KEY_TEST_INT_ELEMENT, 0)); + done(); }); - done(); }) /** @@ -241,8 +241,8 @@ describe('storageTest', function () { expect(4).assertEqual(mPref.getSync(KEY_TEST_LONG_ELEMENT, 0)); mPref.flushSync(); expect(4).assertEqual(mPref.getSync(KEY_TEST_LONG_ELEMENT, 0)); + done(); }); - done(); }) /** @@ -252,17 +252,15 @@ describe('storageTest', function () { */ it('testPutString0162', 0, async function (done) { mPref.clearSync(); - await mPref.put(KEY_TEST_STRING_ELEMENT, "abc", function (err, ret) { - mPref.put(KEY_TEST_STRING_ELEMENT, '', function (err, ret) { - expect('').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue")); - mPref.flushSync(); - expect('').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue")); - }); + await mPref.put(KEY_TEST_STRING_ELEMENT, '', function (err, ret) { + expect('').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue")); + mPref.flushSync(); + expect('').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue")); + done(); }); - done(); }) - /** + /** * @tc.name flush callback interface test * @tc.number SUB_DDM_AppDataFWK_JSPreferences_CallBack_0010 * @tc.desc flush callback interface test -- GitLab