diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn index 206c3dc94bbb8a29c8aaeeb5e30a139fdaf280cd..a5f1086a9448d90830fe94cfaa7705b48ce4e2ce 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 56629398832be9e32c367d9968aab174ada98c51..66111bd8eb50534aa5098008033b85dd236255a9 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 099ec073ec15576061d691403d2532b516e6dd56..22ff5fbdd03fbdff63b230ccd8d2c1e58410e74f 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 d25a97b4abb594bd562c6c9c9d9da2ba3c26da1a..1762cda6dd8f03996989e42dfeb364161e91c0b7 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 b47c47c123a408d782cd596d70e6076871ea643f..b4f121d4d105e2609e85c7aff635beeae9a804fa 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 4f6288d67d450b3eb36a406c45a4b28f2054fb17..3ab248977d5796c2b287f73633a1538d18eea3e3 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 c247ba650e182147dad86f7143bbeb0c3e81defd..3e9de04950acbd4c6456765790781d9d6f4f442a 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 d25a97b4abb594bd562c6c9c9d9da2ba3c26da1a..1762cda6dd8f03996989e42dfeb364161e91c0b7 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 b9151b06eb321e276d01fad736a5972ea0a7236e..073cc4f70061ae0adc2779029396f8157c061457 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 97b8cfe45a0fbc69f5d4109e71b5b3964096c624..0bc4c8a8f2012c1d62f21b35b1939f19e0a7836c 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 6928b68cafd77a5c70a5bd6fb497b401a7c1f6f2..fe086ef163481218b65f944bfe8b1e2c433d4334 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 bc86f5ad19a2c0c827f5fe61cd9c17f4316bd40a..5392d42a922828be7f4ca3dc80523f6596f967be 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 1c7d642f53704a1075343f53211697f7d9455eb4..a42ff7e9a295a1b38de8aaa7fe64b5b32dc4cd3a 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 1405dd359f629939894b86e2b285cb2cc1b37aa6..870e5798acfde4ef19d493a53a5ce12506d880bb 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 2ac05d01618c8877e134e493fb739969f6a43df6..2aebc61076981ac3882b4fab15a9e3bafe4b8b5e 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 1e6814cc28e511f850c71c1a2e80a95cbff3eb7e..9f07dcd3a4e752c30d5bdefef139d5a688ac8b1f 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 e91baa031afd9a1462cd14596f98fbaa481ecff9..59b0a7ff11990489f9611c0c8c4f3673a0444536 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 7237c1f97f2552a00fb10d4bdff8bd0ef37fca7e..8cb793202b148aea74cf51635d6c6020903e2412 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 76785298e923f869fca275d42daaf74953d374cf..9fa00471c5174cccf2e662263f870d27b434af68 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 a49ea2888c9814def053c753c00d5d9bf5377555..2f3c5606755e9f430a9cf8816966d6684035a0d8 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 ec269f7c2b85395f8335b2ad3f226ee3aeac7fd0..22217570e5c6f379f58b234b3e3833f98beffc07 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 83f9fcc62033a495208c6bc731977720234df1df..cb614e6ab96718e6cb197d65e3f4503c92b4d478 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 5be2c7c7f87be6d34c6145670610bb8274c36f72..4a255b15ab9c83d7ba170564a4e7d44646439851 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 2c99713b9577d3991546d2b7c560151e27f74b5a..aefa1ec9ebfb4b3d81b78eb6f761643b1756899a 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 b64cffca2792e1099a325ac31f3528c9179de75c..880ca3fa4d033a8cd47c260912eebe0c467c6941 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 8d34c1204f963ca32a3b80bc00adcf191bed2140..9ca84103f2d97dd83a90b274708f2ee8b33f8c4c 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 b64cffca2792e1099a325ac31f3528c9179de75c..880ca3fa4d033a8cd47c260912eebe0c467c6941 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 653a067795dcb739e64a318380d867593b107f79..2034957828b6414e69604061d610f4db9c6123c5 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 b64cffca2792e1099a325ac31f3528c9179de75c..880ca3fa4d033a8cd47c260912eebe0c467c6941 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 3fec085403a1cdd8a98c8e04c9d7fe80b386ce53..b14a45ee8960c9ecf76f05b5d15de0bc80549e3f 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 6c55d2c949160275293303d557dc358edde4964b..09c6f0bfaa068c67864324a71b69d4c99cafb558 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 3dc4d1abda267cd9a12045af93580e9a7efe0472..78d3d346c4e8e4995d0c0a82f1e70df87549b3fd 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 b64cffca2792e1099a325ac31f3528c9179de75c..880ca3fa4d033a8cd47c260912eebe0c467c6941 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 e9c8bd4dd4e74e67e725cd25e60ae796921c7d6e..0e8ea307c62d0807737d5bd7c25628492eab2374 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 f49453f99c401118f969cc1cb3329e8b04307145..bdb5195c592b1d4ea8f2be35e0628c8d1e3cc263 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 0f05e8b48e9a7cf7832368951bbbc53a69674607..38ff8a1776f27f851b008b90cf77c014e187e897 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 b00e38977349b51175c85c51b488573515d50285..68728e971b786aff2b8ea9288a66e9be15a0002c 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 6db7703ef496536cc7f5e5120ab9a6cfae399c5c..26c6dc16cecd7ee80ab95710a61d558d95c03922 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 bdab784ff5190f50468477c713c7203fa81e069c..b69c8389d42ad2d41a4596b0e93a69522e8d44b6 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 50271a2c74278299cf20b84d5733a94c9d6d58f3..708615abae14a4a83a7db71cbe0115cbaf336081 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 14749691aa56153bd6e609d828a38c8eae0bf37f..e2a909132bc5010233a0d1465c2b863df4c3e068 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 959e27c287c2b08db1978f550c3a12c09e10ccd2..58d3015064ffc1ada1eabe27060f1e66a9aecde3 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 fee0c4675c2235a3149b013a63a3802172211842..4ee797221bf9879f4a5fc7b6824e43bcbbd7a95e 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 6a09f32235fdb20946f73bc1acb9b450d376e047..f38c063ea5246f53dfcad0412373722c79e74ba6 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 1b6ec829f74c2f501fc2196ed7e88fa54a863d9c..a8a08f6192e94a154c7880cf9a00de826c52da52 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 a505d6dd77cbfe694e3ccc8b23e09449e2fbc0a0..5860a5aa56a834c2869091efe1b12d085c09bea8 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 cc01846b04f3e8e1ec3db1b16c833ccbf3978b14..36898c0b26fb484bfb622f67764d6ed25ab740d7 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 a6c2cc862dfb3097fec1cfe56f6f9df233906abd..d95cbac070cd2a39eae21723f745664627a6b8b9 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 4d55fb10291670d788c540dc369a36dd6ae5ce94..af3bc3a11a9d67e7c9a527af355630de2023a29d 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 7a1472e58ff341698d9813355041a0f9b2de291b..6bae42d73033f74fe59824f0bdec3bd6e92d8486 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 671f704bdb73586893debeaa6a1afb04da8aaa51..abeb780eff45082f3605aff52a865e3de02bfeea 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 4d9a73c22af931ad6338ad607ca97e2e7310780d..0287c54e9be12d5407ef88791ae3962f7ea06d9d 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 719ea475d4349202ac43239dc8c81cb493b0649f..9a14d50c9008e7137c0dfeeda8fbd491eb80126b 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 6d59a08f7df9093cd5d78f4eadfb8866c978292d..3f38dd44604ebb86e9efc93093b255bd9faea90f 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 2e7621c55d96c95726abb21a32efc873ac227577..d08659fd7bdde0e92f9d540dae5bb1804ffd4b79 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 d2ea267cf33f0f279af969c5322174ada92aa61b..d7d86254d2fa5d5312e4de7b0737f36d17c09e0c 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 0000000000000000000000000000000000000000..1405dd359f629939894b86e2b285cb2cc1b37aa6 --- /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 0000000000000000000000000000000000000000..52663437cb619d4598126cf403d3689cb31ba131 --- /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 0000000000000000000000000000000000000000..14e78a653e030645860bcc3e7eb6c600b098127b --- /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 fdcec4206023f8ed2904db7224eabb24579b1087..e3a6d8b9279a3da0c22072032e3d9d1536e2cedb 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 36d8e6623d1fd360312f0aedf6babb71e1eeae5c..a3578ae3b9b4fdf39629e5933e7db8432ce94992 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 26bc16c1d02db8fe6448a453f1aeb00539b0a098..9eac6dadc239bbaf1731880114de76cf637a9dd9 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 8097f9547f2c086855b653bb4f6d81c80bc8ec1c..d93b901213d9df43087cc3b7cc13bcd814c2c59a 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 8c82d06e28cf666c6dfaea35252e7bf6bf84501b..c723cf41f2f2f1f185d527ad216792e50be599b2 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 = [