diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js index e112bc9e652dcb1bd82e0474aba380199e1828e8..258a7f423dd587c5a814bdce2ad2848b48d880a4 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js @@ -1294,47 +1294,47 @@ describe('SingleKvStorePromiseTest', function () { }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 * @tc.desc Test Js Api SingleKvStore.PutBatch() testcase 001 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStore.PutBatch() testcase 001 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100'); + it('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100'); try { let entries = putBatchString(10, 'batch_test_string_key'); - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 entries: ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 entries: ' + JSON.stringify(entries)); await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 putBatch success'); expect(err == undefined).assertTrue(); await kvStore.getEntries('batch_test_string_key').then((entrys) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 getEntries success'); - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 getEntries success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 ' + JSON.stringify(entries)); expect(entrys.length == 10).assertTrue(); expect(entrys[0].value.value == 'batch_test_string_value').assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0100 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 * @tc.desc Test Js Api SingleKvStore.PutBatch() testcase 002 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStore.PutBatch() testcase 002 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200'); + it('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200'); try { let entries = []; for (var i = 0; i < 10; i++) { @@ -1348,37 +1348,37 @@ describe('SingleKvStorePromiseTest', function () { } entries.push(entry); } - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 entries: ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 entries: ' + JSON.stringify(entries)); await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 putBatch success'); expect(err == undefined).assertTrue(); await kvStore.getEntries('batch_test_number_key').then((entrys) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 getEntries success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 getEntries success'); expect(entrys.length == 10).assertTrue(); expect(entrys[0].value.value == 222).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0200 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0200 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 * @tc.desc Test Js Api SingleKvStore.PutBatch() testcase 003 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStore.PutBatch() testcase 003 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300'); + it('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300'); try { let entries = []; for (var i = 0; i < 10; i++) { @@ -1392,37 +1392,37 @@ describe('SingleKvStorePromiseTest', function () { } entries.push(entry); } - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 entries: ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 entries: ' + JSON.stringify(entries)); await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 putBatch success'); expect(err == undefined).assertTrue(); await kvStore.getEntries('batch_test_number_key').then((entrys) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 getEntries success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 getEntries success'); expect(entrys.length == 10).assertTrue(); expect(entrys[0].value.value == 2.0).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0300 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0300 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 * @tc.desc Test Js Api SingleKvStore.PutBatch() testcase 004 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStore.PutBatch() testcase 004 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400'); + it('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400'); try { let entries = []; for (var i = 0; i < 10; i++) { @@ -1436,37 +1436,37 @@ describe('SingleKvStorePromiseTest', function () { } entries.push(entry); } - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 entries: ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 entries: ' + JSON.stringify(entries)); await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 putBatch success'); expect(err == undefined).assertTrue(); await kvStore.getEntries('batch_test_number_key').then((entrys) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 getEntries success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 getEntries success'); expect(entrys.length == 10).assertTrue(); expect(entrys[0].value.value == 2.00).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0400 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0400 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 * @tc.desc Test Js Api SingleKvStore.PutBatch() testcase 005 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStore.PutBatch() testcase 005 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500'); + it('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500'); try { var bo = false; let entries = []; @@ -1481,37 +1481,37 @@ describe('SingleKvStorePromiseTest', function () { } entries.push(entry); } - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 entries: ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 entries: ' + JSON.stringify(entries)); await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 putBatch success'); expect(err == undefined).assertTrue(); await kvStore.getEntries('batch_test_bool_key').then((entrys) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 getEntries success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 getEntries success'); expect(entrys.length == 10).assertTrue(); expect(entrys[0].value.value == bo).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0500 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0500 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 * @tc.desc Test Js Api SingleKvStore.PutBatch() testcase 006 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStore.PutBatch() testcase 006 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600'); + it('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600'); try { var arr = new Uint8Array([21,31]); let entries = []; @@ -1526,24 +1526,24 @@ describe('SingleKvStorePromiseTest', function () { } entries.push(entry); } - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 entries: ' + JSON.stringify(entries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 entries: ' + JSON.stringify(entries)); await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 putBatch success'); expect(err == undefined).assertTrue(); await kvStore.getEntries('batch_test_bool_key').then((entrys) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 getEntries success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 getEntries success'); expect(entrys.length == 10).assertTrue(); expect(entrys[0].value.value.toString() == arr.toString()).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 getEntries fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0600 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_PUTBATCH_PROMISE_0600 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); @@ -2039,43 +2039,43 @@ describe('SingleKvStorePromiseTest', function () { }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0200 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0200 * @tc.desc Test Js Api SingleKvStoreCommit testcase 002 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreCommit testcase 002 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0200', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0200'); + it('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0200', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0200'); try { await kvStore.commit('test_string').then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0200 commit success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0200 commit success'); expect(null).assertFail(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0200 commit fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0200 commit fail ' + `, error code is ${err.code}, message is ${err.message}`); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0200 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0200 e ' + `, error code is ${e.code}, message is ${e.message}`); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0300 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0300 * @tc.desc Test Js Api SingleKvStoreCommit testcase 003 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreCommit testcase 003 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0300', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0300'); + it('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0300', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0300'); try { await kvStore.commit(2.000).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0300 commit success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0300 commit success'); expect(null).assertFail(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0300 commit fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0300 commit fail ' + `, error code is ${err.code}, message is ${err.message}`); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0300 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0300 e ' + `, error code is ${e.code}, message is ${e.message}`); } done(); }) @@ -2420,47 +2420,45 @@ describe('SingleKvStorePromiseTest', function () { }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0100 * @tc.desc Test Js Api SingleKvStoreGetSecurityLevel testcase 001 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreGetSecurityLevel testcase 001 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0100', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0100'); try { await kvStore.getSecurityLevel().then((data) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 getSecurityLevel success'); - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 getSecurityLevel success: ' + data); - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 getSecurityLevel success: ' + factory.SecurityLevel.S2); + console.info(`SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0100 getSecurityLevel success, result is ${data}, SecurityLevel is ${factory.SecurityLevel.S2}`); expect(data == factory.SecurityLevel.S2).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 getSecurityLevel fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0100 getSecurityLevel fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0100 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0200 * @tc.desc Test Js Api SingleKvStoreGetSecurityLevel testcase 002 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreGetSecurityLevel testcase 002 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0200', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0200'); try { await kvStore.getSecurityLevel(1).then((data) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 getSecurityLevel success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0200 getSecurityLevel success'); expect(null).assertFail(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 getSecurityLevel fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0200 getSecurityLevel fail ' + `, error code is ${err.code}, message is ${err.message}`); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0200 e ' + `, error code is ${e.code}, message is ${e.message}`); } done(); }) @@ -2508,13 +2506,13 @@ describe('SingleKvStorePromiseTest', function () { }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 - * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 007 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 + * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 001 * @tc.type: FUNC - * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 007 + * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 001 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100'); try { let resultSet; let entries = []; @@ -2530,119 +2528,117 @@ describe('SingleKvStorePromiseTest', function () { entries.push(entry); } await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 putBatch success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); await kvStore.getResultSet('batch_test_string_key').then((result) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 getResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 getResultSet success'); resultSet = result; expect(resultSet.getCount() == 10).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); await kvStore.closeResultSet(resultSet).then((err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 closeResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 closeResultSet success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0700 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 - * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 008 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 + * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 002 * @tc.type: FUNC - * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 008 + * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 002 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200'); try { let resultSet; await kvStore.getResultSet('batch_test_string_key').then((result) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 getResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 getResultSet success'); resultSet = result; expect(resultSet.getCount() == 0).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); await kvStore.closeResultSet(resultSet).then((err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 closeResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 closeResultSet success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0800 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0300 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0300 * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 003 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 003 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0300', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0300'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0300', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0300'); try { let resultSet; await kvStore.getResultSet().then((result) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0300 getResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0300 getResultSet success'); expect(null).assertFail(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0300 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0300 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0300 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0300 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(e.code == 401).assertTrue(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0400 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0400 * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 004 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 004 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0400', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0400'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0400', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0400'); try { - await kvStore.getResultSet('test_key_string', 123).then((result) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0400 getResultSet success'); - expect(true).assertTrue(); - }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0400 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); - }); + kvStore.getResultSet('test_key_string', 123).then((result) => { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0400 getResultSet success'); + kvStore.closeResultSet(result); + }) }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0400 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0400 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 005 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 005 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500'); try { let resultSet; let entries = []; @@ -2658,44 +2654,44 @@ describe('SingleKvStorePromiseTest', function () { entries.push(entry); } await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 putBatch success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); var query = new factory.Query(); query.prefixKey("batch_test"); await kvStore.getResultSet(query).then((result) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 getResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 getResultSet success'); resultSet = result; expect(resultSet.getCount() == 10).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); await kvStore.closeResultSet(resultSet).then((err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 closeResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 closeResultSet success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0500 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 * @tc.desc Test Js Api SingleKvStoreGetResultSet testcase 006 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreGetResultSet testcase 006 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600'); try { let resultSet; let entries = []; @@ -2711,44 +2707,44 @@ describe('SingleKvStorePromiseTest', function () { entries.push(entry); } await kvStore.putBatch(entries).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 putBatch success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 putBatch success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); var query = new factory.Query(); query.prefixKey("batch_test"); await kvStore.getResultSet(query).then((result) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 getResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 getResultSet success'); resultSet = result; expect(resultSet.getCount() == 10).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); await kvStore.closeResultSet(resultSet).then((err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 closeResultSet success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 closeResultSet success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0600 e ' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 - * @tc.desc Test Js Api SingleKvStore.GetResultSet() testcase 001 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 + * @tc.desc Test Js Api SingleKvStore.GetResultSet() testcase 007 * @tc.type: FUNC - * @tc.name Test Js Api SingleKvStore.GetResultSet() testcase 001 + * @tc.name Test Js Api SingleKvStore.GetResultSet() testcase 007 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100', 0, async function (done) { - console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700', 0, async function (done) { + console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700'); try { let entries = []; let resultSet; @@ -2765,53 +2761,54 @@ describe('SingleKvStorePromiseTest', function () { entries.push(entry); } await kvStore.putBatch(entries).then(async (err) => { - console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 putBatch success'); + console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 putBatch success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); let predicates = new dataShare.DataSharePredicates(); predicates.prefixKey("name_"); await kvStore.getResultSet(predicates).then((result) => { - console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 getResultSet success'); + console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 getResultSet success'); resultSet = result; expect(resultSet.getCount() == 10).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); await kvStore.closeResultSet(resultSet).then((err) => { - console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 closeResultSet success'); + console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 closeResultSet success'); expect(err == undefined).assertTrue(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 closeResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`); expect(null).assertFail(); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0100 e' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0700 e' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 - * @tc.desc Test Js Api SingleKvStore.GetResultSet() testcase 002 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0800 + * @tc.desc Test Js Api SingleKvStore.GetResultSet() testcase 008 * @tc.type: FUNC - * @tc.name Test Js Api SingleKvStore.GetResultSet() testcase 002 + * @tc.name Test Js Api SingleKvStore.GetResultSet() testcase 008 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200', 0, async function (done) { - console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200'); + it('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0800', 0, async function (done) { + console.log('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0800'); try { let predicates = new dataShare.DataSharePredicates(); await kvStore.getResultSet(predicates, async function (err, result) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 GetResultSet success: '+`, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0800 GetResultSet success: '+`, error code is ${err.code}, message is ${err.message}`); + kvStore.closeResultSet(result); expect(err == undefined).assertTrue(); done(); }); } catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0200 e' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETRESULTSET_PROMISE_0800 e' + `, error code is ${e.code}, message is ${e.message}`); expect(null).assertFail(); } done(); @@ -3011,28 +3008,28 @@ describe('SingleKvStorePromiseTest', function () { }) /** - * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0100 + * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0300 * @tc.desc Test Js Api SingleKvStoreChangeNotification testcase 003 * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreChangeNotification testcase 003 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0100', 0, async function (done) { + it('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0300', 0, async function (done) { await kvStore.put('deleteEntries', 'byPut').then(() => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0100 put success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0300 put success'); }); var getdeleteEntries = new Promise((resolve, reject) => { kvStore.on('dataChange', 0, function(ChangeNotification){ resolve(ChangeNotification.deleteEntries); }); kvStore.delete("deleteEntries").then(() => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0100 delete success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0300 delete success'); }); }); await getdeleteEntries.then(function(deleteEntries){ - console.info('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0100 deleteEntries' + JSON.stringify(getdeleteEntries)); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0300 deleteEntries' + JSON.stringify(getdeleteEntries)); expect(deleteEntries != null).assertNotNull(); }).catch((error) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0100 can NOT getdeleteEntries, fail:' + `, error code is ${error.code}, message is ${error.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_CHANGENOTIFICATION_PROMISE_0300 can NOT getdeleteEntries, fail:' + `, error code is ${error.code}, message is ${error.message}`); }); done(); }) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets index 20a0882122869f642ed9cddca502a1aab193fc5d..92e4416d457843e2f2ac74bd61bc95fa740c82b0 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreDistributedEtsunit.test.ets @@ -1,6 +1,6 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets index dd3176b559f66c16fe06adb71cfa10c6ab0a7574..8ab1090c6299813110144c786005611539ed1190 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets +++ b/distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/RdbstoreResultsetV9Etsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,8 +25,8 @@ const STORE_CONFIG = { const COLOUNM_NAMES = ["id","data1","data2","data3","data4"]; var rdbStore = undefined; -export default function rdbResultSetTest(context) { -describe('rdbResultSetTest', function () { +export default function rdbResultSetTestV9(context) { +describe('rdbResultSetTestV9', function () { beforeAll(async function () { console.info(TAG + 'beforeAll') rdbStore = await dataRdb.getRdbStoreV9(context, STORE_CONFIG, 1); @@ -84,12 +84,12 @@ describe('rdbResultSetTest', function () { } /** - * @tc.name resultSet getBlob normal test - * @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0010 - * @tc.desc resultSet getBlob normal test + * @tc.name resultSetV9 getBlob normal test + * @tc.number SUB_DDM_RELATIONALETS_RESULTSETV9_0010 + * @tc.desc resultSetV9 getBlob normal test */ - it('testGetBlob0001', 0, async function (done) { - console.info(TAG + '************* testGetBlob0001 start *************'); + 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) try { @@ -109,7 +109,7 @@ describe('rdbResultSetTest', function () { } resultSetV9 = null done(); - console.info(TAG + '************* testGetBlob0001 end *************'); + console.info(TAG + '************* SUB_DDM_RELATIONALETS_RESULTSETV9_0010 end *************'); }) console.info(TAG + '*************Unit Test End*************'); })