Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
859fa276
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
859fa276
编写于
10月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6099 continuationManager错误码新增接口xts覆盖
Merge pull request !6099 from 杜智海/master
上级
a1f4ed35
54d0e44d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
696 addition
and
9 deletion
+696
-9
ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
...ertest/src/main/js/test/ContinuationManagerJsunit.test.js
+696
-9
未找到文件。
ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
浏览文件 @
859fa276
...
...
@@ -309,6 +309,259 @@ describe('continuationManagerTest', function() {
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0100
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 001
*/
it
(
'
testRegisterContinuation001
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
"
testRegisterContinuation001Begin
"
);
continuationManager
.
registerContinuation
(
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
-
token
==
1
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0200
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 002
*/
it
(
'
testRegisterContinuation002
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
targetBundle
:
""
,
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
){
console
.
info
(
"
testRegisterContinuation002
"
+
err
.
message
);
expect
(
err
.
code
==
401
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0300
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 003
*/
it
(
'
testRegisterContinuation003
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
console
.
info
(
"
testRegisterContinuation003
"
+
err
);
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0400
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 004
*/
it
(
'
testRegisterContinuation004
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MULTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
-
token
==
1
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0500
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 005
*/
it
(
'
testRegisterContinuation005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
-
token
==
1
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0600
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 006
*/
it
(
'
testRegisterContinuation006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
targetBundle
:
"
ohos.example.test
"
,
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_SINGLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
==
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation006
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0700
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 007
*/
it
(
'
testRegisterContinuation007
'
,
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
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
==
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation007
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0800
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 008
*/
it
(
'
testRegisterContinuation008
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[],
description
:
""
,
filter
:
""
,
continuationMode
:
null
,
authInfo
:
{}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
!=
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
401
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation008
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_0900
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 009
*/
it
(
'
testRegisterContinuation009
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
10
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
registerContinuation
(
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
-
token
!=
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_REGISTER_1000
* @tc.name [JS-API9]ContinuationManager.registerContinuation().
* @tc.desc Test Js Api ContinuationManager.registerContinuation() testcase 010
*/
it
(
'
testRegisterContinuation010
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
registerContinuation
().
then
((
data
)
=>
{
expect
(
data
-
token
==
1
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
info
(
"
testRegisterContinuation010
"
+
e
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API8]ContinuationManager.unregister().
...
...
@@ -407,6 +660,102 @@ describe('continuationManagerTest', function() {
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0100
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 001
*/
it
(
'
testUnregisterContinuation001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0200
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 002
*/
it
(
'
testUnregisterContinuation002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
"
invalid token
"
,
function
(
err
,
data
)
{
console
.
info
(
"
testUnregisterContinuation002
"
+
data
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0300
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 003
*/
it
(
'
testUnregisterContinuation003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
300
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0400
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 004
*/
it
(
'
testUnregisterContinuation004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
300
,
function
(
data
)
{
expect
(
data
.
code
==
16600002
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UNREGISTER_0500
* @tc.name [JS-API9]ContinuationManager.unregisterContinuation().
* @tc.desc Test Js Api ContinuationManager.unregisterContinuation() testcase 005
*/
it
(
'
testUnregisterContinuation005
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
unregisterContinuation
(
token
,
function
(
data
)
{
console
.
info
(
"
testUnregisterContinuation005
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
==
0
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUnregisterContinuation005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_ON_0100
...
...
@@ -451,13 +800,13 @@ describe('continuationManagerTest', function() {
*/
it
(
'
testOn003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
device
Connect
"
,
token
,
function
(
data
)
{
continuationManager
.
on
(
"
device
Selected
"
,
"
invalid token
"
,
function
(
data
)
{
expect
(
data
==
undefined
).
assertTrue
();
})
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn003
"
+
e
);
expect
(
null
).
assertFail
();
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -469,13 +818,13 @@ describe('continuationManagerTest', function() {
*/
it
(
'
testOn004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
on
(
"
device
Disconnect
"
,
token
,
function
(
data
)
{
continuationManager
.
on
(
"
device
Unselected
"
,
"
invalid token
"
,
function
(
data
)
{
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOn004
"
+
e
);
expect
(
null
).
assertFail
();
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -493,7 +842,7 @@ describe('continuationManagerTest', function() {
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff001
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
must be string
"
)
).
assertTrue
();
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -511,7 +860,7 @@ describe('continuationManagerTest', function() {
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff002
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
must be string
"
)
).
assertTrue
();
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -523,10 +872,11 @@ describe('continuationManagerTest', function() {
*/
it
(
'
testOff003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
deviceSelected
"
,
"
invalid token
"
);
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff003
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
Callback is not registered
"
)
).
assertTrue
();
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -538,11 +888,11 @@ describe('continuationManagerTest', function() {
*/
it
(
'
testOff004
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
off
(
"
device
Disconnect
"
,
token
);
continuationManager
.
off
(
"
device
Unselected
"
,
"
invalid token
"
);
done
();
}
catch
(
e
)
{
console
.
info
(
"
testOff004
"
+
e
);
expect
(
e
.
toString
().
includes
(
"
Callback is not registered
"
)
).
assertTrue
();
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
...
...
@@ -761,6 +1111,220 @@ describe('continuationManagerTest', function() {
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0100
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 001
*/
it
(
'
testStartContinuationDeviceManager001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
token
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0200
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 002
*/
it
(
'
testStartContinuationDeviceManager002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
"
invalid token
"
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0300
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 003
*/
it
(
'
testStartContinuationDeviceManager003
'
,
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
.
startContinuationDeviceManager
(
"
invalid token
"
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager003
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0400
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 004
*/
it
(
'
testStartContinuationDeviceManager004
'
,
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
.
startContinuationDeviceManager
(
52
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager004
"
+
err
.
code
);
expect
(
err
.
code
==
16600002
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0500
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 005
*/
it
(
'
testStartContinuationDeviceManager005
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
30
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager005
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0600
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 006
*/
it
(
'
testStartContinuationDeviceManager006
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
console
.
info
(
"
testStartContinuationDeviceManager006
"
+
err
.
code
);
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0700
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 007
*/
it
(
'
testStartContinuationDeviceManager007
'
,
0
,
async
function
(
done
)
{
try
{
let
continuationExtraParams
=
{
deviceType
:
[
"
00E
"
],
description
:
"
description
"
,
filter
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
},
continuationMode
:
continuationManager
.
ContinuationMode
.
COLLABORATION_MUTIPLE
,
authInfo
:
{
"
name
"
:
"
authInfo
"
,
"
length
"
:
8
}
};
continuationManager
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager007
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0800
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 008
*/
it
(
'
testStartContinuationDeviceManager008
'
,
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
.
startContinuationDeviceManager
(
token
,
continuationExtraParams
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager008
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_STARTDEVICEMANAGER_0900
* @tc.name [JS-API9]ContinuationManager.startContinuationDeviceManager().
* @tc.desc Test Js Api ContinuationManager.startContinuationDeviceManager() testcase 009
*/
it
(
'
testStartContinuationDeviceManager009
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
startContinuationDeviceManager
(
token
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testStartContinuationDeviceManager009
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.name [JS-API8]ContinuationManager.updateConnectStatus().
...
...
@@ -888,5 +1452,128 @@ describe('continuationManagerTest', function() {
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0100
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 001
*/
it
(
'
testUpdateContinuationState001
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState001
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0200
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 002
*/
it
(
'
testUpdateContinuationState002
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
"
invalid token
"
,
TEST_DEVICE_ID
,
TEST_CONNECT_STATUS
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateContinuationState002
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState002
"
+
e
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0300
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 003
*/
it
(
'
testUpdateContinuationState003
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
-
2
,
function
(
err
,
data
)
{
console
.
info
(
"
testUpdateContinuationState003
"
+
err
.
code
);
expect
(
err
.
code
==
401
).
assertTrue
();
expect
(
data
==
undefined
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState003
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0400
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 004
*/
it
(
'
testUpdateContinuationState004
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateContinuationState004 begin
'
);
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
IDLE
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState004
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0500
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 005
*/
it
(
'
testUpdateContinuationState005
'
,
0
,
async
function
(
done
)
{
try
{
console
.
info
(
'
testUpdateContinuationState005 begin
'
);
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
CONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState005
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
/**
* @tc.number SUB_DISTRIBUTEDSCHEDULE_CONTINUATIONMANAGER_UPDATECONNECTSTATUS_0600
* @tc.name [JS-API9]ContinuationManager.updateContinuationState().
* @tc.desc Test Js Api ContinuationManager.updateContinuationState() testcase 006
*/
it
(
'
testUpdateContinuationState006
'
,
0
,
async
function
(
done
)
{
try
{
continuationManager
.
updateContinuationState
(
token
,
TEST_DEVICE_ID
,
continuationManager
.
DeviceConnectState
.
DISCONNECTING
).
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
}).
catch
((
err
)
=>
{
expect
(
err
.
code
==
16600002
).
assertTrue
();
});
done
();
}
catch
(
e
)
{
console
.
info
(
"
testUpdateContinuationState006
"
+
e
);
expect
(
null
).
assertFail
();
done
();
}
})
})}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录