Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b37f5738
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b37f5738
编写于
3月 15, 2023
作者:
Y
yanglifeng1217
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<modified>
Signed-off-by:
N
yanglifeng1217
<
yanglifeng5@huawei.com
>
上级
0278a65f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
239 addition
and
246 deletion
+239
-246
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SchemaJsTest.js
...ributedKVStorejstest/hap/src/main/js/test/SchemaJsTest.js
+1
-1
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEtsunit.test.ets
...t/entry/src/main/ets/test/relationalStoreEtsunit.test.ets
+238
-245
未找到文件。
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SchemaJsTest.js
浏览文件 @
b37f5738
...
...
@@ -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
=
'
s
toreId
'
;
const
TEST_STORE_ID
=
'
SchemaS
toreId
'
;
var
kvManager
=
null
;
var
kvStore
=
null
;
...
...
distributeddatamgr/relationalStoretest/relationalStoreStagetest/entry/src/main/ets/test/relationalStoreEtsunit.test.ets
浏览文件 @
b37f5738
...
...
@@ -24,119 +24,113 @@ function sleep(ms) {
}
export default function relationalStoreTest(context){
describe('relationalStoreTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
})
describe('relationalStoreTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
})
beforeEach(function () {
console.info(TAG + 'beforeEach')
})
beforeEach(function () {
console.info(TAG + 'beforeEach')
})
afterEach(function () {
console.info(TAG + 'afterEach')
})
afterEach(function () {
console.info(TAG + 'afterEach')
})
afterAll(async function () {
console.info(TAG + 'afterAll')
})
afterAll(async function () {
console.info(TAG + 'afterAll')
})
console.log(TAG + "*************Unit Test Begin*************");
console.log(TAG + "*************Unit Test Begin*************");
/**
* @tc.name rdb store getRdbStore with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100
* @tc.desc rdb store getRdbStore with securityLevel S1
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
} catch (err) {
expect(null).assertFail();
/**
* @tc.name rdb store getRdbStore with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100
* @tc.desc rdb store getRdbStore with securityLevel S1
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
}).catch((err) => {
expect(null).assertFail();
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
} catch (err) {
expect(null).assertFail();
}
await dataRdb.deleteRdbStore(context,"secure.db");
done();
}).catch((err) => {
expect(null).assertFail();
})
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 end *************");
})
await storePromise
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0100 end *************");
})
/**
* @tc.name rdb store getRdbStore with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200
* @tc.desc rdb store getRdbStore with securityLevel S2
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
} catch (err) {
expect(null).assertFail();
/**
* @tc.name rdb store getRdbStore with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200
* @tc.desc rdb store getRdbStore with securityLevel S2
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
}).catch((err) => {
expect(null).assertFail();
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
} catch (err) {
expect(null).assertFail();
}
await dataRdb.deleteRdbStore(context,"secure.db");
done();
}).catch((err) => {
expect(null).assertFail();
})
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 end *************");
})
await storePromise
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0200 end *************");
})
/**
* @tc.name rdb store getRdbStore with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300
* @tc.desc rdb store getRdbStore with securityLevel S3
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
} catch (err) {
expect(null).assertFail();
/**
* @tc.name rdb store getRdbStore with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300
* @tc.desc rdb store getRdbStore with securityLevel S3
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
}).catch((err) => {
expect(null).assertFail();
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
} catch (err) {
expect(null).assertFail();
}
await dataRdb.deleteRdbStore(context,"secure.db");
done();
}).catch((err) => {
expect(null).assertFail();
})
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 end *************");
})
await storePromise
storePromise = null
await dataRdb.deleteRdbStore(context,"secure.db");
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0300 end *************");
})
/**
* @tc.name rdb store getRdbStore with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400
* @tc.desc rdb store getRdbStore with securityLevel S4
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400', 0, async function (done) {
/**
* @tc.name rdb store getRdbStore with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400
* @tc.desc rdb store getRdbStore with securityLevel S4
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 start *************");
let config = {
name: "secure.db",
...
...
@@ -157,164 +151,163 @@ describe('relationalStoreTest', function () {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_PROMISE_0400 end *************");
})
/**
* @tc.name rdb store getRdbStore with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100
* @tc.desc rdb store getRdbStore with securityLevel S1
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
dataRdb.getRdbStore(context, config, async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error" + err.message)
expect(null).assertFail();
}else{
console.info(TAG + "create table success")
/**
* @tc.name rdb store getRdbStore with securityLevel S1
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100
* @tc.desc rdb store getRdbStore with securityLevel S1
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
dataRdb.deleteRdbStore(context,"secure.db").then(()=>{
console.info(TAG + "Delete rdbstore success")
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 end *************");
})
});
})
dataRdb.getRdbStore(context, config, async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error" + err.message)
expect(null).assertFail();
}else{
console.info(TAG + "create table success")
}
dataRdb.deleteRdbStore(context,"secure.db").then(()=>{
console.info(TAG + "Delete rdbstore success")
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0100 end *************");
})
});
})
/**
* @tc.name rdb store getRdbStore with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200
* @tc.desc rdb store getRdbStore with securityLevel S2
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
}else{
console.info(TAG + "create table success")
/**
* @tc.name rdb store getRdbStore with securityLevel S2
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200
* @tc.desc rdb store getRdbStore with securityLevel S2
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
dataRdb.deleteRdbStore(context, "secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 end *************");
})
});
})
dataRdb.getRdbStore(this.context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
}else{
console.info(TAG + "create table success")
}
dataRdb.deleteRdbStore(context, "secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0200 end *************");
})
});
})
/**
* @tc.name rdb store getRdbStore with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300
* @tc.desc rdb store getRdbStore with securityLevel S3
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
}else{
console.info(TAG + "create table success")
/**
* @tc.name rdb store getRdbStore with securityLevel S3
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300
* @tc.desc rdb store getRdbStore with securityLevel S3
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
dataRdb.deleteRdbStore(context, "secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 end *************");
})
});
})
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
}else{
console.info(TAG + "create table success")
}
dataRdb.deleteRdbStore(context, "secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0300 end *************");
})
});
})
/**
* @tc.name rdb store getRdbStore with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400
* @tc.desc rdb store getRdbStore with securityLevel S4
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
}else{
console.info(TAG + "get rdb store success")
/**
* @tc.name rdb store getRdbStore with securityLevel S4
* @tc.number SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400
* @tc.desc rdb store getRdbStore with securityLevel S4
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
}else{
console.info(TAG + "get rdb store success")
}
dataRdb.deleteRdbStore(context,"secure.db").then(() => {
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_GETRDBSTORE_CALLBACK_0400 end *************");
})
});
})
/**
* @tc.name rdb store deleteRdbStore
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100
* @tc.desc rdb store deleteRdbStore
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
dataRdb.deleteRdbStore(context,"secure.db").then(() => {
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_GETRDBSTORE_CALLBACK_0400 end *************");
})
});
})
/**
* @tc.name rdb store deleteRdbStore
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100
* @tc.desc rdb store deleteRdbStore
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
let deleteResult = false
await dataRdb.getRdbStore(context, config).then(async (store) => {
console.info(TAG + "create table success")
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_PROMISE_0100 end *************");
})
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 *************");
})
/**
* @tc.name rdb store deleteRdbStore
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100
* @tc.desc rdb store deleteRdbStore
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
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}`)
/**
* @tc.name rdb store deleteRdbStore
* @tc.number SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100
* @tc.desc rdb store deleteRdbStore
* @tc.require: I5PIL6
*/
it('SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100', 0, async function (done) {
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 start *************");
let config = {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
done();
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}`)
}
})
await sleep(1000)
expect(deleteResult).assertTrue();
done();
})
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 end *************");
})
await sleep(1000)
expect(deleteResult).assertTrue();
done();
console.log(TAG + "************* SUB_DDM_RELATIONALETS_DELETERDBSTORE_CALLBACK_0100 end *************");
console.log(TAG + "*************Unit Test 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录