diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/List.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/List.test.js index 84bcde52bf21fa6139556987a94939085268059f..0fb6fd29d2e8f3e8ecda876c2e4be1da49f0b3c0 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/List.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js index 13b05bad9b3fa290052e6d265175be39844ae6e7..004a2fffb1179baf0db5f7c908b71ed1d0965dc6 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreDistributedJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -309,34 +309,6 @@ describe('rdbStoreDistributedTest', function () { done(); console.info(TAG + "************* testRdbStoreDistributed0011 end *************"); }) - - /** - * @tc.name sync test - * @tc.number SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100 - * @tc.desc sync test - */ - it('SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100', 0, async function (done) { - console.info(TAG + "************* SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100 start *************"); - let config = { - name: "secure.db", - securityLevel: dataRdb.SecurityLevel.S1 - } - await dataRdb.getRdbStoreV9(context, config, 1).then(async (store) => { - let predicates = new dataRdb.RdbPredicatesV9("employee") - predicates = predicates.inDevices("12345678abcd"); - try { - store.sync(dataRdb.SyncMode.SYNC_MODE_PUSH, predicates); - } catch (err) { - expect(null).assertFail(); - } - }).catch((err) => { - expect(null).assertFail(); - }) - await dataRdb.deleteRdbStore(context,"secure.db"); - - done(); - console.info(TAG + "************* SUB_DDM_AppDataFWK_JSRDB_Distributed_syncV9_0100 end *************"); - }) /** * @tc.name sync Callback test diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js index e1968d31f3049e082dab5cab69fd8484ab0a33ab..b66d8290dd89917fd7bc4df65d0115ef6fe65f2d 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -1652,9 +1652,9 @@ describe('rdbResultSetTest', function () { it('testGetColumnIndex0004', 0, async function (done) { console.info(TAG + '************* testGetColumnIndex0004 start *************'); { - let predicates = await new dataRdb.RdbPredicates('test'); - let resultSet = await rdbStore.query(predicates); - expect(-1).assertEqual(resultSet.getColumnIndex('')); + let predicates = await new dataRdb.RdbPredicates('test') + let resultSet = await rdbStore.query(predicates) + expect(-1).assertEqual(resultSet.getColumnIndex('')) resultSet = null; done(); diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js index 9724271606ae6be1389b9087f9f831946e6565dc..adcb59cfcda77b10320eb01e1fa04ec3c0f7a4df 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreDeleteJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js index 440dab92cc93ead9dd569b0b36052d65d939572c..77ff84fb553d2397a561cecdbb94250f73eb399d 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreInsertJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js index 11958df234088c500cbd710a987ab5e1eafb28d3..4ccf8ef005e374a9965391bcfface3b492a8d759 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstorePredicatesComplexFiledJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Huawei Device Co., Ltd. + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import dataRdb from '@ohos.data.rdb'; const TAG = "[RDB_JSKITS_TEST]" diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js index e2e2461fa8847637b413145057251f7b6ec26cb8..527170a95882952c7996597afa504d62e9f508c3 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreQuery.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,7 @@ const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIM const STORE_CONFIG = { name: "Query.db", } -const TEST_BUNDLE_NAME="ohos.acts.relationalStorejstest" +const TEST_BUNDLE_NAME="ohos.acts.rdbjstest" var kvManager = null var kvStore = null diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js index 139d67d08598f1c6bbb660c2c4cd6ee22cd2d505..d0baec0b1345e490d2de8a1d045814bdd18864e1 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreRdbstoreJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js index d6ef99fad522a2806bc103af019d7a5e1ea0f15d..161340b3c828c544cb1a4dd7bd7748ffc442f7f0 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreStoreExcuteSqlJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js index 5c3a89475a354cb1ff4eded1fe75a1b2ba3bc096..0660b3a9801ce2bf717a21f17201b80d60e40156 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js index 07a2387339d39f4a7af0d73c356a4cba1879dad7..b718ec141c5811499677f3dc1619f81086993900 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets index 613bc1a533f2108382318d4342281b1fcebda288..26e665417fee9f94bf10adbc231d0854538a72e9 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/List.test.ets @@ -12,11 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import rdbStoreV9Test from './RdbstoreRdbstoreV9.test.ets' -import rdbStoreDistributedTest from './RdbstoreDistributedEtsunit.test.ets' -import rdbResultSetTest from './RdbstoreResultsetV9Etsunit.test.ets' + +import relationalStoreDistributedTest from './relationalStoreDistributedEtsunit.test.ets' +import relationalStoreTest from './relationalStoreEtsunit.test.ets' +import relationalStoreResultSetTest from './relationalStoreTestResultsetEtsunit.test.ets' export default function testsuite() { - rdbStoreDistributedTest(globalThis.abilityContext) - rdbStoreV9Test(globalThis.abilityContext); - rdbResultSetTest(globalThis.abilityContext) + relationalStoreDistributedTest(globalThis.abilityContext) + relationalStoreTest(globalThis.abilityContext) + relationalStoreResultSetTest(globalThis.abilityContext) } diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreDistributedEtsunit.test.ets similarity index 87% rename from distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets rename to distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreDistributedEtsunit.test.ets index 92e4416d457843e2f2ac74bd61bc95fa740c82b0..236c731dc2e010c0f838ac49fe08125346d5c975 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreDistributedEtsunit.test.ets @@ -1,6 +1,6 @@ /* - * Copyright (C) 2022 Huawei Device Co., Ltd. + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +15,7 @@ */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -import dataRdb from '@ohos.data.rdb'; +import dataRdb from '@ohos.data.relationalStore'; const TAG = "[RDB_JSKITS_TEST_Distributed]" const STORE_NAME = "distributed_rdb.db" @@ -27,20 +27,20 @@ const config = { } 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)" -export default function rdbStoreDistributedTest(context) { -describe('rdbStoreDistributedTest', function () { +export default function relationalStoreDistributedTest(context) { +describe('relationalStoreDistributedTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') }) beforeEach(async function () { - rdbStore = await dataRdb.getRdbStoreV9(context, config, 1); + rdbStore = await dataRdb.getRdbStore(context, config); await rdbStore.executeSql(CREATE_TABLE_TEST, null) console.info(TAG + 'beforeEach') }) afterEach(async function () { - await dataRdb.deleteRdbStoreV9(context, STORE_NAME); + await dataRdb.deleteRdbStore(context, STORE_NAME); console.info(TAG + 'afterEach') }) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreRdbstoreV9.test.ets b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEtsunit.test.ets similarity index 62% rename from distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreRdbstoreV9.test.ets rename to distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEtsunit.test.ets index d03d80cde92bdbb689b0cff71d67dabfe724b6ce..dfe4bc2ea6ddaca7c1709e324a1763da8d119401 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreRdbstoreV9.test.ets +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEtsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Huawei Device Co., Ltd. + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -import dataRdb from '@ohos.data.rdb'; +import dataRdb from '@ohos.data.relationalStore'; 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,8 +23,8 @@ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } -export default function rdbStoreV9Test(context){ -describe('rdbStoreV9Test', function () { +export default function relationalStoreTest(context){ +describe('relationalStoreTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') }) @@ -44,18 +44,18 @@ describe('rdbStoreV9Test', function () { console.log(TAG + "*************Unit Test Begin*************"); /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S1 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0100 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S1 + * @tc.name rdb store getRdbStore with securityLevel S1 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 + * @tc.desc rdb store getRdbStore with securityLevel S1 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0100 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S1 } - let storePromise = dataRdb.getRdbStoreV9(context, config, 1); + let storePromise = dataRdb.getRdbStore(context, config); storePromise.then(async (store) => { try { await store.executeSql(CREATE_TABLE_TEST); @@ -69,22 +69,22 @@ describe('rdbStoreV9Test', function () { storePromise = null await dataRdb.deleteRdbStore(context,"secure.db"); done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0100 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 end *************"); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S2 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0200 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S2 + * @tc.name rdb store getRdbStore with securityLevel S2 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 + * @tc.desc rdb store getRdbStore with securityLevel S2 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0200', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0200 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S2 } - let storePromise = dataRdb.getRdbStoreV9(context, config, 1); + let storePromise = dataRdb.getRdbStore(context, config); storePromise.then(async (store) => { try { await store.executeSql(CREATE_TABLE_TEST); @@ -98,22 +98,22 @@ describe('rdbStoreV9Test', function () { storePromise = null await dataRdb.deleteRdbStore(context,"secure.db"); done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0200 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 end *************"); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S3 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0300 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S3 + * @tc.name rdb store getRdbStore with securityLevel S3 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 + * @tc.desc rdb store getRdbStore with securityLevel S3 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0300', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0300 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S3 } - let storePromise = dataRdb.getRdbStoreV9(context, config, 1); + let storePromise = dataRdb.getRdbStore(context, config); storePromise.then(async (store) => { try { await store.executeSql(CREATE_TABLE_TEST); @@ -127,22 +127,22 @@ describe('rdbStoreV9Test', function () { storePromise = null await dataRdb.deleteRdbStore(context,"secure.db"); done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0300 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 end *************"); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S4 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0400 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S4 + * @tc.name rdb store getRdbStore with securityLevel S4 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 + * @tc.desc rdb store getRdbStore with securityLevel S4 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0400', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0400 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S4 } - let storePromise = dataRdb.getRdbStoreV9(context, config, 1); + let storePromise = dataRdb.getRdbStore(context, config); storePromise.then(async (store) => { try { await store.executeSql(CREATE_TABLE_TEST); @@ -156,22 +156,22 @@ describe('rdbStoreV9Test', function () { storePromise = null await dataRdb.deleteRdbStore(context,"secure.db"); done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_PROMISE_0400 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 end *************"); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S1 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0100 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S1 + * @tc.name rdb store getRdbStore with securityLevel S1 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 + * @tc.desc rdb store getRdbStore with securityLevel S1 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0100 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S1 } - dataRdb.getRdbStoreV9(context, config, 1, async (err,data) => { + dataRdb.getRdbStore(context, config, async (err,data) => { if(err != null){ console.info(TAG + "get rdb store error" + err.message) expect(null).assertFail(); @@ -181,24 +181,24 @@ describe('rdbStoreV9Test', function () { dataRdb.deleteRdbStore(context,"secure.db").then(()=>{ console.info(TAG + "Delete rdbstore success") done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0100 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 end *************"); }) }); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S2 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0200 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S2 + * @tc.name rdb store getRdbStore with securityLevel S2 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 + * @tc.desc rdb store getRdbStore with securityLevel S2 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0200', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0200 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S2 } - dataRdb.getRdbStoreV9(context, config, 1,async (err,data) => { + dataRdb.getRdbStore(context, config,async (err,data) => { if(err != null){ console.info(TAG + "get rdb store error") expect(null).assertFail(); @@ -207,24 +207,24 @@ describe('rdbStoreV9Test', function () { } dataRdb.deleteRdbStore(context, "secure.db").then(() => { done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0200 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 end *************"); }) }); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S3 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0300 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S3 + * @tc.name rdb store getRdbStore with securityLevel S3 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 + * @tc.desc rdb store getRdbStore with securityLevel S3 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0300', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0300 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S3 } - dataRdb.getRdbStoreV9(context, config, 1,async (err,data) => { + dataRdb.getRdbStore(context, config,async (err,data) => { if(err != null){ console.info(TAG + "get rdb store error") expect(null).assertFail(); @@ -233,24 +233,24 @@ describe('rdbStoreV9Test', function () { } dataRdb.deleteRdbStore(context, "secure.db").then(() => { done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0300 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 end *************"); }) }); }) /** - * @tc.name rdb store getRdbStoreV9 with securityLevel S4 - * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0400 - * @tc.desc rdb store getRdbStoreV9 with securityLevel S4 + * @tc.name rdb store getRdbStore with securityLevel S4 + * @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 + * @tc.desc rdb store getRdbStore with securityLevel S4 * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0400', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0400 start *************"); + it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S4 } - dataRdb.getRdbStoreV9(context, config, 1,async (err,data) => { + dataRdb.getRdbStore(context, config,async (err,data) => { if(err != null){ console.info(TAG + "get rdb store error") expect(null).assertFail(); @@ -259,53 +259,53 @@ describe('rdbStoreV9Test', function () { } dataRdb.deleteRdbStore(context,"secure.db").then(() => { done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTOREV9_CALLBACK_0400 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 end *************"); }) }); }) /** - * @tc.name rdb store deleteRdbStoreV9 - * @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_PROMISE_0100 - * @tc.desc rdb store deleteRdbStoreV9 + * @tc.name rdb store deleteRdbStore + * @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 + * @tc.desc rdb store deleteRdbStore * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_PROMISE_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_PROMISE_0100 start *************"); + it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S4 } let deleteResult = false - await dataRdb.getRdbStoreV9(context, config, 1).then(async (store) => { + await dataRdb.getRdbStore(context, config).then(async (store) => { console.info(TAG + "create table success") }) - await dataRdb.deleteRdbStoreV9(context,"secure.db").then(() => { + await dataRdb.deleteRdbStore(context,"secure.db").then(() => { deleteResult = true console.info(`${TAG} delete rdb store success,result is ${deleteResult}`) }); expect(deleteResult).assertTrue(); done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_PROMISE_0100 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 end *************"); }) /** - * @tc.name rdb store deleteRdbStoreV9 - * @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_CALLBACK_0100 - * @tc.desc rdb store deleteRdbStoreV9 + * @tc.name rdb store deleteRdbStore + * @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 + * @tc.desc rdb store deleteRdbStore * @tc.require: I5PIL6 */ - it('SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_CALLBACK_0100', 0, async function (done) { - console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_CALLBACK_0100 start *************"); + it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100', 0, async function (done) { + console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 start *************"); let config = { name: "secure.db", securityLevel: dataRdb.SecurityLevel.S1 } let deleteResult = false - await dataRdb.getRdbStoreV9(context, config, 1).then(async (store) => { + await dataRdb.getRdbStore(context, config).then(async (store) => { console.info(TAG + "create rdb store success") }) - dataRdb.deleteRdbStoreV9(context,"secure.db", (err, data) => { + dataRdb.deleteRdbStore(context,"secure.db", (err, data) => { if(err == undefined){ deleteResult = true console.info(`${TAG} delete rdb store success,result is ${deleteResult}`) @@ -315,7 +315,7 @@ describe('rdbStoreV9Test', function () { await sleep(1000) expect(deleteResult).assertTrue(); done(); - console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTOREV9_CALLBACK_0100 end *************"); + console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 end *************"); }) console.log(TAG + "*************Unit Test End*************"); }) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreTestResultsetEtsunit.test.ets similarity index 71% rename from distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets rename to distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreTestResultsetEtsunit.test.ets index 8ab1090c6299813110144c786005611539ed1190..defa1be87c521d3f7dfd32170db16200157f8f75 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreTestResultsetEtsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Huawei Device Co., Ltd. + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -import dataRdb from '@ohos.data.rdb' +import dataRdb from '@ohos.data.relationalStore' 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)'; @@ -25,11 +25,11 @@ const STORE_CONFIG = { const COLOUNM_NAMES = ["id","data1","data2","data3","data4"]; var rdbStore = undefined; -export default function rdbResultSetTestV9(context) { -describe('rdbResultSetTestV9', function () { +export default function relationalStoreResultSetTest(context) { +describe('relationalStoreResultSetTest', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') - rdbStore = await dataRdb.getRdbStoreV9(context, STORE_CONFIG, 1); + rdbStore = await dataRdb.getRdbStore(context, STORE_CONFIG); await rdbStore.executeSql(CREATE_TABLE_TEST, null); await createTest(); }) @@ -45,7 +45,7 @@ describe('rdbResultSetTestV9', function () { afterAll(async function () { console.info(TAG + 'afterAll') rdbStore = null - await dataRdb.deleteRdbStoreV9(context, 'Resultset.db'); + await dataRdb.deleteRdbStore(context, 'Resultset.db'); }) //插入数据 async function createTest() { @@ -84,32 +84,32 @@ describe('rdbResultSetTestV9', function () { } /** - * @tc.name resultSetV9 getBlob normal test - * @tc.number SUB_DDM_RELATIONALETS_RESULTSETV9_0010 - * @tc.desc resultSetV9 getBlob normal test + * @tc.name resultSet getBlob normal test + * @tc.number SUB_DDM_RELATIONALETS_RESULTSET_0010 + * @tc.desc resultSet getBlob normal test */ - it('SUB_DDM_RELATIONALETS_RESULTSETV9_0010', 0, async function (done) { - console.info(TAG + '************* SUB_DDM_RELATIONALETS_RESULTSETV9_0010 start *************'); - let predicates = await new dataRdb.RdbPredicatesV9('test') - let resultSetV9 = await rdbStore.query(predicates) + it('SUB_DDM_RELATIONALETS_RESULTSET_0010', 0, async function (done) { + console.info(TAG + '************* SUB_DDM_RELATIONALETS_RESULTSET_0010 start *************'); + let predicates = await new dataRdb.RdbPredicates('test') + let resultSet = await rdbStore.query(predicates) try { { - expect(true).assertEqual(resultSetV9.goToFirstRow()) - const id = resultSetV9.getLong(resultSetV9.getColumnIndex('id')) - const data4 = resultSetV9.getBlob(resultSetV9.getColumnIndex('data4')) + expect(true).assertEqual(resultSet.goToFirstRow()) + const id = resultSet.getLong(resultSet.getColumnIndex('id')) + const data4 = resultSet.getBlob(resultSet.getColumnIndex('data4')) console.info(TAG + 'id=' + id + ', data4=' + data4); expect(1).assertEqual(data4[0]); expect(2).assertEqual(data4[1]); expect(3).assertEqual(data4[2]); } - resultSetV9.close(); - expect(true).assertEqual(resultSetV9.isClosed) + resultSet.close(); + expect(true).assertEqual(resultSet.isClosed) } catch (e) { expect(null).assertFail(); } - resultSetV9 = null + resultSet = null done(); - console.info(TAG + '************* SUB_DDM_RELATIONALETS_RESULTSETV9_0010 end *************'); + console.info(TAG + '************* SUB_DDM_RELATIONALETS_RESULTSET_0010 end *************'); }) console.info(TAG + '*************Unit Test End*************'); }) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/module.json b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/module.json index 64c6beb1bfbdfa33cd50039d1426597c40cfc292..8ff8ddf62ede3b6a85ce3e90b2471261cb23ece7 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/module.json +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/module.json @@ -17,11 +17,11 @@ "pages": "$profile:main_pages", "uiSyntax": "ets", "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "false" - } - ], + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], "abilities": [ { "name": "ohos.acts.RelationalStoreStage.MainAbility",