Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
01876538
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看板
未验证
提交
01876538
编写于
11月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6725 【Distributeddatamgr】【monthly_20221018】优化无效的异常捕获
Merge pull request !6725 from 梁梁/monthly_20221018
上级
d77301b9
bb3bea5e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
30 deletion
+18
-30
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js
...est/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js
+18
-30
未找到文件。
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RdbstoreEncryptionJsunit.test.js
浏览文件 @
01876538
...
@@ -94,7 +94,7 @@ describe('rdbEncryptTest', function () {
...
@@ -94,7 +94,7 @@ describe('rdbEncryptTest', function () {
console
.
info
(
TAG
+
'
afterAll
'
)
console
.
info
(
TAG
+
'
afterAll
'
)
})
})
console
.
log
(
TAG
+
"
*************Unit Test Begin*************
"
)
console
.
info
(
TAG
+
"
*************Unit Test Begin*************
"
)
/**
/**
* @tc.name RDB encrypted test
* @tc.name RDB encrypted test
...
@@ -102,22 +102,15 @@ describe('rdbEncryptTest', function () {
...
@@ -102,22 +102,15 @@ describe('rdbEncryptTest', function () {
* @tc.desc RDB create encrypt db test
* @tc.desc RDB create encrypt db test
*/
*/
it
(
'
RdbEncryptTest_0010
'
,
0
,
async
function
(
done
)
{
it
(
'
RdbEncryptTest_0010
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0010 start *************
"
)
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0010 start *************
"
)
context
=
ability_featureAbility
.
getContext
()
context
=
ability_featureAbility
.
getContext
()
let
storePromise
=
data_rdb
.
getRdbStore
(
context
,
STORE_CONFIG_ENCRYPT
,
1
);
data_rdb
.
getRdbStore
(
context
,
STORE_CONFIG_ENCRYPT
,
1
).
then
((
store
)
=>
{
storePromise
.
then
(
async
(
store
)
=>
{
done
()
try
{
expect
(
store
!=
null
).
assertTrue
();
console
.
log
(
TAG
+
"
getRdbStore done:
"
+
store
);
}
catch
(
err
)
{
expect
(
null
).
assertFail
();
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
})
})
storePromise
=
null
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0010 end *************
"
)
done
()
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0010 end *************
"
)
})
})
/**
/**
...
@@ -126,22 +119,17 @@ describe('rdbEncryptTest', function () {
...
@@ -126,22 +119,17 @@ describe('rdbEncryptTest', function () {
* @tc.desc RDB create unencrypted db test
* @tc.desc RDB create unencrypted db test
*/
*/
it
(
'
RdbEncryptTest_0020
'
,
0
,
async
function
(
done
)
{
it
(
'
RdbEncryptTest_0020
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0020 start *************
"
)
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0020 start *************
"
)
context
=
ability_featureAbility
.
getContext
()
context
=
ability_featureAbility
.
getContext
()
let
storePromise
=
data_rdb
.
getRdbStore
(
context
,
STORE_CONFIG_UNENCRYPT
,
1
);
let
storePromise
=
data_rdb
.
getRdbStore
(
context
,
STORE_CONFIG_UNENCRYPT
,
1
);
storePromise
.
then
(
async
(
store
)
=>
{
storePromise
.
then
((
store
)
=>
{
try
{
expect
(
store
!=
null
).
assertTrue
();
console
.
log
(
TAG
+
"
getRdbStore done:
"
+
store
);
done
()
}
catch
(
err
)
{
expect
(
null
).
assertFail
();
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
expect
(
null
).
assertFail
();
expect
(
null
).
assertFail
();
})
})
storePromise
=
null
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0020 end *************
"
)
done
()
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0020 end *************
"
)
})
})
...
@@ -151,14 +139,14 @@ describe('rdbEncryptTest', function () {
...
@@ -151,14 +139,14 @@ describe('rdbEncryptTest', function () {
* @tc.desc RDB Encrypt function test
* @tc.desc RDB Encrypt function test
*/
*/
it
(
'
RdbEncryptTest_0030
'
,
0
,
async
function
(
done
)
{
it
(
'
RdbEncryptTest_0030
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0030 start *************
"
)
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0030 start *************
"
)
context
=
ability_featureAbility
.
getContext
()
context
=
ability_featureAbility
.
getContext
()
rdbStore
=
await
CreatRdbStore
(
context
,
STORE_CONFIG_ENCRYPT
)
rdbStore
=
await
CreatRdbStore
(
context
,
STORE_CONFIG_ENCRYPT
)
let
predicates
=
new
data_rdb
.
RdbPredicates
(
"
test
"
)
let
predicates
=
new
data_rdb
.
RdbPredicates
(
"
test
"
)
predicates
.
equalTo
(
"
name
"
,
"
zhangsan
"
)
predicates
.
equalTo
(
"
name
"
,
"
zhangsan
"
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
let
resultSet
=
await
rdbStore
.
query
(
predicates
)
try
{
try
{
console
.
log
(
TAG
+
"
After restore resultSet query done
"
)
console
.
info
(
TAG
+
"
After restore resultSet query done
"
)
expect
(
true
).
assertEqual
(
resultSet
.
goToFirstRow
())
expect
(
true
).
assertEqual
(
resultSet
.
goToFirstRow
())
const
id
=
resultSet
.
getLong
(
resultSet
.
getColumnIndex
(
"
id
"
))
const
id
=
resultSet
.
getLong
(
resultSet
.
getColumnIndex
(
"
id
"
))
const
name
=
resultSet
.
getString
(
resultSet
.
getColumnIndex
(
"
name
"
))
const
name
=
resultSet
.
getString
(
resultSet
.
getColumnIndex
(
"
name
"
))
...
@@ -172,7 +160,7 @@ describe('rdbEncryptTest', function () {
...
@@ -172,7 +160,7 @@ describe('rdbEncryptTest', function () {
resultSet
=
null
resultSet
=
null
rdbStore
=
null
rdbStore
=
null
done
()
done
()
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0030 end *************
"
)
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0030 end *************
"
)
})
})
/**
/**
...
@@ -181,7 +169,7 @@ describe('rdbEncryptTest', function () {
...
@@ -181,7 +169,7 @@ describe('rdbEncryptTest', function () {
* @tc.desc RDB Encrypt function test
* @tc.desc RDB Encrypt function test
*/
*/
it
(
'
RdbEncryptTest_0040
'
,
0
,
async
function
(
done
)
{
it
(
'
RdbEncryptTest_0040
'
,
0
,
async
function
(
done
)
{
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0040 start *************
"
)
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0040 start *************
"
)
context
=
ability_featureAbility
.
getContext
()
context
=
ability_featureAbility
.
getContext
()
rdbStore
=
await
CreatRdbStore
(
context
,
STORE_CONFIG_ENCRYPT
)
rdbStore
=
await
CreatRdbStore
(
context
,
STORE_CONFIG_ENCRYPT
)
rdbStore
=
null
rdbStore
=
null
...
@@ -189,9 +177,9 @@ describe('rdbEncryptTest', function () {
...
@@ -189,9 +177,9 @@ describe('rdbEncryptTest', function () {
expect
(
rdbStore
).
assertNull
expect
(
rdbStore
).
assertNull
done
()
done
()
console
.
log
(
TAG
+
"
************* RdbEncryptTest_0040 end *************
"
)
console
.
info
(
TAG
+
"
************* RdbEncryptTest_0040 end *************
"
)
})
})
console
.
log
(
TAG
+
"
*************Unit Test End*************
"
)
console
.
info
(
TAG
+
"
*************Unit Test End*************
"
)
}
}
)
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录