From 3aee68bcd9d55f2ecde99c6d38d292ac68863f92 Mon Sep 17 00:00:00 2001 From: wupingyuan Date: Fri, 1 Sep 2023 10:26:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9POP3=E5=92=8CSMTP?= =?UTF-8?q?=E5=8E=8B=E5=8A=9B=E6=B5=8B=E8=AF=95xts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ohosTest/ets/test/POP3Press.test.ets | 34 +++++++++++-------- .../src/ohosTest/ets/test/SMTPPress.test.ets | 23 ++++++++++--- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets b/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets index 031e825..97feb39 100644 --- a/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets +++ b/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets @@ -36,10 +36,11 @@ export default function POP3PressTest() { let selectMsgNum: number = -1 let isListShow: boolean = false const BASE_COUNT = 1000 - + let count = 1; + let id = undefined; describe('POP3PressTest', function () { - for (var i = 1;i < BASE_COUNT; i++) { + function allApiInterface() { it('LIST', 0, function () { let option = { @@ -54,7 +55,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.LIST(); - console.log("LIST count:" + i) }) it('STAT', 0, function () { @@ -70,7 +70,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.STAT() - console.log("STAT count:" + i) }) it('NOOP', 0, function () { @@ -86,7 +85,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.NOOP() - console.log("NOOP count:" + i) }) it('UIDL', 0, function () { @@ -102,7 +100,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.UIDL("1") - console.log("UIDL count:" + i) }) it('RSET', 0, function () { @@ -118,7 +115,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.RSET() - console.log("RSET count:" + i) }) it('RETR', 0, function () { @@ -134,7 +130,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.RETR("1") - console.log("RETR count:" + i) }) it('DELE', 0, function () { @@ -150,7 +145,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.DELE("1") - console.log("DELE count:" + i) }) it('QUIT', 0, function () { @@ -166,7 +160,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.QUIT() - console.log("QUIT count:" + i) }) it('connect', 0, function () { @@ -182,7 +175,6 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.connect() - console.log("connect count:" + i) }) it('TOP', 0, function () { @@ -198,7 +190,7 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.TOP("1") - console.log("TOP count:" + i) + }) it('command', 0, function () { @@ -214,9 +206,23 @@ export default function POP3PressTest() { } client = new Pop3Command(option); let result = client.command("NOOP") - console.log("command count:" + i) + if (id) { + clearInterval(id) + id = undefined; + } + if (count <= BASE_COUNT) { + count += 1; + console.log(`POP3---count -1 --->${count}`); + id = setTimeout(function () { + allApiInterface() + done() + }, 1000) + } else { + console.log(`POP3---count -2--->${count}`); + done() + } }) } - + allApiInterface() }) } \ No newline at end of file diff --git a/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets b/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets index dfcfd02..f1fb208 100644 --- a/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets +++ b/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets @@ -17,10 +17,10 @@ export default function SMTPPressTest() { let subject: string = 'test' let content: string = 'test' const BASE_COUNT = 1000 - + let count = 1; + let id = undefined; describe('SMTPPressTest', function () { - - for (var i = 1;i <= BASE_COUNT; i++) { + function allApiInterface() { it('new_SMTPClient', 0, function () { let client = new SMTPClient({ user: '479868299@qq.com', @@ -32,7 +32,6 @@ export default function SMTPPressTest() { ssl: false, tls: undefined }); - console.log("new SMTPClient count:" + i); }) it('sendAsync', 0, function () { @@ -57,7 +56,21 @@ export default function SMTPPressTest() { attachment: null } client.sendAsync(msg) - console.log("sendAsync count:" + i) + if (id) { + clearInterval(id) + id = undefined; + } + if (count <= BASE_COUNT) { + count += 1; + console.log(`SMTP---count -1 --->${count}`); + id = setTimeout(function () { + allApiInterface() + done() + }, 1000) + } else { + console.log(`SMTP---count -2--->${count}`); + done() + } }) } }) -- Gitee From a0d565c0c786656a6c1f40aecec5f36f432b9d22 Mon Sep 17 00:00:00 2001 From: wupingyuan Date: Fri, 1 Sep 2023 10:28:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9POP3=E5=92=8CSMTP?= =?UTF-8?q?=E5=8E=8B=E5=8A=9B=E6=B5=8B=E8=AF=95xts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets b/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets index f1fb208..f6400f7 100644 --- a/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets +++ b/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets @@ -34,7 +34,7 @@ export default function SMTPPressTest() { }); }) - it('sendAsync', 0, function () { + it('sendAsync', 0, function (done) { let client = new SMTPClient({ user: '479868299@qq.com', password: 'bfxeualuaxambged', -- Gitee From 9f3fd9eab3e1c540a0d81a19c5a860ca2b82b059 Mon Sep 17 00:00:00 2001 From: wupingyuan Date: Fri, 1 Sep 2023 10:28:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9POP3=E5=92=8CSMTP?= =?UTF-8?q?=E5=8E=8B=E5=8A=9B=E6=B5=8B=E8=AF=95xts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets | 1 + 1 file changed, 1 insertion(+) diff --git a/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets b/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets index f6400f7..1b76921 100644 --- a/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets +++ b/SMTPClient/entry/src/ohosTest/ets/test/SMTPPress.test.ets @@ -73,5 +73,6 @@ export default function SMTPPressTest() { } }) } + allApiInterface() }) } \ No newline at end of file -- Gitee From fbd7c378f5651d09d00662ad90145d4fc60d8e90 Mon Sep 17 00:00:00 2001 From: wupingyuan Date: Fri, 1 Sep 2023 10:29:42 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9POP3=E5=92=8CSMTP?= =?UTF-8?q?=E5=8E=8B=E5=8A=9B=E6=B5=8B=E8=AF=95xts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets b/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets index 97feb39..dc5655b 100644 --- a/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets +++ b/POP3Client/entry/src/ohosTest/ets/test/POP3Press.test.ets @@ -193,7 +193,7 @@ export default function POP3PressTest() { }) - it('command', 0, function () { + it('command', 0, function (done) { let option = { host: 'pop.qq.com', port: 110, -- Gitee