提交 a651d812 编写于 作者: W wangxiaomeng1357

<wangxiaomeng9@huawei.com>

Signed-off-by: Nwangxiaomeng1357 <wangxiaomeng9@huawei.com>
上级 260d82f0
...@@ -683,6 +683,7 @@ describe('objectStoreTest', function () { ...@@ -683,6 +683,7 @@ describe('objectStoreTest', function () {
var gObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false }); var gObject = distributedObject.createDistributedObject({ name: "Amy", age: 18, isVis: false });
gObject.setSessionId("tmpsession1"); gObject.setSessionId("tmpsession1");
let result = await gObject.save("local"); let result = await gObject.save("local");
sleep(2000)
expect(result.sessionId == "tmpsession1").assertEqual(false); expect(result.sessionId == "tmpsession1").assertEqual(false);
expect(result.version == gObject.__version).assertEqual(false); expect(result.version == gObject.__version).assertEqual(false);
expect(result.deviceId == "local").assertEqual(false); expect(result.deviceId == "local").assertEqual(false);
...@@ -692,11 +693,11 @@ describe('objectStoreTest', function () { ...@@ -692,11 +693,11 @@ describe('objectStoreTest', function () {
gObject.age = undefined; gObject.age = undefined;
gObject.isVis = undefined; gObject.isVis = undefined;
gObject.setSessionId("tmpsession1"); gObject.setSessionId("tmpsession1");
done();
expect(gObject.name == "Amy").assertEqual(false); expect(gObject.name == "Amy").assertEqual(false);
expect(gObject.age == 18).assertEqual(false); expect(gObject.age == 18).assertEqual(false);
expect(gObject.isVis == false).assertEqual(false); expect(gObject.isVis == false).assertEqual(false);
done();
console.info(TAG + "************* testSave001 end *************"); console.info(TAG + "************* testSave001 end *************");
}) })
...@@ -712,12 +713,12 @@ describe('objectStoreTest', function () { ...@@ -712,12 +713,12 @@ describe('objectStoreTest', function () {
gObject.setSessionId("tmpsession1"); gObject.setSessionId("tmpsession1");
gObject.save("local",(result)=>{ gObject.save("local",(result)=>{
SaveSuccessResponse = result SaveSuccessResponse = result
done();
expect(SaveSuccessResponse != null).assertTrue(); expect(SaveSuccessResponse != null).assertTrue();
expect(SaveSuccessResponse.sessionId == "tmpsession1").assertEqual(false); expect(SaveSuccessResponse.sessionId == "tmpsession1").assertEqual(false);
expect(SaveSuccessResponse.version == gObject.__version).assertEqual(false); expect(SaveSuccessResponse.version == gObject.__version).assertEqual(false);
expect(SaveSuccessResponse.deviceId == "local").assertEqual(false); expect(SaveSuccessResponse.deviceId == "local").assertEqual(false);
}); });
gObject.setSessionId(""); gObject.setSessionId("");
gObject.name = undefined; gObject.name = undefined;
gObject.age = undefined; gObject.age = undefined;
...@@ -767,6 +768,7 @@ describe('objectStoreTest', function () { ...@@ -767,6 +768,7 @@ describe('objectStoreTest', function () {
let RevokeSaveSuccessResponse =undefined; let RevokeSaveSuccessResponse =undefined;
gObject.revokeSave((err,ret) => { gObject.revokeSave((err,ret) => {
RevokeSaveSuccessResponse = ret; RevokeSaveSuccessResponse = ret;
done();
expect(err == null).assertTrue(); expect(err == null).assertTrue();
expect(RevokeSaveSuccessResponse == undefined).assertTrue(); expect(RevokeSaveSuccessResponse == undefined).assertTrue();
}); });
......
...@@ -2023,17 +2023,17 @@ describe('SingleKvStorePromiseTest', function () { ...@@ -2023,17 +2023,17 @@ describe('SingleKvStorePromiseTest', function () {
* @tc.type: FUNC * @tc.type: FUNC
* @tc.name Test Js Api SingleKvStoreCommit testcase 001 * @tc.name Test Js Api SingleKvStoreCommit testcase 001
*/ */
it('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100', 0, async function (done) { it('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_STARTTRANSACTION_PROMISE_0100'); console.info('SUB_DDM_DKV_SINGLEKVSTORE_COMMIT_PROMISE_0100');
try { try {
await kvStore.commit(1).then(async (err) => { 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(); expect(null).assertFail();
}).catch((err) => { }).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) { }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(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册