提交 77ca00a1 编写于 作者: Z zhangfuzhi

fixed c049769 from https://gitee.com/zhangfuzhi1/xts_acts/pulls/6398

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