Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5c06ae6e
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看板
提交
5c06ae6e
编写于
5月 06, 2023
作者:
W
wuxiaodan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify testcase
Signed-off-by:
N
wuxiaodan
<
wuxiaodan5@huawei.com
>
上级
1118e723
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
26 deletion
+27
-26
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js
...jectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js
+1
-1
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js
...ctjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js
+26
-25
未找到文件。
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunit.test.js
浏览文件 @
5c06ae6e
...
...
@@ -726,7 +726,7 @@ export default function objectStoreTest() {
g_object
.
setSessionId
(
"
testSession001
"
);
expect
(
"
testSession001
"
==
g_object
.
__sessionId
).
assertEqual
(
true
);
g_object
.
save
(
"
local
"
).
then
((
ret
)
=>
{
await
g_object
.
save
(
"
local
"
).
then
((
ret
)
=>
{
expect
(
ret
.
sessionId
==
"
testSession001
"
).
assertEqual
(
true
);
expect
(
ret
.
version
==
g_object
.
__version
).
assertEqual
(
true
);
expect
(
ret
.
deviceId
==
"
local
"
).
assertEqual
(
true
);
...
...
distributeddatamgr/dataObjectjstest/hap/src/main/js/test/ObjectStoreJsunitV9.test.js
浏览文件 @
5c06ae6e
...
...
@@ -84,7 +84,7 @@ describe('objectStoreTestV9', function () {
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
* @tc.type: FUNC
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 start *************
"
);
var
g_object
;
try
{
...
...
@@ -103,15 +103,16 @@ describe('objectStoreTestV9', function () {
}
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
123456
"
).
then
((
data
)
=>
{
console
.
info
(
TAG
+
"
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
"
);
await
g_object
.
setSessionId
(
"
123456
"
).
then
((
data
)
=>
{
console
.
info
(
TAG
+
"
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001
setSessionId 123456
"
);
console
.
info
(
TAG
+
data
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
);
});
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_001 end *************
"
);
g_object
.
setSessionId
((
error
,
data
)
=>
{
console
.
info
(
TAG
+
error
+
"
,
"
+
data
);
console
.
info
(
TAG
+
error
+
"
,
data=
"
+
data
);
});
done
();
})
...
...
@@ -122,12 +123,12 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
try
{
g_object
.
setSessionId
(
123
).
then
((
data
)
=>
{
await
g_object
.
setSessionId
(
123
).
then
((
data
)
=>
{
console
.
info
(
TAG
+
"
setSessionId test
"
);
console
.
info
(
TAG
+
data
);
}).
catch
((
err
)
=>
{
...
...
@@ -150,13 +151,13 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_003 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
session1
"
);
expect
(
"
session1
"
==
g_object
.
__sessionId
).
assertEqual
(
true
);
g_object
.
setSessionId
(
"
session1
"
).
then
(()
=>
{
await
g_object
.
setSessionId
(
"
session1
"
).
then
(()
=>
{
console
.
info
(
TAG
+
"
setSessionId test
"
);
}).
catch
((
error
)
=>
{
expect
(
error
.
code
==
15400001
).
assertEqual
(
true
);
...
...
@@ -175,11 +176,11 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_SetSessionId_004 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
123456
"
).
then
((
data
)
=>
{
await
g_object
.
setSessionId
(
"
123456
"
).
then
((
data
)
=>
{
console
.
info
(
TAG
+
"
setSessionId test
"
);
console
.
info
(
TAG
+
data
);
}).
catch
((
err
)
=>
{
...
...
@@ -233,11 +234,11 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_001
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_On_001 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
session1
"
).
then
(()
=>
{
await
g_object
.
setSessionId
(
"
session1
"
).
then
(()
=>
{
console
.
info
(
"
join session
"
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
...
...
@@ -315,11 +316,11 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_On_003
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_003
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_On_003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_On_003 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
session1
"
).
then
(()
=>
{
await
g_object
.
setSessionId
(
"
session1
"
).
then
(()
=>
{
console
.
info
(
"
join session
"
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
...
...
@@ -353,11 +354,11 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Off_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_001
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Off_001 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
session5
"
).
then
(()
=>
{
await
g_object
.
setSessionId
(
"
session5
"
).
then
(()
=>
{
console
.
info
(
"
join session
"
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
...
...
@@ -401,11 +402,11 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_Off_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_002
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_Off_002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 start *************
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
session6
"
).
then
(()
=>
{
await
g_object
.
setSessionId
(
"
session6
"
).
then
(()
=>
{
console
.
info
(
"
join session
"
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
...
...
@@ -419,7 +420,7 @@ describe('objectStoreTestV9', function () {
}
console
.
info
(
TAG
+
"
end call watch change
"
);
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_Off_002 end *************
"
);
g_object
.
setSessionId
().
then
((
data
)
=>
{
await
g_object
.
setSessionId
().
then
((
data
)
=>
{
console
.
info
(
TAG
+
data
);
console
.
info
(
TAG
+
"
setSessionId test
"
);
}).
catch
((
error
)
=>
{
...
...
@@ -434,7 +435,7 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 start *************
"
);
console
.
info
(
TAG
+
"
start watch status
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
...
...
@@ -447,7 +448,7 @@ describe('objectStoreTestV9', function () {
}
console
.
info
(
TAG
+
"
watch success
"
);
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_001 end *************
"
);
g_object
.
setSessionId
(
""
).
then
((
data
)
=>
{
await
g_object
.
setSessionId
(
""
).
then
((
data
)
=>
{
console
.
info
(
TAG
+
data
);
console
.
info
(
TAG
+
"
setSessionId test
"
);
}).
catch
((
error
)
=>
{
...
...
@@ -462,7 +463,7 @@ describe('objectStoreTestV9', function () {
* @tc.type: FUNC
* @tc.number: SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002
*/
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002
'
,
0
,
function
(
done
)
{
it
(
'
SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 start *************
"
);
console
.
info
(
TAG
+
"
start watch status
"
);
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
...
...
@@ -474,7 +475,7 @@ describe('objectStoreTestV9', function () {
g_object
.
off
(
"
status
"
);
console
.
info
(
TAG
+
"
unwatch success
"
);
console
.
info
(
TAG
+
"
************* SUB_DDM_AppDataFWK_Object_Api9_OnStatus_002 end *************
"
);
g_object
.
setSessionId
().
then
(()
=>
{
await
g_object
.
setSessionId
().
then
(()
=>
{
console
.
info
(
"
leave session
"
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
...
...
@@ -494,14 +495,14 @@ describe('objectStoreTestV9', function () {
var
g_object
=
distributedObject
.
create
(
context
,
{
name
:
"
Amy
"
,
age
:
18
,
isVis
:
false
});
expect
(
g_object
==
undefined
).
assertEqual
(
false
);
g_object
.
setSessionId
(
"
mySession1
"
).
then
(()
=>
{
await
g_object
.
setSessionId
(
"
mySession1
"
).
then
(()
=>
{
console
.
info
(
"
join session
"
);
}).
catch
((
error
)
=>
{
console
.
info
(
TAG
+
error
.
code
+
error
.
message
);
});
expect
(
"
mySession1
"
==
g_object
.
__sessionId
).
assertEqual
(
true
);
g_object
.
save
(
"
local
"
).
then
((
ret
)
=>
{
await
g_object
.
save
(
"
local
"
).
then
((
ret
)
=>
{
expect
(
ret
.
sessionId
==
"
mySession1
"
).
assertEqual
(
true
);
expect
(
ret
.
version
==
g_object
.
__version
).
assertEqual
(
true
);
expect
(
ret
.
deviceId
==
"
local
"
).
assertEqual
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录