diff --git a/appexecfwk/ams_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js b/appexecfwk/ams_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js index be1e5d8d37db15b6bc82325ba039d1ce9cfc2890..00e47bb9c23a08fb39d3aa680830009190247ade 100644 --- a/appexecfwk/ams_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js +++ b/appexecfwk/ams_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js @@ -15,7 +15,7 @@ import commonEvent from "@ohos.commonevent" import rpc from "@ohos.rpc" import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' const TIMEOUT = 9000; const START_ABILITY_TIMEOUT = 5000; @@ -27,7 +27,7 @@ var subscriberInfoStartAbility_0200 = { events: ["ACTS_Particle_StartAbility_0200_CommonEvent"], }; -describe('ActsStServiceAbilityTest', function () { +describe('ActsParticleAbilityTest', function () { let bundleName = "com.example.particletestserver"; let abilityName = "com.example.particletestserver.MainAbility"; var mRemote; @@ -55,10 +55,10 @@ describe('ActsStServiceAbilityTest', function () { } /* -* @tc.number: ACTS_ParticleAbility_startAbility_0100 -* @tc.name: ConnectAbility : Connects an ability to a Service ability. -* @tc.desc: Check the return value of the interface (by Promise) -*/ + * @tc.number: ACTS_ParticleAbility_startAbility_0100 + * @tc.name: ConnectAbility : Connects an ability to a Service ability and use service to test startAbiltiy. + * @tc.desc: Check the event of the interface startAbiltiy (by promise) + */ it('ACTS_ParticleAbility_startAbility_0100', 0, async function (done) { console.log('ACTS_ParticleAbility_startAbility_0100====Subscribe CallBack data:====>" + JSON.stringify(data)); - var result = featureAbility.disconnectAbility( + it('ACTS_ParticleAbility_startAbility_0200', 0, async function (done) { + console.log('ACTS_ParticleAbility_startAbility_0200====Subscribe CallBack data:====>" + JSON.stringify(data)); + var result = featureAbility.disconnectAbility( connId, - (error,data) => { + (error, data) => { console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) }, ); console.log('DisconnectNative ConnectAbility result : ' + result); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ParticleAbility_startAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await featureAbility.connectAbility( - { - bundleName: bundleName, - abilityName: abilityName, - action: "StartAbilityCallback" - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, - ); - console.log('StartConnectNative ConnectAbility connId : ' + connId); - setTimeout(function () { - console.log('StartConnectNative ConnectAbility timeout') - }, TIMEOUT); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + done(); + } + + commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { + console.debug("====>Create Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack====>"); + done(); + } + + function timeout() { + expect().assertFail(); + console.debug('ACTS_ParticleAbility_startAbility_0200 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + done(); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + connId = await featureAbility.connectAbility( + { + bundleName: bundleName, + abilityName: abilityName, + action: "StartAbilityCallback" + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback, + }, + ); + console.log('StartConnectNative ConnectAbility connId : ' + connId); + setTimeout(function () { + console.log('StartConnectNative ConnectAbility timeout') + }, TIMEOUT); + }) + }) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/ExampleJsunit.test.js index c2aaa75f5b98fb23c45f4f3abe3719e26ef31f96..09fb5edb0c952e6ce4d3a24396c34bfb7c3d4d72 100755 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/ExampleJsunit.test.js @@ -63,7 +63,7 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(err.code).assertEqual(0); console.debug("====>getSlotActsAnsGetSlotTestCallback_0100 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(4); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); @@ -127,7 +127,7 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(err.code).assertEqual(0); console.debug("====>getSlotActsAnsGetSlotTestCallback_0300 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(2); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); @@ -161,7 +161,7 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(err.code).assertEqual(0); console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); @@ -195,7 +195,7 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(err.code).assertEqual(0); console.debug("====>getSlotActsAnsGetSlotTestCallback_0500 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/ExampleJsunit.test.js index c8bef7c39923ff06b56eeedaeeb70c7378a93bd9..52d839f55eaaea90f0bc557f7851e33a3da1d8c1 100755 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/ExampleJsunit.test.js @@ -32,7 +32,7 @@ describe('ActsAnsGetSlotTestPromise', function () { console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 enter====>"); console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(4); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); @@ -99,7 +99,7 @@ describe('ActsAnsGetSlotTestPromise', function () { console.debug("====>getSlotPromise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 enter====>"); console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0300 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(2); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); @@ -133,7 +133,7 @@ describe('ActsAnsGetSlotTestPromise', function () { console.debug("====>getSlotPromise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 enter====>"); console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0400 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); @@ -167,7 +167,7 @@ describe('ActsAnsGetSlotTestPromise', function () { console.debug("====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 enter====>"); console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0500 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/ExampleJsunit.test.js index a707b4da9c1660403e083fece5f5c4a785706fbf..1f25c347ea2b28b92618f28e8a8f7c42eddab325 100755 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/ExampleJsunit.test.js @@ -32,7 +32,7 @@ describe('ActsAnsRemoveSlotTest', function () { console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 enter====>"); console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(3); + expect(data.level).assertEqual(4); expect(data.desc).assertEqual(""); expect(data.badgeFlag).assertEqual(true); expect(data.bypassDnd).assertEqual(false); diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json index 38ceab0b83f034b4fcc5f84dd7ef9199e388791c..4cda20ec3957315bc5503730b7d4f245f232ff69 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.neu.actsansactivesubscribertest", + "bundleName": "com.example.actsansactivesubscribertest", "vendor": "example", "version": { "code": 1, @@ -59,4 +59,4 @@ } ] } -} \ No newline at end of file +} diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json index 242abd2cb083f4ee5063fb77d281228c932ad3e8..88d82782c5b125bd239e7d11ce056515b9011166 100644 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.neu.actsansnotificationtest", + "bundleName": "com.example.actsansnotificationtest", "vendor": "example", "version": { "code": 1, @@ -59,4 +59,4 @@ } ] } -} \ No newline at end of file +}