Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8bd1584f
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看板
提交
8bd1584f
编写于
5月 24, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test cases
Signed-off-by:
N
bayanxing
<
bayanxing@kaihongdigi.com
>
上级
45164681
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
304 addition
and
2 deletion
+304
-2
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestDownloadTaskJsunit.test.ets
...n/ets/MainAbility/test/RequestDownloadTaskJsunit.test.ets
+173
-1
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestJsunit.test.ets
...ntry/src/main/ets/MainAbility/test/RequestJsunit.test.ets
+38
-1
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets
.../src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets
+52
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets
...main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets
+41
-0
未找到文件。
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestDownloadTaskJsunit.test.ets
浏览文件 @
8bd1584f
...
...
@@ -335,5 +335,177 @@ export default function requestDownloadJsunit() {
done();
});
/**
* @tc.number requestDownload_test_015
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_015', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.remove().then((result) => {
console.info('requestDownload_test_015 Download task removed result=' + result);
expect(true).assertTrue();
}).catch ((err) => {
console.log("requestDownload_test_015 downloadTask remove err:" + err);
expect(true).assertTrue();
});
});
} catch (exception) {
console.log("requestDownload_test_015 failed due to execute timeout 5s");
expect(true).assertTrue();
}
done();
});
/**
* @tc.number requestDownload_test_016
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_016', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.query().then((downloadInfo) => {
console.info('requestDownload_test_016 Data:' + JSON.stringify(downloadInfo));
expect(true).assertTrue();
}) .catch((err) => {
console.log("downloadTask query err:" + err);
expect(true).assertTrue();
});
});
} catch (err) {
console.log("requestDownload_test_016 invoke download error : " + JSON.stringify(err));
expect(true).assertTrue();
}
done();
});
/**
* @tc.number requestDownload_test_017
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_017', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.queryMimeType().then((data) => {
console.info('requestDownload_test_017. Data:' + JSON.stringify(data));
expect(true).assertTrue();
}).catch((err) => {
console.log("downloadTask queryMimeType err:" + err);
expect(true).assertTrue();
});
});
} catch (exception) {
console.log("requestDownload_test_017 failed due to execute timeout 5s");
expect(true).assertTrue();
}
done();
});
/**
* @tc.number requestDownload_test_018
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_018', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.pause().then((data) => {
console.info('requestDownload_test_018. Data:' + JSON.stringify(data));
expect(true).assertTrue();
}).catch((err) => {
console.log("requestDownload_test_018 err:" + err);
expect(true).assertTrue();
});
});
} catch (exception) {
console.log("requestDownload_test_018 failed due to execute timeout 5s");
expect(true).assertTrue();
}
done();
});
/**
* @tc.number requestDownload_test_019
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_019', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.pause((err, result)=>{
if(err) {
console.error('requestDownload_test_019 error:' + JSON.stringify(err));
expect(true).assertTrue();
} else {
console.info('requestDownload_test_019. result:' + JSON.stringify(result));
expect(true).assertTrue();
}
});
});
} catch (exception) {
console.log("requestDownload_test_019 failed due to execute timeout 5s");
expect(true).assertTrue();
}
done();
});
/**
* @tc.number requestDownload_test_020
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_020', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.resume().then((data) => {
console.info('requestDownload_test_020. Data:' + JSON.stringify(data));
expect(true).assertTrue();
}).catch((err) => {
console.log("requestDownload_test_020 err:" + err);
expect(true).assertTrue();
});
});
} catch (exception) {
console.log("requestDownload_test_020 failed due to execute timeout 5s");
expect(true).assertTrue();
}
done();
});
/**
* @tc.number requestDownload_test_021
* @tc.name Test The request DownloadTask
* @tc.desc Function test
*/
it('requestDownload_test_021', 0, async function (done) {
try {
request.download(downloadConfig, (downloadTask) => {
console.log("downloadConfig result:" + JSON.stringify(downloadTask))
downloadTask.resume((err, result)=>{
if(err) {
console.error('requestDownload_test_021 error:' + JSON.stringify(err));
expect(true).assertTrue();
} else {
console.info('requestDownload_test_021. result:' + JSON.stringify(result));
expect(true).assertTrue();
}
});
});
} catch (exception) {
console.log("requestDownload_test_021 failed due to execute timeout 5s");
expect(true).assertTrue();
}
done();
});
})
}
}
\ No newline at end of file
miscservices/InputMethodTest_ets/entry/src/main/ets/MainAbility/test/RequestJsunit.test.ets
浏览文件 @
8bd1584f
...
...
@@ -196,7 +196,44 @@ export default function requestJsunit() {
console.log("-----------------------request_upload_0006 end-----------------------");
done();
})
})
});
/**
* @tc.name: ohos.request_request_upload_0007
* @tc.desc: request_upload Method detection
*/
it('request_upload_0007', 0, async function (done) {
console.log("-----------------------request_upload_0007 is starting-----------------------");
try {
console.log("request_upload_0007 getUploadConfig() " + getUploadConfig());
request.upload(getUploadConfig(), (err, uploadTask) => {
if (err) {
expect().assertFail();
} else {
console.log("request_upload_0007 progress uploadTask =" + JSON.stringify(uploadTask));
uploadTask.on('headerReceive', function (data1, data2) {
console.log("request_upload_0007 headerReceive on data1 =" + data1);
console.log("request_upload_0007 headerReceive on data2 =" + data2);
})
uploadTask.off('headerReceive', function (data1, data2) {
console.log("request_upload_0007 headerReceive off data1 =" + data1);
console.log("request_upload_0007 headerReceive off data2 =" + data2);
})
uploadTask.remove().then((result) => {
console.log("request_upload_0006 remove =" + result);
}).catch((err) => {
console.error('Failed to remove the upload task. Cause: ' + JSON.stringify(err));
});
}
})
} catch (err) {
expect(true).assertEqual(true);
console.error("request_upload_0007 error: " + err);
}
console.log("-----------------------request_upload_0007 end-----------------------");
done();
})
});
function getUploadConfig() {
let file = {
...
...
telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets
浏览文件 @
8bd1584f
...
...
@@ -270,6 +270,58 @@ export default function httpRequestJsunit() {
}
});
/**
* @tc.number Telephony_http_HttpRequest_off_headersReceive_0200
* @tc.name httprequest::off_headersReceive
* @tc.desc Test Test httprequest property.
*/
it("Telephony_http_HttpRequest_off_headersReceive_0200", 0, function (done) {
var casename = "Telephony_http_HttpRequest_off_headersReceive_0200"
console.log("-----------------------HttpRequest_off_headersReceive Test is starting-----------------------");
try {
var httpRequest = http.createHttp();
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
httpRequest.off('headersReceive');
expect(true).assertTrue();
console.log("-----------------------HttpRequest_off_headersReceive_0200 Test end-----------------------");
done();
} catch (error) {
console.log("Telephony_http_HttpRequest_off_headersReceive_0200 : error = " + error);
done();
}
});
/**
* @tc.number Telephony_http_HttpRequest_once_headersReceive_0100
* @tc.name httprequest::once_headersReceive
* @tc.desc Test Test httprequest property.
*/
it("Telephony_http_HttpRequest_once_headersReceive_0100", 0, function (done) {
var casename = "Telephony_http_HttpRequest_once_headersReceive_0100"
console.log("-----------------------HttpRequest_once_headersReceive Test is starting-----------------------");
try {
var httpRequest = http.createHttp();
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
httpRequest.once('headersReceive', (data) => {
console.log(casename + " data: " + JSON.stringify(data));
expect(true).assertTrue();
console.log("-----------------------HttpRequest_on_headersReceive Test end-----------------------");
done();
});
} catch (error) {
console.log("Telephony_http_HttpRequest_once_headersReceive_010 : error = " + error);
done();
}
});
})
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets
浏览文件 @
8bd1584f
...
...
@@ -113,6 +113,47 @@ export default function connectionSecondJsUnit() {
done();
});
/**
* @tc.name: 'Telephony_connection_getConnectionProperties_Promise_0200
* @tc.desc: getConnectionProperties detection
*/
it('Telephony_connection_getConnectionProperties_Promise_0200', 0, function (done) {
console.log("----------Telephony_connection_getConnectionProperties_Promise_0200 Test is starting------");
if(false){
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_connection_getConnectionProperties_Promise_0200';
connection.getAllNets((error, data) => {
if (error) {
console.log(`${caseName} get data fail: ${error}`);
expect().assertTrue();
done();
} else {
console.log(`${caseName} get netID value : ${JSON.stringify(data[0])}`);
connection.getConnectionProperties(data[0]).then((value) => {
console.log(`${caseName} get value success: ${JSON.stringify(value)}`);
console.log(caseName + " ifaceName: " + value.ifaceName);
console.log(caseName + " mtu: " + value.mtu);
console.log(caseName + " netAddrList.length: " + value.netAddrList.length);
expect(value.ifaceName == "").assertTrue();
expect(value.domain == "").assertTrue();
expect(value.mtu == 0).assertTrue();
expect(value.netAddrList.length == 0).assertTrue();
expect(value.dnsList.length == 0).assertTrue();
expect(value.routeList.length == 0).assertTrue();
done();
}).catch((error) => {
console.log(`${caseName} getConnectionProperties fail: ${error}`);
expect().assertFail();
done();
});
}
console.log("-----------------------Telephony getConnectionProperties Test end-----------------------");
done();
});
/**
* @tc.name: Telephony_connection_RouteInfo_0300
* @tc.desc: RouteInfo Properties detection
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录