From 256c616a5298d16c6d69c86003c3df4158917070 Mon Sep 17 00:00:00 2001 From: hu0475 Date: Wed, 12 Jul 2023 05:14:15 -0700 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90commonlibrary=E5=AD=90?= =?UTF-8?q?=E7=B3=BB=E7=BB=9Fohos.util.Queue=E3=80=81ohos.util.Stack?= =?UTF-8?q?=E3=80=81ohos.taskpool=E6=A8=A1=E5=9D=97=E7=9A=84=E8=B7=A8?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=B5=8B=E8=AF=95=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu0475 --- commonlibrary/BUILD.gn | 3 +- commonlibrary/crossplatform/BUILD.gn | 24 + .../AppScope/app.json | 16 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../commonlibraryqueueetstest/BUILD.gn | 38 + .../commonlibraryqueueetstest/Test.json | 19 + .../signature/openharmony_sx.p7b | Bin 0 -> 3464 bytes .../src/main/ets/TestAbility/TestAbility.ets | 62 + .../src/main/ets/TestAbility/pages/Index.ets | 48 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 49 + .../src/main/ets/test/List.test.ets | 19 + .../src/main/ets/test/Queue.test.ets | 401 ++++ .../src/main/module.json | 36 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/test_pages.json | 5 + .../AppScope/app.json | 16 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../commonlibrarystacketstest/BUILD.gn | 38 + .../commonlibrarystacketstest/Test.json | 19 + .../signature/openharmony_sx.p7b | Bin 0 -> 3463 bytes .../src/main/ets/TestAbility/TestAbility.ets | 62 + .../src/main/ets/TestAbility/pages/Index.ets | 48 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 49 + .../src/main/ets/test/List.test.ets | 19 + .../src/main/ets/test/Stack.test.ets | 532 +++++ .../src/main/module.json | 36 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/test_pages.json | 5 + .../AppScope/app.json | 16 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../commonlibrarytaskpooletstest/BUILD.gn | 38 + .../commonlibrarytaskpooletstest/Test.json | 19 + .../signature/openharmony_sx.p7b | Bin 0 -> 3466 bytes .../src/main/ets/TestAbility/TestAbility.ets | 62 + .../src/main/ets/TestAbility/pages/Index.ets | 48 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 49 + .../src/main/ets/test/List.test.ets | 19 + .../src/main/ets/test/Taskpool.test.ets | 1772 +++++++++++++++++ .../src/main/module.json | 36 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/test_pages.json | 5 + 50 files changed, 3703 insertions(+), 1 deletion(-) create mode 100755 commonlibrary/crossplatform/BUILD.gn create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/app.json create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/element/string.json create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/media/app_icon.png create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/BUILD.gn create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/Test.json create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/signature/openharmony_sx.p7b create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestAbility/TestAbility.ets create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestAbility/pages/Index.ets create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/List.test.ets create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/Queue.test.ets create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/module.json create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/color.json create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/string.json create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/media/icon.png create mode 100755 commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/profile/test_pages.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/AppScope/app.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/AppScope/resources/base/element/string.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/AppScope/resources/base/media/app_icon.png create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/BUILD.gn create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/Test.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/signature/openharmony_sx.p7b create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/TestAbility.ets create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/pages/Index.ets create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/List.test.ets create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/Stack.test.ets create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/module.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/color.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/string.json create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/media/icon.png create mode 100755 commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/profile/test_pages.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/AppScope/app.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/AppScope/resources/base/element/string.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/AppScope/resources/base/media/app_icon.png create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/BUILD.gn create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/Test.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/signature/openharmony_sx.p7b create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestAbility/TestAbility.ets create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestAbility/pages/Index.ets create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/List.test.ets create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/Taskpool.test.ets create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/module.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/color.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/string.json create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/media/icon.png create mode 100755 commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/profile/test_pages.json diff --git a/commonlibrary/BUILD.gn b/commonlibrary/BUILD.gn index 95ed88686..ff1e721a0 100644 --- a/commonlibrary/BUILD.gn +++ b/commonlibrary/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Huawei Device Co., Ltd. +# 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 @@ -16,6 +16,7 @@ group("commonlibrary") { testonly = true if (is_standard_system) { deps = [ + "crossplatform:crossplatform", "ets_utils:ets_utils", "toolchain:toolchain", ] diff --git a/commonlibrary/crossplatform/BUILD.gn b/commonlibrary/crossplatform/BUILD.gn new file mode 100755 index 000000000..90d34943a --- /dev/null +++ b/commonlibrary/crossplatform/BUILD.gn @@ -0,0 +1,24 @@ +# 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("//test/xts/tools/build/suite.gni") + +group("crossplatform") { + testonly = true + if (is_standard_system) { + deps = [ + "commonlibraryqueueetstest:ActsCrossplatformCommonlibraryQueueTest", + "commonlibrarystacketstest:ActsCrossplatformCommonlibraryStackTest", + "commonlibrarytaskpooletstest:ActsCrossplatformCommonlibraryTaskpoolTest", + ] + } +} diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/app.json b/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/app.json new file mode 100755 index 000000000..59f848377 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/app.json @@ -0,0 +1,16 @@ +{ + "app": { + "bundleName": "ohos.acts.commonlibrary.crossplatform.queue.normal", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/element/string.json b/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/element/string.json new file mode 100755 index 000000000..c96ccdb14 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "xtsDemo1" + } + ] +} diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/media/app_icon.png b/commonlibrary/crossplatform/commonlibraryqueueetstest/AppScope/resources/base/media/app_icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqR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', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestAbility/pages/Index.ets b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestAbility/pages/Index.ets new file mode 100755 index 000000000..82eb2048e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,48 @@ +/* + * 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 hilog from '@ohos.hilog'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100755 index 000000000..92a16d84e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,49 @@ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/List.test.ets b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/List.test.ets new file mode 100755 index 000000000..61b179c9d --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * 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 QueueTest from './Queue.test' + +export default function testsuite() { + QueueTest() +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/Queue.test.ets b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/Queue.test.ets new file mode 100755 index 000000000..93caee018 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/ets/test/Queue.test.ets @@ -0,0 +1,401 @@ +/* + * 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 Queue from "@ohos.util.Queue"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +export default function QueueTest() { +describe("QueueTest", function () { + + /** + * @tc.number: TEST_CONSTRUCTOR_001 + * @tc.name: testConstructor001 + * @tc.desc: Create an Queue instance. For example: let queue = new Queue(). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testConstructor001", 0, function () { + try { + let queue = new Queue(); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200012); + expect(err.message).assertEqual("The Queue's constructor cannot be directly invoked"); + } + }); + + /** + * @tc.number: TEST_ADD_001 + * @tc.name: testAdd001 + * @tc.desc: Add element to Queue instance end. For example: queue.add("四"). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd001", 0, function () { + let queue = new Queue(); + queue.add("四"); + let res = queue.getFirst(); + expect(res).assertEqual("四"); + }); + + /** + * @tc.number: TEST_ADD_002 + * @tc.name: testAdd002 + * @tc.desc: Add element to Queue instance end. For example: queue.add(8). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd002", 0, function () { + let queue = new Queue(); + queue.add(8); + let res = queue.getFirst(); + expect(res).assertEqual(8); + }); + + /** + * @tc.number: TEST_ADD_003 + * @tc.name: testAdd003 + * @tc.desc: Add element to Queue instance end. For example: queue.add(8). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd003", 0, function () { + let queue = new Queue(); + let a = ["a", "b", "c"]; + queue.add(a); + let res = queue.getFirst(); + expect(res).assertEqual(a); + }); + + /** + * @tc.number: TEST_ADD_004 + * @tc.name: testAdd004 + * @tc.desc: Add element to Queue instance end. For example: queue.add("$"). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd004", 0, function () { + let queue = new Queue(); + queue.add("$"); + let res = queue.getFirst(); + expect(res).assertEqual("$"); + }); + + /** + * @tc.number: TEST_ADD_005 + * @tc.name: testAdd005 + * @tc.desc: Add element to Queue instance end. For example: queue.add(" "). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd005", 0, function () { + let queue = new Queue(); + queue.add(" "); + let res = queue.getFirst(); + expect(res).assertEqual(" "); + }); + + /** + * @tc.number: TEST_ADD_006 + * @tc.name: testAdd006 + * @tc.desc: Add element to Queue instance end. For example: queue.add(null). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd006", 0, function () { + let queue = new Queue(); + queue.add(null); + let res = queue.getFirst(); + expect(res).assertEqual(null); + }); + + /** + * @tc.number: TEST_ADD_007 + * @tc.name: testAdd007 + * @tc.desc: Add element to Queue instance end. For example: queue.add(undefined). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd007", 0, function () { + let queue = new Queue(); + queue.add(undefined); + let res = queue.getFirst(); + expect(res).assertEqual(undefined); + }); + + /** + * @tc.number: TEST_ADD_008 + * @tc.name: testAdd008 + * @tc.desc: Add element to Queue instance end. For example: for (let i = 0; i < 100; i++) { queue.add(i);}. + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd008", 0, function () { + let queue = new Queue(); + for (let i = 0; i < 100; i++) { + queue.add(i); + } + let res = queue.length; + expect(res).assertEqual(100); + }); + + /** + * @tc.number: TEST_ADD_009 + * @tc.name: testAdd009 + * @tc.desc: Add element to Queue instance end. For example: queue.add.bind({}, 10)(). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testAdd009", 0, function () { + let queue = new Queue(); + try { + queue.add.bind({}, 10)(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The add method cannot be bound`); + } + }); + + /** + * @tc.number: TEST_GET_FIRST_001 + * @tc.name: testGetFirst001 + * @tc.desc: Get the header element of the queue instance. For example: queue.getFirst(). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testGetFirst001", 0, function () { + let queue = new Queue(); + queue.add(6); + queue.add("四"); + let res = queue.getFirst(); + expect(res).assertEqual(6); + }); + + /** + * @tc.number: TEST_GET_FIRST_002 + * @tc.name: testGetFirst002 + * @tc.desc: Get the header element of the queue instance. For example: queue.getFirst(). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testGetFirst002", 0, function () { + let queue = new Queue(); + let res = queue.getFirst(); + expect(res).assertEqual(undefined); + }); + + /** + * @tc.number: TEST_POP_001 + * @tc.name: testPop001 + * @tc.desc: Delete the header element of a queue instance. For example: queue.pop(). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testPop001", 0, function () { + let queue = new Queue(); + queue.add(6); + queue.add("四"); + let res = queue.pop(); + let res1 = queue.getFirst(); + expect(res).assertEqual(6); + expect(res1).assertEqual("四"); + }); + + /** + * @tc.number: TEST_POP_002 + * @tc.name: testPop002 + * @tc.desc: Delete the header element of a queue instance. For example: queue.pop(). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testPop002", 0, function () { + let queue = new Queue(); + let res = queue.pop(); + expect(res).assertEqual(undefined); + }); + + /** + * @tc.number: TEST_FOREACH_001 + * @tc.name: testForEach001 + * @tc.desc: Traversing elements in queue instances. For example: queue.forEach((item, index) => {arr.push(item);}). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testForEach001", 0, function () { + let queue = new Queue(); + queue.add(8); + queue.add("一"); + queue.add("二"); + queue.add(1); + queue.add(2); + queue.add(3); + queue.add(4); + queue.add(5); + queue.add(6); + let c = ["a", "b", "c", "d"]; + queue.add(c); + let arr = []; + queue.forEach((item, index) => { + arr.push(item); + }); + let a = [8, "一", "二", 1, 2, 3, 4, 5, 6, c]; + for (let i = 0; i < a.length; i++) { + expect(arr[i]).assertEqual(a[i]); + } + }); + + /** + * @tc.number: TEST_FOREACH_002 + * @tc.name: testForEach002 + * @tc.desc: Traversing elements in queue instances. For example: queue.forEach((item, index) => {arr.push(item);}). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testForEach002", 0, function () { + let queue = new Queue(); + let arr = []; + queue.forEach((item, index) => { + arr.push(item); + }); + expect(arr.length).assertEqual(0); + }); + + /** + * @tc.number: TEST_ITERATOR_001 + * @tc.name: testIterator001 + * @tc.desc: Iterate over all elements in the queue instance. For example: for (let item of queue) { arr.push(item);}. + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testIterator001", 0, function () { + let queue = new Queue(); + queue.add(8); + queue.add("一"); + queue.add("二"); + queue.add(5); + queue.add(6); + queue.add("三"); + queue.add("四"); + let arr = []; + for (let item of queue) { + arr.push(item); + } + let a = [8, "一", "二", 5, 6, "三", "四"]; + for (let i = 0; i < a.length; i++) { + expect(arr[i]).assertEqual(a[i]); + } + }); + + /** + * @tc.number: TEST_ITERATOR_002 + * @tc.name: testIterator002 + * @tc.desc: Iterate over all elements in the queue instance. For example: for (let item of queue) { arr.push(item);}. + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testIterator002", 0, function () { + let queue = new Queue(); + let arr = []; + for (let item of queue) { + arr.push(item); + } + expect(arr.length).assertEqual(0); + }); + + /** + * @tc.number: TEST_ITERATOR_003 + * @tc.name: testIterator003 + * @tc.desc: Iterate over all elements in the queue instance. For example: queue[Symbol.iterator](). + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 2 + */ + it("testIterator003", 0, function () { + let queue = new Queue(); + queue.add(8); + queue.add("一"); + queue.add("二"); + queue.add(5); + queue.add(6); + queue.add("三"); + queue.add("四"); + let arr = []; + let size = queue.length; + let itr = queue[Symbol.iterator](); + for (let i = 0; i < size; i++) { + arr.push(itr.next().value); + } + let a = [8, "一", "二", 5, 6, "三", "四"]; + for (let i = 0; i < a.length; i++) { + expect(arr[i]).assertEqual(a[i]); + } + }); + + /** + * @tc.number: TEST_LENGTH_001 + * @tc.name: testLength001 + * @tc.desc: Get the number of elements in the queue instance. For example: queue.length. + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 0 + */ + it("testLength001", 0, function () { + let queue = new Queue(); + queue.add(8); + queue.add("一"); + queue.add("二"); + queue.add(1); + queue.add(2); + queue.add(3); + queue.add(4); + queue.add(5); + queue.add(6); + let res = queue.length; + expect(9).assertEqual(res); + }); + + /** + * @tc.number: TEST_LENGTH_002 + * @tc.name: testLength002 + * @tc.desc: Get the number of elements in the queue instance. For example: queue.length. + * @tc.size: MediumTest + * @tc.type: Function + * @tc.level: Level 0 + */ + it("testLength001", 0, function () { + let queue = new Queue(); + let res = queue.length; + expect(0).assertEqual(res); + }); +}); +} diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/module.json b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/module.json new file mode 100755 index 000000000..97abf299e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/module.json @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/color.json b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/color.json new file mode 100755 index 000000000..3c712962d --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/string.json b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/string.json new file mode 100755 index 000000000..65d8fa5a7 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/media/icon.png b/commonlibrary/crossplatform/commonlibraryqueueetstest/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLl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ossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/TestAbility.ets new file mode 100755 index 000000000..34e37eb84 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/TestAbility.ets @@ -0,0 +1,62 @@ +/* + * 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 UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; + +export default class TestAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/pages/Index.ets b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/pages/Index.ets new file mode 100755 index 000000000..82eb2048e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,48 @@ +/* + * 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 hilog from '@ohos.hilog'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100755 index 000000000..92a16d84e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,49 @@ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/List.test.ets b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/List.test.ets new file mode 100755 index 000000000..797d4a8f7 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * 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 StackTest from './Stack.test' + +export default function testsuite() { + StackTest() +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/Stack.test.ets b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/Stack.test.ets new file mode 100755 index 000000000..1a344537e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/ets/test/Stack.test.ets @@ -0,0 +1,532 @@ +/* + * 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 Stack from "@ohos.util.Stack"; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +export default function StackTest() { +describe("StackTest", function () { + + /** + * @tc.name: testConstructor001 + * @tc.desc: Create an Stack instance. For example: let stack = new Stack(). + */ + it("testConstructor001", 0, function () { + try { + let stack = new Stack(); + expect(stack != undefined).assertEqual(true); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200012); + expect(err.message).assertEqual("The Stack's constructor cannot be directly invoked"); + } + }); + + /** + * @tc.name: testPush002 + * @tc.desc: Insert element at top of stack.For example: stack.push("四"). + */ + it("testPush002", 0, function () { + let stack = new Stack(); + stack.push("四"); + let res = stack.peek(); + expect(res).assertEqual("四"); + }); + + /** + * @tc.name: testPush003 + * @tc.desc: Insert element at top of stack.For example: stack.push(8). + */ + it("testPush003", 0, function () { + let stack = new Stack(); + stack.push(8); + let res = stack.peek(); + expect(res).assertEqual(8); + }); + + /** + * @tc.name: testPush004 + * @tc.desc: Insert element at top of stack.For example: let a = {name: "lala", age: "13岁"}; stack.push(a). + */ + it("testPush004", 0, function () { + let stack = new Stack(); + let a = {name: "lala", age: "13岁"}; + stack.push(a); + let res = stack.peek(); + expect(res).assertEqual(a); + }); + + /** + * @tc.name: testPush005 + * @tc.desc: Insert element at top of stack.For example: let a = [1, 2, 3, 4]; stack.push(a). + */ + it("testPush005", 0, function () { + let stack = new Stack(); + let a = [1, 2, 3, 4]; + stack.push(a); + let res = stack.peek(); + expect(res).assertEqual(a); + }); + + /** + * @tc.name: testPeek006 + * @tc.desc: Get stack top element. For example: stack.peek(). + */ + it("testPeek006", 0, function () { + let stack = new Stack(); + let a = [1, 2, 3, 4]; + stack.push(a); + stack.push("A"); + stack.push("B"); + stack.push(1); + let res = stack.peek(); + expect(res).assertEqual(1); + }); + + /** + * @tc.name: testLocate007 + * @tc.desc: Get the index corresponding to the element in the stack. For example: stack.locate("A"). + */ + it("testLocate007", 0, function () { + let stack = new Stack(); + let a = [1, 2, 3, 4]; + stack.push(8); + stack.push(a); + stack.push("A"); + stack.push("B"); + stack.push(1); + let res = stack.locate("A"); + let res1 = stack.locate("C"); + expect(res).assertEqual(2); + expect(res1).assertEqual(-1); + }); + + /** + * @tc.name: testPop008 + * @tc.desc: Delete top of stack element. For example: stack.pop(). + */ + it("testPop008", 0, function () { + let stack = new Stack(); + stack.push("B"); + stack.push(1); + let res = stack.pop(); + let res1 = stack.peek(); + expect(res).assertEqual(1); + expect(res1).assertEqual("B"); + }); + + /** + * @tc.name: testForEach009 + * @tc.desc: Traversing elements in stack instances. For example: stack.forEach((item, index) => {arr.push(item);}). + */ + it("testForEach009", 0, function () { + let stack = new Stack(); + stack.push(8); + stack.push("三"); + stack.push(5); + let c = {name: "lili", age: "13"}; + stack.push(c); + stack.push(6); + stack.push("四"); + let arr = []; + stack.forEach((item, index) => { + arr.push(item); + }); + let a = [8, "三", 5, c, 6, "四"]; + for (let i = 0; i < a.length; i++) { + expect(arr[i]).assertEqual(a[i]); + } + }); + + /** + * @tc.name: testIterator010 + * @tc.desc: Iterate over all elements in the stack instance. For example: for (let item of stack) {arr.push(item);}. + */ + it("testIterator010", 0, function () { + let stack = new Stack(); + stack.push(8); + stack.push("一"); + stack.push("二"); + stack.push(5); + let c = [1, 2, 3, 4]; + stack.push(c); + stack.push(6); + stack.push("三"); + stack.push("四"); + let arr = []; + for (let item of stack) { + arr.push(item); + } + let a = [8, "一", "二", 5, c, 6, "三", "四"]; + for (let i = 0; i < a.length; i++) { + expect(arr[i]).assertEqual(a[i]); + } + }); + + /** + * @tc.name: testLength011 + * @tc.desc: Get the number of elements in the stack instance. For example: stack.length. + */ + it("testLength011", 0, function () { + let stack = new Stack(); + stack.push(8); + stack.push("一"); + stack.push("二"); + stack.push(5); + let res = stack.length; + expect(4).assertEqual(res); + }); + + /** + * @tc.name: testLength012 + * @tc.desc: Get the number of elements in the stack instance. For example: stack.length. + */ + it("testLength012", 0, function () { + let stack = new Stack(); + let res = stack.length; + expect(0).assertEqual(res); + }); + + /** + * @tc.name: testIsEmpty013 + * @tc.desc: Determine whether the Stack instance is empty. For example: stack.isEmpty(). + */ + it("testIsEmpty013", 0, function () { + let stack = new Stack(); + stack.push(8); + stack.push("一"); + stack.push("二"); + stack.push(5); + let res = stack.isEmpty(); + expect(res).assertEqual(false); + }); + + /** + * @tc.name: testIsEmpty014 + * @tc.desc: Determine whether the Stack instance is empty. For example: stack.isEmpty(). + */ + it("testIsEmpty014", 0, function () { + let stack = new Stack(); + let res = stack.isEmpty(); + expect(res).assertEqual(true); + }); + + /** + * @tc.name: testPush015 + * @tc.desc: Insert element at top of stack.For example: stack.push("你好世界"). + */ + it("testPush015", 0, function () { + let stack = new Stack(); + stack.push("你好世界"); + let res = stack.peek(); + expect(res).assertEqual("你好世界"); + }); + + /** + * @tc.name: testPush016 + * @tc.desc: Insert element at top of stack.For example: stack.push(1234). + */ + it("testPush016", 0, function () { + let stack = new Stack(); + stack.push(1234); + let res = stack.peek(); + expect(res).assertEqual(1234); + }); + + /** + * @tc.name: testPush017 + * @tc.desc: Insert element at top of stack.For example: stack.push(1.234). + */ + it("testPush017", 0, function () { + let stack = new Stack(); + stack.push(1.234); + let res = stack.peek(); + expect(res).assertEqual(1.234); + }); + + /** + * @tc.name: testPush018 + * @tc.desc: Insert element at top of stack.For example: stack.push(-1234). + */ + it("testPush018", 0, function () { + let stack = new Stack(); + stack.push(-1234); + let res = stack.peek(); + expect(res).assertEqual(-1234); + }); + + /** + * @tc.name: testPush019 + * @tc.desc: Insert element at top of stack.For example: stack.push(0). + */ + it("testPush019", 0, function () { + let stack = new Stack(); + stack.push(0); + let res = stack.peek(); + expect(res).assertEqual(0); + }); + + /** + * @tc.name: testPush020 + * @tc.desc: Insert element at top of stack.For example: stack.push("*"). + */ + it("testPush020", 0, function () { + let stack = new Stack(); + stack.push(10); + stack.push(3.14); + stack.push(-2); + stack.push("AB"); + stack.push("*"); + let res = stack.peek(); + expect(res).assertEqual("*"); + }); + + /** + * @tc.name: testPush021 + * @tc.desc: Insert element at top of stack.For example: let arr = {}; stack.push(arr). + */ + it("testPush021", 0, function () { + let stack = new Stack(); + let arr = {}; + stack.push(arr); + let res = stack.peek(); + expect(res).assertEqual(arr); + }); + + /** + * @tc.name: testPush022 + * @tc.desc: Insert element at top of stack.For example: let arr = []; stack.push(arr). + */ + it("testPush022", 0, function () { + let stack = new Stack(); + let arr = []; + stack.push(arr); + let res = stack.peek(); + expect(res).assertEqual(arr); + }); + + /** + * @tc.name: testPush023 + * @tc.desc: Insert element at top of stack.For example: stack.push("hello world"). + */ + it("testPush023", 0, function () { + let stack = new Stack(); + stack.push("hello world"); + let res = stack.peek(); + expect(res).assertEqual("hello world"); + }); + + /** + * @tc.name: testPush024 + * @tc.desc: Insert element at top of stack. + */ + it("testPush024", 0, function () { + let stack = new Stack(); + stack.push("~!@#$^&*()_+-*/=.?<>:;|{}[]"); + let res = stack.peek(); + expect(res).assertEqual("~!@#$^&*()_+-*/=.?<>:;|{}[]"); + }); + + /** + * @tc.name: testPush025 + * @tc.desc: Insert element at top of stack. For example: stack.push(""). + */ + it("testPush025", 0, function () { + let stack = new Stack(); + stack.push(""); + let res = stack.peek(); + expect(res).assertEqual(""); + }); + + /** + * @tc.name: testPush026 + * @tc.desc: Insert element at top of stack. For example: stack.push(true). + */ + it("testPush026", 0, function () { + let stack = new Stack(); + stack.push(true); + let res = stack.peek(); + expect(res).assertEqual(true); + }); + + /** + * @tc.name: testPush027 + * @tc.desc: Insert element at top of stack. For example: stack.push(false). + */ + it("testPush027", 0, function () { + let stack = new Stack(); + stack.push(false); + let res = stack.peek(); + expect(res).assertEqual(false); + }); + + /** + * @tc.name: testPush028 + * @tc.desc: Insert element at top of stack. For example: stack.push(null). + */ + it("testPush028", 0, function () { + let stack = new Stack(); + stack.push(null); + let res = stack.peek(); + expect(res).assertEqual(null); + }); + + /** + * @tc.name: testPush029 + * @tc.desc: Insert element at top of stack. For example: stack.push(undefined). + */ + it("testPush029", 0, function () { + let stack = new Stack(); + stack.push(undefined); + let res = stack.peek(); + expect(res).assertEqual(undefined); + }); + + /** + * @tc.name: testPeek030 + * @tc.desc: Get stack top element. For example: stack.peek(). + */ + it("testPeek030", 0, function () { + let stack = new Stack(); + let res = stack.peek(); + expect(res).assertEqual(undefined); + }); + + /** + * @tc.name: testPop031 + * @tc.desc: Delete top of stack element. For example: stack.pop(). + */ + it("testPop031", 0, function () { + let stack = new Stack(); + let res = stack.pop(); + expect(res).assertEqual(undefined); + }); + + /** + * @tc.name: testForEach032 + * @tc.desc: Traversing elements in stack instances. For example: stack.forEach((item, index) => {arr.push(item);}). + */ + it("testForEach032", 0, function () { + let stack = new Stack(); + let arr = []; + stack.forEach((item, index) => { + arr.push(item); + }); + expect(arr.length).assertEqual(0); + }); + + /** + * @tc.name: testIterator033 + * @tc.desc: Iterate over all elements in the stack instance. For example: for (let item of stack) {arr.push(item);}. + */ + it("testIterator033", 0, function () { + let stack = new Stack(); + let arr = []; + for (let item of stack) { + arr.push(item); + } + expect(arr.length).assertEqual(0); + }); + + /** + * @tc.name: testPush034 + * @tc.desc: Insert element at top of stack. For example: for (let i = 0; i < 1000; i++) {stack.push(i);}. + */ + it("testPush034", 0, function () { + let stack = new Stack(); + for (let i = 0; i < 1000; i++) { + stack.push(i); + } + let res = stack.length; + expect(res).assertEqual(1000); + let res1 = stack.peek(); + expect(res1).assertEqual(999); + }); + + /** + * @tc.name: testIterator035 + * @tc.desc: Iterate over all elements in the stack instance. For example: stack[Symbol.iterator](). + */ + it("testIterator035", 0, function () { + let stack = new Stack(); + stack.push(8); + stack.push("一"); + stack.push("二"); + stack.push(5); + let c = [1, 2, 3, 4]; + stack.push(c); + stack.push(6); + stack.push("三"); + stack.push("四"); + let arr = []; + let itr = stack[Symbol.iterator](); + let tmp = undefined; + do { + tmp = itr.next().value; + arr.push(tmp); + } while (tmp != undefined); + let a = [8, "一", "二", 5, c, 6, "三", "四"]; + for (let i = 0; i < a.length; i++) { + expect(arr[i]).assertEqual(a[i]); + } + }); + + /** + * @tc.name: testPush036 + * @tc.desc: Insert element at top of stack. For example: stack.push.bind({}, 10)(). + */ + it("testPush036 ", 0, function () { + let stack = new Stack(); + try { + stack.push.bind({}, 10)(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The push method cannot be bound`); + } + }); + + /** + * @tc.name: testIsEmpty037 + * @tc.desc: Determine whether the Stack instance is empty. For example: stack.isEmpty.bind({}, "a")(). + */ + it('testIsEmpty037', 0, function () { + let stack = new Stack(); + try { + stack.isEmpty.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The isEmpty method cannot be bound`); + } + }); + + /** + * @tc.name: testPop038 + * @tc.desc: Delete top of stack element. For example: stack.pop.bind({}, "a")(). + */ + it('testPop038', 0, function () { + let stack = new Stack(); + try { + stack.pop.bind({}, "a")(); + expect(true).assertEqual(false); + } catch (err) { + expect(err.name).assertEqual("BusinessError"); + expect(err.code).assertEqual(10200011); + expect(err.message).assertEqual(`The pop method cannot be bound`); + } + }); +}); +} diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/module.json b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/module.json new file mode 100755 index 000000000..97abf299e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/module.json @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/color.json b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/color.json new file mode 100755 index 000000000..3c712962d --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/string.json b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/string.json new file mode 100755 index 000000000..65d8fa5a7 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/media/icon.png b/commonlibrary/crossplatform/commonlibrarystacketstest/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNP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VY&h)76|iy_>SK_hR> z=VH0INJ2xzbe+Ffg+e5^<)YSj$_)_bzXsyGk6HzM9-l8P-X1&xGE#Wq@@UK!jx>j$_R}BFC~nj+35ph1{wo$65jOetO4F!D}e{0$zW1qNRT~t;1EpH zfrJck_;Xb-n2;lqLO=?nkd*t%t8+v$B_u6``b|LpKo9`r_kqZJ9*D9KcK)RGZj zHg$?eeUaWaue1A=g@?aQUbI=F1;Y{nnLOTqghBy7bqN@su!jjp2}gX2U;S`<%y{9q{W?$dvsHVBiDaU9QLK`dud}9t9kw5_027v zUm>gA7d+ox-hSuu%9Nr7kKW(NO=)eaja_<_Q379|GQTu=((>Q6FEN1&>c1|Z+HD#8 zF;BJQ>XiLk18aN6ux{5|tN)@MzGa!{;-PJu zAJmL|Fm>XJPv%mtYVqGTtClMDphXE2j^DFc|4QOFbwLsy>8I8<_Y!m=eZ z7)clUgsg@C2SKeuT8yMy^s{a*1d+4nV8#mkm z>*`Hw8qaOdIXkocly-DeGRGsF<55pPk0uZw&mN5A1y*l>7(wzv=|CPO%on4G&!Nzy zO*fBi+?ylcz5K-1n!jCzU&#|*8T;Pt&zYsFJv&nF?!J{b_S19kh<|p2KqwB|R*mk?QIqUYBmPyU`-du2C=EQr~j$dANUt-(h z0{9?tdL~Ey4~{)k+yw6`>nw`grHeETAb?jXBl|`N` zQ;*Jesd>p5U#I?`XRmdR{OsDf;hb1?4WZbbC80J;=TymqgH;`$tX-RRH1KNosQ9>t zZ(TI54E3zSuh4d8rT2vFy;slYLvbF=k!&`1YXEgGq>TM1>c9(1s~?Phd_hSQK-}2> zt~ER`?y-@U3}teMVj(Ev4n(N1SXNXG3Z9G#A+a#GjW>Pk*8y~)T6t;6Hniyqv!&r1@6XkenvA3`ckf$scly%SoC;u{ vb7nRF*q`~i=w3r{Mn`(~t { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestAbility/pages/Index.ets b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestAbility/pages/Index.ets new file mode 100755 index 000000000..82eb2048e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestAbility/pages/Index.ets @@ -0,0 +1,48 @@ +/* + * 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 hilog from '@ohos.hilog'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100755 index 000000000..92a16d84e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,49 @@ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/List.test.ets b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/List.test.ets new file mode 100755 index 000000000..84952315b --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * 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 TaskPoolTest from './Taskpool.test' + +export default function testsuite() { + TaskPoolTest() +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/Taskpool.test.ets b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/Taskpool.test.ets new file mode 100755 index 000000000..c5146b141 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/ets/test/Taskpool.test.ets @@ -0,0 +1,1772 @@ +/* + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' +import taskpool from '@ohos.taskpool' +import List from '@ohos.util.List' +export default function TaskPoolTest() { + describe('TaskPoolTest', function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + + function promiseCase() { + let p = new Promise(function (resolve, reject) { + setTimeout(function () { + resolve() + }, 100) + }).then(undefined, (error) => { + }) + return p + } + + /** + * @tc.number : TEST_TASK_CONSTRUCTOR_001 + * @tc.name : testTaskConstructor001 + * @tc.desc : Create a Task instance. For example: let task = new taskpool.Task(function, args). + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskConstructor001', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10,20); + var result = await taskpool.execute(task); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_CONSTRUCTOR_002 + * @tc.name : testTaskConstructor001 + * @tc.desc : Create a Task instance. For example: let task = new taskpool.Task(function, args). + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskConstructor002', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10); + var result = await taskpool.execute(task); + expect(result.toString()).assertEqual("NaN"); + done(); + }) + + /** + * @tc.number : TEST_TASK_CONSTRUCTOR_003 + * @tc.name : testTaskConstructor003 + * @tc.desc : Create a Task instance. For example: let task = new taskpool.Task(function, args). + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskConstructor003', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10,20,30); + var result = await taskpool.execute(task); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_SET_TRANSFER_LIST_001 + * @tc.name : testTaskSetTransferList001 + * @tc.desc : To test Task SetTransferLis + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskSetTransferList001', 0, async function (done) { + let buffer = new ArrayBuffer(8); + let view = new Uint8Array(buffer); + let buffer1 = new ArrayBuffer(16); + let view1 = new Uint8Array(buffer1); + + function testTransfer(arg1, arg2) { + "use concurrent" + return arg1.byteLength + arg2.byteLength; + } + let task = new taskpool.Task(testTransfer, view, view1); + task.setTransferList([view.buffer, view1.buffer]); + taskpool.execute(task).then((res)=>{ + expect(res).assertEqual(24); + }); + done(); + }) + + /** + * @tc.number : TEST_TASK_GROUP_CONSTRUCTOR_001 + * @tc.name : testTaskGroupConstructor001 + * @tc.desc : Create a TaskGroup instance + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskGroupConstructor001', 0, async function (done) { + try { + let taskgroup = new taskpool.TaskGroup(); + expect(taskgroup != undefined).assertEqual(true); + done(); + } catch (err) { + expect(err.name).assertEqual("TypeError"); + expect(err.code).assertEqual(undefined); + expect(err.message).assertEqual("Constructor is false"); + } + }) + + /** + * @tc.number : TEST_TASK_GROUP_ADD_TASK_001 + * @tc.name : testTaskGroupAddTask001 + * @tc.desc : To test TaskGroup function addTask + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskGroupAddTask001', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + let task1 = new taskpool.Task(Sum,10,20); + let task2 = new taskpool.Task(Sum,10,20); + let task3 = new taskpool.Task(Sum,10,20); + let taskgroup = new taskpool.TaskGroup(); + taskgroup.addTask(task1); + taskgroup.addTask(task2); + taskgroup.addTask(task3); + done(); + }) + + /** + * @tc.number : TEST_TASK_GROUP_ADD_TASK_002 + * @tc.name : testTaskGroupAddTask002 + * @tc.desc : To test TaskGroup function addTask + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskGroupAddTask002', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + let taskgroup = new taskpool.TaskGroup(); + taskgroup.addTask(Sum,10,20); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_001 + * @tc.name : testTaskPoolExecute001 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute001', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result = await taskpool.execute(Sum, 10, 20); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_002 + * @tc.name : testTaskPoolExecute002 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute002', 0, async function (done) { + function Add(value1, value2) { + "use concurrent" + if (value1 & value2) + return true; + else + return false; + } + var result = await taskpool.execute(Add, true, true); + expect(result).assertEqual(true); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_003 + * @tc.name : testTaskPoolExecute003 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute003', 0, async function (done) { + function StrCat(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result = await taskpool.execute(StrCat, "abc", "def"); + expect(result).assertEqual("abcdef"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_004 + * @tc.name : testTaskPoolExecute004 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute004', 0, async function (done) { + function StrCat(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result = await taskpool.execute(StrCat, "abc", "def"); + result = await taskpool.execute(StrCat, "abc", "def"); + expect(result).assertEqual("abcdef"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_005 + * @tc.name : testTaskPoolExecute002 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute005', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + function StrCat(value1, value2) { + return value1 + value2; + } + return value1+StrCat(value2,"hello"); + } + var result = await taskpool.execute(Sum, "abc", "def"); + expect(result).assertEqual("abcdefhello"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_006 + * @tc.name : testTaskPoolExecute006 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute006', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = []; + value[0] = arg1[0] + arg2[0]; + value[1] = arg1[1] + arg2[1]; + return value; + } + var result = await taskpool.execute(Sum, [1,2], [3,4]); + expect(result[0]).assertEqual(4); + expect(result[1]).assertEqual(6); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_007 + * @tc.name : testTaskPoolExecute007 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute007', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = arg1; + value.a = arg1.a + arg2.a; + value.b = arg1.b + arg2.b; + return value; + } + var result = await taskpool.execute(Sum, {"a": 1, "b" : 2}, {"a": 3, "b" : 4}); + expect(JSON.stringify(result)).assertEqual("{\"a\":4,\"b\":6}"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_008 + * @tc.name : testTaskPoolExecute008 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute008', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result = await taskpool.execute(Sum, 10); + expect(result.toString()).assertEqual("NaN"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_009 + * @tc.name : testTaskPoolExecute009 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute009', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result = await taskpool.execute(Sum, 10, 20, 30); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_010 + * @tc.name : testTaskPoolExecute010 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute010', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1 = await taskpool.execute(Sum, 10, 20); + var result2 = await taskpool.execute(Sum, 30, 40); + expect(result1).assertEqual(30); + expect(result2).assertEqual(70); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_011 + * @tc.name : testTaskPoolExecute011 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute011', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1 = await taskpool.execute(Sum, 10, 20); + var result2 = await taskpool.execute(Sum, 10, 20); + expect(result1).assertEqual(30); + expect(result2).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_012 + * @tc.name : testTaskPoolExecute012 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute012', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + function Multi(value1, value2) { + "use concurrent" + return value1 * value2; + } + var result1 = await taskpool.execute(Sum, 10, 20); + var result2 = await taskpool.execute(Multi, 10, 20); + var result3 = await taskpool.execute(Sum, 10, 30); + var result4 = await taskpool.execute(Multi, 20, 20); + expect(result1).assertEqual(30); + expect(result2).assertEqual(200); + expect(result3).assertEqual(40); + expect(result4).assertEqual(400); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_013 + * @tc.name : testTaskPoolExecute013 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute013', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10, 20); + var result = await taskpool.execute(task); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_014 + * @tc.name : testTaskPoolExecute014 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute014', 0, async function (done) { + function Add(value1, value2) { + "use concurrent" + if (value1 & value2) + return true; + else + return false; + } + var task = new taskpool.Task(Add, true, true); + var result = await taskpool.execute(task); + expect(result).assertEqual(true); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_015 + * @tc.name : testTaskPoolExecute015 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute015', 0, async function (done) { + function StrCat(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(StrCat, "abc", "def"); + var result = await taskpool.execute(task); + expect(result).assertEqual("abcdef"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_016 + * @tc.name : testTaskPoolExecute016 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute016', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + function StrCat(value1, value2) { + return value1 + value2; + } + return value1+StrCat(value2,"hello"); + } + var task = new taskpool.Task(Sum, "abc", "def"); + var result = await taskpool.execute(task); + expect(result).assertEqual("abcdefhello"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_017 + * @tc.name : testTaskPoolExecute017 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute017', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = []; + value[0] = arg1[0] + arg2[0]; + value[1] = arg1[1] + arg2[1]; + return value; + } + var task = new taskpool.Task(Sum, [1,2], [3,4]); + var result = await taskpool.execute(task); + expect(result[0]).assertEqual(4); + expect(result[1]).assertEqual(6); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_018 + * @tc.name : testTaskPoolExecute018 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute018', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = arg1; + value.a = arg1.a + arg2.a; + value.b = arg1.b + arg2.b; + return value; + } + var task = new taskpool.Task(Sum, {"a": 1, "b" : 2}, {"a": 3, "b" : 4}); + var result = await taskpool.execute(task); + expect(JSON.stringify(result)).assertEqual("{\"a\":4,\"b\":6}"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_019 + * @tc.name : testTaskPoolExecute019 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute019', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10); + var result = await taskpool.execute(task); + expect(result.toString()).assertEqual("NaN"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_020 + * @tc.name : testTaskPoolExecute020 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute020', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10, 20, 30); + var result = await taskpool.execute(task); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_021 + * @tc.name : testTaskPoolExecute021 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute021', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10, 20); + var result1 = await taskpool.execute(task); + var result2 = await taskpool.execute(task); + expect(result1).assertEqual(30); + expect(result2).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_022 + * @tc.name : testTaskPoolExecute022 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute022', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task1 = new taskpool.Task(Sum, 10, 20); + var task2 = new taskpool.Task(Sum, 30, 40); + var result1 = await taskpool.execute(task1); + var result2 = await taskpool.execute(task2); + expect(result1).assertEqual(30); + expect(result2).assertEqual(70); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_023 + * @tc.name : testTaskPoolExecute023 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute023', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task1 = new taskpool.Task(Sum, 10, 20); + var task2 = new taskpool.Task(Sum, 10, 20); + var result1 = await taskpool.execute(task1); + var result2 = await taskpool.execute(task2); + expect(result1).assertEqual(30); + expect(result2).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_024 + * @tc.name : testTaskPoolExecute024 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute024', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + function Multi(value1, value2) { + "use concurrent" + return value1 * value2; + } + var task1 = new taskpool.Task(Sum, 10, 20); + var result1 = await taskpool.execute(task1); + var task2 = new taskpool.Task(Multi, 10, 20); + var result2 = await taskpool.execute(task2); + var task3 = new taskpool.Task(Sum, 10, 30); + var result3 = await taskpool.execute(task3); + var task4 = new taskpool.Task(Multi, 20, 20); + var result4 = await taskpool.execute(task4); + expect(result1).assertEqual(30); + expect(result2).assertEqual(200); + expect(result3).assertEqual(40); + expect(result4).assertEqual(400); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_025 + * @tc.name : testTaskPoolExecute025 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute025', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result; + var isTerminate = false; + var task = new taskpool.Task(Sum, 10, 20) + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_026 + * @tc.name : testTaskPoolExecute026 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute026', 0, async function (done) { + function Add(value1, value2) { + "use concurrent" + if (value1 & value2) + return true; + else + return false; + } + var task = new taskpool.Task(Add, true, true) + var isTerminate = false; + var result; + taskpool.execute(task).then((ret) => { + isTerminate = true; + result = ret; + }); + + while (!isTerminate) { + await promiseCase(); + } + + expect(result).assertEqual(true); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_027 + * @tc.name : testTaskPoolExecute027 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute027', 0, async function (done) { + function StrCat(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(StrCat, "abc", "def") + var result; + var isTerminate = false; + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual("abcdef"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_028 + * @tc.name : testTaskPoolExecute028 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute028', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + function StrCat(value1, value2) { + return value1 + value2; + } + return value1+StrCat(value2,"hello"); + } + var task = new taskpool.Task(Sum, "abc", "def"); + var result; + var isTerminate = false; + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual("abcdefhello"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_029 + * @tc.name : testTaskPoolExecute029 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute029', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = []; + value[0] = arg1[0] + arg2[0]; + value[1] = arg1[1] + arg2[1]; + return value; + } + var task = new taskpool.Task(Sum, [1,2], [3,4]); + var result; + var isTerminate = false; + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result[0]).assertEqual(4); + expect(result[1]).assertEqual(6); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_030 + * @tc.name : testTaskPoolExecute030 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute030', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = arg1; + value.a = arg1.a + arg2.a; + value.b = arg1.b + arg2.b; + return value; + } + var task = new taskpool.Task(Sum, {"a": 1, "b" : 2}, {"a": 3, "b" : 4}); + var result; + var isTerminate = false; + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(JSON.stringify(result)).assertEqual("{\"a\":4,\"b\":6}"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_031 + * @tc.name : testTaskPoolExecute031 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('TaskPoolTestClass031', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10); + var result; + var isTerminate = false; + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result.toString()).assertEqual("NaN"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_032 + * @tc.name : testTaskPoolExecute032 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute032', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task = new taskpool.Task(Sum, 10, 20, 30); + var result; + var isTerminate = false; + taskpool.execute(task).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_033 + * @tc.name : testTaskPoolExecute033 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute033', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1; + var result2; + var isTerminate1 = false; + var isTerminate2 = false; + + var task1 = new taskpool.Task(Sum, 10, 20); + taskpool.execute(task1).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + + var task2 = new taskpool.Task(Sum, 30, 40); + taskpool.execute(task2).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + while (!isTerminate1 || !isTerminate2) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(70); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_034 + * @tc.name : testTaskPoolExecute034 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute034', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1; + var result2; + var isTerminate1 = false; + var isTerminate2 = false; + + var task1 = new taskpool.Task(Sum, 10, 20) + taskpool.execute(task1).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + var task2 = new taskpool.Task(Sum, 10, 20) + taskpool.execute(task2).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + while (!isTerminate1 || !isTerminate2) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_035 + * @tc.name : testTaskPoolExecute035 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute035', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1; + var result2; + var isTerminate1 = false; + var isTerminate2 = false; + + var task = new taskpool.Task(Sum, 10, 20) + taskpool.execute(task).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + taskpool.execute(task).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + while (!isTerminate1 || !isTerminate2) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_036 + * @tc.name : testTaskPoolExecute036 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute036', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + function Multi(value1, value2) { + "use concurrent" + return value1 * value2; + } + + var result1; + var result2; + var result3; + var result4; + var isTerminate1 = false; + var isTerminate2 = false; + var isTerminate3 = false; + var isTerminate4 = false; + + var task1 = new taskpool.Task(Sum, 10, 20) + taskpool.execute(task1).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + var task2 = new taskpool.Task(Multi, 10, 20) + taskpool.execute(task2).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + var task3 = new taskpool.Task(Sum, 10, 30) + taskpool.execute(task3).then((ret3) => { + result3 = ret3; + isTerminate3 = true; + }) + var task4 = new taskpool.Task(Multi, 20, 20) + taskpool.execute(task4).then((ret4) => { + result4 = ret4; + isTerminate4 = true; + }) + + while (!isTerminate1 || !isTerminate2 || !isTerminate3 || !isTerminate4) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(200); + expect(result3).assertEqual(40); + expect(result4).assertEqual(400); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_037 + * @tc.name : testTaskPoolExecute037 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute037', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result; + var isTerminate = false; + taskpool.execute(Sum, 10, 20).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_038 + * @tc.name : testTaskPoolExecute038 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute038', 0, async function (done) { + function Add(value1, value2) { + "use concurrent" + if (value1 & value2) + return true; + else + return false; + } + var result; + var isTerminate = false; + taskpool.execute(Add, true, false).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual(false); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_039 + * @tc.name : testTaskPoolExecute039 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute039', 0, async function (done) { + function StrCat(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result; + var isTerminate = false; + taskpool.execute(StrCat, "abc", "def").then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual("abcdef"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_040 + * @tc.name : testTaskPoolExecute040 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute040', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + function StrCat(value1, value2) { + return value1 + value2; + } + return value1+StrCat(value2,"hello"); + } + var result; + var isTerminate = false; + taskpool.execute(Sum, "abc", "def").then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual("abcdefhello"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_041 + * @tc.name : testTaskPoolExecute041 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute041', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = []; + value[0] = arg1[0] + arg2[0]; + value[1] = arg1[1] + arg2[1]; + return value; + } + var result; + var isTerminate = false; + taskpool.execute(Sum, [1,2], [3,4]).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result[0]).assertEqual(4); + expect(result[1]).assertEqual(6); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_042 + * @tc.name : testTaskPoolExecute042 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute042', 0, async function (done) { + function Sum(arg1, arg2) { + "use concurrent" + let value = arg1; + value.a = arg1.a + arg2.a; + value.b = arg1.b + arg2.b; + return value; + } + var result; + var isTerminate = false; + taskpool.execute(Sum, {"a": 1, "b" : 2}, {"a": 3, "b" : 4}).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(JSON.stringify(result)).assertEqual("{\"a\":4,\"b\":6}"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_043 + * @tc.name : testTaskPoolExecute043 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute043', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result; + var isTerminate = false; + taskpool.execute(Sum, 10).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result.toString()).assertEqual("NaN"); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_044 + * @tc.name : testTaskPoolExecute044 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute044', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result; + var isTerminate = false; + taskpool.execute(Sum, 10, 20, 30).then((ret) => { + result = ret; + isTerminate = true; + }) + while (!isTerminate) { + await promiseCase() + } + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_045 + * @tc.name : testTaskPoolExecute045 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute045', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1; + var result2; + var isTerminate1 = false; + var isTerminate2 = false; + + taskpool.execute(Sum, 10, 20).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + taskpool.execute(Sum, 30, 40).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + while (!isTerminate1 || !isTerminate2) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(70); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_046 + * @tc.name : testTaskPoolExecute046 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute046', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var result1; + var result2; + var isTerminate1 = false; + var isTerminate2 = false; + + taskpool.execute(Sum, 10, 20).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + taskpool.execute(Sum, 10, 20).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + while (!isTerminate1 || !isTerminate2) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_047 + * @tc.name : testTaskPoolExecute047 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute047', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + function Multi(value1, value2) { + "use concurrent" + return value1 * value2; + } + + var result1; + var result2; + var result3; + var result4; + var isTerminate1 = false; + var isTerminate2 = false; + var isTerminate3 = false; + var isTerminate4 = false; + + taskpool.execute(Sum, 10, 20).then((ret1) => { + result1 = ret1; + isTerminate1 = true; + }) + taskpool.execute(Multi, 10, 20).then((ret2) => { + result2 = ret2; + isTerminate2 = true; + }) + taskpool.execute(Sum, 10, 30).then((ret3) => { + result3 = ret3; + isTerminate3 = true; + }) + taskpool.execute(Multi, 20, 20).then((ret4) => { + result4 = ret4; + isTerminate4 = true; + }) + while (!isTerminate1 || !isTerminate2 || !isTerminate3 || !isTerminate4) { + await promiseCase() + } + expect(result1).assertEqual(30); + expect(result2).assertEqual(200); + expect(result3).assertEqual(40); + expect(result4).assertEqual(400); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_048 + * @tc.name : testTaskPoolExecute048 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute048', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + try { + var result = await taskpool.execute(Sum); + } catch(e) { + expect(e.toString()).assertEqual("BusinessError: taskpool:: first param must be object when argc is one"); + } + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_049 + * @tc.name : testTaskPoolExecute049 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute049', 0, async function (done) { + function Sum(value1, value2) { + "use concurrent" + return value1 + value2; + } + var task1 = new taskpool.Task(Sum, 10, 20); + var task2 = new taskpool.Task(Sum, 30, 40); + var task3 = new taskpool.Task(Sum, 50, 60); + var result1 = await taskpool.execute(task1,taskpool.Priority.LOW); + var result2 = await taskpool.execute(task2,taskpool.Priority.HIGH); + var result3 = await taskpool.execute(task3,taskpool.Priority.MEDIUM); + expect(result1).assertEqual(30); + expect(result2).assertEqual(70); + expect(result3).assertEqual(110); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_050 + * @tc.name : testTaskPoolExecute050 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute050', 0, async function (done) { + async function func(value1, value2) { + "use concurrent" + let result = await new Promise((resolve, reject) => { + let value = value1 + value2; + resolve(value); + }) + return result; + } + var result = await taskpool.execute(func, 10, 20); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_EXECUTE_051 + * @tc.name : testTaskPoolExecute051 + * @tc.desc : Place the pending function into the taskpool internal task queue and wait for the thread to execute. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolExecute051', 0, async function (done) { + async function func(value1, value2) { + "use concurrent" + let result = await new Promise((resolve, reject) => { + let value = value1 + value2; + resolve(value); + }) + return result; + } + var task = new taskpool.Task(func, 10, 20); + var result = await taskpool.execute(task); + expect(result).assertEqual(30); + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_Cancel_001 + * @tc.name : testTaskPoolCancel001 + * @tc.desc : Cancel tasks that have not been executed + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolCancel001', 0, async function (done) { + function addition(arg) { + "use concurrent" + return arg + 1; + } + function additionDelay(arg) { + "use concurrent" + var start = new Date().getTime(); + while (new Date().getTime() - start < 200) { + continue; + } + return arg + 1; + } + try { + var task1 = new taskpool.Task(additionDelay, 100); + var task2 = new taskpool.Task(additionDelay, 200); + var task3 = new taskpool.Task(additionDelay, 200); + var task4 = new taskpool.Task(additionDelay, 200); + var task5 = new taskpool.Task(additionDelay, 200); + var task6 = new taskpool.Task(additionDelay, 200); + var task7 = new taskpool.Task(additionDelay, 200); + var task8 = new taskpool.Task(additionDelay, 200); + var task9 = new taskpool.Task(additionDelay, 200); + var task10 = new taskpool.Task(additionDelay, 200); + var task11 = new taskpool.Task(addition, 300); + + var result1 = taskpool.execute(task1); + var result2 = taskpool.execute(task2); + var result3 = taskpool.execute(task3); + var result4 = taskpool.execute(task4); + var result5 = taskpool.execute(task5); + var result6 = taskpool.execute(task6); + var result7 = taskpool.execute(task7); + var result8 = taskpool.execute(task8); + var result9 = taskpool.execute(task9); + var result10 = taskpool.execute(task10); + var result11 = taskpool.execute(task11); + + var start = new Date().getTime(); + while (new Date().getTime() - start < 20) { + continue; + } + + taskpool.cancel(task11); + } + catch (e) { + expect(e.toString()).assertEqual(""); + } + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_Cancel_002 + * @tc.name : testTaskPoolCancel002 + * @tc.desc : Cancel the task in progress + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolCancel002', 0, async function (done) { + function addition(arg) { + "use concurrent" + return arg + 1; + } + function additionDelay(arg) { + "use concurrent" + var start = new Date().getTime(); + while (new Date().getTime() - start < 3000) { + continue; + } + return arg + 1; + } + try { + var task1 = new taskpool.Task(additionDelay, 100); + var task2 = new taskpool.Task(additionDelay, 200); + var task3 = new taskpool.Task(addition, 300); + + var result1 = taskpool.execute(task1); + var result2 = taskpool.execute(task2); + var result3 = taskpool.execute(task3); + + var start = new Date().getTime(); + while (new Date().getTime() - start < 1000) { + continue; + } + + taskpool.cancel(task1); + } + catch (e) { + expect(e.toString()).assertEqual( + "BusinessError: The task is executing when it is canceled, taskpool:: can not cancel the running task"); + } + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_Cancel_003 + * @tc.name : testTaskPoolCancel003 + * @tc.desc : Cancel the executed task + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolCancel003', 0, async function (done) { + function addition(arg) { + "use concurrent" + return arg + 1; + } + try { + var task1 = new taskpool.Task(addition, 100); + var task2 = new taskpool.Task(addition, 200); + var task3 = new taskpool.Task(addition, 300); + + var result1 = taskpool.execute(task1); + var result2 = taskpool.execute(task2); + var result3 = taskpool.execute(task3); + + var start = new Date().getTime(); + while (new Date().getTime() - start < 1000) { + continue; + } + + taskpool.cancel(task1); + } + catch (e) { + expect(e.toString()).assertEqual( + "BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task"); + } + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_Cancel_004 + * @tc.name : testTaskPoolCancel004 + * @tc.desc : Cancel nonexistent task + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolCancel004', 0, async function (done) { + function addition(arg) { + "use concurrent" + return arg + 1; + } + try { + var task1 = new taskpool.Task(addition, 100); + var task2 = new taskpool.Task(addition, 200); + var task3 = new taskpool.Task(addition, 300); + + var result1 = taskpool.execute(task1); + var result2 = taskpool.execute(task2); + + taskpool.cancel(task3); + } + catch (e) { + expect(e.toString()).assertEqual( + "BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task"); + } + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_Cancel_005 + * @tc.name : testTaskPoolCancel005 + * @tc.desc : Canceling unexecuted tasks multiple times + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolCancel005', 0, async function (done) { + function addition(arg) { + "use concurrent" + return arg + 1; + } + function additionDelay(arg) { + "use concurrent" + var start = new Date().getTime(); + while (new Date().getTime() - start < 3000) { + continue; + } + return arg + 1; + } + try { + var task1 = new taskpool.Task(additionDelay, 100); + var task2 = new taskpool.Task(additionDelay, 200); + var task3 = new taskpool.Task(addition, 300); + + var result1 = taskpool.execute(task1); + var result2 = taskpool.execute(task2); + var result3 = taskpool.execute(task3); + + var start = new Date().getTime(); + while (new Date().getTime() - start < 1000) { + continue; + } + + taskpool.cancel(task3); + taskpool.cancel(task3); + } + catch (e) { + expect(e.toString()).assertEqual( + "BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task"); + } + done(); + }) + + /** + * @tc.number : TEST_TASK_POOL_Cancel_006 + * @tc.name : testTaskPoolCancel006 + * @tc.desc : Cancel all tasks in sequence + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('testTaskPoolCancel006', 0, async function (done) { + function addition(arg) { + "use concurrent" + return arg + 1; + } + try { + var task1 = new taskpool.Task(addition, 100); + var task2 = new taskpool.Task(addition, 200); + var task3 = new taskpool.Task(addition, 300); + var task4 = new taskpool.Task(addition, 400); + var task5 = new taskpool.Task(addition, 500); + var task6 = new taskpool.Task(addition, 600); + + var result1 = taskpool.execute(task1); + var result2 = taskpool.execute(task2); + var result3 = taskpool.execute(task3); + var result4 = taskpool.execute(task4); + var result5 = taskpool.execute(task5); + var result6 = taskpool.execute(task6); + + var start = new Date().getTime(); + while (new Date().getTime() - start < 100) { + continue; + } + + taskpool.cancel(task6); + taskpool.cancel(task5); + taskpool.cancel(task4); + taskpool.cancel(task3); + taskpool.cancel(task2); + } + catch (e) { + expect(e.toString()).assertEqual( + "BusinessError: The task does not exist when it is canceled, taskpool:: can not find the task"); + } + done(); + }) + }) +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/module.json b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/module.json new file mode 100755 index 000000000..97abf299e --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/module.json @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/color.json b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/color.json new file mode 100755 index 000000000..3c712962d --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/string.json b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/string.json new file mode 100755 index 000000000..65d8fa5a7 --- /dev/null +++ b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/media/icon.png b/commonlibrary/crossplatform/commonlibrarytaskpooletstest/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{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