Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1b859b2f
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看板
未验证
提交
1b859b2f
编写于
11月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6394 电话用例整改
Merge pull request !6394 from zhangfuzhi/master
上级
4c984031
51df72c6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
902 addition
and
35 deletion
+902
-35
telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/ObjectInterface_test.js
...anager_ims2_call/src/main/js/test/ObjectInterface_test.js
+8
-6
telephony/telephonyjstest/netmanager_base/network_nopermission/src/main/js/test/Http.nopermission.test.js
...k_nopermission/src/main/js/test/Http.nopermission.test.js
+4
-12
telephony/telephonyjstest/netmanager_base/register/Test.json
telephony/telephonyjstest/netmanager_base/register/Test.json
+8
-0
telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js
.../register/src/main/js/test/NetworkManagerRegister.test.js
+16
-0
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/NetStackSocket.test.js
...nager_base/socket/src/main/js/test/NetStackSocket.test.js
+141
-1
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
..._socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
+241
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionSecondJsUnit.test.ets
...t/entry/src/main/ets/test/ConnectionSecondJsUnit.test.ets
+67
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/SocketJsunit.test.ets
...ager_socket/entry/src/main/ets/test/SocketJsunit.test.ets
+417
-16
未找到文件。
telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/ObjectInterface_test.js
浏览文件 @
1b859b2f
...
...
@@ -417,7 +417,7 @@ export default function ObjectInterfaceTest() {
try
{
var
resultSet
=
await
contactsapi
.
queryContact
(
queryId
);
console
.
info
(
"
contactsApi_query_contact_test_400 : query resultSet =
"
+
JSON
.
stringify
(
resultSet
));
expect
(
resultSet
!=
null
).
assertTrue
();
expect
(
resultSet
==
undefined
).
assertTrue
();
done
();
}
catch
(
error
)
{
console
.
info
(
"
contactsApi_query_contact_test_400 query error =
"
+
error
);
...
...
@@ -437,7 +437,7 @@ export default function ObjectInterfaceTest() {
done
();
return
;
}
var
queryId
=
gRawContactId
.
toString
()
;
var
queryId
=
gRawContactId
;
var
holder
=
{
bundleName
:
"
com.ohos.contacts
"
,
displayName
:
"
phone
"
,
holderId
:
1
}
...
...
@@ -445,7 +445,8 @@ export default function ObjectInterfaceTest() {
expect
(
holder
.
displayName
===
null
).
assertFalse
();
expect
(
holder
.
holderId
!=
0
).
assertTrue
();
try
{
var
resultSet
=
await
contactsapi
.
queryContact
(
queryId
,
holder
);
var
findKey
=
contactsapi
.
queryKey
(
queryId
);
var
resultSet
=
await
contactsapi
.
queryContact
(
findKey
,
holder
);
console
.
info
(
"
contactsApi_query_contact_test_500 : query resultSet =
"
+
JSON
.
stringify
(
resultSet
));
expect
(
resultSet
===
null
).
assertFalse
();
done
();
...
...
@@ -467,7 +468,7 @@ export default function ObjectInterfaceTest() {
done
();
return
;
}
var
queryId
=
gRawContactId
.
toString
()
;
var
queryId
=
gRawContactId
;
var
holder
=
{
bundleName
:
"
com.ohos.contacts
"
,
displayName
:
"
phone
"
,
holderId
:
1
};
...
...
@@ -475,7 +476,8 @@ export default function ObjectInterfaceTest() {
attributes
:
[
1
,
5
,
6
]
}
try
{
var
resultSet
=
await
contactsapi
.
queryContact
(
queryId
,
holder
,
ContactAttributes
);
var
findKey
=
contactsapi
.
queryKey
(
queryId
);
var
resultSet
=
await
contactsapi
.
queryContact
(
findKey
,
holder
,
ContactAttributes
);
console
.
info
(
"
contactsApi_query_contact_test_600 : query resultSet =
"
+
JSON
.
stringify
(
resultSet
));
expect
(
resultSet
===
null
).
assertFalse
();
done
();
...
...
@@ -1051,7 +1053,7 @@ export default function ObjectInterfaceTest() {
try
{
var
updateCode
=
await
contactsapi
.
updateContact
(
updateValues
,
condition
);
console
.
info
(
"
abnormal_contactsApi_update_test_3000 : updateCode =
"
+
updateCode
);
expect
(
updateCode
===
-
1
).
assert
Fals
e
();
expect
(
updateCode
===
-
1
).
assert
Tru
e
();
done
();
}
catch
(
error
)
{
console
.
info
(
"
abnormal_contactsApi_update_test_3000 : update error =
"
+
error
);
...
...
telephony/telephonyjstest/netmanager_base/network_nopermission/src/main/js/test/Http.nopermission.test.js
浏览文件 @
1b859b2f
...
...
@@ -32,15 +32,12 @@ describe("Telephony_NetManager_NetWorkTest", function () {
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
=
602
).
assertTrue
()
expect
(
code
==
602
).
assertTrue
()
done
();
},
complete
:
function
(){
expect
().
assertTrue
()
done
();
}
})
done
();
});
/**
...
...
@@ -56,15 +53,12 @@ describe("Telephony_NetManager_NetWorkTest", function () {
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
=
602
).
assertTrue
()
expect
(
code
==
602
).
assertTrue
()
done
();
},
complete
:
function
(){
expect
().
assertTrue
()
done
();
}
})
done
();
});
/**
...
...
@@ -80,11 +74,10 @@ describe("Telephony_NetManager_NetWorkTest", function () {
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
=
602
).
assertTrue
()
expect
(
code
==
602
).
assertTrue
()
done
();
}
})
done
();
})
/**
...
...
@@ -100,11 +93,10 @@ describe("Telephony_NetManager_NetWorkTest", function () {
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
=
602
).
assertTrue
()
expect
(
code
==
602
).
assertTrue
()
done
();
}
})
done
();
})
});
...
...
telephony/telephonyjstest/netmanager_base/register/Test.json
浏览文件 @
1b859b2f
...
...
@@ -15,6 +15,14 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
,
"uinput -T -m 425 1000 425 500 400"
]
}
]
}
telephony/telephonyjstest/netmanager_base/register/src/main/js/test/NetworkManagerRegister.test.js
浏览文件 @
1b859b2f
...
...
@@ -29,6 +29,7 @@
const
TIMEOUT
=
100
;
const
TIMEOUT_1
=
1000
;
let
VALUE
=
0
;
let
envReady
=
false
;
function
sleep
(
timeout
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
@@ -2258,6 +2259,11 @@
* @tc.desc Function test
*/
it
(
'
Telephony_NetworkManager_unregister_Async_0100
'
,
0
,
async
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
caseName
=
'
Telephony_NetworkManager_unregister_Async_0100
'
;
let
netSpecifier
=
{
netCapabilities
:
{
...
...
@@ -2353,6 +2359,11 @@
* @tc.desc Function test
*/
it
(
'
Telephony_NetworkManager_unregister_Async_0200
'
,
0
,
async
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
caseName
=
'
Telephony_NetworkManager_unregister_Async_0200
'
;
let
netConn
=
connection
.
createNetConnection
();
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
...
...
@@ -2439,6 +2450,11 @@
* @tc.desc Function test
*/
it
(
'
Telephony_NetworkManager_unregister_Async_0300
'
,
0
,
async
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
caseName
=
'
Telephony_NetworkManager_unregister_Async_0300
'
;
let
netConn
=
connection
.
createNetConnection
();
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
...
...
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/NetStackSocket.test.js
浏览文件 @
1b859b2f
...
...
@@ -19,7 +19,7 @@ export default function Telephony_NETSTACK_SocketTest() {
describe
(
'
Telephony_NETSTACK_SocketTest
'
,
function
()
{
let
envReady
=
false
;
/**
* @tc.number Telephony_NetStack_UDPTest0100
...
...
@@ -28,6 +28,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0100
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
bind
({
address
:
"
127.0.0.1
"
,
...
...
@@ -47,6 +52,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0200
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
bind
({
address
:
"
127.0.0.1
"
,
...
...
@@ -66,6 +76,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0300
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
send
({
address
:
{
...
...
@@ -88,6 +103,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0400
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
send
({
address
:
{
...
...
@@ -110,6 +130,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0500
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
close
(
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTrue
()
...
...
@@ -125,6 +150,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0600
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
close
().
then
(
function
(
data
)
{
expect
(
data
!==
undefined
).
assertTrue
()
...
...
@@ -140,6 +170,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0700
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
getState
(
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTrue
()
...
...
@@ -155,6 +190,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0800
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
getState
().
then
(
function
(
data
)
{
expect
(
data
!==
undefined
).
assertTure
()
...
...
@@ -170,6 +210,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest0900
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
setExtraOptions
({},
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTure
()
...
...
@@ -185,6 +230,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest1000
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
setExtraOptions
({},).
then
(
function
(
date
)
{
expect
(
date
!==
undefined
).
assertTrue
()
...
...
@@ -200,6 +250,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest1100
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
on
(
'
message
'
,
function
()
{
expect
().
assertFail
()
...
...
@@ -227,6 +282,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_UDPTest1200
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
udp
=
netSocket
.
constructUDPSocketInstance
()
udp
.
on
(
'
message
'
,
function
()
{
})
...
...
@@ -262,6 +322,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0100
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
bind
({
address
:
"
127.0.0.1
"
,
...
...
@@ -281,6 +346,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0200
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
bind
({
address
:
"
127.0.0.1
"
,
...
...
@@ -300,6 +370,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0300
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
send
({
data
:
"
Hello
"
...
...
@@ -317,6 +392,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0400
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
send
({
data
:
"
Hello
"
...
...
@@ -334,6 +414,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0500
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
close
(
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTrue
()
...
...
@@ -349,6 +434,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0600
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
close
().
then
(
function
(
data
)
{
expect
(
data
!==
undefined
).
assertTrue
()
...
...
@@ -364,6 +454,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0700
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
getState
(
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTrue
()
...
...
@@ -379,6 +474,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0800
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
getState
().
then
(
function
(
data
)
{
expect
(
data
!==
undefined
).
assertTure
()
...
...
@@ -394,6 +494,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest0900
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
setExtraOptions
({},
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTure
()
...
...
@@ -409,6 +514,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest1000
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
setExtraOptions
({},).
then
(
function
(
date
)
{
expect
(
date
!==
undefined
).
assertTrue
()
...
...
@@ -424,6 +534,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest1100
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
on
(
'
message
'
,
function
()
{
expect
().
assertFail
()
...
...
@@ -451,6 +566,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
*/
it
(
'
Telephony_NetStack_TCPTest1200
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
on
(
'
message
'
,
function
()
{
})
...
...
@@ -485,6 +605,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
* @tc.desc Function test
*/
it
(
'
Telephony_NetStack_TCPTest1300
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
getRemoteAddress
(
function
(
err
,
data
)
{
expect
(
err
!==
undefined
).
assertTure
()
...
...
@@ -499,6 +624,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
* @tc.desc Function test
*/
it
(
'
Telephony_NetStack_TCPTest1400
'
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
tcp
=
netSocket
.
constructTCPSocketInstance
()
tcp
.
getRemoteAddress
().
then
(
function
(
data
)
{
expect
(
data
!==
undefined
).
assertTure
()
...
...
@@ -513,6 +643,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
* @tc.desc Function test
*/
it
(
"
Telephony_NetStack_TCPTest_1500
"
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
TCP
=
netSocket
.
constructTCPSocketInstance
()
TCP
.
connect
({
address
:
{
...
...
@@ -534,6 +669,11 @@ describe('Telephony_NETSTACK_SocketTest', function () {
* @tc.desc Function test
*/
it
(
"
Telephony_NetStack_TCPTest_1600
"
,
0
,
function
(
done
)
{
if
(
!
envReady
)
{
console
.
info
(
"
The environment was not ready
"
);
done
();
return
;
}
let
TCP
=
netSocket
.
constructTCPSocketInstance
()
TCP
.
connect
({
address
:
{
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
浏览文件 @
1b859b2f
...
...
@@ -25,9 +25,15 @@ export default function connectionJsunit() {
const DELAY = 1000;
const NETID_IVVALID = 99;
const NETID_IVVALID2 = 0;
let envReady = false;
console.log("************* connection Test start*************");
it('Telephony_Connection_Request_Socket_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
type HttpRequest = http.HttpRequest
;
type TCPSocket = socket.TCPSocket
...
...
@@ -46,6 +52,11 @@ export default function connectionJsunit() {
* @tc.desc : Create a network connection with optional netSpefifier and timeout.
*/
it('Telephony_Connection_Connection_createNetConnection_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_createNetConnection_0100 Test start*************");
try {
connection.createNetConnection(5000);
...
...
@@ -63,6 +74,11 @@ export default function connectionJsunit() {
* @tc.desc : Create a network connection with optional netSpefifier and timeout.
*/
it('Telephony_Connection_Connection_createNetConnection_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_createNetConnection_0200 Test start*************");
try {
connection.createNetConnection(3000);
...
...
@@ -80,6 +96,11 @@ export default function connectionJsunit() {
* @tc.desc : Create a network connection with optional netSpefifier and timeout.
*/
it('Telephony_Connection_Connection_createNetConnection_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_createNetConnection_0300 Test start*************");
try {
connection.createNetConnection(8000);
...
...
@@ -97,6 +118,11 @@ export default function connectionJsunit() {
* @tc.desc : Create a network connection with optional netSpefifier and timeout.
*/
it('Telephony_Connection_Connection_createNetConnection_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_createNetConnection_0400 Test start*************");
try {
let netSpecifier = {
...
...
@@ -122,6 +148,11 @@ export default function connectionJsunit() {
* @tc.desc : Create a network connection with optional netSpefifier and timeout.
*/
it('Telephony_Connection_Connection_createNetConnection_0500', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_createNetConnection_0500 Test start*************");
try {
let netSpecifier = {
...
...
@@ -147,6 +178,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains the data network that is activated by default.
*/
it('Telephony_Connection_Connection_getDefaultNet_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getDefaultNet_0100 Test start*************");
connection.getDefaultNet((error, data) => {
expect().assertFail();
...
...
@@ -163,6 +199,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains the data network that is activated by default.
*/
it('Telephony_Connection_Connection_getDefaultNet_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getDefaultNet_0200 Test start*************");
connection.getDefaultNet().then(data => {
console.log("Telephony_Connection_Connection_getDefaultNet_0200 getDefaultNet success, case fail");
...
...
@@ -181,6 +222,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains the list of data networks that are activated.
*/
it('Telephony_Connection_Connection_getAllNets_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getAllNets_0100 Test start*************");
connection.getAllNets((error, data) => {
if (error) {
...
...
@@ -199,6 +245,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains the list of data networks that are activated.
*/
it('Telephony_Connection_Connection_getAllNets_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getAllNets_0200 Test start*************");
connection.getAllNets().then(data => {
expect(true).assertTrue();
...
...
@@ -216,6 +267,11 @@ export default function connectionJsunit() {
* @tc.desc : Queries the connection properties of a network.
*/
it('Telephony_Connection_Connection_getConnectionProperties_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getConnectionProperties_0100 Test start*************");
connection.getConnectionProperties((error, data) => {
expect().assertFail();
...
...
@@ -232,6 +288,11 @@ export default function connectionJsunit() {
* @tc.desc : Queries the connection properties of a network.
*/
it('Telephony_Connection_Connection_getConnectionProperties_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getConnectionProperties_0200 Test start*************");
if (utils.notCheck) {
expect(true).assertTrue();
...
...
@@ -254,6 +315,11 @@ export default function connectionJsunit() {
* @tc.desc : Queries the connection properties of a network.
*/
it('Telephony_Connection_Connection_getConnectionProperties_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getConnectionProperties_0300 Test start*************");
let handle ={netId: NETID_IVVALID};
connection.getConnectionProperties(handle, (error, data) => {
...
...
@@ -274,6 +340,11 @@ export default function connectionJsunit() {
* @tc.desc : Queries the connection properties of a network.
*/
it('Telephony_Connection_Connection_getConnectionProperties_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getConnectionProperties_0400 Test start*************");
connection.getAllNets((error, value) => {
if (error) {
...
...
@@ -299,6 +370,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object.
*/
it('Telephony_Connection_Connection_getNetCapabilities_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getNetCapabilities_0100 Test start*************");
connection.getNetCapabilities((error, data) => {
expect().assertFail();
...
...
@@ -315,6 +391,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object.
*/
it('Telephony_Connection_Connection_getNetCapabilities_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getNetCapabilities_0200 Test start*************");
let handle = {netId:NETID_IVVALID};
connection.getNetCapabilities(handle, (error, data) => {
...
...
@@ -334,6 +415,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object.
*/
it('Telephony_Connection_Connection_getNetCapabilities_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getNetCapabilities_0300 Test start*************");
if (false) {
expect(true).assertTrue();
...
...
@@ -355,6 +441,11 @@ export default function connectionJsunit() {
* @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object.
*/
it('Telephony_Connection_Connection_getNetCapabilities_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getNetCapabilities_0400 Test start*************");
let caseName = 'Telephony_Connection_Connection_getNetCapabilities_0400';
connection.getAllNets((error, value) => {
...
...
@@ -390,6 +481,11 @@ export default function connectionJsunit() {
* @tc.desc : Checks whether the default data network is activated.
*/
it('Telephony_Connection_Connection_hasDefaultNet_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_hasDefaultNet_0100 Test start*************");
connection.hasDefaultNet((error, data) => {
if (error) {
...
...
@@ -410,6 +506,11 @@ export default function connectionJsunit() {
* @tc.desc : Checks whether the default data network is activated.
*/
it('Telephony_Connection_Connection_hasDefaultNet_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_hasDefaultNet_0200 Test start*************");
connection.hasDefaultNet().then(activated => {
expect().assertFail();
...
...
@@ -428,6 +529,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is connected.
*/
it('Telephony_Connection_Connection_reportNetConnected_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetConnected_0100 Test start*************");
connection.reportNetConnected((error, data) => {
if (error) {
...
...
@@ -449,6 +555,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is connected.
*/
it('Telephony_Connection_Connection_reportNetConnected_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetConnected_0200 Test start*************");
let handle = {netId: NETID_IVVALID};
connection.reportNetConnected(handle, (error, data) => {
...
...
@@ -471,6 +582,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is connected.
*/
it('Telephony_Connection_Connection_reportNetConnected_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetConnected_0300 Test start*************");
let handle = {netId: NETID_IVVALID2};
connection.reportNetConnected(handle).then(() => {
...
...
@@ -489,6 +605,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is connected.
*/
it('Telephony_Connection_Connection_reportNetConnected_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetConnected_0400 Test start*************");
let handle = {netId: NETID_IVVALID};
connection.reportNetConnected(handle).then(() => {
...
...
@@ -507,6 +628,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is disconnected.
*/
it('Telephony_Connection_Connection_reportNetDisconnected_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0100 Test start*************");
connection.reportNetDisconnected((error, data) => {
if (error) {
...
...
@@ -528,6 +654,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is disconnected.
*/
it('Telephony_Connection_Connection_reportNetDisconnected_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0200 Test start*************");
let handle ={netId: NETID_IVVALID};
connection.reportNetDisconnected(handle, (error, data) => {
...
...
@@ -550,6 +681,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is disconnected.
*/
it('Telephony_Connection_Connection_reportNetDisconnected_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0300 Test start*************");
let handle = {netId:NETID_IVVALID2};
connection.reportNetDisconnected(handle).then(() => {
...
...
@@ -568,6 +704,11 @@ export default function connectionJsunit() {
* @tc.desc : Reports the network state is disconnected.
*/
it('Telephony_Connection_Connection_reportNetDisconnected_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0400 Test start*************");
let handle = {netId: NETID_IVVALID};
connection.reportNetDisconnected(handle).then(() => {
...
...
@@ -586,6 +727,11 @@ export default function connectionJsunit() {
* @tc.desc : Resolves the host name to obtain all IP addresses based on the default data network.
*/
it('Telephony_Connection_Connection_getAddressesByName_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getAddressesByName_0100 Test start*************");
connection.getAddressesByName('www.test.com', (error, data) => {
if (error) {
...
...
@@ -607,6 +753,11 @@ export default function connectionJsunit() {
* @tc.desc : Resolves the host name to obtain all IP addresses based on the default data network.
*/
it('Telephony_Connection_Connection_getAddressesByName_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getAddressesByName_0200 Test start*************");
connection.getAddressesByName('www.test.com').then(data => {
expect().assertFail();
...
...
@@ -627,6 +778,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_netAvailable_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netAvailable_0100 Test start*************");
try {
let netConn = connection.createNetConnection();
...
...
@@ -649,6 +805,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_netBlockStatusChange_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netBlockStatusChange_0100 Test start*************");
try {
let netConn = connection.createNetConnection();
...
...
@@ -671,6 +832,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_netCapabilitiesChange_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netCapabilitiesChange_0100 Test start*************");
try {
let netConn = connection.createNetConnection();
...
...
@@ -693,6 +859,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_netConnectionPropertiesChange_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netConnectionPropertiesChange_0100 Test start*************");
try {
let netConn = connection.createNetConnection();
...
...
@@ -715,6 +886,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_netLost_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netLost_0100 Test start*************");
try {
let netConn = connection.createNetConnection();
...
...
@@ -737,6 +913,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_netUnavailable_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netUnavailable_0100 Test start*************");
try {
let netConn = connection.createNetConnection();
...
...
@@ -759,6 +940,11 @@ export default function connectionJsunit() {
* @tc.desc netCapabilities bearerPrivateIdentifier test
*/
it('Telephony_Connection_Connection_NetSpecifier_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_NetSpecifier_0100 Test start*************");
try {
let netSpecifier = {
...
...
@@ -784,6 +970,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_bindSocket_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_bindSocket_0100 Test start*************");
connection.getDefaultNet().then((handle) => {
handle.bindSocket(1, (error, value) => {
...
...
@@ -805,6 +996,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_NetHandle_getAddressesByName_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_NetHandle_getAddressesByName_0100 Test start*************");
connection.getDefaultNet().then((handle) => {
handle.getAddressesByName(addressBaidu, (error, value) => {
...
...
@@ -826,6 +1022,11 @@ export default function connectionJsunit() {
* @tc.desc Function test
*/
it('Telephony_Connection_Connection_getAddressByName_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_getAddressByName_0100 Test start*************");
connection.getDefaultNet().then((handle) => {
handle.getAddressByName(addressBaidu, (error, value) => {
...
...
@@ -847,6 +1048,11 @@ export default function connectionJsunit() {
* @tc.desc linkUpBandwidthKbps test
*/
it('Telephony_Connection_Connection_linkUpBandwidthKbps_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_linkUpBandwidthKbps_0100 Test start*************");
try {
let netSpecifier = {
...
...
@@ -872,6 +1078,11 @@ export default function connectionJsunit() {
* @tc.desc nlinkDownBandwidthKbps test
*/
it('Telephony_Connection_Connection_linkDownBandwidthKbps_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_linkDownBandwidthKbps_0100 Test start*************");
try {
let netSpecifier = {
...
...
@@ -897,6 +1108,11 @@ export default function connectionJsunit() {
* @tc.desc networkCap test
*/
it('Telephony_Connection_Connection_networkCap_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_networkCap_0100 Test start*************");
try {
let netSpecifier = {
...
...
@@ -922,6 +1138,11 @@ export default function connectionJsunit() {
* @tc.desc bearerTypes test
*/
it('Telephony_Connection_Connection_bearerTypes_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_bearerTypes_0100 Test start*************");
try {
let netSpecifier = {
...
...
@@ -947,6 +1168,11 @@ export default function connectionJsunit() {
* @tc.desc Receives status change notifications of a specified network.
*/
it('Telephony_Connection_Connection_register_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_register_0100 Test start*************");
if (false) {
expect(true).assertTrue();
...
...
@@ -985,6 +1211,11 @@ export default function connectionJsunit() {
* @tc.desc Cancels listening for network status changes. test
*/
it('Telephony_Connection_Connection_unregister_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_unregister_0100 Test start*************");
if (false) {
expect(true).assertTrue();
...
...
@@ -1022,6 +1253,11 @@ export default function connectionJsunit() {
* @tc.desc : netId test.
*/
it('Telephony_Connection_Connection_netId_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_netId_0100 Test start*************");
connection.getDefaultNet((error, data) => {
if (error) {
...
...
@@ -1040,6 +1276,11 @@ export default function connectionJsunit() {
* @tc.desc : domains test.
*/
it('Telephony_Connection_Connection_domains_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Connection_Connection_domains_0100 Test start*************");
let handle = {netId: NETID_IVVALID};
connection.getConnectionProperties(handle, (error, data) => {
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionSecondJsUnit.test.ets
浏览文件 @
1b859b2f
...
...
@@ -19,12 +19,19 @@ import utils from './Utils.ets'
export default function connectionSecondJsUnit() {
describe("connectionSecondJsunit", function () {
let envReady = false;
/**
* @tc.name: Telephony_connection_ConnectionProperties_0100
* @tc.desc: ConnectionProperties Properties detection
* @tc.author: kangyuntao
*/
it("Telephony_connection_ConnectionProperties_0100", 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony ConnectionProperties Test is starting-----------------------");
let caseName = 'Telephony_connection_ConnectionProperties_0100';
try {
...
...
@@ -74,6 +81,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getConnectionProperties_Async_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getConnectionProperties Test is starting-----------------------");
if(false){
expect(true).assertTrue();
...
...
@@ -119,6 +131,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it("Telephony_connection_RouteInfo_0300", 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("----------------------RouteInfo Properties Test is starting-----------------------");
try {
let resultInterface = {
...
...
@@ -158,6 +175,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getRouteInfo_Async_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getRouteInfo Test is starting-----------------------");
let caseName = 'Telephony_connection_getRouteInfo_Async_0400';
connection.getAllNets((error, value) => {
...
...
@@ -195,6 +217,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it("Telephony_connection_LinkAddress_0500", 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("----------------------LinkAddress Properties Test is starting-----------------------");
try {
let resultPrefixLength = {
...
...
@@ -214,6 +241,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getLinkAddress_Async_0600', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getLinkAddress Test is starting-----------------------");
let caseName = 'Telephony_connection_getLinkAddress_Async_0600';
connection.getAllNets((error, value) => {
...
...
@@ -249,6 +281,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it("Telephony_connection_NetAddress_0700", 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("----------------------NetAddress Properties Test is starting-----------------------");
try {
let resultPort = {
...
...
@@ -268,6 +305,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getNetAddress_Async_0800', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getNetAddress Test is starting-----------------------");
let caseName = 'Telephony_connection_getNetAddress_Async_0800';
connection.getAllNets((error, value) => {
...
...
@@ -303,6 +345,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it("Telephony_connection_NetCap_0900", 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony NetCap Properties Test is starting-----------------------");
if (false) {
expect(true).assertTrue();
...
...
@@ -329,6 +376,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getNetCap_Async_1000', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getNetCap Test is starting-----------------------");
let caseName = 'Telephony_connection_getNetCap_Async_1000';
connection.getAllNets((error, value) => {
...
...
@@ -362,6 +414,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it("Telephony_connection_NetBearType_1100", 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony NetBearType Properties Test is starting-----------------------");
if (false) {
expect(true).assertTrue();
...
...
@@ -385,6 +442,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getNetBearType_Async_1200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getNetBearType Test is starting-----------------------");
let caseName = 'Telephony_connection_getNetBearType_Async_1200';
connection.getAllNets((error, value) => {
...
...
@@ -418,6 +480,11 @@ export default function connectionSecondJsUnit() {
* @tc.author: kangyuntao
*/
it('Telephony_connection_getNetCapabilities_Promise_1300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("-----------------------Telephony getNetCapabilities Promise Test is starting-----------------------");
let caseName = 'Telephony_connection_getNetCapabilities_Promise_1300';
connection.getAllNets().then((handle) => {
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/SocketJsunit.test.ets
浏览文件 @
1b859b2f
...
...
@@ -23,6 +23,7 @@ export default function socketJsunit() {
console.log("************* socket Test start*************");
let tcp = socket.constructTCPSocketInstance();
let udp = socket.constructUDPSocketInstance();
let envReady = false;
/*
* @tc.number : Telephony_Socket_Socket_constructUDPSocketInstance_0100
...
...
@@ -30,6 +31,11 @@ export default function socketJsunit() {
* @tc.desc : Creates a UDPSocket object.
*/
it('Telephony_Socket_Socket_constructUDPSocketInstance_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_Socket_constructUDPSocketInstance_0100 Test start*************");
var udpSocket = udp;
expect(udpSocket != null).assertTrue();
...
...
@@ -43,6 +49,11 @@ export default function socketJsunit() {
* @tc.desc : Creates a TCPSocket object.
*/
it('Telephony_Socket_Socket_constructTCPSocketInstance_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_Socket_constructTCPSocketInstance_0100 Test start*************");
var tcpSocket = tcp;
expect(tcpSocket != null).assertTrue();
...
...
@@ -56,6 +67,11 @@ export default function socketJsunit() {
* @tc.desc : interface NetAddress
*/
it('Telephony_Socket_Socket_NetAddress_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_Socket_NetAddress_0100 Test start*************");
let netAddress = {
address: "test address",
...
...
@@ -75,6 +91,11 @@ export default function socketJsunit() {
* @tc.desc : UDPSendOptions.data
*/
it('Telephony_Socket_UDPSendOptions_data_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSendOptions_data_0100 Test start*************");
let udpSendOptions = {
data: "test data",
...
...
@@ -95,6 +116,11 @@ export default function socketJsunit() {
* @tc.desc : ExtraOptionsBase.receiveBufferSize
*/
it('Telephony_Socket_ExtraOptionsBase_receiveBufferSize_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_ExtraOptionsBase_receiveBufferSize_0100 Test start*************");
let extraOptionsBase = {
receiveBufferSize: 1,
...
...
@@ -113,6 +139,11 @@ export default function socketJsunit() {
* @tc.desc : ExtraOptionsBase.sendBufferSize
*/
it('Telephony_Socket_ExtraOptionsBase_sendBufferSize_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_ExtraOptionsBase_sendBufferSize_0100 Test start*************");
let extraOptionsBase = {
receiveBufferSize: 1,
...
...
@@ -131,6 +162,11 @@ export default function socketJsunit() {
* @tc.desc : ExtraOptionsBase.reuseAddress
*/
it('Telephony_Socket_ExtraOptionsBase_reuseAddress_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_ExtraOptionsBase_reuseAddress_0100 Test start*************");
let extraOptionsBase = {
receiveBufferSize: 1,
...
...
@@ -149,6 +185,11 @@ export default function socketJsunit() {
* @tc.desc : ExtraOptionsBase.socketTimeout
*/
it('Telephony_Socket_ExtraOptionsBase_socketTimeout_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_ExtraOptionsBase_socketTimeout_0100 Test start*************");
let extraOptionsBase = {
receiveBufferSize: 1,
...
...
@@ -167,6 +208,11 @@ export default function socketJsunit() {
* @tc.desc : SocketStateBase.isClose
*/
it('Telephony_Socket_SocketStateBase_isClose_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_SocketStateBase_isClose_0100 Test start*************");
let socketStateBase = {
isBound: true,
...
...
@@ -184,6 +230,11 @@ export default function socketJsunit() {
* @tc.desc : SocketRemoteInfo.port
*/
it('Telephony_Socket_SocketRemoteInfo_port_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_SocketRemoteInfo_port_0100 Test start*************");
let socketRemoteInfo = {
address: "test address",
...
...
@@ -202,6 +253,11 @@ export default function socketJsunit() {
* @tc.desc : SocketRemoteInfo.size
*/
it('Telephony_Socket_SocketRemoteInfo_size_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_SocketRemoteInfo_size_0100 Test start*************");
let socketRemoteInfo = {
address: "test address",
...
...
@@ -220,6 +276,11 @@ export default function socketJsunit() {
* @tc.desc : TCPConnectOptions.timeout
*/
it('Telephony_Socket_TCPConnectOptions_timeout_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPConnectOptions_timeout_0100 Test start*************");
let tcpConnectOptions = {
address: {
...
...
@@ -240,6 +301,11 @@ export default function socketJsunit() {
* @tc.desc : TCPSendOptions.data
*/
it('Telephony_Socket_TCPSendOptions_data_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSendOptions_data_0100 Test start*************");
let tcpSendOptions = {
data: "test data",
...
...
@@ -256,6 +322,11 @@ export default function socketJsunit() {
* @tc.desc : TCPSendOptions.encoding
*/
it('Telephony_Socket_TCPSendOptions_encoding_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSendOptions_encoding_0100 Test start*************");
let tcpSendOptions = {
data: "test data",
...
...
@@ -272,6 +343,11 @@ export default function socketJsunit() {
* @tc.desc : TCPExtraOptions.keepAlive
*/
it('Telephony_Socket_TCPExtraOptions_keepAlive_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPExtraOptions_keepAlive_0100 Test start*************");
let tcpExtraOptions = {
keepAlive: true,
...
...
@@ -293,6 +369,11 @@ export default function socketJsunit() {
* @tc.desc : TCPExtraOptions.OOBInline
*/
it('Telephony_Socket_TCPExtraOptions_OOBInline_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPExtraOptions_OOBInline_0100 Test start*************");
let tcpExtraOptions = {
keepAlive: true,
...
...
@@ -314,6 +395,11 @@ export default function socketJsunit() {
* @tc.desc : TCPExtraOptions.TCPNoDelay
*/
it('Telephony_Socket_TCPExtraOptions_TCPNoDelay_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPExtraOptions_TCPNoDelay_0100 Test start*************");
let tcpExtraOptions = {
keepAlive: true,
...
...
@@ -335,6 +421,11 @@ export default function socketJsunit() {
* @tc.desc : TCPExtraOptions.socketLinger
*/
it('Telephony_Socket_TCPExtraOptions_socketLinger_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPExtraOptions_socketLinger_0100 Test start*************");
let tcpExtraOptions = {
keepAlive: true,
...
...
@@ -358,6 +449,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number.
*/
it('Telephony_Socket_UDPSocket_bind_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
let caseName = "Telephony_Socket_UDPSocket_bind_0100"
console.log("************* Telephony_Socket_UDPSocket_bind_0100 Test start*************");
let netAddress = {
...
...
@@ -385,6 +481,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number.
*/
it('Telephony_Socket_UDPSocket_bind_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
let caseName = "Telephony_Socket_UDPSocket_bind_0200"
console.log("************* Telephony_Socket_UDPSocket_bind_0200 Test start*************");
...
...
@@ -416,6 +517,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number.
*/
it('Telephony_Socket_UDPSocket_bind_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_bind_0300 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_bind_0300"
let netAddress = {
...
...
@@ -441,6 +547,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number.
*/
it('Telephony_Socket_UDPSocket_bind_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_bind_0400 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_bind_0400"
let netAddress = {
...
...
@@ -465,6 +576,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_send_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_send_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_send_0100"
let udpSendOptions = {
...
...
@@ -495,6 +611,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_send_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_send_0200 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_send_0200"
let udpSendOptions = {
...
...
@@ -520,6 +641,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_send_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_send_0300 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_send_0300"
let udpSendOptions = {
...
...
@@ -548,6 +674,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_send_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_send_0400 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_send_0400"
let udpSendOptions = {
...
...
@@ -571,6 +702,11 @@ export default function socketJsunit() {
* @tc.desc : Closes a UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_close_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_close_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_close_0100"
udp.close((error, data) => {
...
...
@@ -592,6 +728,11 @@ export default function socketJsunit() {
* @tc.desc : Closes a UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_close_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_close_0200 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_close_0200"
udp.close().then(data => {
...
...
@@ -609,6 +750,11 @@ export default function socketJsunit() {
* @tc.desc : Obtains the status of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_getState_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_getState_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_getState_0100"
udp.getState((error, data) => {
...
...
@@ -631,6 +777,11 @@ export default function socketJsunit() {
* @tc.desc : Obtains the status of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_getState_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_getState_0200 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_getState_0200"
udp.getState().then(data => {
...
...
@@ -649,6 +800,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_setExtraOptions_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0100"
let udpExtraOptions = {
...
...
@@ -683,6 +839,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_setExtraOptions_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0200 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0200"
let udpExtraOptions = {
...
...
@@ -706,6 +867,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_setExtraOptions_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0300 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0300"
let udpExtraOptions = {}
...
...
@@ -729,6 +895,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_setExtraOptions_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0400 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0400"
let udpExtraOptions = {}
...
...
@@ -753,6 +924,11 @@ export default function socketJsunit() {
* @tc.desc : Listens for message receiving events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_on_message_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_on_message_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_on_message_0100"
udp.on('message', (data) => {
...
...
@@ -770,6 +946,11 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for message receiving events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_message_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_message_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_off_message_0100"
udp.off("message", data => {
...
...
@@ -787,7 +968,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for message receiving events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_message_0200', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_message_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_message_0200 Test start*************");
udp.off("message");
expect(true).assertTrue();
console.log("************* Telephony_Socket_UDPSocket_off_message_0200 Test end*************");
...
...
@@ -800,7 +986,12 @@ export default function socketJsunit() {
* @tc.desc : Listens for data packet message events or close events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_on_listening_0100', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_on_listening_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_on_listening_0100 Test start*************");
udp.on("listening", data => {
expect(true).assertTrue();
});
...
...
@@ -814,7 +1005,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_listening_0100', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_listening_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_listening_0100 Test start*************");
udp.off("listening", data => {
expect(true).assertTrue();
});
...
...
@@ -828,7 +1024,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_listening_0200', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_listening_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_listening_0200 Test start*************");
udp.off("listening");
expect(true).assertTrue();
console.log("************* Telephony_Socket_UDPSocket_off_listening_0200 Test end*************");
...
...
@@ -841,7 +1042,12 @@ export default function socketJsunit() {
* @tc.desc : Listens for data packet message events or close events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_on_close_0100', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_on_close_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_on_close_0100 Test start*************");
udp.on("close", data => {
expect(true).assertTrue();
});
...
...
@@ -855,7 +1061,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_close_0100', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_close_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_close_0100 Test start*************");
udp.off("close", data => {
expect(true).assertTrue();
});
...
...
@@ -869,7 +1080,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_close_0200', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_close_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_close_0200 Test start*************");
udp.off("close");
expect(true).assertTrue();
console.log("************* Telephony_Socket_UDPSocket_off_close_0200 Test end*************");
...
...
@@ -882,6 +1098,11 @@ export default function socketJsunit() {
* @tc.desc : Listens for error events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_on_error_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_on_error_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_on_error_0100"
udp.on("error", error => {
...
...
@@ -899,6 +1120,11 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for error events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_error_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_error_0100 Test start*************");
let caseName = "Telephony_Socket_UDPSocket_off_error_0100"
udp.off("error", error => {
...
...
@@ -916,7 +1142,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for error events of the UDPSocket connection.
*/
it('Telephony_Socket_UDPSocket_off_error_0200', 0, function (done) {
console.log("************* Telephony_Socket_UDPSocket_off_error_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_UDPSocket_off_error_0200 Test start*************");
udp.off("error");
expect(true).assertTrue();
console.log("************* Telephony_Socket_UDPSocket_off_error_0200 Test end*************");
...
...
@@ -929,6 +1160,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number
*/
it('Telephony_Socket_TCPSocket_bind_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_bind_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_bind_0100"
let netAddress = {
...
...
@@ -956,6 +1192,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number
*/
it('Telephony_Socket_TCPSocket_bind_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_bind_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_bind_0200"
let netAddress = {
...
...
@@ -980,6 +1221,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number
*/
it('Telephony_Socket_TCPSocket_bind_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_bind_0300 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_bind_0300"
let netAddress = {
...
...
@@ -1005,6 +1251,11 @@ export default function socketJsunit() {
* @tc.desc : Binds the IP address and port number
*/
it('Telephony_Socket_TCPSocket_bind_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_bind_0400 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_bind_0400"
...
...
@@ -1028,6 +1279,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_send_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_send_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_send_0100"
let tcpSendOptions = {
...
...
@@ -1054,6 +1310,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_send_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_send_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_send_0200"
let tcpSendOptions = {
...
...
@@ -1075,6 +1336,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_send_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_send_0300 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_send_0300"
let tcpSendOptions = {
...
...
@@ -1100,6 +1366,11 @@ export default function socketJsunit() {
* @tc.desc : Sends data over a TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_send_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_send_0400 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_send_0400"
let tcpSendOptions = {
...
...
@@ -1120,6 +1391,11 @@ export default function socketJsunit() {
* @tc.desc : Sets up a connection to the specified IP address and port number.
*/
it('Telephony_Socket_TCPSocket_connect_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_connect_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_connect_0100"
let tcpConnectOptions = {
...
...
@@ -1150,6 +1426,11 @@ export default function socketJsunit() {
* @tc.desc : Sets up a connection to the specified IP address and port number.
*/
it('Telephony_Socket_TCPSocket_connect_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_connect_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_connect_0200"
let tcpConnectOptions = {
...
...
@@ -1175,6 +1456,11 @@ export default function socketJsunit() {
* @tc.desc : Sets up a connection to the specified IP address and port number.
*/
it('Telephony_Socket_TCPSocket_connect_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_connect_0300 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_connect_0300"
let tcpConnectOptions = {
...
...
@@ -1204,6 +1490,11 @@ export default function socketJsunit() {
* @tc.desc : Sets up a connection to the specified IP address and port number.
*/
it('Telephony_Socket_TCPSocket_connect_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_connect_0400 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_connect_0400"
let tcpConnectOptions = {
...
...
@@ -1228,6 +1519,11 @@ export default function socketJsunit() {
* @tc.desc : Closes a UDPSocket connection.
*/
it('Telephony_Socket_TCPSocket_close_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_close_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_close_0100"
tcp.close((error, data) => {
...
...
@@ -1249,6 +1545,11 @@ export default function socketJsunit() {
* @tc.desc : Closes a UDPSocket connection.
*/
it('Telephony_Socket_TCPSocket_close_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_close_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_close_0200"
tcp.close().then(data => {
...
...
@@ -1266,6 +1567,11 @@ export default function socketJsunit() {
* @tc.desc : Obtains the status of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_getState_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_getState_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_getState_0100"
tcp.getState((error, data) => {
...
...
@@ -1288,6 +1594,11 @@ export default function socketJsunit() {
* @tc.desc : Obtains the status of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_getState_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_getState_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_getState_0200"
tcp.getState().then(data => {
...
...
@@ -1305,6 +1616,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_setExtraOptions_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0100"
let tcpExtraOptions = {
...
...
@@ -1336,6 +1652,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_setExtraOptions_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0200"
let tcpExtraOptions = {
...
...
@@ -1368,6 +1689,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_setExtraOptions_0300', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0300 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0300"
let tcpExtraOptions = {
...
...
@@ -1396,6 +1722,11 @@ export default function socketJsunit() {
* @tc.desc : Sets other attributes of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_setExtraOptions_0400', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0400 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0400"
let tcpExtraOptions = {
...
...
@@ -1425,6 +1756,11 @@ export default function socketJsunit() {
* @tc.desc : Obtains the peer address of a TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_getRemoteAddress_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_getRemoteAddress_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_getRemoteAddress_0100"
tcp.getRemoteAddress((error) => {
...
...
@@ -1446,6 +1782,11 @@ export default function socketJsunit() {
* @tc.desc : Obtains the peer address of a TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_getRemoteAddress_0200', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_getRemoteAddress_0200 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_getRemoteAddress_0200"
tcp.getRemoteAddress().then(data => {
...
...
@@ -1463,6 +1804,11 @@ export default function socketJsunit() {
* @tc.desc : Listens for message receiving events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_on_message_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_on_message_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_on_message_0100"
tcp.on("message", data => {
...
...
@@ -1480,6 +1826,11 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for message receiving events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_message_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_message_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_off_message_0100"
tcp.off("message", data => {
...
...
@@ -1497,7 +1848,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for message receiving events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_message_0200', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_message_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_message_0200 Test start*************");
tcp.off("message");
expect(true).assertTrue();
console.log("************* Telephony_Socket_TCPSocket_off_message_0200 Test end*************");
...
...
@@ -1510,7 +1866,12 @@ export default function socketJsunit() {
* @tc.desc : Listens for connection or close events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_on_connect_0100', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_on_connect_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_on_connect_0100 Test start*************");
tcp.on("connect", data => {
expect(true).assertTrue();
});
...
...
@@ -1524,7 +1885,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for connection or close events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_connect_0100', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_connect_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_connect_0100 Test start*************");
tcp.off("connect", data => {
expect(true).assertTrue();
});
...
...
@@ -1538,7 +1904,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for connection or close events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_connect_0200', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_connect_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_connect_0200 Test start*************");
tcp.off("connect");
expect(true).assertTrue();
console.log("************* Telephony_Socket_TCPSocket_off_connect_0200 Test end*************");
...
...
@@ -1551,7 +1922,12 @@ export default function socketJsunit() {
* @tc.desc : Listens for connection or close events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_on_close_0100', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_on_close_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_on_close_0100 Test start*************");
tcp.on("close", data => {
expect(true).assertTrue();
});
...
...
@@ -1565,7 +1941,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for connection or close events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_close_0100', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_close_0100 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_close_0100 Test start*************");
tcp.off("close", data => {
expect(true).assertTrue();
});
...
...
@@ -1579,7 +1960,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for connection or close events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_close_0200', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_close_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_close_0200 Test start*************");
tcp.off("close");
expect(true).assertTrue();
console.log("************* Telephony_Socket_TCPSocket_off_close_0200 Test end*************");
...
...
@@ -1592,6 +1978,11 @@ export default function socketJsunit() {
* @tc.desc : Listens for error events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_on_error_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_on_error_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_on_error_0100"
tcp.on("error", error => {
...
...
@@ -1609,6 +2000,11 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for error events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_error_0100', 0, function (done) {
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_error_0100 Test start*************");
let caseName = "Telephony_Socket_TCPSocket_off_error_0100"
tcp.off("error", error => {
...
...
@@ -1626,7 +2022,12 @@ export default function socketJsunit() {
* @tc.desc : Cancels listening for error events of the TCPSocket connection.
*/
it('Telephony_Socket_TCPSocket_off_error_0200', 0, function (done) {
console.log("************* Telephony_Socket_TCPSocket_off_error_0200 Test start*************");
if (!envReady) {
console.info("The environment was not ready");
done();
return;
}
console.log("************* Telephony_Socket_TCPSocket_off_error_0200 Test start*************");
tcp.off("error");
expect(true).assertTrue();
console.log("************* Telephony_Socket_TCPSocket_off_error_0200 Test end*************");
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录