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 dd77efee3ea8f5eb870542a233af12689cc132f4..457332ec06f09521d58987b4689e56c4e10b3c15 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 @@ -341,9 +341,9 @@ describe('rdbStoreDistributedTest', function () { * @tc.number SUB_DDM_AppDataFWK_JSRDB_Distributed_012 * @tc.desc subscribe test */ - it('testRdbStoreDistributed0012', 0, async function (done) { + it('testRdbStoreDistributed0012', 0, async function (done) { console.info(TAG + "************* testRdbStoreDistributed0012 start *************"); - rdbStore.on("dataChange", (device) => { + rdbStore.on("dataChange", dataRdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (device) => { console.info(TAG + device + " dataChange"); }); console.info(TAG + "on dataChange success"); @@ -359,7 +359,7 @@ describe('rdbStoreDistributedTest', function () { */ it('testRdbStoreDistributed0013', 0, async function (done) { console.info(TAG + "************* testRdbStoreDistributed0013 start *************"); - rdbStore.off("dataChange", (device) => { + rdbStore.off("dataChange", dataRdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (device) => { console.info(TAG + device + " dataChange"); }); console.info(TAG + "off dataChange success"); diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js index 57338fe921149490f71a76a2b300e01ca8768bc6..32e72b05ba3636fe005640c04c666a6f1d8e737d 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js @@ -168,14 +168,17 @@ describe('rdbEncryptTest', function () { * @tc.number SUB_DDM_RDB_JS_RdbEncryptTest_0040 * @tc.desc RDB Encrypt function test */ - it('RdbEncryptTest_0040', 0, async function (done) { + it('RdbEncryptTest_0040', 0, async function (done) { console.info(TAG + "************* RdbEncryptTest_0040 start *************") context = ability_featureAbility.getContext() rdbStore = await CreatRdbStore(context, STORE_CONFIG_ENCRYPT) rdbStore = null - rdbStore = await CreatRdbStore(context, STORE_CONFIG_WRONG) - expect(rdbStore).assertNull - + try { + rdbStore = await CreatRdbStore(context, STORE_CONFIG_WRONG) + } catch (err) { + console.info(TAG + `catch err: ` + err) + expect(err).assertTrue + } done() console.info(TAG + "************* RdbEncryptTest_0040 end *************") }) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js index 01127658d510b0fd914a00818b106d0ae6a817dd..b796590f13b6fd1005119db1e96eb9b925474e37 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreDistributedJsunit.test.js @@ -343,9 +343,9 @@ describe('relationalStoreDistributedTest', function () { * @tc.number SUB_DDM_AppDataFWK_JSRelationalStore_Distributed_012 * @tc.desc subscribe test */ - it('testRdbStoreDistributed0012', 0, async function (done) { + it('testRdbStoreDistributed0012', 0, async function (done) { console.info(TAG + "************* testRdbStoreDistributed0012 start *************"); - rdbStore.on("dataChange", (device) => { + rdbStore.on("dataChange", data_Rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (device) => { console.info(TAG + device + " dataChange"); }); console.info(TAG + "on dataChange success"); @@ -361,7 +361,7 @@ describe('relationalStoreDistributedTest', function () { */ it('testRdbStoreDistributed0013', 0, async function (done) { console.info(TAG + "************* testRdbStoreDistributed0013 start *************"); - rdbStore.off("dataChange", (device) => { + rdbStore.off("dataChange", data_Rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (device) => { console.info(TAG + device + " dataChange"); }); console.info(TAG + "off dataChange success"); diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreEncryptionJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreEncryptionJsunit.test.js index 1777b0ad3fa7f99de4ef4a5368ae96c0b11b8281..a6be9c8549410f8710270367d047981422523e06 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreEncryptionJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreEncryptionJsunit.test.js @@ -171,14 +171,18 @@ describe('relationalStoreEncryptTest', function () { * @tc.number SUB_DDM_RelationalStore_JS_RdbEncryptTest_0040 * @tc.desc RelationalStore Encrypt function test */ - it('RdbEncryptTest_0040', 0, async function (done) { + it('RdbEncryptTest_0040', 0, async function (done) { console.info(TAG + "************* RdbEncryptTest_0040 start *************") context = ability_featureAbility.getContext() rdbStore = await CreatRdbStore(context, STORE_CONFIG_ENCRYPT) rdbStore = null - rdbStore = await CreatRdbStore(context, STORE_CONFIG_WRONG) - expect(rdbStore).assertNull - + try { + rdbStore = await CreatRdbStore(context, STORE_CONFIG_WRONG) + } catch (err) { + console.info(TAG + `catch err: err.code= ${err.code}, message = ${err.message}`) + expect(err.code === 14800000).assertTrue + } + done() console.info(TAG + "************* RdbEncryptTest_0040 end *************") })