Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
343c981e
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看板
未验证
提交
343c981e
编写于
7月 04, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 04, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9194 【Distributeddatamgr】【Master】备份恢复用例优化
Merge pull request !9194 from yanglifeng/master
上级
9254cff6
31510d2e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
18 deletion
+53
-18
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreCallbackJsunit.test.js
...s/test/RelationalStoreBackupRestoreCallbackJsunit.test.js
+53
-18
未找到文件。
distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreCallbackJsunit.test.js
浏览文件 @
343c981e
...
...
@@ -399,11 +399,28 @@ export default function relationalStoreBackupRestoreCallbackTest() {
it
(
'
RdbBackupRestoreCallbackTest_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* RdbBackupRestoreCallbackTest_1100 start *************
"
)
RdbStore
.
backup
(
DATABASE_BACKUP_NAME
,
(
err
,
data
)
=>
{
if
(
err
!=
null
){
expect
(
false
).
assertTrue
()
if
(
err
!=
null
)
{
console
.
info
(
`[ttt] backup fail, sode is
${
err
.
code
}
,message is
${
err
.
message
}
`
)
expect
(
err
!=
null
).
assertFalse
();
done
();
}
try
{
RdbStore
.
restore
((
err
,
data
)
=>
{
if
(
err
===
undefined
)
{
console
.
info
(
TAG
+
`restore success`
);
expect
(
err
===
undefined
).
assertFail
();
done
();
}
else
{
console
.
error
(
TAG
,
`Failed, code is
${
err
.
code
}
,message is
${
err
.
message
}
`
);
expect
(
err
!==
null
).
assertFail
();
done
();
}
})
}
catch
(
errInfo
)
{
console
.
info
(
`[ttt] restore error, code is
${
errInfo
.
code
}
,message is
${
errInfo
.
message
}
`
)
expect
(
errInfo
.
code
).
assertEqual
(
'
401
'
);
done
();
}
ReStoreCallbackTest
()
done
();
})
console
.
info
(
TAG
+
"
************* RdbBackupRestoreCallbackTest_1100 end *************
"
)
})
...
...
@@ -434,23 +451,41 @@ export default function relationalStoreBackupRestoreCallbackTest() {
* @tc.number SUB_DDM_RelationalStore_JS_RdbBackupRestoreCallbackTest_1300
* @tc.desc RelationalStore restore function test
*/
it
(
'
RdbBackupRestoreCallbackTest_1300
'
,
0
,
async
function
(
done
)
{
it
(
'
RdbBackupRestoreCallbackTest_1300
'
,
0
,
function
(
done
)
{
console
.
info
(
TAG
+
"
************* RdbBackupRestoreCallbackTest_1300 start *************
"
)
RdbStore
.
backup
(
DATABASE_BACKUP_NAME
,
(
err
,
data
)
=>
{
if
(
err
!=
null
){
expect
(
false
).
assertTrue
()
}
else
{
RdbStore
.
restore
(
DATABASE_BACKUP_NAME
,
(
err
,
data
)
=>
{
if
(
err
!=
null
){
expect
(
false
).
assertTrue
()
}
else
{
ReStoreCallbackTest
(
DATABASE_BACKUP_NAME
)
try
{
RdbStore
.
backup
(
DATABASE_BACKUP_NAME
,
(
e
)
=>
{
console
.
info
(
TAG
,
`backup success`
)
if
(
e
!=
null
)
{
console
.
info
(
`[ttt] backup fail, sode is
${
e
.
code
}
,message is
${
e
.
message
}
`
)
expect
(
e
!=
null
).
assertFalse
();
done
();
}
RdbStore
.
restore
(
DATABASE_BACKUP_NAME
,
function
(
err
)
{
if
(
err
)
{
console
.
error
(
`Restore failed, code is
${
err
.
code
}
,message is
${
err
.
message
}
`
);
expect
(
err
!=
null
).
assertFail
();
done
();
}
console
.
info
(
`Restore1 success.`
);
RdbStore
.
restore
(
DATABASE_BACKUP_NAME
,
function
(
error
)
{
if
(
error
!==
undefined
)
{
console
.
error
(
`Restore failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
expect
(
error
.
code
===
14800011
).
assertTrue
();
done
();
}
else
{
console
.
info
(
`Restore2 success.`
);
expect
(
error
!==
undefined
).
assertFail
();
done
();
}
})
})
}
done
();
console
.
info
(
TAG
+
"
************* RdbBackupRestoreCallbackTest_1300 end *************
"
)
})
})
}
catch
(
errInfo
)
{
console
.
info
(
`[ttt] fail, code is
${
errInfo
.
code
}
,message is
${
errInfo
.
message
}
`
)
expect
(
errInfo
!==
undefined
).
assertFail
();
done
();
}
})
console
.
info
(
TAG
+
"
*************Unit Test End*************
"
)
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录