提交 59d0f350 编写于 作者: B bayanxing

增加分布式数据库、位置服务、安全(用户认证)、轻量级存储相关用例

Signed-off-by: Nbayanxing <bayanxing@kaihongdigi.com>
上级 28b808e3
......@@ -80,9 +80,9 @@ describe('storageTest', function () {
})
/**
* @tc.name removeStorageFromCache interface test
* @tc.name removeStorageFromCache promise interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_Helper_0040
* @tc.desc removeStorageFromCache interface test
* @tc.desc removeStorageFromCache promise interface test
*/
it('testRemoveStorageFromCache002', 0, async function (done) {
let perf = storage.getStorageSync('/data/test_storage2');
......@@ -96,6 +96,27 @@ describe('storageTest', function () {
done();
})
/**
* @tc.name removeStorageFromCache callback interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_Helper_0041
* @tc.desc removeStorageFromCache callback interface test
*/
it('testRemoveStorageFromCache003', 0, function (done) {
let perf = storage.getStorageSync('/data/test_storage2');
storage.removeStorageFromCache(perf, function (err) {
if (err) {
console.info("removeStorageFromCache callback interface test failed.");
expect(null).assertFail();
done();
return
}
console.info("removeStorageFromCache callback interface test successfully.");
expect(true).assertTrue();
done();
})
})
/**
* @tc.name deleteStorageSync interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_Helper_0050
......
......@@ -17,8 +17,11 @@ import factory from '@ohos.data.distributedData';
const TEST_BUNDLE_NAME = 'ohos.acts.distributeddatamgr';
const TEST_STORE_ID = 'storeId';
const STORE_KEY = 'key_test_string';
const STORE_VALUE = 'value-test-string';
var kvManager = null;
var kvStore = null;
var kvStoreNew = null;
describe('KVManagerCallbackTest', function () {
const config = {
......@@ -43,7 +46,10 @@ describe('KVManagerCallbackTest', function () {
console.log('beforeAll');
await factory.createKVManager(config, function (err, manager) {
kvManager = manager;
done();
kvManager.getKVStore(TEST_STORE_ID, options, function (err, store) {
kvStoreNew = store;
done();
});
});
console.log('beforeAll end');
})
......@@ -125,9 +131,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.NO_LEVEL,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -156,9 +162,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S0,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -188,9 +194,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : true,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S1,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -218,7 +224,7 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
}
......@@ -248,9 +254,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : true,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S3,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -278,9 +284,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S4,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -310,7 +316,7 @@ describe('KVManagerCallbackTest', function () {
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.NO_LEVEL,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -340,7 +346,7 @@ describe('KVManagerCallbackTest', function () {
autoSync : false,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S0,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -370,7 +376,7 @@ describe('KVManagerCallbackTest', function () {
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S1,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -398,7 +404,7 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.DEVICE_COLLABORATION,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
}
......@@ -428,9 +434,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S3,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -462,7 +468,7 @@ describe('KVManagerCallbackTest', function () {
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.NO_LEVEL,
securityLevel : factory.SecurityLevel.S4,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -490,9 +496,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S0,
securityLevel : factory.SecurityLevel.NO_LEVEL,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -520,9 +526,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S1,
securityLevel : factory.SecurityLevel.S0,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -550,9 +556,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S2,
securityLevel : factory.SecurityLevel.S1,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -580,9 +586,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S3,
securityLevel : factory.SecurityLevel.S2,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -610,9 +616,9 @@ describe('KVManagerCallbackTest', function () {
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.SINGLE_VERSION,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S4,
securityLevel : factory.SecurityLevel.S3,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
......@@ -628,6 +634,36 @@ describe('KVManagerCallbackTest', function () {
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVMANAGER_GETKVSTORE_1200
* @tc.name [JS-API8]KVManager.GetKVStore.
* @tc.desc Test Js Api KVManager.GetKVStore testcase 120
*/
it('testKVManagerGetKVStore120', 0, async function (done) {
console.log('testKVManagerGetKVStore120');
const optionsInfo = {
createIfMissing : true,
encrypt : false,
backup : false,
autoSync : true,
kvStoreType : factory.KVStoreType.MULTI_VERSION,
schema : '',
securityLevel : factory.SecurityLevel.S4,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo, function (err, store) {
console.log('testKVManagerGetKVStore120 getKVStore success');
expect((err == undefined) && (store != null)).assertTrue();
kvStore = store;
done();
});
} catch (e) {
console.log('testKVManagerGetKVStore119 getKVStore e ' + e);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVMANAGER_CLOSEKVSTORE_1100
* @tc.name [JS-API8]KVManager.CloseKVStore.
......@@ -878,4 +914,111 @@ describe('KVManagerCallbackTest', function () {
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_PUT_1000
* @tc.name [JS-API8]KVStore.Put
* @tc.desc Test Js Api KVManager.Put testcase 100
*/
it('testKVStorePut100', 0, async function (done) {
console.log('testKVStorePut100');
try {
await kvStoreNew.put(STORE_KEY, STORE_VALUE, function (err, data) {
if (err != undefined){
console.log('testKVStorePut100 put callback fail');
} else {
console.log('testKVStorePut100 put callback success');
expect(null).assertFail();
}
done();
});
} catch (e) {
console.log('testKVStorePut100 callback e ' + e);
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_DELETE_1000
* @tc.name [JS-API8]KVStore.Delete
* @tc.desc Test Js Api KVManager.Delete testcase 100
*/
it('testKVStoreDelete100', 0, async function (done) {
console.log('testKVStoreDelete100');
try {
await KVStoreNew.put(STORE_KEY, STORE_VALUE, async function (err,data) {
console.log('testKVStoreDelete100 put success');
try {
kvStore.delete(STORE_KEY, function (err, data) {
if (err == undefined) {
console.log('testKVStoreDelete100 callback delete success');
expect(null).assertFail();
} else {
console.log('testKVStoreDelete100 callback delete fail');
}
done();
});
} catch (e) {
console.log('testKVStoreDelete100 callback delete e ' + e);
done();
}
});
} catch (ee) {
console.log('testKVStoreDelete100 callback delete ee ' + ee);
expect(null).assertFail();
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1000
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 100
*/
it('testKVStoreOn100', 0, async function (done) {
kvStoreNew.on('dataChange', 0, function (data) {
console.log("testKVStoreOn100 callback call data: " + JSON.stringify(data));
expect(true).assertTrue();
});
done();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1100
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 101
*/
it('testKVStoreOn101', 0, async function (done) {
kvStoreNew.on('dataChange', 1, function (data) {
console.log("testKVStoreOn101 callback call data: " + JSON.stringify(data));
expect(true).assertTrue();
});
done();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1200
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 102
*/
it('testKVStoreOn102', 0, async function (done) {
kvStoreNew.on('dataChange', 2, function (data) {
console.log("testKVStoreOn102 callback call data: " + JSON.stringify(data));
expect(true).assertTrue();
});
done();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_ON_1300
* @tc.name [JS-API8]KVStore.On
* @tc.desc Test Js Api KVManager.On testcase 103
*/
it('testKVStoreOn103', 0, async function (done) {
kvStoreNew.on('syncComplete', function (data) {
console.log("testKVStoreOn103 callback call data: " + data);
expect(true).assertTrue();
});
done();
})
})
\ No newline at end of file
......@@ -19,6 +19,9 @@ const TEST_BUNDLE_NAME = 'ohos.acts.distributeddatamgr';
const TEST_STORE_ID = 'storeId';
var kvManager = null;
var kvStore = null;
const STORE_KEY = 'key_test_string';
const STORE_VALUE = 'value-test-string';
var kvStoreNew = null;
describe('KVManagerPromiseTest', function () {
const config = {
......@@ -44,6 +47,12 @@ describe('KVManagerPromiseTest', function () {
await factory.createKVManager(config).then((manager) => {
kvManager = manager;
console.log('beforeAll createKVManager success');
kvManager.getKVStore(TEST_STORE_ID, options).then((store) => {
console.log("beforeAll getKVStore success");
kvStoreNew = store;
}).catch((err) => {
console.log("beforeAll getKVStore err: " + JSON.stringify(err));
});
}).catch((err) => {
console.log('beforeAll createKVManager err ' + err);
});
......@@ -131,7 +140,7 @@ describe('KVManagerPromiseTest', function () {
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.NO_LEVEL,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore003 getKVStore success');
......@@ -158,7 +167,7 @@ describe('KVManagerPromiseTest', function () {
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S1,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore004 getKVStore success');
......@@ -210,7 +219,7 @@ describe('KVManagerPromiseTest', function () {
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S3,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore006 getKVStore success');
......@@ -237,7 +246,7 @@ describe('KVManagerPromiseTest', function () {
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S4,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore007 getKVStore success');
......@@ -262,9 +271,9 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.DEVICE_COLLABORATION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.NO_LEVEL,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore008 getKVStore success');
......@@ -289,9 +298,9 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.DEVICE_COLLABORATION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S0,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore009 getKVStore success');
......@@ -316,9 +325,9 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: false,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.DEVICE_COLLABORATION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S1,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore010 getKVStore success');
......@@ -343,7 +352,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.DEVICE_COLLABORATION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
}
......@@ -372,7 +381,7 @@ describe('KVManagerPromiseTest', function () {
autoSync: true,
kvStoreType: factory.KVStoreType.DEVICE_COLLABORATION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S3,
}
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
console.log('testKVManagerGetKVStore012 getKVStore success');
......@@ -397,9 +406,9 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
kvStoreType: factory.KVStoreType.DEVICE_COLLABORATION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
securityLevel: factory.SecurityLevel.S4,
}
try {
await kvManager.getKVStore(TEST_STORE_ID, optionsInfo).then((store) => {
......@@ -426,7 +435,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.NO_LEVEL,
}
......@@ -453,7 +462,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S0,
}
......@@ -480,7 +489,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S1,
}
......@@ -507,7 +516,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S2,
}
......@@ -534,7 +543,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S3,
}
......@@ -561,7 +570,7 @@ describe('KVManagerPromiseTest', function () {
encrypt: false,
backup: false,
autoSync: true,
kvStoreType: factory.KVStoreType.SINGLE_VERSION,
kvStoreType: factory.KVStoreType.MULTI_VERSION,
schema: '',
securityLevel: factory.SecurityLevel.S4,
}
......@@ -915,4 +924,78 @@ describe('KVManagerPromiseTest', function () {
kvManager.off('distributedDataServiceDie');
done();
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_PUT_1000
* @tc.name [JS-API8]KVStore.Put
* @tc.desc Test Js Api KVManager.Put testcase 001
*/
it('testKVStorePut001', 0, async function (done) {
console.log('testKVStorePut001');
try {
await kvStoreNew.put(TEST_BUNDLE_NAME, TEST_STORE_ID).then((data) => {
if (err != undefined){
console.log('testKVStorePut001 put promise fail');
} else {
console.log('testKVStorePut001 put promise success');
expect(null).assertFail();
}
done();
});
} catch (e) {
console.log('testKVStorePut001 e ' + e);
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_DELETE_1000
* @tc.name [JS-API8]KVStore.Delete
* @tc.desc Test Js Api KVManager.Delete testcase 001
*/
it('testKVStorePut001', 0, async function (done) {
console.log('testKVStorePut001');
try {
await kvStoreNew.put(TEST_BUNDLE_NAME, TEST_STORE_ID).then((data) => {
if (err != undefined){
console.log('testKVStorePut001 put promise fail');
} else {
console.log('testKVStorePut001 put promise success');
expect(null).assertFail();
}
done();
});
} catch (e) {
console.log('testKVStorePut001 e ' + e);
done();
}
})
/**
* @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORE_DELETE_1000
* @tc.name [JS-API8]KVStore.Delete
* @tc.desc Test Js Api KVManager.Delete testcase 001
*/
it('testKVStoreDelete001', 0, async function (done) {
console.log('testKVStoreDelete001');
try {
kvStoreNew.put(STORE_KEY, STORE_VALUE).then((data) => {
console.log('testKVStoreDelete001 getKVStore success');
kvStoreNew.delete(STORE_KEY).then((data) => {
console.log("testKVStoreDelete001 promise delete success");
expect(null).assertFail();
}).catch((err) => {
console.log('testKVStoreDelete001 promise delete fail err' + err);
});
}).catch((err) => {
console.log('testKVStoreDelete001 promise delete fail err' + err);
});
}catch (e) {
console.log('testKVStoreDelete001 promise delete fail err' + err);
}
done();
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册