diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets index 722516ad82802f1e2ff837cb2cd2840a82b3281d..cd2dc3a20ed1bad29731435aecc686da61271622 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets @@ -311,62 +311,6 @@ export default function verificationTest(){ done(); }) - /* - * @tc.number SUB_AA_OpenHarmony_IsTerminating_0100 - * @tc.name Verification ability destroy status query. - * @tc.desc Function test - * @tc.level 3 - */ - it('SUB_AA_OpenHarmony_IsTerminating_0100', 0, async function(done) { - TAG = 'SUB_AA_OpenHarmony_IsTerminating_0100 ==>'; - - try { - let status1 = undefined - let status2 = undefined - let subscriber = null - let subscribeInfo = { - events: ["Stage_MainAbility5_onCreate", "Stage_MainAbility5_onDestroy"] - } - function SubscribeInfoCallback(err, data) { - console.info(TAG + "===SubscribeInfoCallback===" + JSON.stringify(data)) - if (data.event == "Stage_MainAbility5_onCreate") { - status1 = data.parameters.isTerminating - } - if (data.event == "Stage_MainAbility5_onDestroy") { - status2 = data.parameters.isTerminating - expect(status1).assertFalse(); - expect(status2).assertTrue(); - commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback) - } - } - function UnSubscribeInfoCallback(err, data) { - console.info(TAG + "===UnSubscribeInfoCallback===") - done() - } - commonEvent.createSubscriber(subscribeInfo, (err, data) => { - console.info(TAG + "===CreateSubscriberCallback===") - subscriber = data - commonEvent.subscribe(subscriber, SubscribeInfoCallback) - }) - - let wantNum = { - bundleName: 'ohos.acts.aafwk.test.stagesupplement', - abilityName: 'MainAbility5' - } - globalThis.abilityContext.startAbility(wantNum).then((data) => { - console.info(TAG + "startAbility data = " + JSON.stringify(data)); - }).catch((err) => { - console.info(TAG + "startAbility err = " + JSON.stringify(err)); - expect().assertFail(); - done(); - }); - } catch (err) { - console.info(TAG + "catch err = " + JSON.stringify(err)); - expect().assertFail(); - done(); - } - }) - /* * @tc.number SUB_AA_OpenHarmony_StartAbilityLife_0100 * @tc.name Ability startup and termination will not trigger the migration lifecycle. diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index b4b5f6f051e249d66081f13c4366effc58f6eb34..65ccab01b8c9d3ca12503cf6e3fc41921f000c60 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -25,19 +25,19 @@ let subscriberInfoActsStartAbility0100 = { events: ["ACTS_StartAbility_0100_CommonEvent"], }; let subscriberInfoActsStartAbility0200 = { - events: ["ACTS_StartAbility_0200_CommonEvent"], + events: ["ACTS_StartAbility_0201_CommonEvent"], }; let subscriberInfoActsStartAbility0300 = { - events: ["ACTS_StartAbility_0300_CommonEvent"], + events: ["ACTS_StartAbility_0301_CommonEvent"], }; let subscriberInfoActsStartAbility0400 = { - events: ["ACTS_StartAbility_0400_CommonEvent"], + events: ["ACTS_StartAbility_0401_CommonEvent"], }; let subscriberInfoActsStartAbility0500 = { - events: ["ACTS_StartAbility_0500_CommonEvent"], + events: ["ACTS_StartAbility_0501_CommonEvent"], }; let subscriberInfoActsStartAbility0600 = { - events: ["ACTS_StartAbility_0600_CommonEvent"], + events: ["ACTS_StartAbility_0601_CommonEvent"], }; let subscriberInfoStartAbilityTen = { events: ["ACTS_StartAbility_1000_CommonEvent"], @@ -375,18 +375,18 @@ describe('ActsFeatureAbilityTest', function () { }) /** - * @tc.number: ACTS_StartAbility_0200 + * @tc.number: ACTS_StartAbility_0201 * @tc.name: StartAbility : A Page or Service ability uses this method to start a specific ability. * @tc.desc: Pass the parameters, Check the return value of the interface (by Promise) */ - it('ACTS_StartAbility_0200', 0, async function (done) { + it('ACTS_StartAbility_0201', 0, async function (done) { let Subscriber; let id; function SubscribeCallBack(err, data) { clearTimeout(id); expect(promise).assertEqual(0); - expect(data.event).assertEqual("ACTS_StartAbility_0200_CommonEvent"); + expect(data.event).assertEqual("ACTS_StartAbility_0201_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) } @@ -404,7 +404,7 @@ describe('ActsFeatureAbilityTest', function () { function timeout() { expect().assertFail(); - console.debug('ACTS_StartAbility_0200=====timeout======'); + console.debug('ACTS_StartAbility_0201=====timeout======'); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); } @@ -468,17 +468,17 @@ describe('ActsFeatureAbilityTest', function () { }) /** - * @tc.number: ACTS_StartAbility_0300 + * @tc.number: ACTS_StartAbility_0301 * @tc.name: StartAbility : A Page or Service ability uses this method to start a specific ability. * @tc.desc: Passing null, Check the return value of the interface (by Promise) */ - it('ACTS_StartAbility_0300', 0, async function (done) { + it('ACTS_StartAbility_0301', 0, async function (done) { let Subscriber; let id; function SubscribeCallBack(err, data) { clearTimeout(id); - expect(data.event).assertEqual("ACTS_StartAbility_0300_CommonEvent"); + expect(data.event).assertEqual("ACTS_StartAbility_0301_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); @@ -497,7 +497,7 @@ describe('ActsFeatureAbilityTest', function () { function timeout() { expect().assertFail(); - console.debug('ACTS_StartAbility_0300=====timeout======'); + console.debug('ACTS_StartAbility_0301=====timeout======'); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); } @@ -550,17 +550,17 @@ describe('ActsFeatureAbilityTest', function () { }) /** - * @tc.number: ACTS_StartAbility_0400 + * @tc.number: ACTS_StartAbility_0401 * @tc.name: StartAbility : A Page or Service ability uses this method to start a specific ability. * @tc.desc: Check the return value of the interface (by AsyncCallback) */ - it('ACTS_StartAbility_0400', 0, async function (done) { + it('ACTS_StartAbility_0401', 0, async function (done) { let Subscriber; let id; function SubscribeCallBack(err, data) { clearTimeout(id); - expect(data.event).assertEqual("ACTS_StartAbility_0400_CommonEvent"); + expect(data.event).assertEqual("ACTS_StartAbility_0401_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); @@ -579,7 +579,7 @@ describe('ActsFeatureAbilityTest', function () { function timeout() { expect().assertFail(); - console.debug('ACTS_StartAbility_0400=====timeout======'); + console.debug('ACTS_StartAbility_0401=====timeout======'); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); } @@ -635,17 +635,17 @@ describe('ActsFeatureAbilityTest', function () { }) /** - * @tc.number: ACTS_StartAbility_0500 + * @tc.number: ACTS_StartAbility_0501 * @tc.name: StartAbility : A Page or Service ability uses this method to start a specific ability. * @tc.desc: Pass the parameters, Check the return value of the interface (by AsyncCallback) */ - it('ACTS_StartAbility_0500', 0, async function (done) { + it('ACTS_StartAbility_0501', 0, async function (done) { let Subscriber; let id; function SubscribeCallBack(err, data) { clearTimeout(id); - expect(data.event).assertEqual("ACTS_StartAbility_0500_CommonEvent"); + expect(data.event).assertEqual("ACTS_StartAbility_0501_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); @@ -664,7 +664,7 @@ describe('ActsFeatureAbilityTest', function () { function timeout() { expect().assertFail(); - console.debug('ACTS_StartAbility_0500=====timeout======'); + console.debug('ACTS_StartAbility_0501=====timeout======'); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); } @@ -731,17 +731,17 @@ describe('ActsFeatureAbilityTest', function () { }) /** - * @tc.number: ACTS_StartAbility_0600 + * @tc.number: ACTS_StartAbility_0601 * @tc.name: StartAbility : A Page or Service ability uses this method to start a specific ability. * @tc.desc: Passing null, Check the return value of the interface (by AsyncCallback) */ - it('ACTS_StartAbility_0600', 0, async function (done) { + it('ACTS_StartAbility_0601', 0, async function (done) { let Subscriber; let id; function SubscribeCallBack(err, data) { clearTimeout(id); - expect(data.event).assertEqual("ACTS_StartAbility_0600_CommonEvent"); + expect(data.event).assertEqual("ACTS_StartAbility_0601_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) } @@ -759,7 +759,7 @@ describe('ActsFeatureAbilityTest', function () { function timeout() { expect().assertFail(); - console.debug('ACTS_StartAbility_0600=====timeout======'); + console.debug('ACTS_StartAbility_0601=====timeout======'); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); }