diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataAbilityPredicatesJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataAbilityPredicatesJsunit.test.js index 7a874c78e2a4402a3efa048f38b38ecce0bb6701..ac46e138a96d3dbe4e0e4f93b19c019f64a84f7d 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataAbilityPredicatesJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/DataAbilityPredicatesJsunit.test.js @@ -15,7 +15,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import dataRdb from '@ohos.data.rdb'; import dataAbility from '@ohos.data.dataability'; -import featureAbility from '@ohos.ability.featureAbility'; const TAG = "[RDB_JSKITS _TEST]" const CREATE_TABLE_ALL_DATA_TYPE_SQL = "CREATE TABLE IF NOT EXISTS AllDataType " @@ -31,14 +30,12 @@ const STORE_CONFIG = { name: "Predicates.db", } var rdbStore = undefined; -var context = undefined; var DOUBLE_MAX = 9223372036854775807; describe('dataAbilityPredicatesTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') - context = await featureAbility.getContext(); - rdbStore = await dataRdb.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(); @@ -56,7 +53,7 @@ describe('dataAbilityPredicatesTest', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await dataRdb.deleteRdbStore(context, "Predicates.db"); + await dataRdb.deleteRdbStore("Predicates.db"); }) function resultSize(resultSet) { diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreResultSetJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreResultSetJsunit.test.js index feaff8e70b5be43d2a5ebb46bc07d1fbbb97a1c3..81d5189f1e40c308c79bc39ed5e8140b131b3923 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreResultSetJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbStoreResultSetJsunit.test.js @@ -13,8 +13,7 @@ * limitations under the License. */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -import 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_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "data1 text," + "data2 long, " + "data3 double," + "data4 blob)"; @@ -23,13 +22,11 @@ const STORE_CONFIG = { name: "Resultset.db", } var rdbStore = undefined; -var context = undefined; describe('rdbResultSetTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') - context = await ability_featureAbility.getContext(); - rdbStore = await data_rdb.getRdbStore(context, STORE_CONFIG, 1); + rdbStore = await dataRdb.getRdbStore(STORE_CONFIG, 1); await rdbStore.executeSql(CREATE_TABLE_TEST, null); await createTest(); }) @@ -45,7 +42,7 @@ describe('rdbResultSetTest', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await data_rdb.deleteRdbStore(context, "Resultset.db"); + await dataRdb.deleteRdbStore("Resultset.db"); }) //插入数据 async function createTest() { @@ -90,7 +87,7 @@ describe('rdbResultSetTest', function () { */ it('testGetBlob0001', 0, async function (done) { console.log(TAG + "************* testGetBlob0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { { @@ -119,7 +116,7 @@ describe('rdbResultSetTest', function () { */ it('testGetBlob0002', 0, async function (done) { console.log(TAG + "************* testGetBlob0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { { @@ -149,7 +146,7 @@ describe('rdbResultSetTest', function () { */ it('testGetBlob0003', 0, async function (done) { console.log(TAG + "************* testGetBlob0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { { @@ -178,7 +175,7 @@ describe('rdbResultSetTest', function () { */ it('testIsStarted0001', 0, async function (done) { console.log(TAG + "************* testIsStarted0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(false).assertEqual(resultSet.isStarted) @@ -197,7 +194,7 @@ describe('rdbResultSetTest', function () { */ it('testIsStarted0002', 0, async function (done) { console.log(TAG + "************* testIsStarted0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { resultSet.goTo(1) @@ -217,7 +214,7 @@ describe('rdbResultSetTest', function () { */ it('testIsStarted0003', 0, async function (done) { console.log(TAG + "************* testIsStarted0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(true).assertEqual(resultSet.goToNextRow()) @@ -239,7 +236,7 @@ describe('rdbResultSetTest', function () { */ it('testIsStarted0004', 0, async function (done) { console.log(TAG + "************* testIsStarted0004 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(true).assertEqual(resultSet.goToNextRow()) @@ -261,7 +258,7 @@ describe('rdbResultSetTest', function () { */ it('testIsEnded0001', 0, async function (done) { console.log(TAG + "************* testIsEnded0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -281,7 +278,7 @@ describe('rdbResultSetTest', function () { */ it('testIsEnded0002', 0, async function (done) { console.log(TAG + "************* testIsEnded0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(true).assertEqual(resultSet.goToLastRow()) @@ -301,7 +298,7 @@ describe('rdbResultSetTest', function () { */ it('testIsEnded0003', 0, async function (done) { console.log(TAG + "************* testIsEnded0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { resultSet.goToRow(3) @@ -321,7 +318,7 @@ describe('rdbResultSetTest', function () { */ it('testIsEnded0004', 0, async function (done) { console.log(TAG + "************* testIsEnded0004 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { resultSet.goToRow(3) @@ -342,7 +339,7 @@ describe('rdbResultSetTest', function () { */ it('testRowCount0001', 0, async function (done) { console.log(TAG + "************* testRowCount0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(3).assertEqual(resultSet.rowCount) @@ -361,7 +358,7 @@ describe('rdbResultSetTest', function () { */ it('testRowCount0002', 0, async function (done) { console.log(TAG + "************* testRowCount0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) try { @@ -381,7 +378,7 @@ describe('rdbResultSetTest', function () { */ it('testRowCount0003', 0, async function (done) { console.log(TAG + "************* testRowCount0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("data1", "hello"); let resultSet = await rdbStore.query(predicates) try { @@ -401,7 +398,7 @@ describe('rdbResultSetTest', function () { */ it('testRowCount0004', 0, async function (done) { console.log(TAG + "************* testRowCount0004 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("data1", "hello"); predicates.equalTo("data2", 3); let resultSet = await rdbStore.query(predicates) @@ -422,7 +419,7 @@ describe('rdbResultSetTest', function () { */ it('testGetLong0001', 0, async function (done) { console.log(TAG + "************* testGetLong0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { { @@ -449,7 +446,7 @@ describe('rdbResultSetTest', function () { */ it('testGetLong0002', 0, async function (done) { console.log(TAG + "************* testGetLong0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { { @@ -475,7 +472,7 @@ describe('rdbResultSetTest', function () { */ it('testGetLong0003', 0, async function (done) { console.log(TAG + "************* testGetLong0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { { @@ -501,7 +498,7 @@ describe('rdbResultSetTest', function () { */ it('testGetString0001', 0, async function (done) { console.log(TAG + "************* testGetString0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -520,7 +517,7 @@ describe('rdbResultSetTest', function () { */ it('testGetString0002', 0, async function (done) { console.log(TAG + "************* testGetString0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -539,7 +536,7 @@ describe('rdbResultSetTest', function () { */ it('testGetString0003', 0, async function (done) { console.log(TAG + "************* testGetString0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -559,7 +556,7 @@ describe('rdbResultSetTest', function () { */ it('testGetString0004', 0, async function (done) { console.log(TAG + "************* testGetString0004 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -584,7 +581,7 @@ describe('rdbResultSetTest', function () { */ it('testIsClosed0001', 0, async function (done) { console.log(TAG + "************* testIsClosed0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(3).assertEqual(resultSet.rowCount) @@ -603,7 +600,7 @@ describe('rdbResultSetTest', function () { */ it('testIsClosed0002', 0, async function (done) { console.log(TAG + "************* testIsClosed0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(false).assertEqual(resultSet.isClosed) @@ -619,7 +616,7 @@ describe('rdbResultSetTest', function () { */ it('testIsClosed0003', 0, async function (done) { console.log(TAG + "************* testIsClosed0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) expect(false).assertEqual(resultSet.isClosed) @@ -637,7 +634,7 @@ describe('rdbResultSetTest', function () { it('testColumnCount0001', 0, async function (done) { console.log(TAG + "************* testColumnCount0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(5).assertEqual(resultSet.columnCount); resultSet = null; @@ -654,7 +651,7 @@ describe('rdbResultSetTest', function () { it('testColumnCount0002', 0, async function (done) { console.log(TAG + "************* testColumnCount0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) expect(0).assertEqual(resultSet.columnCount); @@ -672,7 +669,7 @@ describe('rdbResultSetTest', function () { it('testRowIndex0001', 0, async function (done) { console.log(TAG + "************* testRowIndex0001 *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -693,7 +690,7 @@ describe('rdbResultSetTest', function () { it('testRowIndex0002', 0, async function (done) { console.log(TAG + "************* testRowIndex0002 *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -714,7 +711,7 @@ describe('rdbResultSetTest', function () { it('testGoToFirstRow0001', 0, async function (done) { console.log(TAG + "************* testGoToFirstRow0001 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -735,7 +732,7 @@ describe('rdbResultSetTest', function () { it('testGoToFirstRow0002', 0, async function (done) { console.log(TAG + "************* testGoToFirstRow0002 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) try { @@ -756,7 +753,7 @@ describe('rdbResultSetTest', function () { it('testGoToFirstRow0003', 0, async function (done) { console.log(TAG + "************* testGoToFirstRow0003 start *************"); - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) try { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -778,7 +775,7 @@ describe('rdbResultSetTest', function () { it('testGoToLastRow0001', 0, async function (done) { console.log(TAG + "************* testGoToLastRow0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -797,7 +794,7 @@ describe('rdbResultSetTest', function () { it('testGoToLastRow0002', 0, async function (done) { console.log(TAG + "************* testGoToLastRow0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -817,7 +814,7 @@ describe('rdbResultSetTest', function () { it('testGoToLastRow0003', 0, async function (done) { console.log(TAG + "************* testGoToLastRow0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -838,7 +835,7 @@ describe('rdbResultSetTest', function () { it('testGoToNextRow0001', 0, async function (done) { console.log(TAG + "************* testGoToNextRow0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToNextRow()) @@ -857,7 +854,7 @@ describe('rdbResultSetTest', function () { it('testGoToNextRow0002', 0, async function (done) { console.log(TAG + "************* testGoToNextRow0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -877,7 +874,7 @@ describe('rdbResultSetTest', function () { it('testGoToNextRow0003', 0, async function (done) { console.log(TAG + "************* testGoToNextRow0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -899,7 +896,7 @@ describe('rdbResultSetTest', function () { it('testGoToNextRow0004', 0, async function (done) { console.log(TAG + "************* testGoToNextRow0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -919,7 +916,7 @@ describe('rdbResultSetTest', function () { it('testGoToPreviousRow0001', 0, async function (done) { console.log(TAG + "************* testGoToPreviousRow0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(false).assertEqual(resultSet.goToPreviousRow()) @@ -938,7 +935,7 @@ describe('rdbResultSetTest', function () { it('testGoToPreviousRow0002', 0, async function (done) { console.log(TAG + "************* testGoToPreviousRow0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -958,7 +955,7 @@ describe('rdbResultSetTest', function () { it('testGoToPreviousRow0003', 0, async function (done) { console.log(TAG + "************* testGoToPreviousRow0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -979,7 +976,7 @@ describe('rdbResultSetTest', function () { it('testGoToPreviousRow0004', 0, async function (done) { console.log(TAG + "************* testGoToPreviousRow0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -999,7 +996,7 @@ describe('rdbResultSetTest', function () { it('testGoTo0001', 0, async function (done) { console.log(TAG + "************* testGoTo0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1020,7 +1017,7 @@ describe('rdbResultSetTest', function () { it('testGoTo0002', 0, async function (done) { console.log(TAG + "************* testGoTo0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -1041,7 +1038,7 @@ describe('rdbResultSetTest', function () { it('testGoTo0003', 0, async function (done) { console.log(TAG + "************* testGoTo0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1063,7 +1060,7 @@ describe('rdbResultSetTest', function () { it('testGoTo0004', 0, async function (done) { console.log(TAG + "************* testGoTo0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -1084,7 +1081,7 @@ describe('rdbResultSetTest', function () { it('testGoToRow0001', 0, async function (done) { console.log(TAG + "************* testGoToRow0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1105,7 +1102,7 @@ describe('rdbResultSetTest', function () { it('testGoToRow0002', 0, async function (done) { console.log(TAG + "************* testGoToRow0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -1126,7 +1123,7 @@ describe('rdbResultSetTest', function () { it('testGoToRow0003', 0, async function (done) { console.log(TAG + "************* testGoToRow0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1149,7 +1146,7 @@ describe('rdbResultSetTest', function () { it('testGoToRow0004', 0, async function (done) { console.log(TAG + "************* testGoToRow0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -1170,7 +1167,7 @@ describe('rdbResultSetTest', function () { it('testIsAtFirstRow0001', 0, async function (done) { console.log(TAG + "************* testIsAtFirstRow0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1190,7 +1187,7 @@ describe('rdbResultSetTest', function () { it('testIsAtFirstRow0002', 0, async function (done) { console.log(TAG + "************* testIsAtFirstRow0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -1210,7 +1207,7 @@ describe('rdbResultSetTest', function () { it('testIsAtFirstRow0003', 0, async function (done) { console.log(TAG + "************* testIsAtFirstRow0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1231,7 +1228,7 @@ describe('rdbResultSetTest', function () { it('testIsAtFirstRow0004', 0, async function (done) { console.log(TAG + "************* testIsAtFirstRow0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -1251,7 +1248,7 @@ describe('rdbResultSetTest', function () { it('testIsAtFirstRow0005', 0, async function (done) { console.log(TAG + "************* testIsAtFirstRow0005 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goTo(1) @@ -1272,7 +1269,7 @@ describe('rdbResultSetTest', function () { it('testIsAtFirstRow0006', 0, async function (done) { console.log(TAG + "************* testIsAtFirstRow0006 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goTo(1) @@ -1293,7 +1290,7 @@ describe('rdbResultSetTest', function () { it('testIsAtLastRow0001', 0, async function (done) { console.log(TAG + "************* testIsAtLastRow0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1313,7 +1310,7 @@ describe('rdbResultSetTest', function () { it('testIsAtLastRow0002', 0, async function (done) { console.log(TAG + "************* testIsAtLastRow0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) { @@ -1333,7 +1330,7 @@ describe('rdbResultSetTest', function () { it('testIsAtLastRow0003', 0, async function (done) { console.log(TAG + "************* testIsAtLastRow0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1354,7 +1351,7 @@ describe('rdbResultSetTest', function () { it('testIsAtLastRow0004', 0, async function (done) { console.log(TAG + "************* testIsAtLastRow0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToLastRow()) @@ -1374,7 +1371,7 @@ describe('rdbResultSetTest', function () { it('testIsAtLastRow0005', 0, async function (done) { console.log(TAG + "************* testIsAtLastRow0005 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goToRow(2) @@ -1395,7 +1392,7 @@ describe('rdbResultSetTest', function () { it('testGetDouble0001', 0, async function (done) { console.log(TAG + "************* testGetDouble0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goTo(1) @@ -1416,7 +1413,7 @@ describe('rdbResultSetTest', function () { it('testGetDouble0002', 0, async function (done) { console.log(TAG + "************* testGetDouble0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goTo(2) @@ -1437,7 +1434,7 @@ describe('rdbResultSetTest', function () { it('testGetDouble0003', 0, async function (done) { console.log(TAG + "************* testGetDouble0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goTo(3) @@ -1458,7 +1455,7 @@ describe('rdbResultSetTest', function () { it('testGetDouble0004', 0, async function (done) { console.log(TAG + "************* testGetDouble0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goTo(1) @@ -1479,7 +1476,7 @@ describe('rdbResultSetTest', function () { it('testIsColumnNull0001', 0, async function (done) { console.log(TAG + "************* testIsColumnNull0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1502,7 +1499,7 @@ describe('rdbResultSetTest', function () { it('testIsColumnNull0002', 0, async function (done) { console.log(TAG + "************* testIsColumnNull0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { expect(true).assertEqual(resultSet.goToFirstRow()) @@ -1525,7 +1522,7 @@ describe('rdbResultSetTest', function () { it('testIsColumnNull0003', 0, async function (done) { console.log(TAG + "************* testIsColumnNull0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goToRow(5) @@ -1544,7 +1541,7 @@ describe('rdbResultSetTest', function () { it('testIsColumnNull0004', 0, async function (done) { console.log(TAG + "************* testIsColumnNull0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) { resultSet.goToRow(2) @@ -1564,7 +1561,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnIndex0001', 0, async function (done) { console.log(TAG + "************* testGetColumnIndex0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(true).assertEqual(resultSet.goToFirstRow()) expect(1).assertEqual(resultSet.getColumnIndex("data1")) @@ -1583,7 +1580,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnIndex0002', 0, async function (done) { console.log(TAG + "************* testGetColumnIndex0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) expect(-1).assertEqual(resultSet.getColumnIndex("data1")) @@ -1602,7 +1599,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnIndex0003', 0, async function (done) { console.log(TAG + "************* testGetColumnIndex0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(-1).assertEqual(resultSet.getColumnIndex("dataX")) @@ -1620,7 +1617,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnIndex0004', 0, async function (done) { console.log(TAG + "************* testGetColumnIndex0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(-1).assertEqual(resultSet.getColumnIndex("")) @@ -1638,7 +1635,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnName0001', 0, async function (done) { console.log(TAG + "************* testGetColumnIndex0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect("data1").assertEqual(resultSet.getColumnName(1)) @@ -1658,7 +1655,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnName0002', 0, async function (done) { console.log(TAG + "************* testGetColumnName0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) @@ -1679,7 +1676,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnName0003', 0, async function (done) { console.log(TAG + "************* testGetColumnName0003 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect("").assertEqual(resultSet.getColumnName(10)) @@ -1698,7 +1695,7 @@ describe('rdbResultSetTest', function () { it('testGetColumnName0004', 0, async function (done) { console.log(TAG + "************* testGetColumnName0004 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) @@ -1718,7 +1715,7 @@ describe('rdbResultSetTest', function () { it('testClose0001', 0, async function (done) { console.log(TAG + "************* testClose0001 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) resultSet.goToRow(1) resultSet.close() @@ -1738,7 +1735,7 @@ describe('rdbResultSetTest', function () { it('testClose0002', 0, async function (done) { console.log(TAG + "************* testClose0002 start *************"); { - let predicates = await new data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "wangwu"); let resultSet = await rdbStore.query(predicates) resultSet.close() diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreDeleteJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreDeleteJsunit.test.js index 240b7843113b5609840cdc1773547f1f5ea18c3f..50d33dfad16fb06582d0754d8d374fa19f8e0583 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreDeleteJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreDeleteJsunit.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_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; @@ -23,7 +22,6 @@ const STORE_CONFIG = { name: "Delete.db", } var rdbStore = undefined; -var context = undefined; describe('rdbStoreDeleteTest', function () { beforeAll(function () { @@ -32,8 +30,7 @@ describe('rdbStoreDeleteTest', function () { beforeEach(async function () { console.info(TAG + 'beforeEach') - 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_TEST, null); }) @@ -41,7 +38,7 @@ describe('rdbStoreDeleteTest', function () { console.info(TAG + 'afterEach') await rdbStore.executeSql("DELETE FROM test"); rdbStore = null - await ohos_data_rdb.deleteRdbStore(context, "Delete.db"); + await dataRdb.deleteRdbStore("Delete.db"); }) afterAll(async function () { @@ -86,7 +83,7 @@ describe('rdbStoreDeleteTest', function () { } //删除 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let deletePromise = rdbStore.delete(predicates) deletePromise.then(async (ret) => { expect(3).assertEqual(ret) @@ -137,7 +134,7 @@ describe('rdbStoreDeleteTest', function () { } //删除 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "zhangsan") let deletePromise = rdbStore.delete(predicates) deletePromise.then(async (ret) => { @@ -180,14 +177,14 @@ describe('rdbStoreDeleteTest', function () { } //删除前查询 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("age", 28) let resultSet = await rdbStore.query(predicates) expect(1).assertEqual(resultSet.rowCount) } //删除 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("age", 28) let deletePromise = rdbStore.delete(predicates) deletePromise.then(async (ret) => { @@ -200,7 +197,7 @@ describe('rdbStoreDeleteTest', function () { } //删除后查询 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("age", 28) let resultSet = await rdbStore.query(predicates) expect(0).assertEqual(resultSet.rowCount) @@ -246,7 +243,7 @@ describe('rdbStoreDeleteTest', function () { } //删除 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("aaa id", 1) let deletePromise = rdbStore.delete(predicates) deletePromise.then(async (ret) => { @@ -297,7 +294,7 @@ describe('rdbStoreDeleteTest', function () { } //删除 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") predicates.equalTo("name", "lisi") let deletePromise = rdbStore.delete(predicates) deletePromise.then(async (ret) => { @@ -349,7 +346,7 @@ describe('rdbStoreDeleteTest', function () { } //删除 { - let predicates = await new ohos_data_rdb.RdbPredicates("") + let predicates = await new dataRdb.RdbPredicates("") let deletePromise = rdbStore.delete(predicates) deletePromise.then(async (ret) => { console.log(TAG + "delete done: " + ret) diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js index 28f3ee41d9ecb9e2368d72ccf5f334be245d211f..4162a5f107a10d2be534285f8632727949316033 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js @@ -14,8 +14,7 @@ */ 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_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; @@ -25,13 +24,11 @@ const STORE_CONFIG = { } var rdbStore = undefined; -var context = undefined; describe('rdbStoreInsertTest', 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_TEST, null); }) @@ -47,7 +44,7 @@ describe('rdbStoreInsertTest', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await ohos_data_rdb.deleteRdbStore(context, "InsertTest.db"); + await dataRdb.deleteRdbStore("InsertTest.db"); }) console.log(TAG + "*************Unit Test Begin*************"); @@ -88,7 +85,7 @@ describe('rdbStoreInsertTest', function () { await rdbStore.insert("test", valueBucket) } - let predicates = new ohos_data_rdb.RdbPredicates("test"); + let predicates = new dataRdb.RdbPredicates("test"); predicates.equalTo("name", "zhangsan") let resultSet = await rdbStore.query(predicates) try { 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 24336eef04159bdd937128872f777bdd2168cf1c..33ee7b59eba0f1708b1ad2b972d35bf1abb3ceca 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/RdbstoreRdbstoreJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js index 81c7ef7162d7b445434c0e7739e0cc9ca3c69052..7528a5d80045fe8c8ead1c402fb7532db37792ed 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js @@ -14,8 +14,7 @@ */ 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_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; @@ -23,11 +22,9 @@ const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIM const STORE_CONFIG = { name: "rdbstore.db", } -var context = undefined; describe('rdbStoreTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') - context = await ability_featureAbility.getContext(); }) beforeEach(function () { @@ -51,7 +48,7 @@ describe('rdbStoreTest', function () { */ it('testRdbStore0001', 0, async function (done) { console.log(TAG + "************* testRdbStore0001 start *************"); - let storePromise = ohos_data_rdb.getRdbStore(context, STORE_CONFIG, 1); + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 1); storePromise.then(async (store) => { try { await console.log(TAG + "getRdbStore done: " + store); @@ -63,7 +60,7 @@ describe('rdbStoreTest', function () { }) await storePromise storePromise = null - await ohos_data_rdb.deleteRdbStore(context, "rdbstore.db"); + await dataRdb.deleteRdbStore("rdbstore.db"); done(); console.log(TAG + "************* testRdbStore0001 end *************"); }) @@ -75,7 +72,7 @@ describe('rdbStoreTest', function () { */ it('testRdbStore0002', 0, async function (done) { console.log(TAG + "************* testRdbStore0002 start *************"); - let storePromise = ohos_data_rdb.getRdbStore(context, STORE_CONFIG, 2); + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 2); storePromise.then(async (store) => { try { await console.log(TAG + "getRdbStore done: " + store); @@ -88,7 +85,7 @@ describe('rdbStoreTest', function () { }) await storePromise storePromise = null - await ohos_data_rdb.deleteRdbStore(context, "rdbstore.db"); + await dataRdb.deleteRdbStore("rdbstore.db"); done(); console.log(TAG + "************* testRdbStore0002 end *************"); }) @@ -104,7 +101,7 @@ describe('rdbStoreTest', function () { let storeConfig = { name: "/wrong/rdbstore.db", } - let storePromise = ohos_data_rdb.getRdbStore(context, storeConfig, 4); + let storePromise = dataRdb.getRdbStore(storeConfig, 4); storePromise.then(async (ret) => { await console.log(TAG + "getRdbStore done" + ret); expect(null).assertFail(); @@ -124,7 +121,7 @@ describe('rdbStoreTest', function () { it('testRdbStore0004', 0, async function (done) { console.log(TAG + "************* testRdbStore0004 start *************"); - let storePromise = ohos_data_rdb.getRdbStore(context, STORE_CONFIG, 6); + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 6); storePromise.then(async (store) => { try { await store.executeSql(CREATE_TABLE_TEST); @@ -136,7 +133,7 @@ describe('rdbStoreTest', function () { }) await storePromise storePromise = null - await ohos_data_rdb.deleteRdbStore(context, "rdbstore.db"); + await dataRdb.deleteRdbStore("rdbstore.db"); done(); console.log(TAG + "************* testRdbStore0004 end *************"); }) diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreStoreExcuteSqlJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreStoreExcuteSqlJsunit.test.js index 63640620549d7daf88eab9caa88d18ea4e2da138..c35afd6673b803ea69a3aead56c03f4d6ecd1f21 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreStoreExcuteSqlJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreStoreExcuteSqlJsunit.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_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; @@ -23,13 +22,11 @@ const STORE_CONFIG = { name: "ExcuteSqlTest.db", } var rdbStore = undefined; -var context = undefined; describe('rdbStoreInsertTest', 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_TEST, null); }) @@ -45,7 +42,7 @@ describe('rdbStoreInsertTest', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await ohos_data_rdb.deleteRdbStore(context, "ExcuteSqlTest.db"); + await dataRdb.deleteRdbStore("ExcuteSqlTest.db"); }) /** diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js index 7d99f360fa6397f97266360300871b6e2f9ff0fb..ce3da461ec85ea529f81dd7723ec97165de58218 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.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_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT UNIQUE, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; @@ -22,13 +21,11 @@ const STORE_CONFIG = { name: "UpdataTest.db", } var rdbStore = undefined; -var context = undefined; describe('rdbStoreUpdateTest', 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_TEST, null); }) @@ -44,7 +41,7 @@ describe('rdbStoreUpdateTest', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await ohos_data_rdb.deleteRdbStore(context, "UpdataTest.db"); + await dataRdb.deleteRdbStore("UpdataTest.db"); }) /** @@ -81,7 +78,7 @@ describe('rdbStoreUpdateTest', function () { "salary": 200.5, "blobType": u8, } - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") await predicates.equalTo("id", "1") let updatePromise = rdbStore.update(valueBucket, predicates) updatePromise.then(async (ret) => { @@ -95,7 +92,7 @@ describe('rdbStoreUpdateTest', function () { } //查询 { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let resultSet = await rdbStore.query(predicates) expect(true).assertEqual(resultSet.goToFirstRow()) @@ -137,7 +134,7 @@ describe('rdbStoreUpdateTest', function () { "blobType": u8, } { - let predicates = new ohos_data_rdb.RdbPredicates("") + let predicates = new dataRdb.RdbPredicates("") let updatePromise = rdbStore.update(valueBucket, predicates) updatePromise.then(async (ret) => { await console.log(TAG + "update done: " + ret); @@ -148,7 +145,7 @@ describe('rdbStoreUpdateTest', function () { } { const emptyBucket = {}; - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let updatePromise = rdbStore.update(emptyBucket, predicates) updatePromise.then(async (ret) => { await console.log(TAG + "update done: " + ret); @@ -158,7 +155,7 @@ describe('rdbStoreUpdateTest', function () { }) } { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") await predicates.equalTo("aaa", "null") let updatePromise = rdbStore.update(valueBucket, predicates) updatePromise.then(async (ret) => { @@ -191,7 +188,7 @@ describe('rdbStoreUpdateTest', function () { "wrongColumn": 100.5, } { - let predicates = new ohos_data_rdb.RdbPredicates("wrongTable") + let predicates = new dataRdb.RdbPredicates("wrongTable") let updatePromise = rdbStore.update(valueBucket, predicates) updatePromise.then(async (ret) => { await console.log(TAG + "update done: " + ret); @@ -202,7 +199,7 @@ describe('rdbStoreUpdateTest', function () { //await updatePromise } { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") let updatePromise = rdbStore.update(valueBucket, predicates) updatePromise.then(async (ret) => { await console.log(TAG + "update done: " + ret); @@ -234,7 +231,7 @@ describe('rdbStoreUpdateTest', function () { "blobType": u8, } { - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") await predicates.equalTo("aaa", "null") let updatePromise = rdbStore.update(valueBucket, predicates) updatePromise.then(async (ret) => { @@ -247,7 +244,7 @@ describe('rdbStoreUpdateTest', function () { } { const emptyBucket = {}; - let predicates = await new ohos_data_rdb.RdbPredicates("test") + let predicates = await new dataRdb.RdbPredicates("test") await predicates.equalTo("name", "zhangsan") await predicates.equalTo("age", 18) await predicates.equalTo("null", 100.5) 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 index 9e744cb9b275c727d56fec2dc7261a20b891c0b5..e58813134ff6b15f58d123a97cbd1d3db9d44567 100755 --- 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,13 +252,11 @@ 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(); }) }) \ No newline at end of file diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageHelperJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageHelperJsunit.test.js index 0e1a446df2c37bff3c99295f92f25ed5d92d9959..b5d89ba9f3f384cda7223f58e4fa82797c49b66c 100755 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageHelperJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/StorageHelperJsunit.test.js @@ -110,8 +110,8 @@ describe('storageTest', function () { } try { perf.putSync("int", 3); - expect(null).assertFail(); } catch (e) { + expect(null).assertFail(); } })