From 6f02104156cccae268ff3d24d42af2ac69dc3a4e Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Thu, 4 Aug 2022 09:29:10 +0800 Subject: [PATCH] =?UTF-8?q?XTS=E6=96=B0=E6=A1=86=E6=9E=B6=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- ability/ability_runtime/BUILD.gn | 4 +- .../aacommand/AACommandPrintSyncTest/BUILD.gn | 4 +- .../AACommandPrintSyncTest/Test.json | 2 +- .../ets/TestRunner/OpenHarmonyTestRunner.ts | 3 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../aacommand/AACommandtest/BUILD.gn | 4 +- .../aacommand/AACommandtest/Test.json | 2 +- .../ets/TestRunner/OpenHarmonyTestRunner.ts | 3 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- ability/ability_runtime/aacommand/BUILD.gn | 14 +- .../actsamstestthirdscene/Test.json | 2 +- .../ability_runtime/abilitymontior/BUILD.gn | 4 +- .../ability_runtime/abilitymontior/Test.json | 2 +- .../entry/src/main/ets/TestAbility/app.ets | 2 +- .../src/main/ets/test/ContextJsunit.test.ets | 2 +- .../test/addContextAndAbilityJsunit.test.ets | 2 +- .../ets/test/getAbilityInfoJsunit.test.ets | 2 +- .../ets/test/getAppVersionInfoJsunit.test.ets | 2 +- .../test/getApplicationContextJsunit.test.ets | 2 +- .../ets/test/getHapModuleInfoJsunit.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../entry/src/main/ets/test/Ability.test.ets | 2 +- .../{TestApi => apitest}/AppScope/app.json | 42 +++--- .../resources/base/element/string.json | 16 +-- .../resources/base/media/app_icon.png | Bin .../{TestApi => apitest}/BUILD.gn | 4 +- .../{TestApi => apitest}/Test.json | 2 +- .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility2/MainAbility2.ts | 112 +++++++-------- .../src/main/ets/MainAbility2/pages/index.ets | 0 .../src/main/ets/MainAbility3/MainAbility3.ts | 118 ++++++++-------- .../src/main/ets/MainAbility3/pages/index.ets | 0 .../src/main/ets/MainAbility4/MainAbility4.ts | 108 +++++++-------- .../src/main/ets/MainAbility5/MainAbility5.ts | 108 +++++++-------- .../ets/TestRunner/OpenHarmonyTestRunner.ts | 0 .../entry/src/main/ets/pages/index.ets | 60 ++++---- .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 130 +++++++++--------- .../main/resources/base/element/string.json | 126 ++++++++--------- .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin ability/ability_runtime/faapicover/BUILD.gn | 2 +- .../faapicover/faapicoverhaptest/BUILD.gn | 9 +- .../faapicover/faapicoverhaptest/Test.json | 9 +- .../entry/src/main/config.json | 23 ++++ .../src/main/ets/MainAbility/pages/index.ets | 21 --- .../entry/src/main/ets/TestAbility/app.ets | 32 +++++ .../src/main/ets/TestAbility/pages/index.ets | 49 +++++++ .../ets/TestRunner/OpenHarmonyTestRunner.ts | 77 +++++++++++ .../main/ets/test/ApiCoverAbility.test.ets | 2 +- .../ets/test/{ListTest.ets => List.test.ets} | 0 .../src/main/ets/test/VerificationTest.ets | 2 +- .../main/resources/base/element/string.json | 8 ++ .../workercontextcover/BUILD.gn | 2 +- .../workercontexttest/BUILD.gn | 2 +- 77 files changed, 671 insertions(+), 495 deletions(-) rename ability/ability_runtime/{TestApi => apitest}/AppScope/app.json (96%) rename ability/ability_runtime/{TestApi => apitest}/AppScope/resources/base/element/string.json (91%) rename ability/ability_runtime/{TestApi => apitest}/AppScope/resources/base/media/app_icon.png (100%) rename ability/ability_runtime/{TestApi => apitest}/BUILD.gn (95%) rename ability/ability_runtime/{TestApi => apitest}/Test.json (93%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/Application/AbilityStage.ts (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility2/MainAbility2.ts (97%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility2/pages/index.ets (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility3/MainAbility3.ts (97%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility3/pages/index.ets (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility4/MainAbility4.ts (97%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/MainAbility5/MainAbility5.ts (97%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/pages/index.ets (96%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/ets/test/List.test.ets (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/module.json (96%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/resources/base/element/string.json (94%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/resources/base/media/icon.png (100%) rename ability/ability_runtime/{TestApi => apitest}/entry/src/main/resources/base/profile/main_pages.json (100%) rename ability/ability_runtime/{TestApi => apitest}/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/app.ets create mode 100644 ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/pages/index.ets create mode 100644 ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/{ListTest.ets => List.test.ets} (100%) diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn index 206c3dc94..a5f1086a9 100644 --- a/ability/ability_runtime/BUILD.gn +++ b/ability/ability_runtime/BUILD.gn @@ -17,10 +17,9 @@ group("ability_runtime") { testonly = true if (is_standard_system) { deps = [ - "TestApi:Testapi", "aacommand:aacommand", "abilitymanager:actsabilitymanagertest", - "abilitymontior:AbilityMonitorTest", + "abilitymontior:ActsAbilityMonitorTest", "abilitymultiinstance:abilitymultiinstance", "actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest", "actsabilitymanageretstest:ActsAbilityManagerEtsTest", @@ -38,6 +37,7 @@ group("ability_runtime") { "amsdisplayIdtest:amsdisplayIdtest", "amsgetabilityprocessinfo:amsgetabilityprocessinfo", "apicover:apicover", + "apitest:ActsApiTest", "context:context", "fa:fa", "faapicover:faapicover", diff --git a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/BUILD.gn b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/BUILD.gn index 566293988..66111bd8e 100644 --- a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/BUILD.gn +++ b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("AACommandPrintSyncTest") { +ohos_js_hap_suite("ActsAACommandPrintSyncTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ @@ -22,7 +22,7 @@ ohos_js_hap_suite("AACommandPrintSyncTest") { ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "AACommandPrintSyncTest" + hap_name = "ActsAACommandPrintSyncTest" } ohos_app_scope("aacommandprintsynctest_app_profile") { diff --git a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/Test.json b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/Test.json index 099ec073e..22ff5fbdd 100644 --- a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/Test.json +++ b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/Test.json @@ -24,7 +24,7 @@ }, { "test-file-name": [ - "AACommandPrintSyncTest.hap", + "ActsAACommandPrintSyncTest.hap", "AACommandPrintSync.hap" ], "type": "AppInstallKit", diff --git a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d25a97b4a..1762cda6d 100644 --- a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,8 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout' + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets index b47c47c12..b4f121d4d 100644 --- a/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/aacommand/AACommandPrintSyncTest/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import appManager from '@ohos.application.appManager'; const DELAY = 3000 import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' diff --git a/ability/ability_runtime/aacommand/AACommandtest/BUILD.gn b/ability/ability_runtime/aacommand/AACommandtest/BUILD.gn index 4f6288d67..3ab248977 100644 --- a/ability/ability_runtime/aacommand/AACommandtest/BUILD.gn +++ b/ability/ability_runtime/aacommand/AACommandtest/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("AACommandtest") { +ohos_js_hap_suite("ActsAACommandTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ @@ -22,7 +22,7 @@ ohos_js_hap_suite("AACommandtest") { ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "AACommandtest" + hap_name = "ActsAACommandTest" } ohos_app_scope("aacommandtest_app_profile") { diff --git a/ability/ability_runtime/aacommand/AACommandtest/Test.json b/ability/ability_runtime/aacommand/AACommandtest/Test.json index c247ba650..3e9de0495 100644 --- a/ability/ability_runtime/aacommand/AACommandtest/Test.json +++ b/ability/ability_runtime/aacommand/AACommandtest/Test.json @@ -19,7 +19,7 @@ }, { "test-file-name": [ - "AACommandtest.hap", + "ActsAACommandTest.hap", "AACommand07.hap", "AACommand08.hap", "AACommandpackage.hap", diff --git a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d25a97b4a..1762cda6d 100644 --- a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -22,7 +22,8 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout' + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { diff --git a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets index b9151b06e..073cc4f70 100644 --- a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import appManager from '@ohos.application.appManager'; const DELAY = 3000 import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' diff --git a/ability/ability_runtime/aacommand/BUILD.gn b/ability/ability_runtime/aacommand/BUILD.gn index 97b8cfe45..0bc4c8a8f 100644 --- a/ability/ability_runtime/aacommand/BUILD.gn +++ b/ability/ability_runtime/aacommand/BUILD.gn @@ -17,13 +17,13 @@ group("aacommand") { testonly = true if (is_standard_system) { deps = [ - "AACommand07:AACommand07", - "AACommand08:AACommand08", - "AACommandPrintSync:AACommandPrintSync", - "AACommandPrintSyncTest:AACommandPrintSyncTest", - "AACommandRelyHap:AACommandRelyHap", - "AACommandpackage:AACommandpackage", - "AACommandtest:AACommandtest", + "aacommand07:AACommand07", + "aacommand08:AACommand08", + "aacommandprintsync:AACommandPrintSync", + "aacommandprintsynctest:ActsAACommandPrintSyncTest", + "aacommandrelyhap:AACommandRelyHap", + "aacommandpackage:AACommandpackage", + "aacommandtest:ActsAACommandTest", ] } } diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/Test.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/Test.json index 6928b68ca..fe086ef16 100644 --- a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/Test.json +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/Test.json @@ -1,7 +1,7 @@ { "description": "Configuration for hjunit demo Tests", "driver": { - "type": "JSUnitTest", + "type": "OHJSUnitTest", "test-timeout": "300000", "bundle-name": "com.example.actsamstestthirdscene", "package-name": "com.example.actsamstestthirdscene", diff --git a/ability/ability_runtime/abilitymontior/BUILD.gn b/ability/ability_runtime/abilitymontior/BUILD.gn index bc86f5ad1..5392d42a9 100644 --- a/ability/ability_runtime/abilitymontior/BUILD.gn +++ b/ability/ability_runtime/abilitymontior/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("AbilityMonitorTest") { +ohos_js_hap_suite("ActsAbilityMonitorTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ @@ -22,7 +22,7 @@ ohos_js_hap_suite("AbilityMonitorTest") { ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "AbilityMonitorTest" + hap_name = "ActsAbilityMonitorTest" } ohos_app_scope("abilitymonitortest_app_profile") { diff --git a/ability/ability_runtime/abilitymontior/Test.json b/ability/ability_runtime/abilitymontior/Test.json index 1c7d642f5..a42ff7e9a 100644 --- a/ability/ability_runtime/abilitymontior/Test.json +++ b/ability/ability_runtime/abilitymontior/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "AbilityMonitorTest.hap" + "ActsAbilityMonitorTest.hap" ], "type": "AppInstallKit", "run-command": [ diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets index 1405dd359..870e5798a 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets @@ -13,7 +13,7 @@ * limitations under the License. */ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default { diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets index 2ac05d016..2aebc6107 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets @@ -14,7 +14,7 @@ */ import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeEach, afterEach, it, expect} from 'hypium/index'; +import {describe, beforeEach, afterEach, it, expect} from '@ohos/hypium'; import Utils from './Utils'; export default function ContextJsunit() { diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets index 1e6814cc2..9f07dcd3a 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from 'hypium/index'; +import {describe, it, expect} from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_particleAbility from '@ohos.ability.particleAbility'; diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets index e91baa031..59b0a7ff1 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from 'hypium/index'; +import {describe, it, expect} from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets index 7237c1f97..8cb793202 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from 'hypium/index'; +import {describe, it, expect} from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets index 76785298e..9fa00471c 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from 'hypium/index'; +import {describe, it, expect} from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets index a49ea2888..2f3c56067 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from 'hypium/index'; +import {describe, it, expect} from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; diff --git a/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/MainAbility/MainAbility.ts index ec269f7c2..22217570e 100644 --- a/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -1,6 +1,6 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/test/Ability.test.ets index 83f9fcc62..cb614e6ab 100644 --- a/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsabilityusertest/entry/src/main/ets/test/Ability.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import commonEvent from '@ohos.commonEvent' var subscriberInfo_MainAbility = { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility/MainAbility.ts index 5be2c7c7f..4a255b15a 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -15,7 +15,7 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets index 2c99713b9..aefa1ec9e 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets @@ -14,7 +14,7 @@ * limitations under the License. */ // @ts-nocheck -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' const START_ABILITY_TIMEOUT = 4000; diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/MainAbility/MainAbility.ts index b64cffca2..880ca3fa4 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -15,7 +15,7 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/test/Ability.test.ets index 8d34c1204..9ca84103f 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import commonEvent from '@ohos.commonEvent' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' const START_ABILITY_TIMEOUT = 5000; diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/MainAbility/MainAbility.ts index b64cffca2..880ca3fa4 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -15,7 +15,7 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/test/Ability.test.ets index 653a06779..203495782 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import commonEvent from '@ohos.commonEvent' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' const START_ABILITY_TIMEOUT = 5000; diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts index b64cffca2..880ca3fa4 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -15,7 +15,7 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/test/Ability.test.ets index 3fec08540..b14a45ee8 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import commonEvent from '@ohos.commonEvent' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' const START_ABILITY_TIMEOUT = 5000; diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/MainAbility/MainAbility.ts index 6c55d2c94..09c6f0bfa 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -15,7 +15,7 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/test/Ability.test.ets index 3dc4d1abd..78d3d346c 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/test/Ability.test.ets @@ -14,7 +14,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import commonEvent from "@ohos.commonEvent" diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/MainAbility/MainAbility.ts index b64cffca2..880ca3fa4 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -15,7 +15,7 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/test/Ability.test.ets index e9c8bd4dd..0e8ea307c 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import commonEvent from "@ohos.commonEvent" diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/MainAbility/MainAbility.ts index f49453f99..bdb5195c5 100644 --- a/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -14,7 +14,7 @@ */ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class TestAbility extends Ability { diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/test/Ability.test.ets index 0f05e8b48..38ff8a177 100644 --- a/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/ets/test/Ability.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' export default function abilityTest() { describe('ActsAbilityTest', function () { diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/MainAbility/MainAbility.ts index b00e38977..68728e971 100644 --- a/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/MainAbility/MainAbility.ts @@ -14,7 +14,7 @@ */ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class TestAbility extends Ability { diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/test/Ability.test.ets index 6db7703ef..26c6dc16c 100644 --- a/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/ets/test/Ability.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import appManager from '@ohos.application.appManager'; export default function abilityTest() { diff --git a/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/MainAbility/MainAbility.ts index bdab784ff..b69c8389d 100644 --- a/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -1,6 +1,6 @@ import Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' export default class MainAbility extends Ability { diff --git a/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/test/Ability.test.ets index 50271a2c7..708615aba 100644 --- a/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsstartrunnertest/entry/src/main/ets/test/Ability.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import commonEvent from '@ohos.commonEvent' var subscriberInfo_MainAbility = { diff --git a/ability/ability_runtime/TestApi/AppScope/app.json b/ability/ability_runtime/apitest/AppScope/app.json similarity index 96% rename from ability/ability_runtime/TestApi/AppScope/app.json rename to ability/ability_runtime/apitest/AppScope/app.json index 14749691a..e2a909132 100644 --- a/ability/ability_runtime/TestApi/AppScope/app.json +++ b/ability/ability_runtime/apitest/AppScope/app.json @@ -1,21 +1,21 @@ -{ - "app": { - "bundleName": "com.example.testapi", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} +{ + "app": { + "bundleName": "com.example.testapi", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 9, + "targetAPIVersion": 9, + "car": { + "apiCompatibleVersion": 9, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/TestApi/AppScope/resources/base/element/string.json b/ability/ability_runtime/apitest/AppScope/resources/base/element/string.json similarity index 91% rename from ability/ability_runtime/TestApi/AppScope/resources/base/element/string.json rename to ability/ability_runtime/apitest/AppScope/resources/base/element/string.json index 959e27c28..58d301506 100644 --- a/ability/ability_runtime/TestApi/AppScope/resources/base/element/string.json +++ b/ability/ability_runtime/apitest/AppScope/resources/base/element/string.json @@ -1,8 +1,8 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Testapi" - } - ] -} +{ + "string": [ + { + "name": "app_name", + "value": "Testapi" + } + ] +} diff --git a/ability/ability_runtime/TestApi/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/apitest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from ability/ability_runtime/TestApi/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/apitest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/TestApi/BUILD.gn b/ability/ability_runtime/apitest/BUILD.gn similarity index 95% rename from ability/ability_runtime/TestApi/BUILD.gn rename to ability/ability_runtime/apitest/BUILD.gn index fee0c4675..4ee797221 100644 --- a/ability/ability_runtime/TestApi/BUILD.gn +++ b/ability/ability_runtime/apitest/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("Testapi") { +ohos_js_hap_suite("ActsApiTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ @@ -22,7 +22,7 @@ ohos_js_hap_suite("Testapi") { ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "Testapi" + hap_name = "ActsApiTest" } ohos_app_scope("testapi_app_profile") { diff --git a/ability/ability_runtime/TestApi/Test.json b/ability/ability_runtime/apitest/Test.json similarity index 93% rename from ability/ability_runtime/TestApi/Test.json rename to ability/ability_runtime/apitest/Test.json index 6a09f3223..f38c063ea 100644 --- a/ability/ability_runtime/TestApi/Test.json +++ b/ability/ability_runtime/apitest/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "Testapi.hap" + "ActsApiTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/apitest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts similarity index 97% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility2/MainAbility2.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts index 1b6ec829f..a8a08f619 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -1,56 +1,56 @@ -/* -* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>"); - setTimeout(()=>{ - globalThis.abilityContext.terminateSelf(); - console.debug("====>MainAbility2 terminateSelf succese====>") - },2000) -} -export default class MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility2 onCreate") - globalThis.abilityContext = this.context - } - - onDestroy() { - console.log("[Demo] MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility2 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility2 onForeground") - commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility2 onBackground") - } -}; +/* +* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>"); + setTimeout(()=>{ + globalThis.abilityContext.terminateSelf(); + console.debug("====>MainAbility2 terminateSelf succese====>") + },2000) +} +export default class MainAbility2 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility2 onCreate") + globalThis.abilityContext = this.context + } + + onDestroy() { + console.log("[Demo] MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility2 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility2 onForeground") + commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility2 onBackground") + } +}; diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility2/pages/index.ets b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/pages/index.ets similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility2/pages/index.ets rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/pages/index.ets diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility3/MainAbility3.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts similarity index 97% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility3/MainAbility3.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts index a505d6dd7..5860a5aa5 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility3/MainAbility3.ts +++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts @@ -1,59 +1,59 @@ -/* -* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>"); - globalThis.abilityContext.terminateSelf().then(()=>{ - console.debug("====>MainAbility3 terminateSelf====>"); - }); -} -export default class MainAbility3 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility3 onCreate") - globalThis.abilityContext = this.context - } - - onDestroy() { - console.log("[Demo] MainAbility3 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility3 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility3 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility3 onForeground") - globalThis.abilitydelegator.getCurrentTopAbility().then((data)=>{ - globalThis.ability3 = data - console.debug("====>MainAbility getCurrentTopAbility:====>" + JSON.stringify(globalThis.ability3)); - commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); - }) - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility3 onBackground") - } -}; +/* +* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>"); + globalThis.abilityContext.terminateSelf().then(()=>{ + console.debug("====>MainAbility3 terminateSelf====>"); + }); +} +export default class MainAbility3 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility3 onCreate") + globalThis.abilityContext = this.context + } + + onDestroy() { + console.log("[Demo] MainAbility3 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility3 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility3 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility3 onForeground") + globalThis.abilitydelegator.getCurrentTopAbility().then((data)=>{ + globalThis.ability3 = data + console.debug("====>MainAbility getCurrentTopAbility:====>" + JSON.stringify(globalThis.ability3)); + commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); + }) + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility3 onBackground") + } +}; diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility3/pages/index.ets b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/pages/index.ets similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility3/pages/index.ets rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/pages/index.ets diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility4/MainAbility4.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility4/MainAbility4.ts similarity index 97% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility4/MainAbility4.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility4/MainAbility4.ts index cc01846b0..36898c0b2 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility4/MainAbility4.ts +++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility4/MainAbility4.ts @@ -1,54 +1,54 @@ -/* -* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack Event====>"); -} -export default class MainAbility4 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility4 onCreate") - globalThis.abilityContext = this.context - setTimeout(()=> { - commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); - }, 500) - } - - onDestroy() { - console.log("[Demo] MainAbility4 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility4 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility4 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility4 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility4 onBackground") - } -}; +/* +* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack Event====>"); +} +export default class MainAbility4 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility4 onCreate") + globalThis.abilityContext = this.context + setTimeout(()=> { + commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); + }, 500) + } + + onDestroy() { + console.log("[Demo] MainAbility4 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility4 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility4 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility4 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility4 onBackground") + } +}; diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility5/MainAbility5.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts similarity index 97% rename from ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility5/MainAbility5.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts index a6c2cc862..d95cbac07 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/ets/MainAbility5/MainAbility5.ts +++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts @@ -1,54 +1,54 @@ -/* -* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack Event====>"); -} -export default class MainAbility5 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility5 onCreate") - globalThis.abilityContext = this.context - setTimeout(()=> { - commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); - }, 500) - } - - onDestroy() { - console.log("[Demo] MainAbility5 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility5 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility5 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility5 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility5 onBackground") - } -}; +/* +* Copyright (c) 2022 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 Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack Event====>"); +} +export default class MainAbility5 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility5 onCreate") + globalThis.abilityContext = this.context + setTimeout(()=> { + commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); + }, 500) + } + + onDestroy() { + console.log("[Demo] MainAbility5 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility5 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility5 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility5 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility5 onBackground") + } +}; diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/apitest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to ability/ability_runtime/apitest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/apitest/entry/src/main/ets/pages/index.ets similarity index 96% rename from ability/ability_runtime/TestApi/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/apitest/entry/src/main/ets/pages/index.ets index 4d55fb102..af3bc3a11 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/apitest/entry/src/main/ets/pages/index.ets @@ -1,31 +1,31 @@ -/* -* Copyright (c) 2022 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. -*/ -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } +/* +* Copyright (c) 2022 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. +*/ +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } } \ No newline at end of file diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets diff --git a/ability/ability_runtime/TestApi/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/apitest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/apitest/entry/src/main/ets/test/List.test.ets diff --git a/ability/ability_runtime/TestApi/entry/src/main/module.json b/ability/ability_runtime/apitest/entry/src/main/module.json similarity index 96% rename from ability/ability_runtime/TestApi/entry/src/main/module.json rename to ability/ability_runtime/apitest/entry/src/main/module.json index 7a1472e58..6bae42d73 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/module.json +++ b/ability/ability_runtime/apitest/entry/src/main/module.json @@ -1,66 +1,66 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - }, - { - "name": "MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:MainAbility2_label", - "visible": true - }, - { - "name": "MainAbility3", - "srcEntrance": "./ets/MainAbility3/MainAbility3.ts", - "description": "$string:MainAbility3_desc", - "icon": "$media:icon", - "label": "$string:MainAbility3_label", - "visible": true - }, - { - "name": "MainAbility4", - "srcEntrance": "./ets/MainAbility4/MainAbility4.ts", - "description": "$string:MainAbility4_desc", - "icon": "$media:icon", - "label": "$string:MainAbility4_label" - }, - { - "name": "MainAbility5", - "srcEntrance": "./ets/MainAbility5/MainAbility5.ts", - "description": "$string:MainAbility5_desc", - "icon": "$media:icon", - "label": "$string:MainAbility5_label" - } - ] - } +{ + "module": { + "name": "entry", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:entry_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:MainAbility_desc", + "icon": "$media:icon", + "label": "$string:MainAbility_label", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + }, + { + "name": "MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:MainAbility2_desc", + "icon": "$media:icon", + "label": "$string:MainAbility2_label", + "visible": true + }, + { + "name": "MainAbility3", + "srcEntrance": "./ets/MainAbility3/MainAbility3.ts", + "description": "$string:MainAbility3_desc", + "icon": "$media:icon", + "label": "$string:MainAbility3_label", + "visible": true + }, + { + "name": "MainAbility4", + "srcEntrance": "./ets/MainAbility4/MainAbility4.ts", + "description": "$string:MainAbility4_desc", + "icon": "$media:icon", + "label": "$string:MainAbility4_label" + }, + { + "name": "MainAbility5", + "srcEntrance": "./ets/MainAbility5/MainAbility5.ts", + "description": "$string:MainAbility5_desc", + "icon": "$media:icon", + "label": "$string:MainAbility5_label" + } + ] + } } \ No newline at end of file diff --git a/ability/ability_runtime/TestApi/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/apitest/entry/src/main/resources/base/element/string.json similarity index 94% rename from ability/ability_runtime/TestApi/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/apitest/entry/src/main/resources/base/element/string.json index 671f704bd..abeb780ef 100644 --- a/ability/ability_runtime/TestApi/entry/src/main/resources/base/element/string.json +++ b/ability/ability_runtime/apitest/entry/src/main/resources/base/element/string.json @@ -1,64 +1,64 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "MainAbility1_desc", - "value": "description" - }, - { - "name": "MainAbility1_label", - "value": "label" - }, - { - "name": "MainAbility2_desc", - "value": "description" - }, - { - "name": "MainAbility2_label", - "value": "label" - }, - { - "name": "MainAbility3_desc", - "value": "description" - }, - { - "name": "MainAbility3_label", - "value": "label" - }, - { - "name": "MainAbility4_desc", - "value": "description" - }, - { - "name": "MainAbility4_label", - "value": "label" - }, - { - "name": "MainAbility5_desc", - "value": "description" - }, - { - "name": "MainAbility5_label", - "value": "label" - }, - { - "name": "app_name", - "value": "Testapi" - }, - { - "name": "description_application", - "value": "demo for test" - } - ] +{ + "string": [ + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "MainAbility1_desc", + "value": "description" + }, + { + "name": "MainAbility1_label", + "value": "label" + }, + { + "name": "MainAbility2_desc", + "value": "description" + }, + { + "name": "MainAbility2_label", + "value": "label" + }, + { + "name": "MainAbility3_desc", + "value": "description" + }, + { + "name": "MainAbility3_label", + "value": "label" + }, + { + "name": "MainAbility4_desc", + "value": "description" + }, + { + "name": "MainAbility4_label", + "value": "label" + }, + { + "name": "MainAbility5_desc", + "value": "description" + }, + { + "name": "MainAbility5_label", + "value": "label" + }, + { + "name": "app_name", + "value": "Testapi" + }, + { + "name": "description_application", + "value": "demo for test" + } + ] } \ No newline at end of file diff --git a/ability/ability_runtime/TestApi/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/apitest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/apitest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/TestApi/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/apitest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from ability/ability_runtime/TestApi/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/apitest/entry/src/main/resources/base/profile/main_pages.json diff --git a/ability/ability_runtime/TestApi/signature/openharmony_sx.p7b b/ability/ability_runtime/apitest/signature/openharmony_sx.p7b similarity index 100% rename from ability/ability_runtime/TestApi/signature/openharmony_sx.p7b rename to ability/ability_runtime/apitest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/faapicover/BUILD.gn b/ability/ability_runtime/faapicover/BUILD.gn index 4d9a73c22..0287c54e9 100644 --- a/ability/ability_runtime/faapicover/BUILD.gn +++ b/ability/ability_runtime/faapicover/BUILD.gn @@ -17,7 +17,7 @@ group("faapicover") { testonly = true if (is_standard_system) { deps = [ - "faapicoverhaptest:FaApiCoverHapTest", + "faapicoverhaptest:ActsFaApiCoverTest", "faauxiliary:FaAuxiliary", ] } diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/BUILD.gn b/ability/ability_runtime/faapicover/faapicoverhaptest/BUILD.gn index 719ea475d..9a14d50c9 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/BUILD.gn +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/BUILD.gn @@ -13,20 +13,25 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("FaApiCoverHapTest") { +ohos_js_hap_suite("ActsFaApiCoverTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":faapicoverhaptest_ets_assets", ":faapicoverhaptest_ets_resources", + ":faapicoverhaptest_ets_test_assets", ] ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FaApiCoverHapTest" + hap_name = "ActsFaApiCoverTest" } ohos_js_assets("faapicoverhaptest_ets_assets") { source_dir = "./entry/src/main/ets/MainAbility" } +ohos_js_assets("faapicoverhaptest_ets_test_assets") { + source_dir = "./entry/src/main/ets/TestAbility" +} ohos_resources("faapicoverhaptest_ets_resources") { sources = [ "./entry/src/main/resources" ] hap_profile = "./entry/src/main/config.json" } + diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json b/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json index 6d59a08f7..3f38dd446 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json @@ -1,15 +1,16 @@ { "description": "Configuration for hjunit demo Tests", "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.faapicoverhaptest", + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.example.faapicoverhaptest", + "package-name": "com.example.faapicoverhaptest", "shell-timeout": "600000" }, "kits": [ { "test-file-name": [ - "FaApiCoverHapTest.hap", + "ActsFaApiCoverTest.hap", "FaAuxiliary.hap" ], "type": "AppInstallKit", diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json index 2e7621c55..d08659fd7 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json @@ -41,6 +41,19 @@ "label": "$string:MainAbility_label", "type": "page", "launchType": "singleton" + }, + { + "orientation": "unspecified", + "formsEnabled": false, + "name": ".TestAbility", + "srcLanguage": "js", + "srcPath": "TestAbility", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "label": "$string:TestAbility_label", + "type": "page", + "visible": true, + "launchType": "singleton" } ], "distro": { @@ -66,6 +79,16 @@ "designWidth": 720, "autoDesignWidth": false } + }, + { + "pages": [ + "pages/index" + ], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } } ] } diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/MainAbility/pages/index.ets index d2ea267cf..d7d86254d 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/MainAbility/pages/index.ets @@ -12,32 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import list from '../../test/ListTest' - @Entry @Component struct Index { @State message: string = 'Hello World FA MainAbility' - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(this) - list(); - core.execute(); - } - build() { Row() { Column() { diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/app.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/app.ets new file mode 100644 index 000000000..1405dd359 --- /dev/null +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/app.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from 'hypium/index' +import testsuite from '../test/List.test' + +export default { + onCreate() { + console.info('Application onCreate') + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/pages/index.ets new file mode 100644 index 000000000..52663437c --- /dev/null +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestAbility/pages/index.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 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 router from '@system.router'; + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info('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/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 000000000..14e78a653 --- /dev/null +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 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 TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key] + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + console.log('onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + console.info('OpenHarmonyTestRunner OnPrepare') + } + + onRun() { + console.log('OpenHarmonyTestRunner onRun run') + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }) + console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') + var context = abilityDelegator.getAppContext() + console.info('getAppContext : ' + JSON.stringify(context)) + console.info('OpenHarmonyTestRunner onRun end') + } +}; \ No newline at end of file diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets index fdcec4206..e3a6d8b92 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import FormInfo from '@ohos.application.formInfo'; import formError from '@ohos.application.formError'; diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ListTest.ets rename to ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/List.test.ets diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets index 36d8e6623..a3578ae3b 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import ability_featureAbility from '@ohos.ability.featureAbility'; import commonEvent from '@ohos.commonEvent'; diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/resources/base/element/string.json index 26bc16c1d..9eac6dadc 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/resources/base/element/string.json +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/resources/base/element/string.json @@ -11,6 +11,14 @@ { "name": "MainAbility_label", "value": "FaXts" + }, + { + "name": "TestAbility_desc", + "value": "description" + }, + { + "name": "TestAbility_label", + "value": "label" } ] } \ No newline at end of file diff --git a/ability/ability_runtime/workercontextcover/BUILD.gn b/ability/ability_runtime/workercontextcover/BUILD.gn index 8097f9547..d93b90121 100644 --- a/ability/ability_runtime/workercontextcover/BUILD.gn +++ b/ability/ability_runtime/workercontextcover/BUILD.gn @@ -16,6 +16,6 @@ import("//test/xts/tools/build/suite.gni") group("workercontextcover") { testonly = true if (is_standard_system) { - deps = [ "workercontexttest:WorkerContextTest" ] + deps = [ "workercontexttest:ActsWorkerContextTest" ] } } diff --git a/ability/ability_runtime/workercontextcover/workercontexttest/BUILD.gn b/ability/ability_runtime/workercontextcover/workercontexttest/BUILD.gn index 8c82d06e2..c723cf41f 100644 --- a/ability/ability_runtime/workercontextcover/workercontexttest/BUILD.gn +++ b/ability/ability_runtime/workercontextcover/workercontexttest/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("WorkerContextTest") { +ohos_js_hap_suite("ActsWorkerContextTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ -- GitLab