Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9a339e86
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9a339e86
编写于
7月 22, 2023
作者:
G
gaoxi785
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new code
Signed-off-by:
N
gaoxi785
<
gaoxi785@huawei.com
>
上级
c291af34
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
274 addition
and
7 deletion
+274
-7
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/List.test.js
...test/netmanager_base/socket/src/main/js/test/List.test.js
+2
-0
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/NetManagerTLSSocketServer.test.js
...socket/src/main/js/test/NetManagerTLSSocketServer.test.js
+46
-0
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/NetworkManagerTCPSocketServer.test.js
...et/src/main/js/test/NetworkManagerTCPSocketServer.test.js
+38
-3
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/HttpJsunit.test.ets
...tmanager_http/entry/src/main/ets/test/HttpJsunit.test.ets
+101
-4
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
...tistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
+1
-0
telephony/telephonyjstest/sms_mms/sms_mms_error/src/main/js/test/SmsMmsError.test.js
...ms_mms/sms_mms_error/src/main/js/test/SmsMmsError.test.js
+86
-0
未找到文件。
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/List.test.js
浏览文件 @
9a339e86
...
...
@@ -14,7 +14,9 @@
*/
import
Telephony_NETSTACK_SocketTest
from
'
./NetStackSocket.test
'
;
import
NetworkManagerTCPSocketServer
from
"
./NetworkManagerTCPSocketServer.test
"
;
import
NetManagerTLSSocketServer
from
'
./NetManagerTLSSocketServer.test
'
;
export
default
function
testsuite
()
{
Telephony_NETSTACK_SocketTest
();
NetworkManagerTCPSocketServer
();
NetManagerTLSSocketServer
();
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/NetManagerTLSSocketServer.test.js
0 → 100644
浏览文件 @
9a339e86
/**
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
netSocket
from
'
@ohos.net.socket
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
NetManagerTlsSocketServerTest
()
{
describe
(
'
NetManagerTLSSocketServerTest
'
,
function
()
{
/**
* @tc.number NetworkManager_TLSSocketServer_on_connect_0100
* @tc.name Test on() interface
* @tc.desc Function test
*/
it
(
'
NetworkManager_TLSSocketServer_on_connect_0100
'
,
0
,
async
function
(
done
)
{
let
caseName
=
'
NetworkManager_TLSSocketServer_on_connect_0100
'
;
let
tlsServer
=
netSocket
.
constructTLSSocketServerInstance
();
try
{
tlsServer
.
on
(
'
connect
'
,
data
=>
{
console
.
info
(
`
${
caseName
}
on connect success
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
.
clientId
!=
undefined
).
assertTrue
();
done
();
});
tlsServer
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
ExpectFalse
();
done
();
return
;
}
});
});
}
\ No newline at end of file
telephony/telephonyjstest/netmanager_base/socket/src/main/js/test/NetworkManagerTCPSocketServer.test.js
浏览文件 @
9a339e86
...
...
@@ -142,8 +142,10 @@ export default function NetTCPSocketServerTest() {
try
{
server
.
on
(
'
connect
'
,
data
=>
{
console
.
info
(
`
${
caseName
}
on connect success
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
.
clientId
!=
undefined
).
assertTrue
();
done
();
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -219,6 +221,7 @@ export default function NetTCPSocketServerTest() {
ExpectFalse
();
done
();
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -268,6 +271,7 @@ export default function NetTCPSocketServerTest() {
}
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -301,6 +305,7 @@ export default function NetTCPSocketServerTest() {
}
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -334,6 +339,7 @@ export default function NetTCPSocketServerTest() {
}
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect send error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -365,6 +371,7 @@ export default function NetTCPSocketServerTest() {
return
;
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -396,6 +403,7 @@ export default function NetTCPSocketServerTest() {
return
;
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -428,6 +436,7 @@ export default function NetTCPSocketServerTest() {
}
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -459,6 +468,7 @@ export default function NetTCPSocketServerTest() {
return
;
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -491,6 +501,7 @@ export default function NetTCPSocketServerTest() {
}
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -522,6 +533,7 @@ export default function NetTCPSocketServerTest() {
return
;
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -754,7 +766,9 @@ export default function NetTCPSocketServerTest() {
done
();
return
;
}
data
.
off
(
'
message
'
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -788,6 +802,7 @@ export default function NetTCPSocketServerTest() {
return
;
}
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -824,6 +839,7 @@ export default function NetTCPSocketServerTest() {
return
;
}
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -859,7 +875,9 @@ export default function NetTCPSocketServerTest() {
done
();
return
;
}
data
.
off
(
'
message
'
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -887,6 +905,7 @@ export default function NetTCPSocketServerTest() {
expect
(
true
).
assertTrue
();
done
();
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -919,7 +938,9 @@ export default function NetTCPSocketServerTest() {
done
();
return
;
}
data
.
off
(
'
close
'
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -953,6 +974,7 @@ export default function NetTCPSocketServerTest() {
return
;
}
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -989,6 +1011,7 @@ export default function NetTCPSocketServerTest() {
return
;
}
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1024,7 +1047,9 @@ export default function NetTCPSocketServerTest() {
done
();
return
;
}
data
.
off
(
'
close
'
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1052,6 +1077,7 @@ export default function NetTCPSocketServerTest() {
expect
(
true
).
assertTrue
();
done
();
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1076,7 +1102,9 @@ export default function NetTCPSocketServerTest() {
console
.
info
(
`
${
caseName
}
on err failed, err:
${
JSON
.
stringify
(
err
)}
`
);
done
();
});
data
.
off
(
"
error
"
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1110,6 +1138,7 @@ export default function NetTCPSocketServerTest() {
return
;
}
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1138,6 +1167,7 @@ export default function NetTCPSocketServerTest() {
done
();
});
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1172,7 +1202,9 @@ export default function NetTCPSocketServerTest() {
done
();
return
;
}
data
.
off
(
"
error
"
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1198,6 +1230,7 @@ export default function NetTCPSocketServerTest() {
});
data
.
off
(
"
error
"
);
});
server
.
off
(
'
connect
'
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1219,6 +1252,7 @@ export default function NetTCPSocketServerTest() {
server
.
on
(
"
error
"
,
err
=>
{
console
.
info
(
`
${
caseName
}
on err failed, err:
${
JSON
.
stringify
(
err
)}
`
);
});
server
.
off
(
"
error
"
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1267,6 +1301,7 @@ export default function NetTCPSocketServerTest() {
server
.
off
(
null
,
err
=>
{
console
.
info
(
`
${
caseName
}
off err failed, err:
${
JSON
.
stringify
(
err
)}
`
);
});
server
.
off
(
"
error
"
);
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch err, expect err: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1288,7 +1323,7 @@ export default function NetTCPSocketServerTest() {
server
.
on
(
"
error
"
,
err
=>
{
console
.
info
(
`
${
caseName
}
on err failed, err:
${
JSON
.
stringify
(
err
)}
`
);
});
server
.
off
(
"
error
"
)
server
.
off
(
"
error
"
)
;
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
caseName
}
catch error, expect error: [
${
error
.
code
}
,
${
error
.
message
}
]`
);
...
...
@@ -1313,7 +1348,7 @@ export default function NetTCPSocketServerTest() {
done
();
}
else
{
console
.
info
(
caseName
+
'
getSocketFd data
'
+
JSON
.
stringify
(
data
));
expect
(
data
==
0
).
assertTrue
();
expect
(
data
!=
-
1
).
assertTrue
();
done
();
}
});
...
...
@@ -1329,7 +1364,7 @@ export default function NetTCPSocketServerTest() {
let
tcp
=
socket
.
constructTCPSocketInstance
();
tcp
.
getSocketFd
().
then
((
data
)
=>
{
console
.
info
(
caseName
+
'
getSocketFd data
'
+
JSON
.
stringify
(
data
));
expect
(
data
==
0
).
assertTrue
();
expect
(
data
!=
-
1
).
assertTrue
();
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
caseName
+
'
getSocketFd err
'
+
JSON
.
stringify
(
err
));
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/test/HttpJsunit.test.ets
浏览文件 @
9a339e86
...
...
@@ -15,9 +15,12 @@
import {describe, it, expect} from '@ohos/hypium';
import http from '@ohos.net.http';
import connection from "@ohos.net.connection";
import ethernet from '@ohos.net.ethernet';
type httpProxy = connection.HttpProxy;
export default function httpJsunit() {
describe("httpJsunitTest", function () {
/**
* @tc.number Telephony_Http_Http_createHttp_0100
* @tc.name createHttp
...
...
@@ -31,6 +34,7 @@ export default function httpJsunit() {
httpRequest.destroy();
done();
});
/**
* @tc.number Telephony_NetworkManager_getDefaultNetSync
* @tc.name Test getDefaultNetSync() to check return value
...
...
@@ -69,7 +73,7 @@ export default function httpJsunit() {
expect(data).assertEqual(true);
done();
}
})
})
;
});
/**
...
...
@@ -87,7 +91,100 @@ export default function httpJsunit() {
console.log(JSON.stringify(error));
expect().assertFail();
done();
})
});
});
/**
* @tc.number Telephony_NetworkManager_getDefaultHttpProxy_Async_0100
* @tc.name Test getDefaultHttpProxy() to check return value
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getDefaultHttpProxy_Async_0100', 0, async function (done) {
let caseName = 'Telephony_NetworkManager_getDefaultHttpProxy_Async_0100';
connection.getDefaultHttpProxy((error, data) => {
if (error) {
console.log(`${caseName} getDefaultHttpProxy error`);
expect().assertFail();
done();
} else {
console.log(`${caseName} getDefaultHttpProxy success`);
expect(error).assertEqual(undefined);
expect(data != '').assertTrue();
done();
}
});
});
/**
* @tc.number Telephony_NetworkManager_getDefaultHttpProxy_Promise_0100
* @tc.name Test getDefaultHttpProxy() to check return value
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getDefaultHttpProxy_Promise_0100', 0, async function (done) {
let caseName = 'Telephony_NetworkManager_getDefaultHttpProxy_Promise_0100';
connection.getDefaultHttpProxy().then((data) => {
console.log(`${caseName} getDefaultHttpProxy success`);
expect(data != '').assertTrue();
done();
}).catch((error) => {
console.log(JSON.stringify(error));
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_NetworkManager_getDefaultHttpProxy_Async_0200
* @tc.name Test getDefaultHttpProxy() to check return value
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getDefaultHttpProxy_Async_0200', 0, async function (done) {
let caseName = 'Telephony_NetworkManager_getDefaultHttpProxy_Async_0200';
connection.getDefaultNet().then(function (netHandle) {
console.log("netHandle is " +JSON.stringify(netHandle));
connection.setAppNet(netHandle).then(() => {
console.log("setAppNet success");
connection.getDefaultHttpProxy((error, data) => {
if (error) {
console.log(`${caseName} getDefaultHttpProxy error`);
expect().assertFail();
done();
} else {
console.log(`${caseName} getDefaultHttpProxy success`);
expect(data != '').assertTrue();
done();
}
});
}).catch(error => {
console.log("setAppNet err " + JSON.stringify(error));
});
});
});
/**
* @tc.number Telephony_NetworkManager_getDefaultHttpProxy_Promise_0200
* @tc.name Test getDefaultHttpProxy() to check return value
* @tc.desc Function test
*/
it('Telephony_NetworkManager_getDefaultHttpProxy_Promise_0200', 0, async function (done) {
let caseName = 'Telephony_NetworkManager_getDefaultHttpProxy_Promise_0200';
connection.getDefaultNet().then(function (netHandle) {
console.log("netHandle is " +JSON.stringify(netHandle));
connection.setAppNet(netHandle).then(() => {
console.log("setAppNet success");
connection.getDefaultHttpProxy().then((data) => {
console.log(`${caseName} getDefaultHttpProxy success`);
expect(data != '').assertTrue();
done();
}).catch((error) => {
console.log(JSON.stringify(error));
expect().assertFail();
done();
});
}).catch(error => {
console.log("setAppNet err " + JSON.stringify(error));
});
});
});
})
};
\ No newline at end of file
});
}
\ No newline at end of file
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
浏览文件 @
9a339e86
...
...
@@ -316,6 +316,7 @@ export default function radioSecondJsunit() {
expect(NETWORK_TYPES).assertContain(data[i].signalInformation.signalType);
expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.signalLevel);
expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.dBm);
expect(data[i].data != undefined && data[i].data != '' && data[i].data != null).assertTrue();
if (data[i].networkType === radio.NetworkType.NETWORK_TYPE_LTE) {
console.log("radio.NetworkType.NETWORK_TYPE_LTE:" + radio.NetworkType.NETWORK_TYPE_LTE);
...
...
telephony/telephonyjstest/sms_mms/sms_mms_error/src/main/js/test/SmsMmsError.test.js
浏览文件 @
9a339e86
...
...
@@ -153,5 +153,91 @@ describe('SmsMmsErrorTest', function () {
done
();
}
});
/**
* @tc.number Telephony_SmsMms_sendShortMessage_Promise_0100
* @tc.name Telephony_SmsMms_sendShortMessage_Promise_0100
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_sendShortMessage_Promise_0100
'
,
0
,
async
function
(
done
)
{
try
{
let
sendCallback
=
function
(
err
,
data
)
{
expect
(
data
.
isLastPart
).
assertEqual
(
false
);
console
.
log
(
`sendCallback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
}
let
deliveryCallback
=
function
(
err
,
data
)
{
console
.
log
(
`deliveryCallback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
}
let
slotId
=
0
;
let
content
=
'
短信内容
'
;
let
destinationHost
=
'
10086
'
;
let
serviceCenter
=
''
;
let
destinationPort
=
1000
;
let
options
=
{
slotId
,
content
,
destinationHost
,
serviceCenter
,
destinationPort
,
sendCallback
,
deliveryCallback
};
sms
.
sendMessage
(
options
).
then
((
data
)
=>
{
console
.
info
(
'
Telephony_SmsMms_sendShortMessage_Promise_0100
'
+
JSON
.
stringify
(
data
));
expect
().
assertFail
();
done
();
}).
catch
((
error
)
=>
{
expect
(
error
.
code
==
201
).
assertTrue
();
done
();
});
}
catch
(
err
)
{
expect
(
true
).
assertFalse
();
done
();
}
});
/**
* @tc.number Telephony_SmsMms_sendShortMessage_Async_0100
* @tc.name v
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_sendShortMessage_Async_0100
'
,
0
,
async
function
(
done
)
{
try
{
let
sendCallback
=
function
(
err
,
data
)
{
expect
(
data
.
isLastPart
).
assertEqual
(
false
);
console
.
log
(
`sendCallback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
}
let
deliveryCallback
=
function
(
err
,
data
)
{
console
.
log
(
`deliveryCallback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
}
let
slotId
=
0
;
let
content
=
'
短信内容
'
;
let
destinationHost
=
'
10086
'
;
let
serviceCenter
=
''
;
let
destinationPort
=
1000
;
let
options
=
{
slotId
,
content
,
destinationHost
,
serviceCenter
,
destinationPort
,
sendCallback
,
deliveryCallback
};
sms
.
sendMessage
(
options
,(
err
,
data
)
=>
{
if
(
err
){
expect
(
error
.
code
==
201
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
Telephony_SmsMms_sendShortMessage_Async_0100
'
+
JSON
.
stringify
(
data
));
expect
().
assertFail
();
done
();
}
});
}
catch
(
err
)
{
expect
(
true
).
assertFalse
();
done
();
}
});
});
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录