Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
582074d0
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看板
提交
582074d0
编写于
8月 18, 2022
作者:
Y
yuxiaoya2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
协同关系API xts用例新增
Signed-off-by:
N
yuxiaoya2
<
yuxiaoya@huawei.com
>
上级
37cf463e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
317 addition
and
4 deletion
+317
-4
ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
...ertest/src/main/js/test/ContinuationManagerJsunit.test.js
+317
-4
未找到文件。
ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
浏览文件 @
582074d0
...
@@ -58,6 +58,7 @@ describe('continuationManagerTest', function() {
...
@@ -58,6 +58,7 @@ describe('continuationManagerTest', function() {
*/
*/
it
(
'
testRegister001
'
,
0
,
async
function
(
done
)
{
it
(
'
testRegister001
'
,
0
,
async
function
(
done
)
{
try
{
try
{
console
.
info
(
"
testRegister001Begin
"
);
continuationManager
.
register
(
function
(
err
,
data
)
{
continuationManager
.
register
(
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
-
token
==
1
).
assertTrue
();
expect
(
data
-
token
==
1
).
assertTrue
();
...
@@ -85,7 +86,7 @@ describe('continuationManagerTest', function() {
...
@@ -85,7 +86,7 @@ describe('continuationManagerTest', function() {
authInfo
:
{}
authInfo
:
{}
};
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
){
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
){
console
.
info
(
"
testRegister002
"
+
err
.
message
)
console
.
info
(
"
testRegister002
"
+
err
.
message
)
;
expect
(
err
.
message
==
"
Invalidate params.
"
).
assertTrue
();
expect
(
err
.
message
==
"
Invalidate params.
"
).
assertTrue
();
done
();
done
();
});
});
...
@@ -133,7 +134,7 @@ describe('continuationManagerTest', function() {
...
@@ -133,7 +134,7 @@ describe('continuationManagerTest', function() {
deviceType
:
[
"
00E
"
],
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MU
L
TIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
...
@@ -149,6 +150,160 @@ describe('continuationManagerTest', function() {
...
@@ -149,6 +150,160 @@ describe('continuationManagerTest', function() {
})
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 005
*/
it
(
'
testRegister005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
-
token
==
1
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 006
*/
it
(
'
testRegister006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
==
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister006
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 007
*/
it
(
'
testRegister007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
==
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister007
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 008
*/
it
(
'
testRegister008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
!=
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister008
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 009
*/
it
(
'
testRegister009
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
register
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
!=
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testRegister009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API8]ContinuationManager.register().
* @tc.desc Test Js Api ContinuationManager.register() testcase 010
*/
it
(
'
testRegister010
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
register
().
then
((
data
)
=>
{
expect
(
data
-
token
==
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegister010
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.name [JS-API8]ContinuationManager.unregister().
...
@@ -208,6 +363,46 @@ describe('continuationManagerTest', function() {
...
@@ -208,6 +363,46 @@ describe('continuationManagerTest', function() {
}
}
})
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 004
*/
it
(
'
testUnregister004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
300
,
function
(
data
)
{
expect
(
data
.
code
==
29360208
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API8]ContinuationManager.unregister().
* @tc.desc Test Js Api ContinuationManager.unregister() testcase 005
*/
it
(
'
testUnregister005
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregister
(
token
,
function
(
data
)
{
console
.
info
(
"
testUnregister005
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregister005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100
* @tc.name [JS-API8]ContinuationManager.on().
* @tc.name [JS-API8]ContinuationManager.on().
...
@@ -397,7 +592,7 @@ describe('continuationManagerTest', function() {
...
@@ -397,7 +592,7 @@ describe('continuationManagerTest', function() {
deviceType
:
[
"
00E
"
],
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MU
L
TIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
};
continuationManager
.
startDeviceManager
(
null
,
continuationExtraParams
,
function
(
err
,
data
)
{
continuationManager
.
startDeviceManager
(
null
,
continuationExtraParams
,
function
(
err
,
data
)
{
...
@@ -423,7 +618,7 @@ describe('continuationManagerTest', function() {
...
@@ -423,7 +618,7 @@ describe('continuationManagerTest', function() {
deviceType
:
[
"
00E
"
],
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MU
L
TIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
};
continuationManager
.
startDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
continuationManager
.
startDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
...
@@ -513,6 +708,54 @@ describe('continuationManagerTest', function() {
...
@@ -513,6 +708,54 @@ describe('continuationManagerTest', function() {
done
();
done
();
}
}
})
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 008
*/
it
(
'
testStartDeviceManager008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startDeviceManager
(
token
,
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager008
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API8]ContinuationManager.startDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startDeviceManager() testcase 009
*/
it
(
'
testStartDeviceManager009
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startDeviceManager
(
token
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartDeviceManager009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
...
@@ -572,4 +815,74 @@ describe('continuationManagerTest', function() {
...
@@ -572,4 +815,74 @@ describe('continuationManagerTest', function() {
done
();
done
();
}
}
})
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 004
*/
it
(
'
testUpdateConnectStatus004
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateConnectStatus004 begin
'
);
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
IDLE
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 005
*/
it
(
'
testUpdateConnectStatus005
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateConnectStatus005 begin
'
);
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
CONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
* @tc.desc Test Js Api ContinuationManager.updateConnectStatus() testcase 006
*/
it
(
'
testUpdateConnectStatus006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateConnectStatus
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
DISCONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
29360210
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateConnectStatus006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
})}
})}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录