Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5ce1b41c
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看板
未验证
提交
5ce1b41c
编写于
1月 03, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7055 【distributeddatamgr】【monthly】SingleKvStoreKVPromiseJsTest.js 用例优化
Merge pull request !7055 from wuxiaodan/monthly_20221018
上级
b9916d65
8cbdd0c6
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
205 addition
and
147 deletion
+205
-147
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js
...est/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js
+17
-28
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js
...test/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js
+188
-119
未找到文件。
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVCallbackJsTest.js
浏览文件 @
5ce1b41c
...
...
@@ -773,21 +773,16 @@ describe('SingleKvStoreCallbackTest', function () {
* @tc.name Test Js Api SingleKvStore.Delete() testcase 001
*/
it
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2700
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
S
ingleKvStoreDeletePredicatesCallbackTest001
'
);
console
.
log
(
'
S
UB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2700
'
);
try
{
let
predicates
=
new
dataShare
.
DataSharePredicates
();
await
kvStore
.
delete
(
predicates
,
function
(
err
,
data
)
{
if
(
err
==
undefined
)
{
console
.
log
(
'
SingleKvStoreDeletePredicatesCallbackTest001 delete success
'
);
expect
(
null
).
assertFail
();
}
else
{
console
.
error
(
'
SingleKvStoreDeletePredicatesCallbackTest001 delete fail
'
+
err
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
err
!=
undefined
).
assertTrue
();
}
await
kvStore
.
delete
(
KEY_TEST_STRING_ELEMENT
,
function
(
err
,
data
)
{
console
.
log
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2700 delete err:
'
+
err
);
expect
(
err
==
undefined
).
assertTrue
();
console
.
log
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2700 expect fin
'
);
done
();
});
}
catch
(
e
)
{
console
.
error
(
'
S
ingleKvStoreDeletePredicatesCallbackTest001
e
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
console
.
error
(
'
S
UB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2700
e
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
...
...
@@ -802,13 +797,10 @@ describe('SingleKvStoreCallbackTest', function () {
it
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2800
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SingleKvStoreDeletePredicatesCallbackTest002
'
);
try
{
let
predicates
=
new
dataShare
.
DataSharePredicates
();
let
arr
=
[
"
name
"
];
predicates
.
inKeys
(
arr
);
await
kvStore
.
put
(
"
name
"
,
"
Bob
"
,
async
function
(
err
,
data
)
{
console
.
log
(
'
SingleKvStoreDeletePredicatesCallbackTest002 put success
'
);
expect
(
err
==
undefined
).
assertTrue
();
await
kvStore
.
delete
(
predicates
,
function
(
err
,
data
)
{
await
kvStore
.
delete
(
"
name
"
,
function
(
err
,
data
)
{
console
.
log
(
'
SingleKvStoreDeletePredicatesCallbackTest002 delete success
'
);
expect
(
err
==
undefined
).
assertTrue
();
done
();
...
...
@@ -828,23 +820,20 @@ describe('SingleKvStoreCallbackTest', function () {
* @tc.name Test Js Api SingleKvStore.Delete() testcase 003
*/
it
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2900
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
S
ingleKvStoreDeletePredicatesCallbackTest003
'
);
console
.
log
(
'
S
UB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2900
'
);
try
{
let
predicates
=
new
dataShare
.
DataSharePredicates
();
let
arr
=
[
null
];
predicates
.
inKeys
(
arr
);
await
kvStore
.
put
(
"
name
"
,
"
Bob
"
,
async
function
(
err
,
data
)
{
console
.
log
(
'
S
ingleKvStoreDeletePredicatesCallbackTest003
put success
'
);
console
.
log
(
'
S
UB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2900
put success
'
);
expect
(
err
==
undefined
).
assertTrue
();
await
kvStore
.
delete
(
predicates
,
function
(
err
,
data
)
{
console
.
log
(
'
SingleKvStoreDeletePredicatesCallbackTest003 delete success:
'
+
err
);
expect
(
err
==
undefined
).
assertTrue
();
done
();
});
console
.
log
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2900 expect finash
'
);
})
await
kvStore
.
delete
(
arr
,
function
(
err
,
data
)
{
console
.
log
(
'
SUB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2900 delete success:
'
+
err
);
});
}
catch
(
e
)
{
console
.
error
(
'
S
ingleKvStoreDeletePredicatesCallbackTest003
e
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
console
.
error
(
'
S
UB_DDM_DKV_SINGLEKVSTORE_DELETE_CALLBACK_2900
e
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -2228,8 +2217,8 @@ describe('SingleKvStoreCallbackTest', function () {
it
(
'
SUB_DDM_DKV_SINGLEKVSTORE_GETRESULT_CALLBACK_7800
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SingleKvStoreGetResultSetPredicatesCallbackTest001
'
);
try
{
let
predicates
=
new
dataShare
.
DataSharePredicates
();
await
kvStore
.
getResultSet
(
predicates
).
then
((
result
)
=>
{
let
query
=
new
factory
.
Query
();
await
kvStore
.
getResultSet
(
query
).
then
((
result
)
=>
{
console
.
log
(
'
SingleKvStoreGetResultSetPredicatesCallbackTest001 getResultSet success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
SingleKvStoreGetResultSetPredicatesCallbackTest001 getResultSet fail
'
+
err
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
...
...
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/SingleKvStoreKVPromiseJsTest.js
浏览文件 @
5ce1b41c
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录