Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
601c2f93
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看板
未验证
提交
601c2f93
编写于
3月 24, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 24, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8170 【distributeddatamgr】【master】【acts】修改无断言用例和永真断言用例
Merge pull request !8170 from wuxiaodan/master
上级
f570d894
a2297749
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
102 addition
and
54 deletion
+102
-54
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVPromiseJsTest.js
...rejstest/hap/src/main/js/test/KvManagerKVPromiseJsTest.js
+102
-54
未找到文件。
distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVPromiseJsTest.js
浏览文件 @
601c2f93
...
...
@@ -99,6 +99,7 @@ describe('KVManagerPromiseTest', function () {
});
}
catch
(
e
)
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_GETKVSTORE_PROMISE_0100 getKVStore e
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
expect
(
e
.
code
==
401
).
assertTrue
();
}
done
();
})
...
...
@@ -120,6 +121,7 @@ describe('KVManagerPromiseTest', function () {
});
}
catch
(
e
)
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_GETKVSTORE_PROMISE_0200 getKVStore e
'
+
`, error code is
${
e
.
code
}
, message is
${
e
.
message
}
`
);
expect
(
e
.
code
==
401
).
assertTrue
();
}
done
();
})
...
...
@@ -146,6 +148,7 @@ describe('KVManagerPromiseTest', function () {
expect
(
null
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_GETKVSTORE_PROMISE_0300 getKVStore err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
err
.
code
==
401
).
assertTrue
();
});
done
();
})
...
...
@@ -157,14 +160,14 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.CloseKVStore() testcase 001
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_CLOSEKVSTORE_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
KVManagerCloseKVStorePromiseTest004
'
);
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CLOSEKVSTORE_PROMISE_0100
'
);
await
kvManager
.
getKVStore
(
TEST_STORE_ID
,
options
).
then
(
async
()
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CLOSEKVSTORE_PROMISE_0100 getKVStore success
'
);
await
kvManager
.
closeKVStore
(
TEST_BUNDLE_NAME
,
TEST_STORE_ID
).
then
(()
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CLOSEKVSTORE_PROMISE_0100 closeKVStore success
'
);
expect
(
true
).
assertTrue
();
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CLOSEKVSTORE_PROMISE_0100 closeKVStore twice err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
();
});
});
done
();
...
...
@@ -195,13 +198,19 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.On() testcase 001
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0100
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0100
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0100
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0100 death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0100 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
done
();
})
/**
...
...
@@ -211,17 +220,22 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.On() testcase 002
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0200
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0200
'
);
var
deathCallback1
=
function
()
{
console
.
info
(
'
death callback call
'
);
}
var
deathCallback2
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0200
'
);
var
deathCallback1
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0200 death callback call
'
);
}
var
deathCallback2
=
function
()
{
console
.
info
(
'
death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback1
);
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback2
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback1
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback2
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0200 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback1
);
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback2
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback1
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback2
);
done
();
})
...
...
@@ -232,13 +246,18 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.On() testcase 003
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0300
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0300
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0300
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0300 death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_ON_PROMISE_0300 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
done
();
})
...
...
@@ -249,11 +268,16 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.Off() testcase 001
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0100
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0100
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0100
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0100 death callback call
'
);
}
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0100 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
done
();
})
...
...
@@ -264,12 +288,17 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.Off() testcase 002
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0200
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0200
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0200
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0200 death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0200 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
done
();
})
...
...
@@ -280,16 +309,21 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.Off() testcase 003
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0300
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0300
'
);
var
deathCallback1
=
function
()
{
console
.
info
(
'
death callback call
'
);
}
var
deathCallback2
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0300
'
);
var
deathCallback1
=
function
()
{
console
.
info
(
'
death callback call
'
);
}
var
deathCallback2
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0300 death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback1
);
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback2
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback1
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0300 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback1
);
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback2
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback1
);
done
();
})
...
...
@@ -300,13 +334,18 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.Off() testcase 004
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0400
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0400
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0400
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0400 death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0400 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
,
deathCallback
);
done
();
})
...
...
@@ -317,12 +356,17 @@ describe('KVManagerPromiseTest', function () {
* @tc.name Test Js Api KVManager.Off() testcase 005
*/
it
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0500
'
,
0
,
function
(
done
)
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0100
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
death callback call
'
);
try
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0500
'
);
var
deathCallback
=
function
()
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0500 death callback call
'
);
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
);
}
catch
(
e
)
{
console
.
log
(
`SUB_DDM_DKV_KVMANAGER_OFF_PROMISE_0500 error.code is
${
e
.
code
}
,message is
${
e
.
message
}
`
);
expect
(
null
).
assertFail
();
}
kvManager
.
on
(
'
distributedDataServiceDie
'
,
deathCallback
);
kvManager
.
off
(
'
distributedDataServiceDie
'
);
done
();
})
...
...
@@ -395,14 +439,16 @@ describe('KVManagerPromiseTest', function () {
store
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 put data success
'
);
store
.
get
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
info
(
"
testcreateKVManager001
get data success
"
);
console
.
info
(
"
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100
get data success
"
);
expect
(
data
).
assertEqual
(
STORE_VALUE
);
done
();
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 get data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
();
});
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0100 put data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
();
});
}).
catch
((
err
)
=>
{
console
.
info
(
"
testcreateKVManager001 getKVStore err:
"
+
JSON
.
stringify
(
err
));
...
...
@@ -434,14 +480,16 @@ describe('KVManagerPromiseTest', function () {
store
.
put
(
STORE_KEY
,
STORE_VALUE
).
then
(
async
(
data
)
=>
{
console
.
info
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 put data success
'
);
store
.
get
(
STORE_KEY
).
then
((
data
)
=>
{
console
.
info
(
"
testcreateKVManager002
get data success
"
);
console
.
info
(
"
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200
get data success
"
);
expect
(
data
).
assertEqual
(
STORE_VALUE
);
done
();
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 get data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
();
});
}).
catch
((
err
)
=>
{
console
.
error
(
'
SUB_DDM_DKV_KVMANAGER_CREATEKVMANAGER_PROMISE_0200 put data err
'
+
`, error code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
expect
(
null
).
assertFail
();
});
}).
catch
((
err
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录