diff --git a/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js b/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js index cd6da6bc2f4527d43ff0bd2cceda5eff65209056..d900b32a02f8cb9bd204d619ce272692d823d6d0 100644 --- a/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js +++ b/distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js @@ -683,6 +683,7 @@ describe('objectStoreTest', function () { var gObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); gObject.setSessionId("tmpsession1"); let result = await gObject.save("local"); + sleep(2000) expect(result.sessionId == "tmpsession1").assertEqual(false); expect(result.version == gObject.__version).assertEqual(false); expect(result.deviceId == "local").assertEqual(false); @@ -692,11 +693,11 @@ describe('objectStoreTest', function () { gObject.age = undefined; gObject.isVis = undefined; gObject.setSessionId("tmpsession1"); - + done(); + expect(gObject.name == "Amy").assertEqual(false); expect(gObject.age == 18).assertEqual(false); expect(gObject.isVis == false).assertEqual(false); - done(); console.info(TAG + "************* testSave001 end *************"); }) @@ -712,12 +713,12 @@ describe('objectStoreTest', function () { gObject.setSessionId("tmpsession1"); gObject.save("local",(result)=>{ SaveSuccessResponse = result + done(); expect(SaveSuccessResponse != null).assertTrue(); expect(SaveSuccessResponse.sessionId == "tmpsession1").assertEqual(false); expect(SaveSuccessResponse.version == gObject.__version).assertEqual(false); expect(SaveSuccessResponse.deviceId == "local").assertEqual(false); }); - gObject.setSessionId(""); gObject.name = undefined; gObject.age = undefined; @@ -767,6 +768,7 @@ describe('objectStoreTest', function () { let RevokeSaveSuccessResponse =undefined; gObject.revokeSave((err,ret) => { RevokeSaveSuccessResponse = ret; + done(); expect(err == null).assertTrue(); expect(RevokeSaveSuccessResponse == undefined).assertTrue(); }); 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 258a7f423dd587c5a814bdce2ad2848b48d880a4..6905f774aad3c46c3ac297e286c48ec69b8818ee 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js @@ -2023,17 +2023,17 @@ describe('SingleKvStorePromiseTest', function () { * @tc.type: FUNC * @tc.name Test Js Api SingleKvStoreCommit testcase 001 */ - it('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100', 0, async function (done) { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100'); + it('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100', 0, async function (done) { + console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100'); try { await kvStore.commit(1).then(async (err) => { - console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100 commit success'); + console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100 commit success'); expect(null).assertFail(); }).catch((err) => { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100 commit fail ' + `, error code is ${err.code}, message is ${err.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100 commit fail ' + `, error code is ${err.code}, message is ${err.message}`); }); }catch(e) { - console.error('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100 e ' + `, error code is ${e.code}, message is ${e.message}`); + console.error('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100 e ' + `, error code is ${e.code}, message is ${e.message}`); } done(); })