提交 b37f5738 编写于 作者: Y yanglifeng1217

<modified>

Signed-off-by: Nyanglifeng1217 <yanglifeng5@huawei.com>
上级 0278a65f
......@@ -19,7 +19,7 @@ import abilityFeatureAbility from '@ohos.ability.featureAbility'
var context = abilityFeatureAbility.getContext();
const TEST_BUNDLE_NAME = 'ohos.acts.distributedKvStore';
const TEST_STORE_ID = 'storeId';
const TEST_STORE_ID = 'SchemaStoreId';
var kvManager = null;
var kvStore = null;
......
......@@ -24,7 +24,7 @@ function sleep(ms) {
}
export default function relationalStoreTest(context){
describe('relationalStoreTest', function () {
describe('relationalStoreTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
})
......@@ -62,13 +62,11 @@ describe('relationalStoreTest', function () {
} catch (err) {
expect(null).assertFail();
}
await dataRdb.deleteRdbStore(context,"secure.db");
done();
}).catch((err) => {
expect(null).assertFail();
})
await storePromise
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 end *************");
})
......@@ -91,13 +89,11 @@ describe('relationalStoreTest', function () {
} catch (err) {
expect(null).assertFail();
}
await dataRdb.deleteRdbStore(context,"secure.db");
done();
}).catch((err) => {
expect(null).assertFail();
})
await storePromise
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 end *************");
})
......@@ -120,13 +116,11 @@ describe('relationalStoreTest', function () {
} catch (err) {
expect(null).assertFail();
}
await dataRdb.deleteRdbStore(context,"secure.db");
done();
}).catch((err) => {
expect(null).assertFail();
})
await storePromise
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 end *************");
})
......@@ -196,7 +190,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
dataRdb.getRdbStore(context, config,async (err,data) => {
dataRdb.getRdbStore(this.context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
......@@ -277,13 +271,13 @@ describe('relationalStoreTest', function () {
let deleteResult = false
await dataRdb.getRdbStore(context, config).then(async (store) => {
console.info(TAG + "create table success")
})
await dataRdb.deleteRdbStore(context,"secure.db").then(() => {
deleteResult = true
console.info(`${TAG} delete rdb store success,result is ${deleteResult}`)
});
expect(deleteResult).assertTrue();
done();
})
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 end *************");
})
......@@ -302,19 +296,18 @@ describe('relationalStoreTest', function () {
let deleteResult = false
await dataRdb.getRdbStore(context, config).then(async (store) => {
console.info(TAG + "create rdb store success")
})
dataRdb.deleteRdbStore(context,"secure.db", (err, data) => {
if(err == undefined){
deleteResult = true
console.info(`${TAG} delete rdb store success,result is ${deleteResult}`)
}
done();
})
await sleep(1000)
expect(deleteResult).assertTrue();
done();
})
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 end *************");
})
console.log(TAG + "*************Unit Test End*************");
})
})
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册