diff --git a/notification/ans_standard/BUILD.gn b/notification/ans_standard/BUILD.gn index ee5c617395ac81c45c0b9d7b601f28cbe47dac0c..9c176177fab3bf855c80998e8b44d3f5c9135d86 100644 --- a/notification/ans_standard/BUILD.gn +++ b/notification/ans_standard/BUILD.gn @@ -20,8 +20,6 @@ group("ans_standard") { #"actsansnotificationremove:ActsAnsNotificationRemove", "actsansslottest:ActsAnsSlotTest", "publish_test:publish_test", - - #"publishicontest:ActsAnsIconTest", ] } } diff --git a/notification/ans_standard/actsansnotificationcancel/Test.json b/notification/ans_standard/actsansnotificationcancel/Test.json index 7d1cf8bb0b4e4be5fc8e7cc59c1bae241e989d11..4ca9b73b1aa306ae295919c42826b1c423a46946 100644 --- a/notification/ans_standard/actsansnotificationcancel/Test.json +++ b/notification/ans_standard/actsansnotificationcancel/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansnotificationcancel", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsNotificationCancel.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansnotificationcancel", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsNotificationCancel.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/actsansnotificationcancel/entry/src/main/config.json b/notification/ans_standard/actsansnotificationcancel/entry/src/main/config.json index 8ad13153cbf8d6760b137014d25aa4175d43fbb2..815370be6aa672c9e703a869b2b64a0b3c26723c 100644 --- a/notification/ans_standard/actsansnotificationcancel/entry/src/main/config.json +++ b/notification/ans_standard/actsansnotificationcancel/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansnotificationcancel", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansnotificationcancel", - "name": ".actsansnotificationcancel", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansnotificationcancel.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansnotificationcancel", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansnotificationcancel", + "name": ".actsansnotificationcancel", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansnotificationcancel.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/default/app.js b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/default/app.js index 48aa9fe912943aac43b1aafc75e48aca62bd2a3c..4f1747a95c4acbb66db5351e826c31584356e11c 100644 --- a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* -* Copyright (c) 2021 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. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* +* Copyright (c) 2021 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. +*/ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/resources/base/element/string.json index 37e7d7cda395f580d7ab3db25d10f110e13d1a6a..c19c844328d1dc57e6c5eb1f17a5b409c5b65f99 100644 --- a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "cancel" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "cancel" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/ActsAnsNotificationCancel.test.js b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/ActsAnsNotificationCancel.test.js index bacd6ad9ba1d6f650732f95868862578f5d3a75e..35d5b954b0409904468cb14fb7df541254430cd6 100644 --- a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/ActsAnsNotificationCancel.test.js +++ b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/ActsAnsNotificationCancel.test.js @@ -15,38 +15,39 @@ import notify from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - +var timeout = 500; describe('ActsAnsNotificationCancel', function () { console.info("===========ActsAnsNotificationCancel start====================>"); var timesOfOnConsume - function onConsumeCancelAll(err, data) { - console.info("================onConsumeCancelAll_0100=======================>"); - console.info("================onConsumeCancelAll_0100 data: =======================>" + JSON.stringify(data)); + async function onConsumeCancelAll(data) { + console.info("================ANS_Cancel_0100 onConsume start=======================>"); + console.info("================ANS_Cancel_0100 onConsume data:=================>" + JSON.stringify(data)); timesOfOnConsume = timesOfOnConsume + 1 if (timesOfOnConsume == 2){ - notify.cancelAll(cancelAllCallBack); - console.info("============onConsumeCancelAll_0100 cancelAll=======================>"); + await notify.cancelAll(cancelAllCallBack); + console.info("================ANS_Cancel_0100 onConsume cancelAll=======================>"); } - console.info("================onConsumeCancelAll_0100 end=======================>"); + console.info("================ANS_Cancel_0100 onConsume end=======================>"); } var timesOfOnCancel - function onCancelCancelAll(err, data) { - console.info("================onCancelCancelAll_0100=======================>"); - console.info("================onCancelCancelAll_0100 data : =======================>" + JSON.stringify(data)); - console.info("================onCancelCancelAll_0100 err : =======================>" + JSON.stringify(err)); + function onCancelCancelAll(data) { + console.info("================ANS_Cancel_0100 onCancel start===============>"); + console.info("================ANS_Cancel_0100 onCancel data:===============>" + JSON.stringify(data)); timesOfOnCancel = timesOfOnCancel + 1 if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(1); + expect(data.request.id).assertEqual(1); } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertequal(2); + expect(data.request.id).assertEqual(2); } - console.info("================onCancel_cancelAll_0100 end=======================>"); + console.info("================ANS_Cancel_0100 onCancel end=======================>"); + console.info("===========ANS_Cancel_0100 onCancel unsubscribe promise========>"); + } function cancelAllCallBack(err, data){ - console.info("==================cancelAllCallBack start=======================>"); - console.info("==================cancelAllCallBack data==================>" + JSON.stringify(data)); - console.info("==================cancelAllCallBack err==================>" + JSON.stringify(err)); - console.info("==================cancelAllCallBack end=======================>"); + console.info("========ANS_Cancel_0100 cancelAllCallBack start==============>"); + console.info("========ANS_Cancel_0100 cancelAllCallBack data===============>" + JSON.stringify(data)); + console.info("========ANS_Cancel_0100 cancelAllCallBack err================>" + JSON.stringify(err)); + console.info("========ANS_Cancel_0100 cancelAllCallBack end================>"); } /* @@ -63,8 +64,6 @@ describe('ActsAnsNotificationCancel', function () { onConsume:onConsumeCancelAll, onCancel:onCancelCancelAll, } - await notify.subscribe(subscriber); - console.info("==================subscribe_0100_promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -125,38 +124,42 @@ describe('ActsAnsNotificationCancel', function () { badgeIconStyle: 1, showDeliveryTime: true, } + await notify.subscribe(subscriber); + console.info("===========ANS_Cancel_0100 subscribe promise=======>"); await notify.publish(notificationRequest); - console.info("==================publish_0100_promise==================>"); + console.info("===========ANS_Cancel_0100 publish1 promise=======>"); await notify.publish(notificationRequest1); - console.info("==================publish2_0100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0100_promise==================>"); - setTimeout((function(){ - console.info("==================ANS_Cancel_0100 done==================>"); - }),1000); - done(); + console.info("===========ANS_Cancel_0100 publish2 promise=======>"); + setTimeout((async function(){ + console.info("======ANS_Cancel_0100 setTimeout==================>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0100 setTimeout unsubscribe==================>"); + done(); + }),timeout); }) - function onConsumeCancelAllPromise(err, data) { - console.info("================onConsume_cancelAll_promise_0200=======================>"); - console.info("================onConsume_0200 data: =======================>" + JSON.stringify(data)); + + + function onConsumeCancelAllPromise(data) { timesOfOnConsume = timesOfOnConsume + 1 + console.info("================ANS_Cancel_0200 onConsume start===========>"); + console.info("================ANS_Cancel_0200 onConsume data:============>" + JSON.stringify(data)); if (timesOfOnConsume == 2){ notify.cancelAll(); - console.info("==========cancelAll_promise_0200 end==========>"); + console.info("==========ANS_Cancel_0200 onConsume cancelAll promise==========>"); } - console.info("================onConsume_cancelAll_promise_0200 end=======================>"); + console.info("================ANS_Cancel_0200 onConsume end===============>"); } - function onCancelCancelAllPromise(err, data) { + + function onCancelCancelAllPromise(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("================onCancel_cancelAll_promise_0200=======================>"); - console.info("================onCancel_0200 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_0200 err : =======================>" + JSON.stringify(err)); + console.info("=========ANS_Cancel_0200 onCancel start==========>"); + console.info("=========ANS_Cancel_0200 onCancel data:==========>" + JSON.stringify(data)); if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(1); + expect(data.request.id).assertEqual(1); } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertequal(2); + expect(data.request.id).assertEqual(2); } - console.info("================onCancel_cancelAll_promise_0200 end=======================>"); + console.info("==========ANS_Cancel_0200 onCancel end=======================>"); } /* @@ -174,7 +177,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAllPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0200_promise==================>"); + console.info("==================ANS_Cancel_0200 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -236,36 +239,33 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish1_0200_promise==================>"); + console.info("==========ANS_Cancel_0200 publish1 promise==================>"); await notify.publish(notificationRequest1); - console.info("==================publish2_0200_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_0200 done==================>"); - }),1000); - + console.info("==========ANS_Cancel_0200 publish2 promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0200 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelAllNoNotify(err, data) { - console.info("================onConsume_cancelAll_noNotify_0300=======================>"); - console.info("================onConsume_0300 data: =======================>" + JSON.stringify(data)); - expect(1).assertequal(0); - console.info("================onConsume_cancelAll_noNotify_0300 end=======================>"); - } - function onCancelCancelAllNoNotify(err, data) { - console.info("=================onCancel_cancelAll_0300=======================>"); - expect(1).assertequal(0); - console.info("================onCancel_0300 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_0300 err : =======================>" + JSON.stringify(err)); - console.info("================onCancel_0300 end=======================>"); + function onConsumeCancelAllNoNotify(data) { + console.info("================ANS_Cancel_0300 onConsume start========>"); + console.info("================ANS_Cancel_0300 onConsume data:========>" + JSON.stringify(data)); + expect().assertFail(); + console.info("================ANS_Cancel_0300 onConsume end=======================>"); + } + function onCancelCancelAllNoNotify(data) { + console.info("=================ANS_Cancel_0300 onCancel start=============>"); + expect().assertFail(); + console.info("================ANS_Cancel_0300 onCancel data:==============>" + JSON.stringify(data)); + console.info("================ANS_Cancel_0300 onCancel end================>"); } function cancelAllCallBackNoNotify(err, data){ - console.info("================cancelAllCallBack_noNotify_0300 start=======================>"); - console.info("==========cancelAllCallBack_0300 data : =======================>" + JSON.stringify(data)); - console.info("==========cancelAllCallBack_0300 err : =======================>" + JSON.stringify(err)); - console.info("================cancelAllCallBack_noNotify_0300 end=======================>"); + console.info("==========ANS_Cancel_0300 cancelAllCallBack start=============>"); + console.info("==========ANS_Cancel_0300 cancelAllCallBack data:=============>" + JSON.stringify(data)); + console.info("==========ANS_Cancel_0300 cancelAllCallBack err:=============>" + JSON.stringify(err)); + console.info("==========ANS_Cancel_0300 cancelAllCallBack end===============>"); } /* @@ -284,28 +284,27 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAllNoNotify, } await notify.subscribe(subscriber); - console.info("==================subscribe_0300_promise==================>"); + console.info("===============ANS_Cancel_0300 subscribe promise===============>"); await notify.cancelAll(cancelAllCallBackNoNotify); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0300_promise==================>"); - done(); - setTimeout((function(){ - console.info("==============ANS_Cancel_0300 done==================>"); - }),1000); + console.info("===============ANS_Cancel_0300 cancelAll promise===============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0300 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelAllNoNotifyPromise(err, data) { - console.info("================onConsume_cancelAll_noNotify_promise_0400=======================>"); - console.info("================onConsume_promise_0400 data: =======================>" + JSON.stringify(data)); - expect(1).assertequal(0); - console.info("================onConsume_promise_0400 end=======================>"); - } - function onCancelCancelAllNoNotifyPromise(err, data) { - console.info("===============onCancel_cancelAll_noNotify_promise_0400=======================>"); - console.info("===============onCancel_promise_0400 data=================>" + JSON.stringify(data)); - console.info("===============onCancel_promise_0400 err=====================>" + JSON.stringify(err)); - expect(1).assertequal(0); - console.info("===============onCancel_cancelAll_noNotify_promise_0400 end=======================>"); + function onConsumeCancelAllNoNotifyPromise(data) { + console.info("================ANS_Cancel_0400 onConsume===============>"); + console.info("================ANS_Cancel_0400 onConsume data:===========>" + JSON.stringify(data)); + expect().assertFail(); + console.info("================ANS_Cancel_0400 onConsume end===========>"); + } + function onCancelCancelAllNoNotifyPromise(data) { + console.info("===============ANS_Cancel_0400 onCancel ==================>"); + console.info("===============ANS_Cancel_0400 onCancel data==============>" + JSON.stringify(data)); + expect().assertFail(); + console.info("===============ANS_Cancel_0400 onCancel end===============>"); } /* @@ -324,49 +323,47 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAllNoNotifyPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0400_promise==================>"); + console.info("================ANS_Cancel_0400 subscribe promise=============>"); await notify.cancelAll(); - console.info("==========cancelAll_noNotify_promise_0400 start==========>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0400_promise==================>"); - done(); - setTimeout((function(){ - console.info("==============ANS_Cancel_0400 done==================>"); - }),1000); + console.info("================ANS_Cancel_0400 cancelAll promise=============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0400 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelAll2Times(err, data) { - console.info("================onConsume_cancelAll2Times_0500=======================>"); - console.info("================onConsume_cancelAll2Times_0500 data:==============>" + JSON.stringify(data)); + function onConsumeCancelAll2Times(data) { + console.info("==========ANS_Cancel_0500 onConsume start==============>"); + console.info("==========ANS_Cancel_0500 onConsume data:==============>" + JSON.stringify(data)); notify.cancelAll(cancelAllCallBack2Times1); - console.info("================onConsume_cancelAll2Times_0500 cancelAll=======================>"); - console.info("================onConsume_cancelAll2Times_0500 end=======================>"); + console.info("==========ANS_Cancel_0500 onConsume cancelAll=================>"); + console.info("==========ANS_Cancel_0500 onConsume end=======================>"); } - function onCancelCancelAll2Times(err, data) { - console.info("==========================onCancel_cancelAll2Times_0500=======================>"); - console.info("onCancel_cancelAll2Times_0500 data : =======================>" + JSON.stringify(data)); - console.info("onCancel_cancelAll2Times_0500 err : =======================>" + JSON.stringify(err)); + function onCancelCancelAll2Times(data) { + console.info("=========ANS_Cancel_0500 onCancel start===============>"); + console.info("=========ANS_Cancel_0500 onCancel data:===============>" + JSON.stringify(data)); timesOfOnCancel = timesOfOnCancel + 1 if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(5); + expect(data.request.id).assertEqual(5); } else if (timesOfOnCancel){ - expect(data.request.id).assertequal(0); + expect(data.request.id).assertEqual(0); } - console.info("================onCancel_cancelAll2Times_0500 end=======================>"); + console.info("==========ANS_Cancel_0500 onCancel end===============>"); } function cancelAllCallBack2Times1(err){ - console.info("cancelAllCallBack2Times1_0500 start=======================>"); - console.info("cancelAllCallBack2Times1_0500 err : =======================>" + JSON.stringify(err)); + console.info("==========ANS_Cancel_0500 cancelAllCallBack1 start==========>"); + console.info("==========ANS_Cancel_0500 cancelAllCallBack1 err:===========>" + JSON.stringify(err)); notify.cancelAll(cancelAllCallBack2Times2); - console.info("==========================cancelAllCallBack2Times1_0500 cancelAll=======================>"); - console.info("==========================cancelAllCallBack2Times1_0500 end=======================>"); + console.info("==========ANS_Cancel_0500 cancelAllCallBack1 cancelAll======>"); + console.info("==========ANS_Cancel_0500 cancelAllCallBack1 end===========>"); } function cancelAllCallBack2Times2(err){ - console.info("==========================cancelAllCallBack2Times2_0500 start=======================>"); - console.info("cancelAllCallBack2Times2_0500 err : =======================>" + JSON.stringify(err)); - console.info("==========================cancelAllCallBack2Times2_0500 end=======================>"); + console.info("==========ANS_Cancel_0500 cancelAllCallBack2 start=============>"); + console.info("==========ANS_Cancel_0500 cancelAllCallBack2 err:==============>" + JSON.stringify(err)); + console.info("==========ANS_Cancel_0500 cancelAllCallBack2 end===============>"); } /* @@ -377,14 +374,14 @@ describe('ActsAnsNotificationCancel', function () { and then cancel the notification again */ it('ANS_Cancel_0500', 0, async function (done) { - console.info("===============ANS_Cancel_0500 start==========================>"); + console.info("============ANS_Cancel_0500 start==================>"); timesOfOnCancel = 0 var subscriber ={ onConsume:onConsumeCancelAll2Times, onCancel:onCancelCancelAll2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_0500_promise==================>"); + console.info("============ANS_Cancel_0500 subscribe promise======>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -416,36 +413,33 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0500_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_0500 done==================>"); - }),1000); + console.info("==============ANS_Cancel_0500 publish promise end==============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0500 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelAll2TimesPromise(err, data) { - console.info("================onConsume_cancelAll2Times_promise_0600=======================>"); - console.info("================onConsume_promise_0600 data: =======================>" + JSON.stringify(data)); + function onConsumeCancelAll2TimesPromise(data) { + console.info("==========ANS_Cancel_0600 onConsume start============>"); + console.info("==========ANS_Cancel_0600 onConsume data=============>" + JSON.stringify(data)); notify.cancelAll(); - console.info("==========cancelAll_promise_2times1_0600 end==========>"); + console.info("==========ANS_Cancel_0600 onConsume cancelAll 2times1 end======>"); notify.cancelAll(); - console.info("==========cancelAll_promise_2times2_0600 end==========>"); - console.info("================onConsume_cancelAll2Times_promise_0600 cancelAll=========>"); - console.info("================onConsume_cancelAll2Times_promise_0600 end==========>"); + console.info("==========ANS_Cancel_0600 onConsume cancelAll 2times2 end======>"); + console.info("==========ANS_Cancel_0600 onConsume end========>"); } - function onCancelCancelAll2TimesPromise(err, data) { + function onCancelCancelAll2TimesPromise(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("==============onCancel_cancelAll2Times_promise_0600=======================>"); - console.info("==============onCancel_0600 data:===================>" + JSON.stringify(data)); - console.info("==============onCancel_0600 err : =======================>" + JSON.stringify(err)); + console.info("==========ANS_Cancel_0600 onCancel===================>"); + console.info("==========ANS_Cancel_0600 onCancel data:============>" + JSON.stringify(data)); if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(6); + expect(data.request.id).assertEqual(6); } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertequal(0); + expect().assertFail(); } - console.info("================onCancel_cancelAll2Times_promise_0600 end=======================>"); + console.info("==========ANS_Cancel_0600 onCancel end=============>"); } /* @@ -462,7 +456,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAll2TimesPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0600_promise==================>"); + console.info("==================ANS_Cancel_0600 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -494,34 +488,32 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0600_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_0600 done==================>"); - }),1000); + console.info("==================ANS_Cancel_0600 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0600 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelAllIsUnremovable(err, data) { - console.info("================onConsume_cancelAll_isUnremovable_0700 start=======================>"); - console.info("================onConsume_0700 data: =======================>" + JSON.stringify(data)); + function onConsumeCancelAllIsUnremovable(data) { + console.info("========ANS_Cancel_0700 onConsume start===========>"); + console.info("========ANS_Cancel_0700 onConsume data: ===========>" + JSON.stringify(data)); notify.cancelAll(cancelAllCallBackIsUnremovable); - console.info("================onConsume_0700 cancelAll=======================>"); - console.info("================onConsume__0700 end=======================>"); + console.info("========ANS_Cancel_0700 onConsume cancelAll===========>"); + console.info("========ANS_Cancel_0700 onConsume end============>"); } - function onCancelCancelAllIsUnremovable(err, data) { - console.info("================onCancel_cancelAll_isUnremovable_0700 start=======================>"); - console.info("================onCancel_0700 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_0700 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(7); - console.info("================onCancel_cancelAll_isUnremovable_0700 end=======================>"); + function onCancelCancelAllIsUnremovable(data) { + console.info("================ANS_Cancel_0700 onCancel start=======================>"); + console.info("================ANS_Cancel_0700 onCancel data:====================>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(7); + console.info("================ANS_Cancel_0700 onCancel end=======================>"); } function cancelAllCallBackIsUnremovable(err, data){ - console.info("================cancelAllCallBack_IsUnremovable_0700 start=======================>"); - console.info("================cancelAllCallBack_0700 data:================>" + JSON.stringify(err)); - console.info("================cancelAllCallBack_0700 err:==============>" + JSON.stringify(data)); - console.info("================cancelAllCallBack_IsUnremovable_0700 end=======================>"); + console.info("===========ANS_Cancel_0700 cancelAllCallBack start==========>"); + console.info("===========ANS_Cancel_0700 cancelAllCallBack err:===========>" + JSON.stringify(err)); + console.info("===========ANS_Cancel_0700 cancelAllCallBack data:==========>" + JSON.stringify(data)); + console.info("===========ANS_Cancel_0700 cancelAllCallBack end=======================>"); } /* @@ -538,7 +530,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAllIsUnremovable, } await notify.subscribe(subscriber); - console.info("==================subscribe_0700_promise==================>"); + console.info("========ANS_Cancel_0700 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -570,28 +562,26 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0700_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0700_promise==================>"); - done(); - setTimeout((function(){ - console.info("==============ANS_Cancel_0700 done==================>"); - }),1000); + console.info("===========ANS_Cancel_0700 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0700 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelAllIsUnremovablPromise(err, data) { - console.info("================onConsume_cancelAll_isUnremovable_0800 start=======================>"); - console.info("================onConsume_0800 data: =======================>" + JSON.stringify(data)); + function onConsumeCancelAllIsUnremovablPromise(data) { + console.info("================ANS_Cancel_0800 onConsume start=============>"); + console.info("================ANS_Cancel_0800 onConsume data:=============>" + JSON.stringify(data)); notify.cancelAll(); - console.info("==========cancelAll_promise_isUnremovable_0800 end==========>"); - console.info("================onConsume_cancelAll_isUnremovable_0800 end=======================>"); + console.info("================ANS_Cancel_0800 cancelAll==========>"); + console.info("================ANS_Cancel_0800 onConsume end===============>"); } - function onCancelCancelAllIsUnremovablePromise(err, data) { - console.info("================onCancel_cancelAll_isUnremovable_promise_0800 start================>"); - console.info("================onCancel_promise_0800 data :===============>" + JSON.stringify(data)); - console.info("================onCancel_promise_0800 err :==================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(8); - console.info("================onCancel_cancelAll_isUnremovable_promise_0800 end==================>"); + function onCancelCancelAllIsUnremovablePromise(data) { + console.info("================ANS_Cancel_0800 onCancel start================>"); + console.info("================ANS_Cancel_0800 onCancel data :===============>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(8); + console.info("================ANS_Cancel_0800 onCancel end================>"); } /* @@ -608,7 +598,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAllIsUnremovablePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0800_promise==================>"); + console.info("==================ANS_Cancel_0800 subscribe promsie==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -640,33 +630,31 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0800_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0800_promise==================>"); - done(); - setTimeout((function(){ - console.info("==============ANS_Cancel_0800 done==================>"); - }),1000); + console.info("=========ANS_Cancel_0800 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0800 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancel(err, data) { - console.info("================onConsume_cancel_0900 start=======================>"); - console.info("================onConsume_cancel_0900 data: =======================>" + JSON.stringify(data)); + function onConsumeCancel(data) { + console.info("=========ANS_Cancel_0900 onConsume start================>"); + console.info("=========ANS_Cancel_0900 onConsume data:================>" + JSON.stringify(data)); notify.cancel(data.request.id,cancelCallBackCancel); - console.info("================onConsume_cancel_0900 cancel=======================>"); - console.info("================onConsume_cancel_0900 end=======================>"); + console.info("=========ANS_Cancel_0900 onConsume cancel=============>"); + console.info("=========ANS_Cancel_0900 onConsume end================>"); } - function onCancelCancel(err, data) { - console.info("===============onCancel_cancel_0900 start=======================>"); - console.info("===============onCancel_cancel_0900 data : =======================>" + JSON.stringify(data)); - console.info("===============onCancel_cancel_0900 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(9); - console.info("===============onCancel_cancel_0900 end=======================>"); + function onCancelCancel(data) { + console.info("=========ANS_Cancel_0900 onCancel start================>"); + console.info("=========ANS_Cancel_0900 onCancel data:================>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(9); + console.info("=========ANS_Cancel_0900 onCancel end================>"); } function cancelCallBackCancel(err){ - console.info("===========cancelAllCallBack_cancel_0900 start=======================>"); - console.info("===========cancelAllCallBack_0900 err : =======================>" + JSON.stringify(err)); - console.info("===========cancelAllCallBack_cancel_0900 end=======================>"); + console.info("===========ANS_Cancel_0900 cancelCallBack start================>"); + console.info("===========ANS_Cancel_0900 cancelCallBack err:=================>" + JSON.stringify(err)); + console.info("===========ANS_Cancel_0900 cancelCallBack end==================>"); } /* @@ -682,7 +670,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancel, } await notify.subscribe(subscriber); - console.info("==================subscribe_0900_promise==================>"); + console.info("==================ANS_Cancel_0900 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -713,35 +701,34 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0900_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0900_promise==================>"); - done(); - setTimeout((function(){ - console.info("==============ANS_Cancel_0900 done==================>"); - }),1000); + console.info("==================ANS_Cancel_0900 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_0900 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelWrongId(err, data) { - console.info("================onConsume_cancel_cancel_wrongId_1000 start=======================>"); - console.info("================onConsume_1000 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1000 label: =======================>" + data.request.label); - console.info("================onConsume_1000 id: =======================>" + data.request.id); + function onConsumeCancelWrongId(data) { + console.info("========ANS_Cancel_1000 onConsume start==============>"); + console.info("========ANS_Cancel_1000 onConsume data:==============>" + JSON.stringify(data)); + console.info("========ANS_Cancel_1000 onConsume label:=============>" + data.request.label); + console.info("========ANS_Cancel_1000 onConsume id:================>" + data.request.id); notify.cancel(9999,cancelCallBackCancelWrongId); - console.info("================onConsume_cancel_cancel_wrongId_1000 cancel_id=======================>"); - console.info("================onConsume_cancel_cancel_wrongId_1000 end=======================>"); + console.info("========ANS_Cancel_1000 onConsume cancel==========>"); + console.info("========ANS_Cancel_1000 onConsume end============>"); } - function onCancelCancelWrongId(err, data) { - console.info("================onCancel_cancel_wrongId_1000 start=======================>"); - console.info("================onCancel_1000 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1000 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(0); - console.info("================onCancel_cancel_wrongId_1000 end=======================>"); + function onCancelCancelWrongId(data) { + console.info("================ANS_Cancel_1000 onCancel start=============>"); + console.info("================ANS_Cancel_1000 onCancel data:=============>" + JSON.stringify(data)); + expect().assertFail(); + console.info("================ANS_Cancel_1000 onCancel end===============>"); } function cancelCallBackCancelWrongId(err){ - console.info("================cancelCallBack_cancel_wrongId_1000 start=======================>"); - console.info("================cancelCallBac_1000 err : =======================>" + JSON.stringify(err)); - console.info("================cancelCallBack_cancel_wrongId_1000 end=======================>"); + console.info("==============ANS_Cancel_1000 cancelCallBack start===============>"); + console.info("==============ANS_Cancel_1000 cancelCallBack err:================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("==============ANS_Cancel_1000 cancelCallBack end=================>"); } /* @@ -757,7 +744,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelWrongId, } await notify.subscribe(subscriber); - console.info("==================subscribe_1000_promise==================>"); + console.info("================ANS_Cancel_1000 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -789,35 +776,34 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1000_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1000_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1000 done==================>"); - }),1000); + console.info("===========ANS_Cancel_1000 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1000 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelIsUnremovable(err, data) { - console.info("================onConsume_cancel_isUnremovable_1100 start=======================>"); - console.info("================onConsume_1100 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1100 label: =======================>" + data.request.label); - console.info("================onConsume_1100 id: =======================>" + data.request.id); + function onConsumeCancelIsUnremovable(data) { + console.info("============ANS_Cancel_1100 onConsume start===============>"); + console.info("============ANS_Cancel_1100 onConsume data:===============>" + JSON.stringify(data)); + console.info("============ANS_Cancel_1100 onConsume label:==============>" + data.request.label); + console.info("============ANS_Cancel_1100 onConsume id: =======================>" + data.request.id); notify.cancel(data.request.id,cancelCallBackCancelIsUnremovable); - console.info("================onConsume_1100 cancel=======================>"); - console.info("================onConsume_cancel_isUnremovable_1100 end=======================>"); + console.info("============ANS_Cancel_1100 onConsume cancel=======================>"); + console.info("============ANS_Cancel_1100 onConsume end=======================>"); } - function onCancelCancelIsUnremovable(err, data) { - console.info("===============onCancel_cancel_isUnremovable_1100 start=======================>"); - console.info("===============onCancel_1100 data : =======================>" + JSON.stringify(data)); - console.info("===============onCancel_1100 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(11); - console.info("===============onCancel_cancel_isUnremovable_1100 end=======================>"); + function onCancelCancelIsUnremovable(data) { + console.info("============ANS_Cancel_1100 onCancel start================>"); + console.info("============ANS_Cancel_1100 onCancel data:================>" + JSON.stringify(data)); + console.info("============ANS_Cancel_1100 onCancel id:================>" + data.request.id); + expect(data.request.id).assertEqual(11); + console.info("============ANS_Cancel_1100 onCancel end=======================>"); } function cancelCallBackCancelIsUnremovable(err){ - console.info("================cancelCallBack_cancel_isUnremovable_1100 start=======================>"); - console.info("================cancelCallBack_1100 err : =======================>" + JSON.stringify(err)); - console.info("================cancelCallBack_cancel_isUnremovable_1100 end=======================>"); + console.info("============ANS_Cancel_1100 cancelCallBack start=================>"); + console.info("============ANS_Cancel_1100 cancelCallBack err:==================>" + JSON.stringify(err)); + console.info("============ANS_Cancel_1100 cancelCallBack end===================>"); } /* @@ -833,7 +819,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelIsUnremovable, } await notify.subscribe(subscriber); - console.info("==================subscribe_1100_promise==================>"); + console.info("===============ANS_Cancel_1100 subscribe promise=============>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -864,50 +850,50 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1100_promise==================>"); - done(); - setTimeout((function(){ - console.info("==============ANS_Cancel_1100 done==================>"); - }),1000); + console.info("============ANS_Cancel_1100 publish promise===========>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1100 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) var id1200 - function onConsumeCancel2Times(err, data) { - console.info("================onConsume_cancel_2Times_1200 start=======================>"); - console.info("================onConsume_1200 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1200 label: =======================>" + data.request.label); - console.info("================onConsume_1200 id: =======================>" + data.request.id); + function onConsumeCancel2Times(data) { + console.info("=========ANS_Cancel_1200 onConsume start=====================>"); + console.info("=========ANS_Cancel_1200 onConsume data:=====================>" + JSON.stringify(data)); + console.info("=========ANS_Cancel_1200 onConsume label:====================>" + data.request.label); + console.info("=========ANS_Cancel_1200 onConsume id:=======================>" + data.request.id); id1200 = data.request.id notify.cancel(id1200, cancelCallBackCancel2Times1); - console.info("================onConsume_cancel_2Times_1200 cancel_2Times1=======================>"); - console.info("================onConsume_cancel_2Times_1200 end=======================>"); + console.info("=========ANS_Cancel_1200 onConsume cancel====================>"); + console.info("=========ANS_Cancel_1200 onConsume end=======================>"); } - function onCancelCancel2Times(err, data) { + function onCancelCancel2Times(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("============onCancel_cancel_2Times_1200 start=======================>"); - console.info("===========onCancel_cancel_2Times_1200 data : =======================>" + JSON.stringify(data)); - console.info("===========onCancel_cancel_2Times_1200 err : =======================>" + JSON.stringify(err)); + console.info("=========ANS_Cancel_1200 onCancel start======================>"); + console.info("=========ANS_Cancel_1200 onCancel data:===========>" + JSON.stringify(data)); + console.info("=========ANS_Cancel_1200 onCancel timesOfOnCancel========>"+timesOfOnCancel); if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(12); + expect(data.request.id).assertEqual(12); + console.info("=========ANS_Cancel_1200 onCancel id:======================>" + data.request.id); + notify.cancel(id1200, cancelCallBackCancel2Times2); + console.info("=========ANS_Cancel_1200 onCancel cancelCallBack_cancel 2Times2===========>"); }else if(timesOfOnCancel == 2) { - expect(data.request.id).assertequal(0); + expect().assertFail(); } - console.info("================onCancel_cancel_2Times_1200 end=======================>"); + console.info("=========ANS_Cancel_1200 onCancel end=======================>"); } function cancelCallBackCancel2Times1(err){ - console.info("================cancelCallBack_cancel_2Times1_1200 start=======================>"); - console.info("================cancelCallBack_1200 err : =======================>" + JSON.stringify(err)); - notify.cancelCallBack_cancel(id1200,cancelCallBackCancel2Times2); - console.info("================cancelCallBack_cancel_2Times1_1200 cancel=======================>"); - console.info("================cancelCallBack_cancel_2Times1_1200 end=======================>"); + console.info("===========ANS_Cancel_1200 cancelCallBack1 start================>"); + console.info("===========ANS_Cancel_1200 cancelCallBack1 err:=================>" + JSON.stringify(err)); + console.info("===========ANS_Cancel_1200 cancelCallBack1 end=======================>"); } function cancelCallBackCancel2Times2(err){ - console.info("===============cancelCallBack_cancel_2Times2_1200 start=======================>"); - console.info("===============cancelCallBack_1200 err : =======================>" + JSON.stringify(err)); - console.info("==========================>cancelCallBack_cancel_2Times2_1200 end=======================>"); + console.info("===========ANS_Cancel_1200 cancelCallBack2 start===========>"); + console.info("===========ANS_Cancel_1200 cancelCallBack2 err:============>" + JSON.stringify(err)); + console.info("===========ANS_Cancel_1200 cancelCallBack2 end============>"); } /* @@ -917,14 +903,14 @@ describe('ActsAnsNotificationCancel', function () { interface is called twice in a row to cancel the notification */ it('ANS_Cancel_1200', 0, async function (done) { - console.info("===============ANS_Cancel_1200 start==========================>"); + console.info("=============ANS_Cancel_1200 start==========================>"); timesOfOnCancel = 0 var subscriber ={ onConsume:onConsumeCancel2Times, onCancel:onCancelCancel2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_1200_promise==================>"); + console.info("=============ANS_Cancel_1200 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -955,36 +941,36 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1200_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1200 done==================>"); - }),1000); + console.info("========ANS_Cancel_1200 publish promise=================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1200 setTimeout unsubscribe end==================>"); + done(); + }),1500); }) - function onConsumeCancelLabel(err, data) { - console.info("================onConsume_cancel_label_1300 start=======================>"); - console.info("================onConsume_1300 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1300 label: =======================>" + data.request.label); - console.info("================onConsume_1300 id: =======================>" + data.request.id); + function onConsumeCancelLabel(data) { + console.info("============ANS_Cancel_1300 onConsume start=============>"); + console.info("============ANS_Cancel_1300 onConsume data:=============>" + JSON.stringify(data)); + console.info("============ANS_Cancel_1300 onConsume label: ===========>" + data.request.label); + console.info("============ANS_Cancel_1300 onConsume id: ==============>" + data.request.id); notify.cancel(data.request.id, data.request.label, cancelCallBackCancelLabel); - console.info("================onConsume_cancel_label_1300 cancel_label=======================>"); - console.info("================onConsume_cancel_label_1300 end=======================>"); - } - function onCancelCancelLabel(err, data) { - console.info("================onCancel_cancel_label_1300 start=======================>"); - console.info("================onCancel_1300 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1300 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(13); - expect(data.request.label).assertequal("1300"); - console.info("================onCancel_cancel_label_1300 end=======================>"); + console.info("============ANS_Cancel_1300 onConsume cance=============>"); + console.info("============ANS_Cancel_1300 onConsume end===============>"); + } + function onCancelCancelLabel(data) { + console.info("=========ANS_Cancel_1300 onCancel start============>"); + console.info("=========ANS_Cancel_1300 onCancel data:============>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(13); + console.info("=========ANS_Cancel_1300 onCancel id:============>" + data.request.id); + expect(data.request.label).assertEqual("1300"); + console.info("=========ANS_Cancel_1300 onCancel label:============>" + data.request.label); + console.info("=========ANS_Cancel_1300 onCancel end==============>"); } function cancelCallBackCancelLabel(err){ - console.info("cancelCallBack_cancel_label_1300 start=======================>"); - console.info("cancelCallBack_cancel_label_1300 err : =======================>" + JSON.stringify(err)); - console.info("cancelCallBack_cancel_label_1300 end=======================>"); + console.info("=========ANS_Cancel_1300 cancelCallBack start====================>"); + console.info("=========ANS_Cancel_1300 cancelCallBack err:=====================>" + JSON.stringify(err)); + console.info("=========ANS_Cancel_1300 cancelCallBack end=====================>"); } /* @@ -1001,7 +987,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabel, } await notify.subscribe(subscriber); - console.info("==================subscribe_1300_promise==================>"); + console.info("================ANS_Cancel_1300 subscribe promise==============>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1033,29 +1019,31 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1300_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1300_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1300 done==================>"); - }),1000); + console.info("===========ANS_Cancel_1300 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1300 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelLabelPromise(err, data) { - console.info("================onConsume_cancel_label_promise start=======================>"); - console.info("================onConsume_promise data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_promise label: =======================>" + data.request.label); - console.info("================onConsume_promise id: =======================>" + data.request.id); + function onConsumeCancelLabelPromise(data) { + console.info("==========ANS_Cancel_1400 onConsume start=================>"); + console.info("==========ANS_Cancel_1400 onConsume data:=================>" + JSON.stringify(data)); + console.info("==========ANS_Cancel_1400 onConsume label:================>" + data.request.label); + console.info("==========ANS_Cancel_1400 onConsume id:===================>" + data.request.id); notify.cancel(data.request.id, data.request.label); - console.info("==========cancel_labe_lpromise_1400 end==========>"); - console.info("================onConsume_cancel_label_promise end=======================>"); - } - function onCancelCancelLabelPromise(err, data) { - console.info("================onCancel_cancel_label_promise_1400 start=======================>"); - console.info("================onCancel_1400 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1400 err : =======================>" + JSON.stringify(err)); - console.info("================onCancel_1400 end=======================>"); + console.info("==========ANS_Cancel_1400 onConsume cancel==========>"); + console.info("==========ANS_Cancel_1400 onConsume end=============>"); + } + function onCancelCancelLabelPromise(data) { + console.info("==========ANS_Cancel_1400 onCancel start============>"); + console.info("==========ANS_Cancel_1400 onCancel data:============>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(14); + console.info("==========ANS_Cancel_1400 onCancel id:================>" + data.request.id); + expect(data.request.label).assertEqual("1400"); + console.info("==========ANS_Cancel_1400 onCancel label:================>" + data.request.label); + console.info("==========ANS_Cancel_1400 onCancel end==============>"); } /* @@ -1071,7 +1059,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabelPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_1400_promise==================>"); + console.info("==========ANS_Cancel_1400 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1103,36 +1091,36 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1400_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1400_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1400 done==================>"); - }),1000); + console.info("===============ANS_Cancel_1400 publish promise==============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1400 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelLabelIsUnremoveable(err, data) { - console.info("onConsume_cancel_label_isUnremoveable_1500 start=======================>"); - console.info("================onConsume_1500 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1500 label: =======================>" + data.request.label); - console.info("================onConsume_1500 id: =======================>" + data.request.id); + function onConsumeCancelLabelIsUnremoveable(data) { + console.info("========ANS_Cancel_1500 onConsume start=====================>"); + console.info("========ANS_Cancel_1500 onConsume data:=====================>" + JSON.stringify(data)); + console.info("========ANS_Cancel_1500 onConsume label:====================>" + data.request.label); + console.info("========ANS_Cancel_1500 onConsume id:=======================>" + data.request.id); notify.cancel(data.request.id, data.request.label, cancelCallBackCancelLabelIsUnremoveable); - console.info("================onConsume_1500 cancel_label=======================>"); - console.info("================onConsume_1500 end=======================>"); - } - function onCancelCancelLabelIsUnremoveable(err, data) { - console.info("================onCancel_Cancel_Label_IsUnremoveable_1500 start=======================>"); - console.info("================onCancel_1500 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1500 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(15); - expect(data.request.label).assertequal("1500"); - console.info("================onCancel_Cancel_Label_IsUnremoveable_1500 end=======================>"); + console.info("========ANS_Cancel_1500 onConsume cancel====================>"); + console.info("========ANS_Cancel_1500 onConsume end=======================>"); + } + function onCancelCancelLabelIsUnremoveable(data) { + console.info("========ANS_Cancel_1500 onCancel start=======================>"); + console.info("========ANS_Cancel_1500 onCancel data : =======================>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(15); + console.info("========ANS_Cancel_1500 onCancel id : =======================>" + data.request.id); + expect(data.request.label).assertEqual("1500"); + console.info("========ANS_Cancel_1500 onCancel label : =======================>" + data.request.label); + console.info("========ANS_Cancel_1500 onCancel end=======================>"); } function cancelCallBackCancelLabelIsUnremoveable(err){ - console.info("===============cancelCallBack_cancel_label_isUnremoveable_1500 start=======================>"); - console.info("================cancelCallBack_1500 err : =======================>" + JSON.stringify(err)); - console.info("============onConsume_cancel_label_isUnremoveable_1500 end=======================>"); + console.info("========ANS_Cancel_1500 cancelCallBack start=========>"); + console.info("========ANS_Cancel_1500 cancelCallBack err:==========>" + JSON.stringify(err)); + console.info("========ANS_Cancel_1500 cancelCallBack end===========>"); } /* @@ -1148,7 +1136,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabelIsUnremoveable, } await notify.subscribe(subscriber); - console.info("==================subscribe_1500_promise==================>"); + console.info("=======ANS_Cancel_1500 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1180,29 +1168,31 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1500_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1500 done==================>"); - }),1000); + console.info("===========ANS_Cancel_1500 publish promise=============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1500 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelLabelIsUnremoveablePromise(err, data) { - console.info("================onConsume_cancel_label_isUnremoveable_1600 start=======================>"); - console.info("================onConsume_1600 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1600 label: =======================>" + data.request.label); - console.info("================onConsume_1600 id: =======================>" + data.request.id); + function onConsumeCancelLabelIsUnremoveablePromise(data) { + console.info("============ANS_Cancel_1600 onConsume start==================>"); + console.info("============ANS_Cancel_1600 onConsume data:==================>" + JSON.stringify(data)); + console.info("============ANS_Cancel_1600 onConsume label:=================>" + data.request.label); + console.info("============ANS_Cancel_1600 onConsume id:====================>" + data.request.id); notify.cancel(data.request.id, data.request.label) - console.info("==========cancel_label_isUnremoveable_promise_1600 end==========>"); - console.info("================onConsume_cancel_label_isUnremoveable_1600 end=======================>"); - } - function onCancelCancelLabelIsUnremoveablePromise(err, data) { - console.info("===============onConsume_cancel_label_isUnremoveable_1600 start=======================>"); - console.info("===============onConsume_1600 data : =======================>" + JSON.stringify(data)); - console.info("===============onConsume_1600 err : =======================>" + JSON.stringify(err)); - console.info("===============onConsume_cancel_label_isUnremoveable_1600 end=======================>"); + console.info("============ANS_Cancel_1600 onConsume cancel end==========>"); + console.info("============ANS_Cancel_1600 onConsume end====================>"); + } + function onCancelCancelLabelIsUnremoveablePromise(data) { + console.info("============ANS_Cancel_1600 onCancel start=================>"); + console.info("============ANS_Cancel_1600 onCancel data:=================>" + JSON.stringify(data)); + expect(data.request.id).assertEqual(16); + console.info("============ANS_Cancel_1600 onCancel id : =======================>" + data.request.id); + expect(data.request.label).assertEqual("1600"); + console.info("============ANS_Cancel_1600 onCancel label : =======================>" + data.request.label); + console.info("============ANS_Cancel_1600 onCancel end===================>"); } /* @@ -1218,7 +1208,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabelIsUnremoveablePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_1600_promise==================>"); + console.info("==============ANS_Cancel_1600 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1250,35 +1240,33 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1600_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1600 done==================>"); - }),1000); + console.info("==============ANS_Cancel_1600 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1600 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelWrongLabel(err, data) { - console.info("================onConsume_cancel_wrongLabel_1700 start=======================>"); - console.info("================onConsume_1700 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1700 label: =======================>" + data.request.label); - console.info("================onConsume_1700 id: =======================>" + data.request.id); + function onConsumeCancelWrongLabel(data) { + console.info("================ANS_Cancel_1700 onConsume start===============>"); + console.info("================ANS_Cancel_1700 onConsume data:===============>" + JSON.stringify(data)); + console.info("================ANS_Cancel_1700 onConsume label:==============>" + data.request.label); + console.info("================ANS_Cancel_1700 onConsume id:=================>" + data.request.id); notify.cancel(data.request.id, "9999", cancelCallBackCancelWrongLabel); - console.info("================onConsume_1700 cancel_label=======================>"); - console.info("================onConsume_cancel_wrongLabel_1700 end=======================>"); + console.info("================ANS_Cancel_1700 onConsume cancel=======================>"); + console.info("================ANS_Cancel_1700 onConsume end=======================>"); } - function onCancelCancelWrongLabel(err, data) { - console.info("================onCancel_cancel_wrongLabel_1700 start=======================>"); - console.info("================onCancel_1700 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1700 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(0); - expect(data.request.label).assertequal("0"); - console.info("=================onCancel_cancel_wrongLabel_1700 end=======================>"); + function onCancelCancelWrongLabel(data) { + console.info("================ANS_Cancel_1700 onCancel start===============>"); + console.info("================ANS_Cancel_1700 onCancel data:===============>" + JSON.stringify(data)); + expect().assertFail(0); + console.info("================ANS_Cancel_1700 onCancel end=================>"); } function cancelCallBackCancelWrongLabel(err){ - console.info("================cancelCallBack_cancel_wrongLabel_1700 start=======================>"); - console.info("================cancelCallBack_1700 err : =======================>" + JSON.stringify(err)); - console.info("================cancelCallBack_cancel_wrongLabel_1700 end=======================>"); + console.info("================ANS_Cancel_1700 cancelCallBack start=================>"); + console.info("================ANS_Cancel_1700 cancelCallBack err:==================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("================ANS_Cancel_1700 cancelCallBack end===================>"); } /* @@ -1294,7 +1282,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelWrongLabel, } await notify.subscribe(subscriber); - console.info("===============subscribe_1700_promise==================>"); + console.info("==============ANS_Cancel_1700 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1326,30 +1314,27 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1700_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1700_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1700 done==================>"); - }),1000); + console.info("==============ANS_Cancel_1700 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1700 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelWrongLabelPromise(err, data) { - console.info("onConsume_cancel_wrongLabel_1800 start=======================>"); - console.info("onConsume_cancel_wrongLabel_1800 data: =======================>" + JSON.stringify(data)); - console.info("onConsume_cancel_wrongLabel_1800 label: =======================>" + data.request.label); - console.info("onConsume_cancel_wrongLabel_1800 id: =======================>" + data.request.id); + function onConsumeCancelWrongLabelPromise(data) { + console.info("=========ANS_Cancel_1800 onConsume start================>"); + console.info("=========ANS_Cancel_1800 onConsume data:================>" + JSON.stringify(data)); + console.info("=========ANS_Cancel_1800 onConsume label:===============>" + data.request.label); + console.info("=========ANS_Cancel_1800 onConsume id:==================>" + data.request.id); notify.cancel(data.request.id, "9999"); - console.info("================onConsume_cancel_wrongLabel_1800 end=======================>"); + console.info("=========ANS_Cancel_1800 onConsume end=======================>"); } - function onCancelCancelWrongLabelPromise(err, data) { - console.info("================onCancel_cancel_wrongLabel_1800 start=======================>"); - console.info("================onCancel_1800 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1800 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(0); - expect(data.request.label).assertequal("0"); - console.info("================onCancel_cancel_wrongLabel_1800 end=======================>"); + function onCancelCancelWrongLabelPromise(data) { + console.info("=========ANS_Cancel_1800 onCancel start=======================>"); + console.info("=========ANS_Cancel_1800 onCancel data : =======================>" + JSON.stringify(data)); + expect().assertFail(0); + console.info("=========ANS_Cancel_1800 onCancel end=======================>"); } /* @@ -1365,7 +1350,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelWrongLabelPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_1800_promise==================>"); + console.info("==============ANS_Cancel_1800 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1397,36 +1382,34 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1800_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1800_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_1800 done==================>"); - }),1000); + console.info("==============ANS_Cancel_1800 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1800 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelLabelNullCharacter(err, data) { - console.info("================onConsume_cancel_label_nullCharacter_1900 start=======================>"); - console.info("================onConsume_1900 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_1900 label: =======================>" + data.request.label); - console.info("================onConsume_1900 id: =======================>" + data.request.id); + function onConsumeCancelLabelNullCharacter(data) { + console.info("===========ANS_Cancel_1900 onConsume start==================>"); + console.info("===========ANS_Cancel_1900 onConsume data:==================>" + JSON.stringify(data)); + console.info("===========ANS_Cancel_1900 onConsume label:=================>" + data.request.label); + console.info("===========ANS_Cancel_1900 onConsume id:====================>" + data.request.id); notify.cancel(data.request.id, "", cancelCallBackCancelNullCharacter); - console.info("================onConsume_cancel_nullCharacte_1900 cancel_label=======================>"); - console.info("================onConsume_cancel_nullCharacte_1900 end=======================>"); + console.info("===========ANS_Cancel_1900 onConsume cancel=======================>"); + console.info("===========ANS_Cancel_1900 onConsume end=======================>"); } - function onCancelCancelLabelNullCharacter(err, data) { - console.info("onCancel_cancel_label_nullCharacter_1900 start=======================>"); - console.info("================onCancel_1900 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_1900 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(0); - expect(data.request.label).assertequal("0"); - console.info("onCancel_cancel_nullCharacter_1900 end=======================>"); + function onCancelCancelLabelNullCharacter(data) { + console.info("===========ANS_Cancel_1900 onCancel start================>"); + console.info("===========ANS_Cancel_1900 onCancel data:================>" + JSON.stringify(data)); + expect().assertFail(0); + console.info("===========ANS_Cancel_1900 onCancel end=======================>"); } function cancelCallBackCancelNullCharacter(err){ - console.info("==============cancelCallBack_cancel_nullCharacter_1900 start=======================>"); - console.info("==============cancelCallBack_1900 err : =======================>" + JSON.stringify(err)); - console.info("==============cancelCallBack_cancel_nullCharacter_1900 end=======================>"); + console.info("===========ANS_Cancel_1900 cancelCallBack start=================>"); + console.info("===========ANS_Cancel_1900 cancelCallBack err:==================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("===========ANS_Cancel_1900 cancelCallBack end===================>"); } /* @@ -1442,7 +1425,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabelNullCharacter, } await notify.subscribe(subscriber); - console.info("==================subscribe_1900_promise==================>"); + console.info("=============ANS_Cancel_1900 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1474,31 +1457,28 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1900_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1900_promise==================>"); - setTimeout((function(){ - console.info("==================ANS_Cancel_1900 done==================>"); - }),1000); - done(); + console.info("==========ANS_Cancel_1900 publish promise==============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_1900 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelNullCharacter(err, data) { - console.info("==========onConsume_cancel_nullCharacte_2000 start=======================>"); - console.info("==========onConsume_2000 data: =======================>" + JSON.stringify(data)); - console.info("==========onConsume_2000 label: =======================>" + data.request.label); - console.info("==========onConsume_2000 id: =======================>" + data.request.id); + function onConsumeCancelNullCharacter(data) { + console.info("==========ANS_Cancel_2000 onConsume start=================>"); + console.info("==========ANS_Cancel_2000 onConsume data:=================>" + JSON.stringify(data)); + console.info("==========ANS_Cancel_2000 onConsume label:================>" + data.request.label); + console.info("==========ANS_Cancel_2000 onConsume id:===================>" + data.request.id); notify.cancel(data.request.id, ""); - console.info("==========cancel_nullCharacte_2000 end==========>"); - console.info("================onConsume_cancel_nullCharacte_2000 end=======================>"); + console.info("==========ANS_Cancel_2000 onConsume cancel end==========>"); + console.info("==========ANS_Cancel_2000 onConsume end=================>"); } - function onCancelCancelNullCharacter(err, data) { - console.info("================onCancel_cancel_nullCharacter_2000 start=======================>"); - console.info("================onCancel_2000 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_2000 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(0); - expect(data.request.label).assertequal("0"); - console.info("================onCancel_cancel_nullCharacter_2000 end=======================>"); + function onCancelCancelNullCharacter(data) { + console.info("==========ANS_Cancel_2000 onCancel start====================>"); + console.info("==========ANS_Cancel_2000 onCancel data:======================>" + JSON.stringify(data)); + expect().assertFail(0); + console.info("==========ANS_Cancel_2000 onCancel end=======================>"); } /* @@ -1514,7 +1494,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelNullCharacter, } await notify.subscribe(subscriber); - console.info("==================subscribe_2000_promise==================>"); + console.info("=========ANS_Cancel_2000 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1546,52 +1526,52 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2000_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2000_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2000 done==================>"); - }),1000); + console.info("============ANS_Cancel_2000 publish promise===============>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2000 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) var id2100 var label2100 - function onConsumeCancelLabel2Times(err, data) { - console.info("onConsume_cancel_label_2Times_2100 start=======================>"); - console.info("onConsume_cancel_label_2Times_2100 data:====================>" + JSON.stringify(data)); - console.info("onConsume_cancel_label_2Times_2100 label:====================>" + data.request.label); - console.info("onConsume_cancel_label_2Times_2100 id:====================>" + data.request.id); + function onConsumeCancelLabel2Times(data) { + console.info("=========ANS_Cancel_2100 onConsume start==================>"); + console.info("=========ANS_Cancel_2100 onConsume data:==================>" + JSON.stringify(data)); + console.info("=========ANS_Cancel_2100 onConsume label:=================>" + data.request.label); + console.info("=========ANS_Cancel_2100 onConsume id:====================>" + data.request.id); id2100 = data.request.id label2100 = data.request.label notify.cancel(id2100, label2100, cancelCallBackCancelLabel2Times1); - console.info("=============onConsume_cancel_label_2Times_2100 cancel_label=======================>"); - console.info("=============onConsume_cancel_label_2Times_2100 end=======================>"); + console.info("=========ANS_Cancel_2100 onConsume cancel=======================>"); + console.info("=========ANS_Cancel_2100 onConsume end=======================>"); } - function onCancelCancelLabel2Times(err, data) { + function onCancelCancelLabel2Times(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("===============onCancel_cancel_label_2Times_2100 start=======================>"); - console.info("===============onCancel_2100 data : =======================>" + JSON.stringify(data)); - console.info("===============onCancel_2100 err : =======================>" + JSON.stringify(err)); + console.info("=========ANS_Cancel_2100 onCancel start==========>"); + console.info("=========ANS_Cancel_2100 onCancel data===========>" + JSON.stringify(data)); if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(21); - expect(data.request.label).assertequal("2100"); + expect(data.request.id).assertEqual(21); + expect(data.request.label).assertEqual("2100"); }else if(timesOfOnCancel == 2){ expect().assertFail(); } - console.info("================onCancel_cancel_label_2Times_2100 end=======================>"); + console.info("=========ANS_Cancel_2100 onCancel end==========>"); } function cancelCallBackCancelLabel2Times1(err){ - console.info("================cancelCallBack_cancel_label_2Times1_2100 start=======================>"); - console.info("================cancelCallBack_2100 err : =======================>" + JSON.stringify(err)); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 start============>"); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 err==============>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); notify.cancel(id2100, label2100, cancelCallBackCancelLabel2Times2); - console.info("===============cancelCallBack_2100 cancel_label_2Times1=======================>"); - console.info("===============cancelCallBack_2Times1_2100 end=======================>"); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 cancel =======================>"); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 end=======================>"); } function cancelCallBackCancelLabel2Times2(err){ - console.info("================cancelCallBack_cancel_label_2Times2_2100 start=======================>"); - console.info("================cancelCallBack_2100 err : =======================>" + JSON.stringify(err)); - console.info("================cancelCallBack_cancel_label_2Times2_2100 end=======================>"); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 start================>"); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 err:=================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 end==================>"); } /* @@ -1608,7 +1588,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabel2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_2100_promise==================>"); + console.info("=============ANS_Cancel_2100 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1640,42 +1620,40 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2100_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2100 done==================>"); - }),1000); + console.info("=============ANS_Cancel_2100 publish promise================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2100 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) var id2200 var label2200 - function onConsumeCancelLabelPromise2Times(err, data) { - console.info("================onConsume_cancel_label_2Times_poromise_2200 start=======================>"); - console.info("onConsume_cancel_label_2Times_poromise_2200 data:========>" + JSON.stringify(data)); - console.info("onConsume_cancel_label_2Times_poromise_2200 label:========>" + data.request.label); - console.info("onConsume_cancel_label_2Times_poromise_2200 id:========>" + data.request.id); + function onConsumeCancelLabelPromise2Times(data) { + console.info("===========ANS_Cancel_2200 onConsume start=======================>"); + console.info("===========ANS_Cancel_2200 onConsume data:=========>" + JSON.stringify(data)); + console.info("===========ANS_Cancel_2200 onConsume label:========>" + data.request.label); + console.info("===========ANS_Cancel_2200 onConsume id:===========>" + data.request.id); id2200 = data.request.id label2200 = data.request.label notify.cancel(id2200, label2200); - console.info("==========cancel_label_2Times1_promise_2200 end==========>"); + console.info("===========ANS_Cancel_2200 onConsume cancel1==========>"); notify.cancel(id2200, label2200) - console.info("==========cancel_label_2Times2_promise_2200 end==========>"); - console.info("================onConsume_cancel_label_2Times_poromise_2200 end=======================>"); + console.info("===========ANS_Cancel_2200 onConsume cancel2==========>"); + console.info("===========ANS_Cancel_2200 onConsume end==============>"); } - function onCancelCancelLabelPromise2Times(err, data) { - console.info("onCancel_cancel_label_2Times_2200 start=======================>"); + function onCancelCancelLabelPromise2Times(data) { + console.info("===========ANS_Cancel_2200 onCancel start===================>"); + console.info("===========ANS_Cancel_2200 onCancel data:===================>" + JSON.stringify(data)); timesOfOnCancel = timesOfOnCancel + 1 - console.info("onCancel_cancel_label_2Times_2200 data : =======================>" + JSON.stringify(data)); - console.info("onCancel_cancel_label_2Times_2200 err : =======================>" + JSON.stringify(err)); if (timesOfOnCancel == 1){ - expect(data.request.id).assertequal(22); - expect(data.request.label).assertequal("2200"); + expect(data.request.id).assertEqual(22); + expect(data.request.label).assertEqual("2200"); }else if (timesOfOnCancel == 2){ expect().assertFail(); } - console.info("================onCancel_cancel_label_2Times_2200 end=======================>"); + console.info("===========ANS_Cancel_2200 onCancel end=======================>"); } /* @@ -1692,7 +1670,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelLabelPromise2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_2200_promise==================>"); + console.info("================ANS_Cancel_2200 subscribe_2200_promise=============>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1724,42 +1702,41 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2200_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2200 done==================>"); - }),1000); + console.info("================ANS_Cancel_2200 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2200 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelRightLabelWrongId(err, data) { - console.info("================onConsume_cancel_rightLabel_wrongId_2300 start=======================>"); - console.info("================onConsume_2300 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_2300 label: =======================>" + data.request.label); - console.info("================onConsume_2300 id: =======================>" + data.request.id); + function onConsumeCancelRightLabelWrongId(data) { + console.info("============ANS_Cancel_2300 onConsume start=======================>"); + console.info("============ANS_Cancel_2300 onConsume data: =======================>" + JSON.stringify(data)); + console.info("============ANS_Cancel_2300 onConsume label: =======================>" + data.request.label); + console.info("============ANS_Cancel_2300 onConsume id: =======================>" + data.request.id); notify.cancel(11111, data.request.label, cancelCallBackCancelRightLabelWrongId); - console.info("================onConsume_2300 cancel_rightLabel_wrongId=======================>"); - console.info("================onConsume_cancel_rightLabel_wrongId_2300 end=======================>"); + console.info("============ANS_Cancel_2300 onConsume cancel=======================>"); + console.info("============ANS_Cancel_2300 onConsume end=======================>"); } - function onCancelCancelRightLabelWrongId(err, data) { - console.info("===================onCancel_cancel_rightLabel_wrongId_2300 start=======================>"); - console.info("================onCancel_2300 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_2300 err : =======================>" + JSON.stringify(err)); + function onCancelCancelRightLabelWrongId(data) { + console.info("============ANS_Cancel_2300 onCancel start=======================>"); + console.info("============ANS_Cancel_2300 onCancel data:=======================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================onCancel_cancel_rightLabel_wrongId_2300 end=======================>"); + console.info("============ANS_Cancel_2300 onCancel end=======================>"); } function cancelCallBackCancelRightLabelWrongId(err){ - console.info("cancelCallBack_cancel_rightLabel_wrongId_2300 start=======================>"); - console.info("cancelCallBack_cancel_rightLabel_wrongId_2300 err:===============>" + JSON.stringify(err)); - console.info("cancelCallBack_cancel_rightLabel_wrongId_2300 end===================>"); + console.info("============ANS_Cancel_2300 cancelCallBack start=======================>"); + console.info("============ANS_Cancel_2300 cancelCallBack err:===============>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("============ANS_Cancel_2300 cancelCallBack end===================>"); } /* * @tc.number: ANS_Cancel_2300 * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): - void interface is called, the label is correct and the ID is correct wrong. + void interface is called, the label is correct and the ID is wrong. */ it('ANS_Cancel_2300', 0, async function (done) { console.info("===============ANS_Cancel_2300 start==========================>"); @@ -1768,7 +1745,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelRightLabelWrongId, } await notify.subscribe(subscriber); - console.info("==================subscribe_2300_promise==================>"); + console.info("================ANS_Cancel_2300 promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1800,32 +1777,28 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2300_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2300_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2300 done==================>"); - }),1000); + console.info("============ANS_Cancel_2300 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2300 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelRightLabelWrongIdPromise(err, data) { - console.info("onConsume_cancel_rightLabel_wrongId_promise_2400 start=======================>"); - console.info("================onConsume_2400 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_2400 label: =======================>" + data.request.label); - console.info("================onConsume_2400 id: =======================>" + data.request.id); + function onConsumeCancelRightLabelWrongIdPromise(data) { + console.info("============ANS_Cancel_2400 onConsume start==============>"); + console.info("============ANS_Cancel_2400 onConsume data:==============>" + JSON.stringify(data)); + console.info("============ANS_Cancel_2400 onConsume label:=============>" + data.request.label); + console.info("============ANS_Cancel_2400 onConsume id:================>" + data.request.id); notify.cancel(11111, data.request.label) - console.info("==========cancel_rightLabel_wrongId_promise_2400 end==========>"); - console.info("================onConsume_2400 cancel_rightLabel_wrongId=======================>"); - console.info("================onConsume_2400 end=======================>"); - } - function onCancelCancelRightLabelWrongIdPromise(err, data) { - console.info("================onCancel_cancel_rightLabel_wrongId_2400 start : =======================>"); - console.info("================onCancel_2400 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel_2400 err : =======================>" + JSON.stringify(err)); - expect(data.request.id).assertequal(0); - expect(data.request.label).assertequal("0"); - console.info("================onCancel_cancel_rightLabel_wrongId_2400 end=======================>"); + console.info("============ANS_Cancel_2400 onConsume cancel==========>"); + console.info("============ANS_Cancel_2400 onConsume end=============>"); + } + function onCancelCancelRightLabelWrongIdPromise(data) { + console.info("============ANS_Cancel_2400 onCancel start:==============>"); + console.info("============ANS_Cancel_2400 onCancel data:===============>" + JSON.stringify(data)); + expect().assertFail(); + console.info("============ANS_Cancel_2400 onCancel end=======================>"); } /* @@ -1841,7 +1814,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelRightLabelWrongIdPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_2400_promise==================>"); + console.info("============ANS_Cancel_2400 subscribe promise========>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1873,35 +1846,34 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2400_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2400_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2400 done==================>"); - }),1000); + console.info("============ANS_Cancel_2400 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2400 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelWrongLabelWrongId(err, data) { - console.info("================onConsume_cancel_wrongLabel_wrongId_2500 start=======================>"); - console.info("================onConsume_2500 data: =======================>" + JSON.stringify(data)); - console.info("================onConsume_2500 label: =======================>" + data.request.label); - console.info("================onConsume_2500 id: =======================>" + data.request.id); + function onConsumeCancelWrongLabelWrongId(data) { + console.info("==========ANS_Cancel_2500 onConsume start=======================>"); + console.info("==========ANS_Cancel_2500 onConsume data:=======================>" + JSON.stringify(data)); + console.info("==========ANS_Cancel_2500 onConsume label:======================>" + data.request.label); + console.info("==========ANS_Cancel_2500 onConsume id==========================>" + data.request.id); notify.cancel(6666, "6666", cancelCallBackCancelWrongLabelWrongId); - console.info("================onConsume__2500 cancel=======================>"); - console.info("================onConsume_cancel_wrongLabel_wrongId_2500 end=======================>"); + console.info("==========ANS_Cancel_2500 onConsume cancel====================>"); + console.info("==========ANS_Cancel_2500 onConsume end=======================>"); } - function onCancelCancelWrongLabelWrongId(err, data) { - console.info("================onCancel_cancel_wrongLabel_wrongId_2500 start=======================>"); - console.info("================onCancel_2500 data : =======================>" + JSON.stringify(data)); - console.info("================onCancel__2500 err : =======================>" + JSON.stringify(err)); + function onCancelCancelWrongLabelWrongId(data) { + console.info("==========ANS_Cancel_2500 onCancel start====================>"); + console.info("==========ANS_Cancel_2500 onCancel data:====================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================onCancel_cancel_wrongLabel_wrongId_2500 end=======================>"); + console.info("==========ANS_Cancel_2500 onCancel end======================>"); } function cancelCallBackCancelWrongLabelWrongId(err){ - console.info("cancelCallBack_cancel_wrongLabel_wrongId_2500 start=======================>"); - console.info("cancelCallBack_cancel_wrongLabel_wrongId_2500 err:================>" + JSON.stringify(err)); - console.info("cancelCallBack_cancel_wrongLabel_wrongId_2500 end=======================>"); + console.info("==========ANS_Cancel_2500 cancelCallBack start=======================>"); + console.info("==========ANS_Cancel_2500 cancelCallBack err:================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("==========ANS_Cancel_2500 cancelCallBack end=======================>"); } /* @@ -1917,7 +1889,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelWrongLabelWrongId, } await notify.subscribe(subscriber); - console.info("==================subscribe_2500_promise==================>"); + console.info("================ANS_Cancel_2500 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1949,30 +1921,28 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2500_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2500 done==================>"); - }),1000); + console.info("==========ANS_Cancel_2500 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2500 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) - function onConsumeCancelWrongLabelWrongIdPromise(err, data) { - console.info("===========onConsume_cancel_wrongLabel_wrongId_2600 start=======================>"); - console.info("onConsume_cancel_2600 data: =======================>" + JSON.stringify(data)); - console.info("onConsume_cancel_2600 label: =======================>" + data.request.label); - console.info("onConsume_cancel_2600 id: =======================>" + data.request.id); + function onConsumeCancelWrongLabelWrongIdPromise(data) { + console.info("========ANS_Cancel_2600 onConsume start:=============>"); + console.info("========ANS_Cancel_2600 onConsume data:==============>" + JSON.stringify(data)); + console.info("========ANS_Cancel_2600 onConsume label:=============>" + data.request.label); + console.info("========ANS_Cancel_2600 onConsume id:================>" + data.request.id); notify.cancel(6666, "6666") - console.info("==========cancel_wrongLabel_wrongId_2600 end==========>"); - console.info("================onConsume_cancel_wrongLabel_wrongId_2600 end=======================>"); + console.info("========ANS_Cancel_2600 onConsume end================>"); + console.info("========ANS_Cancel_2600 onConsume end================>"); } - function onCancelCancelWrongLabelWrongIdPromise(err, data) { - console.info("================onCancel_cancel_wrongLabel_wrongId_2600 start=======================>"); - console.info("onCancel_2600 data : =======================>" + JSON.stringify(data)); - console.info("onCancel_2600 err : =======================>" + JSON.stringify(err)); + function onCancelCancelWrongLabelWrongIdPromise(data) { + console.info("========ANS_Cancel_2600 onCancel start=======================>"); + console.info("========ANS_Cancel_2600 onCancel data:=======================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================onCancel_cancel_wrongLabel_wrongId_2600 end=======================>"); + console.info("========ANS_Cancel_2600 onCancel end=======================>"); } /* @@ -1988,7 +1958,7 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelWrongLabelWrongIdPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_2600_promise==================>"); + console.info("===============ANS_Cancel_2600 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2020,12 +1990,11 @@ describe('ActsAnsNotificationCancel', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2600_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Cancel_2600 done==================>"); - }),1000); + console.info("===============ANS_Cancel_2600 publish promise==================>"); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info("======ANS_Cancel_2600 setTimeout unsubscribe end==================>"); + done(); + }),timeout); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/List.test.js index 84801103beef5e466c93ade8dc4ecc55374e2227..b2e8a4fefdbe7ac89c19db2e229ad44936809e8b 100644 --- a/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansnotificationcancel/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* -* Copyright (c) 2021 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. -*/ -require('./ActsAnsNotificationCancel.test.js') +/* +* Copyright (c) 2021 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. +*/ +require('./ActsAnsNotificationCancel.test.js') diff --git a/notification/ans_standard/actsansnotificationremove/Test.json b/notification/ans_standard/actsansnotificationremove/Test.json index fbe885dbb0665f7e51a2361f80e46db8ab5e305a..78f98aad5c67d2353a5164e9ebd7b26c31aa1354 100644 --- a/notification/ans_standard/actsansnotificationremove/Test.json +++ b/notification/ans_standard/actsansnotificationremove/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansnotificationremove", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsNotificationRemove.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansnotificationremove", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsNotificationRemove.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/actsansnotificationremove/entry/src/main/config.json b/notification/ans_standard/actsansnotificationremove/entry/src/main/config.json index 28c7d14415f94a748f833e5ffae90005f001f388..29cde28e99512ce9ec5715d1642f126064f79319 100644 --- a/notification/ans_standard/actsansnotificationremove/entry/src/main/config.json +++ b/notification/ans_standard/actsansnotificationremove/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansnotificationremove", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansnotificationremove", - "name": ".actsansnotificationremove", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansnotificationremove.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansnotificationremove", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansnotificationremove", + "name": ".actsansnotificationremove", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansnotificationremove.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/default/app.js b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/default/app.js index 48aa9fe912943aac43b1aafc75e48aca62bd2a3c..4f1747a95c4acbb66db5351e826c31584356e11c 100644 --- a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* -* Copyright (c) 2021 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. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* +* Copyright (c) 2021 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. +*/ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/resources/base/element/string.json index 2f9470d82c49675a64972657d8d367cd95e51c63..d405647b90183b99fb4e15025a9fe12c85c495d4 100644 --- a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/ActsAnsNotificationRemove.test.js b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/ActsAnsNotificationRemove.test.js index a9a87c0e7ca3bc2c85f2fc74b3322b77289fa23e..abe9d2196842f1e07901c833156461526859f900 100644 --- a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/ActsAnsNotificationRemove.test.js +++ b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/ActsAnsNotificationRemove.test.js @@ -15,60 +15,41 @@ import notify from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - - +var timeout = 500; describe('ActsAnsNotificationRemove', function () { console.info("===========ActsAnsNotificationRemove start====================>"); var subscriber; - function updateCallback(err, data) { - console.info("================updateCallback======================>"); - } - function subscribeCallback(err) { - console.info("==================subscribeCallback=======================>"); - } - function onUnsubscribeCallback(err) { - console.info("================onUnsubscribeCallback=======================>"); - } - function unSubscribeCallback(err) { - console.info("==========================unSubscribeCallback=======================>"); - } function publishCallback(err) { console.info("==========================publishCallback=======================>"); } var hashCode; - function onConsumeRemove(err, data) { - console.info("=============OnConsume_remove_0100=======================>"); - console.info("=============OnConsume_remove_0100 data:==================>" + JSON.stringify(data)); - console.info("=============OnConsume_remove_0100 hascode:===============>" + data.request.hashCode); + function onConsumeRemove(data) { + console.info("=============ANS_Remove_0100 onConsume start=======================>"); + console.info("=============ANS_Remove_0100 onConsume data:==================>" + JSON.stringify(data)); + console.info("=============ANS_Remove_0100 onConsume hascode:===============>" + data.request.hashCode); hashCode = data.request.hashCode notify.remove(hashCode,removeCallBack); - console.info("================OnConsume_remove_0100 remove=======================>"); - console.info("================OnConsume_remove_0100 end=======================>"); + console.info("=============ANS_Remove_0100 onConsume remove=======================>"); + console.info("=============ANS_Remove_0100 onConsume end=======================>"); } - function onCancelRemove(err, data) { - console.info("==========================OnCancel_remove_0100=======================>"); - console.info("================OnCancel_remove_0100 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancel_remove_0100 err : =======================>" + JSON.stringify(err)); - console.info("================OnCancel_remove_0100 hashCode=======================>" + hashCode); - console.info("================OnCancel_0100 data.request.hashCode==========>" + data.request.hashCode); - expect(hashCode).assertequal(data.request.hashCode); - console.info("================OnCancel_remove_0100 end=======================>"); + function onCancelRemove(data) { + console.info("==========ANS_Remove_0100 onCancel start==================>"); + console.info("==========ANS_Remove_0100 onCancel data : ================>" + JSON.stringify(data)); + console.info("==========ANS_Remove_0100 onCancel hashCode===============>" + hashCode); + console.info("==========ANS_Remove_0100 onCancel data.request.hashCode==>" + data.request.hashCode); + expect(hashCode).assertEqual(data.request.hashCode); + console.info("==========ANS_Remove_0100 onCancel end=======================>"); } function removeCallBack(err, data) { - console.info("================removeCallBack_0100 err : =======================>" + JSON.stringify(err)); - console.info("================removeCallBack_0100 data : =======================>" + JSON.stringify(data)); + console.info("==========ANS_Remove_0100 removeCallBack err=========>" + JSON.stringify(err)); + console.info("==========ANS_Remove_0100 removeCallBack data : =======================>" + JSON.stringify(data)); } - function subscriberCallBack(err, data) { console.info("================subscriberCallBack err : =======================>" + JSON.stringify(err)); console.info("================subscriberCallBack data : =======================>" + JSON.stringify(data)); } - function unsubscribeCallBack(err, data) { - console.info("================unsubscribeCallBack err : =======================>" + JSON.stringify(err)); - console.info("================unsubscribeCallBack data : =======================>" + JSON.stringify(data)); - } function publishCallback(err, data) { console.info("================publishCallback err : =======================>" + JSON.stringify(err)); console.info("================publishCallback data : =======================>" + JSON.stringify(data)); @@ -88,7 +69,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemove, } await notify.subscribe(subscriber); - console.info("==================subscribe_0100_promise==================>"); + console.info("==================ANS_Remove_0100 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -120,34 +101,34 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0100_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0100 done==================>"); - }),1000); + console.info("=============ANS_Remove_0100 publish promise===========>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0100 setTimeout==================>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0100 setTimeout unsubscribe==================>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemovePromise(err, data) { - console.info("================OnConsume_remove_promise_0200=======================>"); - console.info("================OnConsume_remove_promise_0200 data:================>" + JSON.stringify(data)); - console.info("================OnConsume_remove_promise_0200 hascode:=============>" + data.request.hashCode); + function onConsumeRemovePromise(data) { + console.info("================ANS_Remove_0200 onConsume start===============>"); + console.info("================ANS_Remove_0200 onConsume data================>" + JSON.stringify(data)); hashCode = data.request.hashCode + console.info("================ANS_Remove_0200 onConsume hascode:========>" + data.request.hashCode); notify.remove(hashCode); - console.info("================OnConsume_remove_promise_0200 remove=======================>"); - console.info("================OnConsume_remove_promise_0200 end=======================>"); + console.info("================ANS_Remove_0200 onConsume remove============>"); + console.info("================ANS_Remove_0200 onConsume end===============>"); } - function onCancelRemovePromise(err, data) { - console.info("==========================OnCancel_remove_0200=======================>"); - console.info("================OnCancel_remove_0200 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancel_remove_0200 err : =======================>" + JSON.stringify(err)); - console.info("================OnCancel_remove_0200 hashCode=======================>" + hashCode); - console.info("================OnCancel_remove_0200 data.request.hashCode==========>" + data.request.hashCode); - expect(hashCode).assertequal(data.request.hashCode); - console.info("================OnCancel_remove_0200 end=======================>"); + function onCancelRemovePromise(data) { + console.info("===========ANS_Remove_0200 onCancel start================>"); + console.info("===========ANS_Remove_0200 onCancel data:=================>" + JSON.stringify(data)); + console.info("===========ANS_Remove_0200 onCancel hashCode====================>" + hashCode); + console.info("===========ANS_Remove_0200 onCancel data.request.hashCode=======>" + data.request.hashCode); + expect(hashCode).assertEqual(data.request.hashCode); + console.info("===========ANS_Remove_0200 onCancel end===================>"); } /* @@ -164,7 +145,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemovePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0200_promise==================>"); + console.info("===============ANS_Remove_0200 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -196,33 +177,34 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0200 done==================>"); - }),1000); + console.info("======ANS_Remove_0200 publish==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0200 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0200 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveErrHashCode(err, data) { - console.info("================OnConsume_removeErrHashCode_0300 start=======================>"); - console.info("================OnConsume_removeErrHashCode_0300 data:=============>" + JSON.stringify(data)); + + function onConsumeRemoveErrHashCode(data) { + console.info("================ANS_Remove_0300 onConsume start=======================>"); + console.info("================ANS_Remove_0300 onConsume data:=============>" + JSON.stringify(data)); notify.remove("errorHashCode",removeErrHashCodeCallBack); - console.info("================OnConsume_removeErrHashCode_0300 end=======================>"); + console.info("================ANS_Remove_0300 onConsume remove=======================>"); + console.info("================ANS_Remove_0300 onConsume end=======================>"); } - function onCancelRemoveErrHashCode() { - console.info("================OnCancel_removeErrHashCode_0300 start=======================>"); - console.info("==========================OnCancel_removeErrHashCode_0300=======================>"); + console.info("================ANS_Remove_0300 onCancel start=======================>"); expect().assertFail(); - console.info("================OnCancel_removeErrHashCode_0300 end=======================>"); + console.info("================ANS_Remove_0300 onCancel end=======================>"); } - function removeErrHashCodeCallBack(err,data) { - console.info("================removeErrHashCodeCallBack_0300 start=======================>"); - console.info("================removeErrHashCodeCallBack_0300=======================>" + JSON.stringify(err)); - console.info("================removeErrHashCodeCallBack_0300=======================>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeErrHashCodeCallBack_0300 end=======================>"); + console.info("==========ANS_Remove_0300 removeCallBack start==============>"); + console.info("==========ANS_Remove_0300 removeCallBack err====================>" + JSON.stringify(err)); + console.info("==========ANS_Remove_0300 removeCallBack data===============>" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + console.info("==========ANS_Remove_0300 removeCallBack end=======================>"); } /* @@ -238,7 +220,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveErrHashCode, } await notify.subscribe(subscriber); - console.info("==================subscribe_0300_promise==================>"); + console.info("==================ANS_Remove_0300 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -270,23 +252,28 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0300_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0300_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0300 done==================>"); - }),1000); + console.info("==================ANS_Remove_0300 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0300 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0300 setTimeout unsubscribe============>"); + await notify.cancelAll() + done(); + }),timeout); }) - function onConsumeRemoveErrHashCodePromise(err, data) { - console.info("===========OnConsume_removeErrHashCode_promise_0400 data:===========>" + JSON.stringify(data)); + + function onConsumeRemoveErrHashCodePromise(data) { + console.info("===========ANS_Remove_0400 onConsume start:===========>"); + console.info("===========ANS_Remove_0400 onConsume data:===========>" + JSON.stringify(data)); notify.remove("errorHashCode"); - console.info("================OnConsume_removeErrHashCode_promise_0400 end=======================>"); + console.info("===========ANS_Remove_0400 onConsume remove:===========>"); + console.info("===========ANS_Remove_0400 onConsume end:===========>"); } function onCancelRemoveErrHashCodePromise() { - console.info("==========================OnCancel_RemoveErrHashCode_Promise_0400=======================>"); + console.info("===========ANS_Remove_0400 onCancel start:===========>"); expect().assertFail(); + console.info("===========ANS_Remove_0400 onCancel end:===========>"); } /* @@ -302,7 +289,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveErrHashCodePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0400_promise==================>"); + console.info("===============ANS_Remove_0400 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -334,33 +321,36 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0400_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0400_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0400 done==================>"); - }),1000); + console.info("==================ANS_Remove_0400 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0400 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0400 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveUseEmptyCharacter(err, data) { - console.info("================OnConsume_removeUseEmptyCharacter_0500 start=======================>"); - console.info("OnConsume_removeUseEmptyCharacter_0500 data:===================>" + JSON.stringify(data)); + + function onConsumeRemoveUseEmptyCharacter(data) { + console.info("================ANS_Remove_0500 onConsume start==============>"); + console.info("================ANS_Remove_0500 onConsume data:==============>" + JSON.stringify(data)); notify.remove('',removeCallBackUseEmptyCharacter); - console.info("================OnConsume_removeUseEmptyCharacter_0500 end=======================>"); + console.info("================ANS_Remove_0500 onConsume remove=============>"); + console.info("================ANS_Remove_0500 onConsume end================>"); } - function onCancelRemoveUseEmptyCharacter(err, data) { - console.info("OnCancel_removeUseEmptyCharacter_0500 start=======================>"); - console.info("================OnCancel_0500 data : =======================>" + JSON.stringify(data)); + function onCancelRemoveUseEmptyCharacter(data) { + console.info("=============ANS_Remove_0500 onCancel start===============>"); + console.info("=============ANS_Remove_0500 onCancel data:===============>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeUseEmptyCharacter_0500 end=======================>"); + console.info("=============ANS_Remove_0500 onCancel end=================>"); } function removeCallBackUseEmptyCharacter(err) { - console.info("================removeCallBack_UseEmptyCharacter_0500 start=======================>"); - console.info("removeCallBack_UseEmptyCharacter_0500 err=======================>" + JSON.stringify(err)); - expect(err.code).assertNotEqual(0); - console.info("================removeCallBack_UseEmptyCharacter_0500 end=======================>"); + console.info("=============ANS_Remove_0500 removeCallBack start===============>"); + console.info("=============ANS_Remove_0500 removeCallBack err=================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("=============ANS_Remove_0500 removeCallBack end=================>"); } /* @@ -377,7 +367,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveUseEmptyCharacter, } await notify.subscribe(subscriber); - console.info("==================subscribe_0500_promise==================>"); + console.info("==================ANS_Remove_0500 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -409,28 +399,29 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0500_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0500 done==================>"); - }),1000); + console.info("==================ANS_Remove_0500 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0500 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0500 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function OnConsumeRemoveUseEmptyCharacterPromise(err, data) { - console.info("================OnConsume_removeUseEmptyCharacter_promise_0600 start=======================>"); - console.info("OnConsume_removeUseEmptyCharacter_promise_0600 data:==================>" + JSON.stringify(data)); + function OnConsumeRemoveUseEmptyCharacterPromise(data) { + console.info("================ANS_Remove_0600 onConsume start=======================>"); + console.info("================ANS_Remove_0600 onConsume data:==================>" + JSON.stringify(data)); notify.remove('',removeCallBackUseEmptyCharacter); - console.info("================OnConsume_removeUseEmptyCharacter_promise_0600 remove=======================>"); - console.info("================OnConsume_removeUseEmptyCharacter_promise_0600 end=======================>"); + console.info("================ANS_Remove_0600 onConsume remove=======================>"); + console.info("================ANS_Remove_0600 onConsume end=======================>"); } - function OnCancelRemoveUseEmptyCharacterPromise(err, data) { - console.info("==============OnCancel_removeUseEmptyCharacter_0600 start================>"); - console.info("OnCancel_removeUseEmptyCharacter_0600 data:=============>" + JSON.stringify(data)); + function OnCancelRemoveUseEmptyCharacterPromise(data) { + console.info("==============ANS_Remove_0600 onCancel start=============>"); + console.info("==============ANS_Remove_0600 onCancel data:=============>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeUseEmptyCharacter_0600 end=======================>"); + console.info("==============ANS_Remove_0600 onCancel end===============>"); } /* @@ -440,13 +431,13 @@ describe('ActsAnsNotificationRemove', function () { remove(hashCode: string): Promise to delete the notification information */ it('ANS_Remove_0600', 0, async function (done) { - console.info("===============ANS_Remove_0600==========================>"); + console.info("===============ANS_Remove_0600 start==========================>"); var subscriber ={ onConsume:OnConsumeRemoveUseEmptyCharacterPromise, onCancel:OnCancelRemoveUseEmptyCharacterPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0600_promise==================>"); + console.info("==================ANS_Remove_0600 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -478,35 +469,36 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0600_promise==================>"); - setTimeout((function(){ - console.info("==================ANS_Remove_0600 done==================>"); - }),1000); - done(); + console.info("==================ANS_Remove_0600 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0600 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0600 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveNotExistHashCode(err, data) { - console.info("================OnConsume_removeNotExistHashCode_0700=======================>"); - console.info("OnConsume_removeNotExistHashCode_0700 data: =======================>" + JSON.stringify(data)); + function onConsumeRemoveNotExistHashCode(data) { + console.info("==============ANS_Remove_0700 onConsume start===================>"); + console.info("==============ANS_Remove_0700 onConsume data:===================>" + JSON.stringify(data)); notify.remove("9999_9999_9",removeNotExistHashCodeCallBack); - console.info("================OnConsume_removeNotExistHashCode_0700 remove=======================>"); - console.info("================OnConsume_removeNotExistHashCode_0700 end=======================>"); + console.info("==============ANS_Remove_0700 onConsume remove===================>"); + console.info("==============ANS_Remove_0700 onConsume end===================>"); } - function onCancelRemoveNotExistHashCode(err, data) { - console.info("===========OnCancel_removeNotExistHashCode_0700 start=======================>"); - console.info("OnCancel_removeNotExistHashCode_0700 data:============>" + JSON.stringify(data)); + function onCancelRemoveNotExistHashCode(data) { + console.info("==============ANS_Remove_0700 onCancel start=======================>"); + console.info("==============ANS_Remove_0700 onCancel data:============>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeNotExistHashCode_0700 end=======================>"); + console.info("==============ANS_Remove_0700 onCancel end=======================>"); } function removeNotExistHashCodeCallBack(err) { - console.info("================removeNotExistHashCodeCallBack_0700 start=======================>"); - console.info("=============removeNotExistHashCodeCallBack_0700=================>" + JSON.stringify(err)); - expect(err.code).assertNotEqual(0); - console.info("================removeNotExistHashCodeCallBack_0700 end=======================>"); + console.info("==========ANS_Remove_0700 removeCallBack start==========>"); + console.info("==========ANS_Remove_0700 removeCallBack err=================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("==========ANS_Remove_0700 removeCallBack end=======================>"); } /* @@ -523,7 +515,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveNotExistHashCode, } await notify.subscribe(subscriber); - console.info("==================subscribe_0700_promise==================>"); + console.info("================ANS_Remove_0700 subscribe promise=======>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -555,29 +547,29 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0700_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0700_promise==================>"); - setTimeout((function(){ - console.info("==================ANS_Remove_0700 done==================>"); - }),1000); - done(); + console.info("============ANS_Remove_0700 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0700 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0700 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveNotExistHashCodePromise(err, data) { - console.info("================OnConsume_removeNotExistHashCode_promise_0800=======================>"); - console.info("OnConsume_removeNotExistHashCode_promise_0800 data:===============>" + JSON.stringify(data)); - console.info("OnConsume_removeNotExistHashCode_promise_0800 err:===========>" + JSON.stringify(err)); + function onConsumeRemoveNotExistHashCodePromise(data) { + console.info("================ANS_Remove_0800 onConsume start=======================>"); + console.info("================ANS_Remove_0800 onConsume data:===============>" + JSON.stringify(data)); notify.remove("9999_9999_9"); - console.info("================OnConsume_removeNotExistHashCode_promise_0800 end=======================>"); + console.info("================ANS_Remove_0800 onConsume remove====================>"); + console.info("================ANS_Remove_0800 onConsume end=======================>"); } - function onCancelRemoveNotExistHashCodePromise(err, data) { - console.info("================OnCancelCallback_removeNotExistHashCode_promise_0800=======================>"); - console.info("================OnCancelCallback_0800 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_0800 err : =======================>" + JSON.stringify(err)); + function onCancelRemoveNotExistHashCodePromise(data) { + console.info("============ANS_Remove_0800 onCancel start===============>"); + console.info("============ANS_Remove_0800 onCancel data:===============>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancelCallback_removeNotExistHashCode_promise_0800 end===========>"); + console.info("============ANS_Remove_0800 onCancel end=================>"); } /* @@ -593,7 +585,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveNotExistHashCodePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_0800_promise==================>"); + console.info("================ANS_Remove_0800 subscribe promise=======>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -625,36 +617,37 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0800_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0800_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0800 done==================>"); - }),1000); + console.info("==========ANS_Remove_0800 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0800 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0800 setTimeout unsubscribe============>"); + await notify.cancelAll() + done(); + }),timeout); }) - function onConsumeRemoveNonComplianceHashCode(err, data) { - console.info("================OnConsumeCallback_removeNonComplianceHashCode_0900 start===================>"); - console.info("================OnConsumeCallback_0900 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsumeCallback_0900 err: =======================>" + JSON.stringify(err)); + + function onConsumeRemoveNonComplianceHashCode(data) { + console.info("================ANS_Remove_0900 onConsume start===================>"); + console.info("================ANS_Remove_0900 onConsume data: ==================>" + JSON.stringify(data)); notify.remove("哈希码",removeNonComplianceHashCallBack); - console.info("================OnConsumeCallback_removeNonComplianceHashCode_0900 remove===================>"); - console.info("================OnConsumeCallback_removeNonComplianceHashCode_0900 end======================>"); + console.info("================ANS_Remove_0900 onConsume remove==================>"); + console.info("================ANS_Remove_0900 onConsume end=====================>"); } - function onCancelRemoveNonComplianceHashCode(err, data) { - console.info("================OnCancelCallback_removeNonComplianceHashCode_0900 start====================>"); - console.info("================OnCancelCallback_0900 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancelCallback_0900 data: =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_removeNonComplianceHashCode_0900 end=======================>"); + function onCancelRemoveNonComplianceHashCode(data) { + console.info("================ANS_Remove_0900 onCancel start====================>"); + console.info("================ANS_Remove_0900 onCancel data:====================>" + JSON.stringify(data)); + expect().assertFail(); + console.info("================ANS_Remove_0900 onCancel end======================>"); } function removeNonComplianceHashCallBack(err, data) { - console.info("================removeNonComplianceHashCallBack_0900 start=======================>"); - console.info("================removeNonComplianceHashCallBack_0900=================>" + JSON.stringify(err)); - console.info("================removeNonComplianceHashCallBack_0900=================>" + JSON.stringify(data)); - console.info("================removeNonComplianceHashCallBack_0900 end=======================>"); - expect(err.code).assertNotEqual(0); + console.info("================ANS_Remove_0900 removeCallBack start=======================>"); + console.info("================ANS_Remove_0900 removeCallBack err=================>" + JSON.stringify(err)); + console.info("================ANS_Remove_0900 removeCallBack data=================>" + JSON.stringify(data)); + console.info("================ANS_Remove_0900 removeCallBack end=======================>"); + expect(err.code != 0).assertEqual(true); } /* @@ -670,7 +663,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveNonComplianceHashCode, } await notify.subscribe(subscriber); - console.info("==================subscribe_0900_promise==================>"); + console.info("============ANS_Remove_0900 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -702,28 +695,29 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_0900_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_0900_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_0900 done==================>"); - }),1000); + console.info("==================ANS_Remove_0900 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_0900 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_0900 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveNonComplianceHashCodePromise(err, data) { - console.info("================OnConsumeCallback_removeNonComplianceHashCode_1000 start================>"); - console.info("================OnConsumeCallback_1000 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsumeCallback_1000 err: =======================>" + JSON.stringify(err)); + + function onConsumeRemoveNonComplianceHashCodePromise(data) { + console.info("================ANS_Remove_1000 onConsume start===========>"); + console.info("================ANS_Remove_1000 onConsume data:===========>" + JSON.stringify(data)); notify.remove("哈希码"); - console.info("================OnConsumeCallback_removeNonComplianceHashCode_1000 end=======================>"); + console.info("================ANS_Remove_1000 onConsume remove==========>"); + console.info("================ANS_Remove_1000 onConsume end=============>"); } - function onCancelRemoveNonComplianceHashCodePromise(err, data) { - console.info("OnCancel_removeNonComplianceHashCode_1000 start=======================>"); - console.info("================OnCancel_1000 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_1000 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveNonComplianceHashCodePromise(data) { + console.info("================ANS_Remove_1000 onCancel start==================>"); + console.info("================ANS_Remove_1000 onCancel data:==================>" + JSON.stringify(data)); expect().assertFail(); - console.info("OnCancelCallback_removeNonComplianceHashCode_1000 end=======================>"); + console.info("================ANS_Remove_1000 onCancel end====================>"); } /* @@ -739,7 +733,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveNonComplianceHashCodePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_1000_promise==================>"); + console.info("================ANS_Remove_1000 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -771,45 +765,49 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1000_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1000_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1000 done==================>"); - }),1000); + console.info("================ANS_Remove_1000 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1000 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1000 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) + function removeCallBack2TimesOf2(err) { - console.info("================removeCallBack2TimesOf2_1100 start=======================>"); - console.info("================removeCallBack2TimesOf2_1100=======================>" + JSON.stringify(err)); - expect(err.code).assertNotEqual(0); - console.info("================removeCallBack2TimesOf2_1100 end=======================>"); + console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 start==========>"); + console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 err============>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 end==========>"); } function removeCallBack2TimesOf1(err) { - console.info("================removeCallBack2TimesOf1_1100=======================>"); - console.info("================removeCallBack2TimesOf1_1100=======================>" + JSON.stringify(err)); - expect(err.code).assertequal(0); - notify.remove(hashCode,removeCallBack2TimesOf2); - } - function onConsumeCallbackRemove2Times(err, data) { - console.info("================OnConsumeCallback_remove2Times_1100 start=======================>"); - console.info("================OnConsumeCallback_1100 data: =======================>" + JSON.stringify(data)); - notify.remove(hashCode,removeCallBack2TimesOf1); - console.info("================OnConsumeCallback_remove2Times_1100 remove=======================>"); - console.info("================OnConsumeCallback_remove2Times_1100 end=======================>"); + console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 start============>"); + console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 err========>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + notify.remove(hashCode1100,removeCallBack2TimesOf2); + console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 end============>"); + } + var hashCode1100; + function onConsumeCallbackRemove2Times(data) { + console.info("=====ANS_Remove_1100 onConsume start=================>"); + console.info("=====ANS_Remove_1100 onConsume data: ================>" + JSON.stringify(data)); + hashCode1100 = data.request.hashCode; + notify.remove(data.request.hashCode,removeCallBack2TimesOf1); + console.info("=====ANS_Remove_1100 onConsume remove================>"); + console.info("=====ANS_Remove_1100 onConsume end===================>"); } var timesOfOnCancelCallbackRemove2Times - function onCancelCallbackRemove2Times(err, data) { + function onCancelCallbackRemove2Times(data) { timesOfOnCancelCallbackRemove2Times = timesOfOnCancelCallbackRemove2Times + 1 - console.info("==========================OnCancelCallback_remove2Times_1100=======================>"); - console.info("================OnCancelCallback_1100 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_1100 err : =======================>" + JSON.stringify(err)); + console.info("=====ANS_Remove_1100 onCancel start=======================>"); + console.info("=====ANS_Remove_1100 onCancel data:=======================>" + JSON.stringify(data)); if (timesOfOnCancelCallbackRemove2Times == 1){ - expect(data.request.id).assertequal(1); + expect(data.request.id).assertEqual(11); } else if (timesOfOnCancelCallbackRemove2Times == 2){ expect().assertFail(); } - console.info("================OnCancelCallback_remove2Times_1100 end=======================>"); + console.info("=====ANS_Remove_1100 onCancel end=======================>"); } /* @@ -820,13 +818,14 @@ describe('ActsAnsNotificationRemove', function () { */ it('ANS_Remove_1100', 0, async function (done) { console.info("===============ANS_Remove_1100==========================>"); + hashCode1100 = 0; timesOfOnCancelCallbackRemove2Times = 0 var subscriber ={ onConsume:onConsumeCallbackRemove2Times, onCancel:onCancelCallbackRemove2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_1100_promise==================>"); + console.info("===============ANS_Remove_1100 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -858,37 +857,36 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1100_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1100 done==================>"); - }),1000); + console.info("==========ANS_Remove_1100 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1100 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1100 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeCallbackRemove2TimesPromise(err, data) { - console.info("================OnConsumeCallback_remove2Times_promise_1200 start=======================>"); - console.info("================OnConsumeCallback_1200 data: =======================>" + JSON.stringify(data)); - notify.remove(hashCode); - console.info("================remove_2times1_1200=======================>"); - notify.remove(hashCode); - console.info("================remove_2times2_1200=======================>"); - console.info("================OnConsumeCallback_remove2Times_promise_1200 remove=======================>"); - console.info("================OnConsumeCallback_remove2Times_promise_1200 end=======================>"); + + function onConsumeCallbackRemove2TimesPromise(data) { + console.info("================ANS_Remove_1200 onConsume start=================>"); + console.info("================ANS_Remove_1200 onConsume data:==========>" + JSON.stringify(data)); + notify.remove(data.request.hashCode); + console.info("================ANS_Remove_1200 onConsume remove_2times1===========>"); + notify.remove(data.request.hashCode); + console.info("================ANS_Remove_1200 onConsume remove_2times2===========>"); + console.info("================ANS_Remove_1200 onConsume end=================>"); } var timesOfOnCancelCallbackRemove2TimesPromise - function onCancelCallbackRemove2TimesPromise(err, data) { + function onCancelCallbackRemove2TimesPromise(data) { timesOfOnCancelCallbackRemove2TimesPromise = timesOfOnCancelCallbackRemove2TimesPromise + 1 - console.info("==========================OnCancelCallback_remove2Times_1200=======================>"); - console.info("================OnCancelCallback_1200 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_1200 err : =======================>" + JSON.stringify(err)); + console.info("================ANS_Remove_1200 onCancel start==========>"); + console.info("================ANS_Remove_1200 onCancel data:=========>" + JSON.stringify(data)); if (timesOfOnCancelCallbackRemove2TimesPromise == 1){ - expect(data.request.id).assertequal(1); + expect(data.request.id).assertEqual(12); } else if (timesOfOnCancelCallbackRemove2TimesPromise == 2){ expect().assertFail(); } - console.info("================OnCancelCallback_remove2Times_1200 end=======================>"); + console.info("================ANS_Remove_1200 onCancel end==============>"); } /* @@ -898,14 +896,14 @@ describe('ActsAnsNotificationRemove', function () { * delete the notification information */ it('ANS_Remove_1200', 0, async function (done) { - console.info("===============ANS_Remove_1200==========================>"); + console.info("===============ANS_Remove_1200 start========================>"); timesOfOnCancelCallbackRemove2TimesPromise = 0 var subscriber ={ onConsume:onConsumeCallbackRemove2TimesPromise, onCancel:onCancelCallbackRemove2TimesPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_1200_promise==================>"); + console.info("===============ANS_Remove_1200 subscribe promise=============>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -937,38 +935,37 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1200_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1200 done==================>"); - }),1000); + console.info("============ANS_Remove_1200 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1200 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1200 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveIsUnremovable(err, data) { - console.info("OnConsume_removeIsUnremovable_1300 start=================>"); - console.info("OnConsume_removeIsUnremovable_1300 data:===================>" + JSON.stringify(data)); - console.info("OnConsume_removeIsUnremovable_1300 err:=================>" + JSON.stringify(err)); + function onConsumeRemoveIsUnremovable(data) { + console.info("==========ANS_Remove_1300 onConsume start=================>"); + console.info("==========ANS_Remove_1300 onConsume data:=================>" + JSON.stringify(data)); notify.remove(data.request.hashCode,removeIsUnremovableCallBack); - console.info("OnConsume_removeIsUnremovable_1300 remove=============>"); - console.info("OnConsume_removeIsUnremovable_1300 end=============>"); + console.info("==========ANS_Remove_1300 onConsume remove=============>"); + console.info("==========ANS_Remove_1300 onConsume end=================>"); } - function onCancelRemoveIsUnremovable(err, data) { - console.info("==========================OnCancel_removeIsUnremovable_1300 start=======================>"); - console.info("================OnCancel_removeIsUnremovable_1300 err: ===============>" + JSON.stringify(err)); - console.info("================OnCancel_removeIsUnremovable_1300 data: ==============>" + JSON.stringify(data)); + function onCancelRemoveIsUnremovable(data) { + console.info("==========ANS_Remove_1300 onCancel start================>"); + console.info("==========ANS_Remove_1300 onCancel data:===========>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeIsUnremovable_1300 end=======================>"); + console.info("==========ANS_Remove_1300 onCancel end================>"); } function removeIsUnremovableCallBack(err, data) { - console.info("================removeIsUnremovableCallBack_1300 start=======================>"); - console.info("================removeIsUnremovableCallBack_1300=====================>" + JSON.stringify(err)); - expect(err.code).assertNotEqual(0); - console.info("================removeIsUnremovableCallBack_1300=====================>" + JSON.stringify(data)); - console.info("================removeIsUnremovableCallBack_1300 end=======================>"); + console.info("==========ANS_Remove_1300 removeCallBack start=======================>"); + console.info("==========ANS_Remove_1300 removeCallBack err=====================>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("==========ANS_Remove_1300 removeCallBack data=====================>" + JSON.stringify(data)); + console.info("==========ANS_Remove_1300 removeCallBack end=======================>"); } /* @@ -984,7 +981,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveIsUnremovable, } await notify.subscribe(subscriber); - console.info("==================subscribe_1300_promise==================>"); + console.info("================ANS_Remove_1300 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1016,31 +1013,29 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1300_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1300_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1300 done==================>"); - }),1000); + console.info("================ANS_Remove_1300 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1300 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1300 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function OnConsumeRemoveIsUnremovablePromise(err, data) { - console.info("================OnConsume_removeIsUnremovable_promise_1400 start=======================>"); - console.info("================OnConsume_1400 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_1400 err: =======================>" + JSON.stringify(err)); + function OnConsumeRemoveIsUnremovablePromise(data) { + console.info("==============ANS_Remove_1400 onConsume start==============>"); + console.info("==============ANS_Remove_1400 onConsume data:==============>" + JSON.stringify(data)); notify.remove(data.request.hashCode); - console.info("================removeIsUnremovable_promise_1400=======================>"); - console.info("================OnConsume_removeIsUnremovable_promise_1400 end=======================>"); + console.info("==============ANS_Remove_1400 onConsume remove=============>"); + console.info("==============ANS_Remove_1400 onConsume end================>"); } - function OnCancelRemoveIsUnremovablePromise(err, data) { - console.info("=====OnCancel_removeIsUnremovable_promise_1400 start=======================>"); - console.info("================OnCancel_1400 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_1400 data: =======================>" + JSON.stringify(data)); + function OnCancelRemoveIsUnremovablePromise(data) { + console.info("==============ANS_Remove_1400 onCancel start==============>"); + console.info("==============ANS_Remove_1400 onCancel data:==============>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeIsUnremovable_promise_1400 end=======================>"); + console.info("==============ANS_Remove_1400 onCancel end================>"); } /* @@ -1050,13 +1045,13 @@ describe('ActsAnsNotificationRemove', function () { deletes the notification information that the property isunremovable is true */ it('ANS_Remove_1400', 0, async function (done) { - console.info("===============ANS_Remove_1400==========================>"); + console.info("===============ANS_Remove_1400 start==========================>"); var subscriber ={ onConsume:OnConsumeRemoveIsUnremovablePromise, onCancel:OnCancelRemoveIsUnremovablePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_1400_promise==================>"); + console.info("===============ANS_Remove_1400 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1088,50 +1083,47 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1400_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1400_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1400 done==================>"); - }),1000); + console.info("==============ANS_Remove_1400 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1400 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1400 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) var timesOfOnConsumeRemoveAllByBundleOption - function onConsumeRemoveAllByBundleOption(err, data) { + function onConsumeRemoveAllByBundleOption(data) { timesOfOnConsumeRemoveAllByBundleOption = timesOfOnConsumeRemoveAllByBundleOption + 1 - console.info("================OnConsume_removeAllByBundleOption_1500 start=======================>"); - console.info("================OnConsume_1500 data: ====================>" + JSON.stringify(data)); - console.info("================OnConsume_1500 err: =====================>" + JSON.stringify(err)); + console.info("==========ANS_Remove_1500 onConsume start=======>"); + console.info("==========ANS_Remove_1500 onConsume data:=======>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, } if (timesOfOnConsumeRemoveAllByBundleOption == 2){ notify.removeAll(bundleOption,removeAllByBundleOptionCallBack); - console.info("================OnConsume_removeAllByBundleOption_1500 remove=======================>"); + console.info("=======ANS_Remove_1500 onConsume remove=============>"); } - console.info("================OnConsume_removeAllByBundleOption_1500 end=======================>"); + console.info("===========ANS_Remove_1500 onConsume end===========>"); } var timesOfOnCancelRemoveAllByBundleOption - function onCancelRemoveAllByBundleOption(err, data) { + function onCancelRemoveAllByBundleOption(data) { timesOfOnCancelRemoveAllByBundleOption = timesOfOnCancelRemoveAllByBundleOption + 1 - console.info("==========================OnCancel_removeAllByBundleOption_1500 start=======================>"); - console.info("================OnCancel_1500 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_1500 data: =======================>" + JSON.stringify(data)); + console.info("===========ANS_Remove_1500 onCancel start====================>"); + console.info("===========ANS_Remove_1500 onCancel data:====================>" + JSON.stringify(data)); if (timesOfOnCancelRemoveAllByBundleOption == 1){ - expect(data.request.label).assertequal("1500_1"); + expect(data.request.label).assertEqual("1500_1"); }else if (timesOfOnCancelRemoveAllByBundleOption == 2){ - expect(data.request.label).assertequal("1500_2"); + expect(data.request.label).assertEqual("1500_2"); } - console.info("================OnCancel_removeIsUnremovable_1500 end=======================>"); + console.info("===========ANS_Remove_1500 onCancel end=======================>"); } - function removeAllByBundleOptionCallBack(err, data) { - console.info("================removeAllByBundleOptionCallBack_1500 start=======================>"); - console.info("================removeAllByBundleOptionCallBack_1500==================>" + JSON.stringify(err)); - console.info("================removeAllByBundleOptionCallBack_1500==================>" + JSON.stringify(data)); - console.info("================removeAllByBundleOptionCallBack_1500 end=======================>"); + function removeAllByBundleOptionCallBack(data) { + console.info("===========ANS_Remove_1500 removeAllCallBack start=================>"); + console.info("===========ANS_Remove_1500 removeAllCallBack data==================>" + JSON.stringify(data)); + console.info("===========ANS_Remove_1500 removeAllCallBack end===================>"); } /* @@ -1141,7 +1133,7 @@ describe('ActsAnsNotificationRemove', function () { * deletes all notification information through BundleOption */ it('ANS_Remove_1500', 0, async function (done) { - console.info("===============ANS_Remove_1500==========================>"); + console.info("===============ANS_Remove_1500 start==========================>"); timesOfOnCancelRemoveAllByBundleOption = 0 timesOfOnConsumeRemoveAllByBundleOption = 0 var subscriber ={ @@ -1149,7 +1141,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveAllByBundleOption, } await notify.subscribe(subscriber); - console.info("==================subscribe_1500_promise==================>"); + console.info("===============ANS_Remove_1500 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1211,23 +1203,22 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish1_1500_promise==================>"); + console.info("=============ANS_Remove_1500 publish1 promise==================>"); await notify.publish(notificationRequest1); - console.info("==================publish2_1500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1500_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1500 done==================>"); - }),1000); + console.info("=============ANS_Remove_1500 publish2 promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1500 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1500 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) var timesOfOnConsumeRemoveAllByBundleOptionNullUid - function onConsumeRemoveAllByBundleOptionNullUid(err, data) { - console.info("OnConsume_removeAllByBundleOption_nullUid_1600 start==========>"); - console.info("OnConsume_removeAllByBundleOption_nullUid_1600 data:========>" + JSON.stringify(data)); - console.info("OnConsume_removeAllByBundleOption_nullUid_1600 err:======>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionNullUid(data) { + console.info("===============ANS_Remove_1600 onConsume start================>"); + console.info("===============ANS_Remove_1600 onConsume data:========>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -1235,28 +1226,27 @@ describe('ActsAnsNotificationRemove', function () { timesOfOnConsumeRemoveAllByBundleOptionNullUid = timesOfOnConsumeRemoveAllByBundleOptionNullUid + 1 if (timesOfOnConsumeRemoveAllByBundleOptionNullUid == 2){ notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullUid); - console.info("================OnConsume_removeAllByBundleOption_nullUid_1600 remove==================>"); + console.info("===============ANS_Remove_1600 onConsume remove==================>"); } - console.info("================OnConsume_removeAllByBundleOption_nullUid_1600 end=======================>"); + console.info("===============ANS_Remove_1600 onConsume end================>"); } var timesOfOnCancelRemoveAllByBundleOptionNullUid - function onCancelRemoveAllByBundleOptionNullUid(err, data) { + function onCancelRemoveAllByBundleOptionNullUid(data) { timesOfOnCancelRemoveAllByBundleOptionNullUid = timesOfOnCancelRemoveAllByBundleOptionNullUid + 1 - console.info("================OnCancel_removeAllByBundleOption_nullUid_1600 start=======================>"); - console.info("================OnCancel_1600 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_1600 data: =======================>" + JSON.stringify(data)); + console.info("===============ANS_Remove_1600 onCancel start===================>"); + console.info("===============ANS_Remove_1600 onCancel data:===================>" + JSON.stringify(data)); if (timesOfOnCancelRemoveAllByBundleOptionNullUid == 1){ - expect(data.request.label).assertequal("1600_1"); + expect(data.request.label).assertEqual("1600_1"); }else if (timesOfOnCancelRemoveAllByBundleOptionNullUid == 2){ - expect(data.request.label).assertequal("1600_2"); + expect(data.request.label).assertEqual("1600_2"); } - console.info("================OnCancel_removeAllByBundleOption_nullUid_1600 end=======================>"); + console.info("===============ANS_Remove_1600 onCancel end====================>"); } function removeAllByBundleOptionCallBackNullUid(err, data) { - console.info("================removeAllByBundleOptionCallBack_nullUid_1600 start=======================>"); - console.info("================removeAllByBundleOption_1600=======================>" + JSON.stringify(err)); - console.info("================removeAllByBundleOption_1600=======================>" + JSON.stringify(data)); - console.info("================removeAllByBundleOptionCallBack_nullUid_1600 end=======================>"); + console.info("=========ANS_Remove_1600 removeAllCallBack start=============>"); + console.info("=========ANS_Remove_1600 removeAllCallBack err===============>" + JSON.stringify(err)); + console.info("=========ANS_Remove_1600 removeAllCallBack data==============>" + JSON.stringify(data)); + console.info("=========ANS_Remove_1600 removeAllCallBack end===============>"); } /* @@ -1274,7 +1264,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveAllByBundleOptionNullUid, } await notify.subscribe(subscriber); - console.info("==================subscribe_1600_promise==================>"); + console.info("==================ANS_Remove_1600 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1336,43 +1326,40 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish1_1600_promise==================>"); + console.info("==================ANS_Remove_1600 publish1 promise==================>"); await notify.publish(notificationRequest1); - console.info("==================publish2_1600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1600_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1600 done==================>"); - }),1000); + console.info("==================ANS_Remove_1600 publish2 promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1600 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1600 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveAllByBundleOptionWrongUid(err, data) { - console.info("================OnConsume_removeAllByBundleOption_wrongUid_1700 start=======================>"); - console.info("================OnConsume_1700 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_1700 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionWrongUid(data) { + console.info("========ANS_Remove_1700 onConsume start==============>"); + console.info("========ANS_Remove_1700 onConsume data:==============>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:123456789 } notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongUid); - console.info("================OnConsume_removeAllByBundleOption_wrongUid_1700 remove====================>"); - console.info("================OnConsume_removeAllByBundleOption_wrongUid_1700 end=======================>"); + console.info("========ANS_Remove_1700 onConsume remove============>"); + console.info("========ANS_Remove_1700 onConsume end===============>"); } - function onCancelRemoveAllByBundleOptionWrongUid(err, data) { - console.info("================OnCancel_removeAllByBundleOption_wrongUid_1700 start======================>"); - console.info("================OnCancel_1700 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_1700 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveAllByBundleOptionWrongUid(data) { + console.info("==========ANS_Remove_1700 onCancel start====================>"); + console.info("==========ANS_Remove_1700 onCancel data:====================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeAllByBundleOption_wrongUid_1700 end=======================>"); + console.info("==========ANS_Remove_1700 onCancel end======================>"); } function removeAllByBundleOptionCallBackWrongUid(err, data) { - console.info("================removeAllByBundleOptionCallBack_wrongUid_1700 start=======================>"); - console.info("================removeAllByBundleOption_1700=======================>" + JSON.stringify(err)); - console.info("================removeAllByBundleOption_1700=======================>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeAllByBundleOptionCallBack_wrongUid_1700 end=======================>"); + console.info("==========ANS_Remove_1700 removeAllCallBack start=============>"); + console.info("==========ANS_Remove_1700 removeAllCallBack err===============>" + JSON.stringify(err)); + console.info("==========ANS_Remove_1700 removeAllCallBack data==============>" + JSON.stringify(data)); + console.info("==========ANS_Remove_1700 removeAllCallBack end=======================>"); } /* @@ -1388,7 +1375,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveAllByBundleOptionWrongUid, } await notify.subscribe(subscriber); - console.info("==================subscribe_1700_promise==================>"); + console.info("=============ANS_Remove_1700 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1420,42 +1407,39 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1700_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1700_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1700 done==================>"); - }),1000); + console.info("===============ANS_Remove_1700 publish promise===============>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1700 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1700 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid(err, data) { - console.info("OnConsume_removeAllByBundleOption_wrongBundle_correctUid_1800 start=============>"); - console.info("================OnConsume_1800 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_1800 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid(data) { + console.info("==============ANS_Remove_1800 onConsume start=============>"); + console.info("==============ANS_Remove_1800 onConsume data:=============>" + JSON.stringify(data)); var bundleOption = { bundle:"wrongBundleName", uid:data.request.creatorUid, } notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongBundleCorrectUid); - console.info("================OnConsume_wrongBundle_correctUid_1800 remove=======================>"); - console.info("================OnConsume_wrongBundle_correctUid_1800 end=======================>"); + console.info("==============ANS_Remove_1800 onConsume remove=============>"); + console.info("==============ANS_Remove_1800 onConsume end================>"); } - function onCancelremoveAllByBundleOptionwrongBundleCorrectUid(err, data) { - console.info("OnCancel_removeAllByBundleOption_wrongBundle_correctUid_1800 start=======================>"); - console.info("================OnCancel_1800 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_1800 data: =======================>" + JSON.stringify(data)); + function onCancelremoveAllByBundleOptionwrongBundleCorrectUid(data) { + console.info("==============ANS_Remove_1800 onCancel start===============>"); + console.info("==============ANS_Remove_1800 onCancel data:===============>" + JSON.stringify(data)); expect().assertFail(); - console.info("OnCancel_removeAllByBundleOption_wrongBundle_correctUid_1800 end=======================>"); + console.info("==============ANS_Remove_1800 onCancel end===============>"); } function removeAllByBundleOptionCallBackWrongBundleCorrectUid(err, data) { - console.info("================removeAllByBundleOptionCallBack_wrongBundle_correctUid_1800 start==========>"); - console.info("================wrongBundle_correctUid_1800=======================>" + JSON.stringify(err)); - console.info("================wrongBundle_correctUid_1800=======================>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeAllByBundleOptionCallBack_wrongBundle_correctUid_1800 end============>"); + console.info("=========ANS_Remove_1800 removeAllCallBack start==========>"); + console.info("=========ANS_Remove_1800 removeAllCallBack err============>" + JSON.stringify(err)); + console.info("=========ANS_Remove_1800 removeAllCallBack data===========>" + JSON.stringify(data)); + console.info("=========ANS_Remove_1800 removeAllCallBack end==========>"); } /* @@ -1465,13 +1449,13 @@ describe('ActsAnsNotificationRemove', function () { * deletes all notification information through BundleOption wrong bundle, correct uid. */ it('ANS_Remove_1800', 0, async function (done) { - console.info("===============ANS_Remove_1800==========================>"); + console.info("===============ANS_Remove_1800 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid, onCancel:onCancelremoveAllByBundleOptionwrongBundleCorrectUid, } await notify.subscribe(subscriber); - console.info("==================subscribe_1800_promise==================>"); + console.info("================ANS_Remove_1800 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1503,41 +1487,38 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1800_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1800_promise==================>"); - - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1800 done==================>"); - }),1000); + console.info("============ANS_Remove_1800 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1800 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1800 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid(err, data) { - console.info("================OnConsume_nullCharacterBundle_correctUid_1900 start=======================>"); - console.info("================OnConsume_correctUid_1900 data: ============>" + JSON.stringify(data)); - console.info("================OnConsume_correctUid_1900 err: =============>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid(data) { + console.info("===========ANS_Remove_1900 onConsume start===============>"); + console.info("===========ANS_Remove_1900 onConsume data:===============>" + JSON.stringify(data)); var bundleOption = { bundle:"", uid:data.request.creatorUid, } notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullCharacterBundleCorrectUid); - console.info("================OnConsume_nullCharacterBundle_correctUid_1900 remove====================>"); - console.info("================OnConsume_nullCharacterBundle_correctUid_1900 end=======================>"); + console.info("===========ANS_Remove_1900 onConsume removeAll===========>"); + console.info("===========ANS_Remove_1900 onConsume end=================>"); } - function onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid(err, data) { - console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_correctUid_1900 start===========>"); - console.info("OnCancel_1900 err:=======>" + JSON.stringify(err)); - console.info("OnCancel_1900 data:==========>" + JSON.stringify(data)); + function onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid(data) { + console.info("===========ANS_Remove_1900 onCancel start===========>"); + console.info("===========ANS_Remove_1900 onCancel data:==========>" + JSON.stringify(data)); expect().assertFail(); - console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_correctUid_1900 end=============>"); + console.info("===========ANS_Remove_1900 onCancel end===========>"); } function removeAllByBundleOptionCallBackNullCharacterBundleCorrectUid(err, data) { - console.info("================nullCharacterBundle_correctUid_1900 start=======================>"); - console.info("================nullCharacterBundle_correctUid_1900===================>" + JSON.stringify(err)); - console.info("================nullCharacterBundle_correctUid_1900==================>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeAllByBundleOptionCallBack_nullCharacterBundle_correctUid_1900 end=====>"); + console.info("========ANS_Remove_1900 removeAllCallback start===========>"); + console.info("========ANS_Remove_1900 removeAllCallback err=============>" + JSON.stringify(err)); + console.info("========ANS_Remove_1900 removeAllCallback data=========>" + JSON.stringify(data)); + console.info("========ANS_Remove_1900 removeAllCallback end=======================>"); } /* @@ -1547,13 +1528,13 @@ describe('ActsAnsNotificationRemove', function () { * deletes all notification information through BundleOption null character bundle, correct uid. */ it('ANS_Remove_1900', 0, async function (done) { - console.info("===============ANS_Remove_1900==========================>"); + console.info("===============ANS_Remove_1900 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid, onCancel:onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid, } await notify.subscribe(subscriber); - console.info("==================subscribe_1900_promise==================>"); + console.info("===============ANS_Remove_1900 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1585,40 +1566,38 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_1900_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_1900_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_1900 done==================>"); - }),1000); + console.info("===============ANS_Remove_1900 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_1900 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_1900 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveAllByBundleOptionWrongBundleWrongUid(err, data) { - console.info("OnConsume_removeAllByBundleOption_wrongBundle_wrongUid_2000 start=======================>"); - console.info("OnConsume_2000 data: =======================>" + JSON.stringify(data)); - console.info("OnConsume_2000 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionWrongBundleWrongUid(data) { + console.info("============ANS_Remove_2000 onConsume start================>"); + console.info("============ANS_Remove_2000 onConsume data:================>" + JSON.stringify(data)); var bundleOption = { bundle:"wrongBundleName", uid:123456789, } notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongBundleWrongUid); - console.info("================OnConsume_2000 remove=======================>"); - console.info("OnConsume_removeAllByBundleOption_wrongBundle_wrongUid_2000 end=======================>"); + console.info("============ANS_Remove_2000 onConsume remove================>"); + console.info("============ANS_Remove_2000 onConsume end===================>"); } - function onCancelRemoveAllByBundleOptionWrongBundleWrongUid(err, data) { - console.info("================OnCancel_wrongBundle_wrongUid_2000 start======================>"); - console.info("================OnCancel_wrongBundle_wrongUid_2000 err: =============>" + JSON.stringify(err)); - console.info("================OnCancel_wrongUid_2000 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveAllByBundleOptionWrongBundleWrongUid(data) { + console.info("============ANS_Remove_2000 onCancel start=================>"); + console.info("============ANS_Remove_2000 onCancel data:=================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeAllByBundleOption_wrongBundle_wrongUid_2000 end==============>"); + console.info("============ANS_Remove_2000 onCancel end==============>"); } function removeAllByBundleOptionCallBackWrongBundleWrongUid(err, data) { - console.info("================removeAllByBundleOptionCallBack_wrongBundle_wrongUid_2000 start=============>"); - console.info("================wrongBundle_wrongUid_2000=======================>" + JSON.stringify(err)); - console.info("================wrongBundle_wrongUid_2000=======================>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeAllByBundleOptionCallBack_wrongBundle_wrongUid_2000 end===============>"); + console.info("============ANS_Remove_2000 removeAllCallBack start============>"); + console.info("============ANS_Remove_2000 removeAllCallBack err==============>" + JSON.stringify(err)); + console.info("============ANS_Remove_2000 removeAllCallBack data=============>" + JSON.stringify(data)); + console.info("============ANS_Remove_2000 removeAllCallBack end=============>"); } /* @@ -1628,13 +1607,13 @@ describe('ActsAnsNotificationRemove', function () { * deletes all notification information through BundleOption wrong bundle, wrong uid. */ it('ANS_Remove_2000', 0, async function (done) { - console.info("===============ANS_Remove_2000==========================>"); + console.info("===============ANS_Remove_2000 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveAllByBundleOptionWrongBundleWrongUid, onCancel:onCancelRemoveAllByBundleOptionWrongBundleWrongUid, } await notify.subscribe(subscriber); - console.info("==================subscribe_2000_promise==================>"); + console.info("==============ANS_Remove_2000 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1666,40 +1645,38 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2000_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2000_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2000 done==================>"); - }),1000); + console.info("==============ANS_Remove_2000 publish promise==============>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2000 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2000 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid(err, data) { - console.info("OnConsume_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 start===================>"); - console.info("OnConsume_2100 data:======>" + JSON.stringify(data)); - console.info("OnConsume_2100 err:=====>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid(data) { + console.info("=========ANS_Remove_2100 onConsume start===================>"); + console.info("=========ANS_Remove_2100 onConsume data:======>" + JSON.stringify(data)); var bundleOption = { bundle:"", uid:123456789, } notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullCharacterBundleWrongUid); - console.info("OnConsume_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 remove==============>"); - console.info("OnConsume_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 end=================>"); + console.info("=========ANS_Remove_2100 onConsume remove===================>"); + console.info("=========ANS_Remove_2100 onConsume end===================>"); } - function onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid(err, data) { - console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 start============>"); - console.info("OnCancel_2100 err:===========>" + JSON.stringify(err)); - console.info("OnCancel_2100 data:==========>" + JSON.stringify(data)); + function onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid(data) { + console.info("=========ANS_Remove_2100 onCancel start==========>"); + console.info("=========ANS_Remove_2100 onCancel data:==========>" + JSON.stringify(data)); expect().assertFail(); - console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 end=====================>"); + console.info("=========ANS_Remove_2100 onCancel end============>"); } function removeAllByBundleOptionCallBackNullCharacterBundleWrongUid(err, data) { - console.info("removeAllByBundleOptionCallBack_nullCharacterBundle_wrongUid_2100 start====================>"); - console.info("CallBack_2100=========>" + JSON.stringify(err)); - console.info("CallBack_2100=========>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("removeAllByBundleOptionCallBac_nullCharacterBundle_wrongUid_2100 end=======================>"); + console.info("=========ANS_Remove_2100 removeAllCallBack start===============>"); + console.info("=========ANS_Remove_2100 err=========>" + JSON.stringify(err)); + console.info("=========ANS_Remove_2100 data=========>" + JSON.stringify(data)); + console.info("=========ANS_Remove_2100 removeAllCallBack end===============>"); } /* @@ -1709,13 +1686,13 @@ describe('ActsAnsNotificationRemove', function () { * deletes all notification information through BundleOption null character bundle, wrong uid. */ it('ANS_Remove_2100', 0, async function (done) { - console.info("===============ANS_Remove_2100==========================>"); + console.info("===============ANS_Remove_2100 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid, onCancel:onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid, } await notify.subscribe(subscriber); - console.info("==================subscribe_2100_promise==================>"); + console.info("============ANS_Remove_2100 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1747,39 +1724,38 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2100_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2100 done==================>"); - }),1000); + console.info("=========ANS_Remove_2100 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2100 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2100 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveAllByBundleOptionIsUnremovable(err, data) { - console.info("================OnConsume_removeAllByBundleOption_isUnremovable_2200 start==================>"); - console.info("================OnConsume_2200 data: ==================>" + JSON.stringify(data)); - console.info("================OnConsume_2200 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveAllByBundleOptionIsUnremovable(data) { + console.info("==========ANS_Remove_2200 onConsume start==================>"); + console.info("==========ANS_Remove_2200 onConsume data:=================>" + JSON.stringify(data)); var bundleOption = { - bundle:data.request.bundle, - uid:data.request.creatorUidss, + bundle:data.request.creatorBundleName, + uid:data.request.creatorUid, } notify.removeAll(bundleOption,removeAllByBundleOptionCallBackIsUnremovable); - console.info("================OnConsume_removeAllByBundleOption_isUnremovable_2200 removeAll==============>"); - console.info("================OnConsume_removeAllByBundleOption_isUnremovable_2200 end====================>"); + console.info("==========ANS_Remove_2200 onConsume removeAll==================>"); + console.info("==========ANS_Remove_2200 onConsume end==================>"); } - function onCancelRemoveAllByBundleOptionIsUnremovable(err, data) { - console.info("================OnCancel_2200 start=======================>"); - console.info("================OnCancel_2200 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_2200 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveAllByBundleOptionIsUnremovable(data) { + console.info("==========ANS_Remove_2200 onCancel start=================>"); + console.info("==========ANS_Remove_2200 onCancel data:=================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_2200 end=======================>"); + console.info("==========ANS_Remove_2200 onCancel end===================>"); } function removeAllByBundleOptionCallBackIsUnremovable(err, data) { - console.info("removeAllByBundleOptionCallBack_nullCharacterBundle_wrongUid_2200 start=====================>"); - console.info("================Callback_2200=======================>" + JSON.stringify(err)); - console.info("================Callback_2200=======================>" + JSON.stringify(data)); - console.info("================removeAllByBundleOptionCallBac_nullCharacterBundle_wrongUid_2200 end========>"); + console.info("==========ANS_Remove_2200 removeAllCallBack start==========>"); + console.info("==========ANS_Remove_2200 removeAllCallBack err============>" + JSON.stringify(err)); + console.info("==========ANS_Remove_2200 removeAllCallBack data===========>" + JSON.stringify(data)); + console.info("==========ANS_Remove_2200 removeAllCallBack end============>"); } /* @@ -1789,13 +1765,13 @@ describe('ActsAnsNotificationRemove', function () { interface is called to delete the notification information whose attribute isUnremovable is true */ it('ANS_Remove_2200', 0, async function (done) { - console.info("===============ANS_Remove_2200==========================>"); + console.info("===============ANS_Remove_2200 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveAllByBundleOptionIsUnremovable, onCancel:onCancelRemoveAllByBundleOptionIsUnremovable, } await notify.subscribe(subscriber); - console.info("==================subscribe_2200_promise==================>"); + console.info("==============ANS_Remove_2200 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1827,48 +1803,48 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2200_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2200 done==================>"); - }),1000); - done(); + console.info("=============ANS_Remove_2200 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2200 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2200 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) function removeAllCallBack(err,data) { - console.info("================removeAllCallBack_2300 start: =======================>"); - console.info("================removeAllCallBack_2300 err: =======================>" + JSON.stringify(err)); - console.info("================removeAllCallBack_2300 data: =======================>" + JSON.stringify(data)); - console.info("================removeAllCallBack_2300 end: =======================>"); + console.info("================ANS_Remove_2300 removeAllCallBack start:========>"); + console.info("================ANS_Remove_2300 removeAllCallBack err:==========>" + JSON.stringify(err)); + console.info("================ANS_Remove_2300 removeAllCallBack data:=========>" + JSON.stringify(data)); + console.info("================ANS_Remove_2300 removeAllCallBack end:==========>") } var timesOfOnConsumeRemoveAll - function onConsumeRemoveAll(err, data, ) { + function onConsumeRemoveAll(data) { timesOfOnConsumeRemoveAll = timesOfOnConsumeRemoveAll + 1 - console.info("================OnConsume_removeAll_2300 start=======================>"); - console.info("================OnConsume_removeAll_2300 data: =======================>" + JSON.stringify(data)); + console.info("================ANS_Remove_2300 onConsume start==================>"); + console.info("================ANS_Remove_2300 onConsume data: =================>" + JSON.stringify(data)); if (timesOfOnConsumeRemoveAll == 2) { notify.removeAll(removeAllCallBack); - console.info("================OnConsume_removeAll_2300 removeAll=======================>"); + console.info("============ANS_Remove_2300 onConsume removeAll==========>"); } - console.info("================OnConsume_removeAll_2300 end=======================>"); + console.info("================ANS_Remove_2300 onConsume end====================>"); } var timesOfOnCancelRemoveAll - function onCancelRemoveAll(err, data) { + function onCancelRemoveAll(data) { timesOfOnCancelRemoveAll = timesOfOnCancelRemoveAll + 1 - console.info("==========================OnCancel_removeAll_2300=======================>"); - console.info("================OnCancel_removeAll_2300 data : =======================>" + JSON.stringify(data)); + console.info("==================ANS_Remove_2300 onCancel start===========>"); + console.info("==================ANS_Remove_2300 onCancel data============>" + JSON.stringify(data)); if (timesOfOnCancelRemoveAll == 1) { - expect(data.request.label).assertequal("2300_1"); + expect(data.request.label).assertEqual("2300_1"); } if (timesOfOnCancelRemoveAll == 2) { - expect(data.request.label).assertequal("2300_2"); + expect(data.request.label).assertEqual("2300_2"); } - console.info("================cancelCallback_removeAll_0200 end=======================>"); + console.info("==================ANS_Remove_2300 onCancel end=============>"); } /* @@ -1878,7 +1854,7 @@ describe('ActsAnsNotificationRemove', function () { * notification information */ it('ANS_Remove_2300', 0, async function (done) { - console.info("===============ANS_Remove_2300==========================>"); + console.info("===============ANS_Remove_2300 start==========================>"); timesOfOnConsumeRemoveAll = 0; timesOfOnCancelRemoveAll = 0; var subscriber ={ @@ -1886,7 +1862,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveAll, } await notify.subscribe(subscriber); - console.info("==================subscribe_2300_promise==================>"); + console.info("=============ANS_Remove_2300 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -1948,43 +1924,44 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish1_2300_promise==================>"); + console.info("===========ANS_Remove_2300 publish1 promise================>"); await notify.publish(notificationRequest1); - console.info("==================publish2_2300_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2300_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2300 done==================>"); - }),1000); + console.info("============ANS_Remove_2300 publish2 promise===============>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2300 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2300 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) var timesOfOnConsumeRemoveAll - function onConsumeRemoveAllPromise(err, data) { + function onConsumeRemoveAllPromise(data) { timesOfOnConsumeRemoveAll = timesOfOnConsumeRemoveAll + 1 - console.info("================OnConsume_removeAll_promise_2400 start=======================>"); - console.info("================OnConsume_removeAll_promise_2400 data: =============>" + JSON.stringify(data)); + console.info("===========ANS_Remove_2400 onConsume start==============>"); + console.info("===========ANS_Remove_2400 onConsume data:==============>" + JSON.stringify(data)); if (timesOfOnConsumeRemoveAll == 2) { notify.removeAll(); - console.info("================OnConsume_removeAll_promise_2400 removeAll=======================>"); + console.info("===========ANS_Remove_2400 onConsume removeAll==========>"); } - console.info("================OnConsume_removeAll_promise_2400 end=======================>"); + console.info("===========ANS_Remove_2400 onConsume end==============>"); } var timesOfOnCancelRemoveAll - function onCancelRemoveAllPromise(err, data) { + function onCancelRemoveAllPromise(data) { timesOfOnCancelRemoveAll = timesOfOnCancelRemoveAll + 1 - console.info("==========================OnCancel_removeAll_promise_2400 start=======================>"); - console.info("================OnCancel_removeAll_promise_2400 data : =============>" + JSON.stringify(data)); + console.info("===========ANS_Remove_2400 onCancel start=======================>"); + console.info("===========ANS_Remove_2400 onCancel data : =============>" + JSON.stringify(data)); if (timesOfOnCancelRemoveAll == 1) { - expect(data.request.label).assertequal("2400_1"); + expect(data.request.label).assertEqual("2400_1"); } if (timesOfOnCancelRemoveAll == 2) { - expect(data.request.label).assertequal("2400_2"); + expect(data.request.label).assertEqual("2400_2"); } - console.info("================OnCancel_removeAll_promise_2400 end=======================>"); + console.info("===========ANS_Remove_2400 onCancel end=======================>"); } /* @@ -1994,7 +1971,7 @@ describe('ActsAnsNotificationRemove', function () { * notification information */ it('ANS_Remove_2400', 0, async function (done) { - console.info("===============ANS_Remove_2400==========================>"); + console.info("===============ANS_Remove_2400 start==========================>"); timesOfOnConsumeRemoveAll = 0 timesOfOnCancelRemoveAll = 0 var subscriber ={ @@ -2002,7 +1979,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveAllPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_2400_promise==================>"); + console.info("==============ANS_Remove_2400 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2064,35 +2041,35 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish1_2400_promise==================>"); + console.info("===ANS_Remove_2400 publish1 promise============>"); await notify.publish(notificationRequest1); - console.info("==================publish2_2400_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2400_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2400 done==================>"); - }),1000); + console.info("===ANS_Remove_2400 publish2 promise============>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2400 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2400 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) function removeAllCallBackIsUnremovable(err,data) { - console.info("================removeAllCallBack_isUnremovable_2500 start=======================>"); - console.info("================removeAllCallBack_2500 JSON.stringify(err): ===========>" + JSON.stringify(err)); - console.info("================removeAllCallBack_2500 JSON.stringify(data): =========>" + JSON.stringify(data)); - console.info("================removeAllCallBack_isUnremovable_2500 end=======================>"); - } - function onConsumeRemoveAllIsUnremovable(err, data) { - console.info("================OnConsume_removeAll_isUnremovable_2500 start=======================>"); - console.info("================OnConsume_2500 data: =======================>" + JSON.stringify(data)); + console.info("=========ANS_Remove_2500 removeAllCallBack start=========>"); + console.info("=========ANS_Remove_2500 removeAllCallBack err:==========>" + JSON.stringify(err)); + console.info("=========ANS_Remove_2500 removeAllCallBack data:=========>" + JSON.stringify(data)); + console.info("=========ANS_Remove_2500 removeAllCallBack end===========>"); + } + function onConsumeRemoveAllIsUnremovable(data) { + console.info("=========ANS_Remove_2500 onConsume start===========>"); + console.info("=========ANS_Remove_2500 onConsumedata:============>" + JSON.stringify(data)); notify.removeAll(removeAllCallBackIsUnremovable); - console.info("================removeAll_isUnremovable_2500 =======================>"); - console.info("================OnConsume_removeAll_isUnremovable_2500 end=======================>"); + console.info("=========ANS_Remove_2500 onConsume removeAll=======>"); + console.info("=========ANS_Remove_2500 onConsume end=============>"); } - function onCancelCallbackRemoveAllIsUnremovable(err, data) { - console.info("================OnCancelCallback_removeAll_isUnremovable_2500 start=======================>"); - console.info("================OnCancelCallback_2500 err : =======================>" + JSON.stringify(err)); - console.info("================OnCancelCallback_2500 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_removeAll_isUnremovable_2500 end=======================>"); + function onCancelCallbackRemoveAllIsUnremovable(data) { + console.info("=========ANS_Remove_2500 onCancel start==============>"); + console.info("=========ANS_Remove_2500 onCancel data:==============>" + JSON.stringify(data)); + console.info("=========ANS_Remove_2500 onCancel end================>"); } /* @@ -2102,13 +2079,13 @@ describe('ActsAnsNotificationRemove', function () { * notification information whose attribute isUnremovable is true */ it('ANS_Remove_2500', 0, async function (done) { - console.info("===============ANS_Remove_2500==========================>"); + console.info("===============ANS_Remove_2500 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveAllIsUnremovable, onCancel:onCancelCallbackRemoveAllIsUnremovable, } await notify.subscribe(subscriber); - console.info("==================subscribe_2500_promise==================>"); + console.info("======ANS_Remove_2500 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2140,28 +2117,27 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2500_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2500 done==================>"); - }),1000); + console.info("============ANS_Remove_2500 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2500 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2500 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function OnConsumeRemoveAllIsUnremovablePromise(err, data) { - console.info("================OnConsume_removeAll_isUnremovable_promise_2600 start=======================>"); - console.info("================OnConsume_2600 data=======================>" + JSON.stringify(data)); - console.info("================OnConsume_2600 err=======================>" + JSON.stringify(err)); + function OnConsumeRemoveAllIsUnremovablePromise(data) { + console.info("===========ANS_Remove_2600 onConsume start===========>"); + console.info("===========ANS_Remove_2600 onConsume data============>" + JSON.stringify(data)); notify.removeAll() - console.info("================removeAll_isUnremovable_2600 end=======================>"); - console.info("================OnConsume_removeAll_isUnremovable_promise_2600 end=======================>"); + console.info("===========ANS_Remove_2600 onConsume removeAll=======>"); + console.info("===========ANS_Remove_2600 onConsume end=============>"); } - function OnCancelCallbackRemoveAllIsUnremovablePromise(err, data) { - console.info("================OnCancelCallback_removeAll_isUnremovable_promise_2600 start================>"); - console.info("================OnCancelCallback_2600 err : =======================>" + JSON.stringify(err)); - console.info("================OnCancelCallback_2600 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_2600 end=======================>"); + function OnCancelCallbackRemoveAllIsUnremovablePromise(data) { + console.info("===========ANS_Remove_2600 onCancel start================>"); + console.info("===========ANS_Remove_2600 onCancel data : ==============>" + JSON.stringify(data)); + console.info("===========ANS_Remove_2600 onCancel end==================>"); } /* @@ -2171,13 +2147,13 @@ describe('ActsAnsNotificationRemove', function () { * notification information whose attribute isUnremovable is true */ it('ANS_Remove_2600', 0, async function (done) { - console.info("===============ANS_Remove_2600==========================>"); + console.info("===============ANS_Remove_2600 start==========================>"); var subscriber ={ onConsume:OnConsumeRemoveAllIsUnremovablePromise, onCancel:OnCancelCallbackRemoveAllIsUnremovablePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_2600_promise==================>"); + console.info("============ANS_Remove_2600 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2209,50 +2185,49 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2600_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2600 done==================>"); - }),1000); + console.info("==========ANS_Remove_2600 publish promise==============>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2600 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2600 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) function removeAllCallBack2TimesOf2(err,data) { - console.info("================removeAllCallBack2TimesOf2_2700 start=======================>"); - console.info("================removeAllCallBack2TimesOf2_2700 err=================>" + JSON.stringify(err)); - console.info("================removeAllCallBack2TimesOf2_2700 data===============>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeAllCallBack2TimesOf2_2700 end=======================>"); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 start===========>"); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 err=============>" + JSON.stringify(err)); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 data============>" + JSON.stringify(data)); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 end=============>"); } function removeAllCallBack2TimesOf1(err,data) { - console.info("================removeAllCallBack2TimesOf1_2700 start=======================>"); - console.info("================removeAllCallBack2TimesOf1_2700 err===================>" + JSON.stringify(err)); - console.info("================removeAllCallBack2TimesOf1_2700 data=================>" + JSON.stringify(data)); - expect(err.code).assertequal(0); - notify.removeAll(removeCallBack2TimesOf2); - console.info("================removeAllCallBack2TimesOf1_2700 removeCallBack2TimesOf2====================>"); - console.info("================removeAllCallBack2TimesOf1_2700 end=======================>"); - } - function onConsumeRemoveAll2Times(err, data) { - console.info("================OnConsumeCallback_removeAll2Times_2700 start=======================>"); - console.info("================OnConsumeCallback_removeAll2Times_2700 data: ========>" + JSON.stringify(data)); - notify.removeAll(removeCallBack2TimesOf1); - console.info("================OnConsumeCallback_removeAll2Times_2700 remove=======================>"); - console.info("================OnConsumeCallback_removeAll2Times_2700 end=======================>"); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 start==========>"); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 err============>" + JSON.stringify(err)); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 data===========>" + JSON.stringify(data)); + expect(err.code).assertEqual(0); + notify.removeAll(removeAllCallBack2TimesOf2); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 removeAll=====>"); + console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 end==========>"); + } + function onConsumeRemoveAll2Times(data) { + console.info("=======ANS_Remove_2700 onConsume start=========>"); + console.info("=======ANS_Remove_2700 onConsume data:=========>" + JSON.stringify(data)); + notify.removeAll(removeAllCallBack2TimesOf1); + console.info("=======ANS_Remove_2700 onConsume remove========>"); + console.info("=======ANS_Remove_2700 onConsume end===========>"); } var timesOfOnCancelCallbackRemoveAll2Times - function onCancelRemoveAll2Times(err, data) { + function onCancelRemoveAll2Times(data) { timesOfOnCancelCallbackRemoveAll2Times = timesOfOnCancelCallbackRemoveAll2Times + 1 - console.info("================OnCancelCallback_removeAll2Times_2700 start=======================>"); - console.info("================OnCancelCallback_2700 data : =======================>" + JSON.stringify(data)); - console.info("================OnCancelCallback_2700 err : =======================>" + JSON.stringify(err)); + console.info("=======ANS_Remove_2700 onCancel start============>"); + console.info("=======ANS_Remove_2700 onCancel data:============>" + JSON.stringify(data)); if (timesOfOnCancelCallbackRemoveAll2Times == 1){ - expect(data.request.id).assertequal(1); + expect(data.request.id).assertEqual(27); } else if (timesOfOnCancelCallbackRemoveAll2Times == 2){ expect().assertFail(); } - console.info("================OnCancelCallback_removeAll2Times_2700 end=======================>"); + console.info("=======ANS_Remove_2700 onCancel end============>"); } /* @@ -2262,14 +2237,14 @@ describe('ActsAnsNotificationRemove', function () { * twice in a row to delete the notification information */ it('ANS_Remove_2700', 0, async function (done) { - console.info("===============ANS_Remove_2700==========================>"); + console.info("===============ANS_Remove_2700 start==========================>"); timesOfOnCancelCallbackRemoveAll2Times = 0 var subscriber ={ onConsume:onConsumeRemoveAll2Times, onCancel:onCancelRemoveAll2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_2700_promise==================>"); + console.info("============ANS_Remove_2700 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2301,37 +2276,36 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2700_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2700_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2700 done==================>"); - }),1000); + console.info("=========ANS_Remove_2700 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2700 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2700 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeCallbackRemoveAll2TimesPromise(err, data) { - console.info("================OnConsumeCallback_removeAll2Times_promise_2800 start=======================>"); - console.info("================OnConsumeCallback_2800 data: =======================>" + JSON.stringify(data)); + function onConsumeCallbackRemoveAll2TimesPromise(data) { + console.info("=============ANS_Remove_2800 onConsume start=============>"); + console.info("=============ANS_Remove_2800 onConsume data: =======================>" + JSON.stringify(data)); notify.removeAll() - console.info("================removeAll_2times2_2800 end=======================>"); + console.info("=============ANS_Remove_2800 onConsume removeAll1=======================>"); notify.removeAll() - console.info("================removeAll_2times2_2800 end=======================>"); - console.info("================OnConsumeCallback_removeAll2Times_promise_2800 remove=======================>"); - console.info("================OnConsumeCallback_removeAll2Times_promise_2800 end=======================>"); + console.info("=============ANS_Remove_2800 onConsume removeAll2=======================>"); + console.info("=============ANS_Remove_2800 onConsume end=============>"); } var timesOfOnCancelCallbackRemoveAll2TimesPromise - function onCancelCallbackRemoveAll2TimesPromise(err, data) { + function onCancelCallbackRemoveAll2TimesPromise(data) { timesOfOnCancelCallbackRemoveAll2TimesPromise = timesOfOnCancelCallbackRemoveAll2TimesPromise + 1 - console.info("==========================OnCancelCallback_removeAll2Times_2800 start=======================>"); - console.info("================OnCancelCallback_removeAll2Times_2800 data : ========>" + JSON.stringify(data)); - console.info("================OnCancelCallback_removeAll2Times_2800 err : ==========>" + JSON.stringify(err)); + console.info("===================ANS_Remove_2800 onCancel start=======================>"); + console.info("===================ANS_Remove_2800 onCancel data : ========>" + JSON.stringify(data)); if (timesOfOnCancelCallbackRemoveAll2TimesPromise == 1){ - expect(data.request.id).assertequal(1); + expect(data.request.id).assertEqual(28); } else if (timesOfOnCancelCallbackRemoveAll2TimesPromise == 2){ expect().assertFail(); } - console.info("================OnCancelCallback_removeAll2Times_2800 end=======================>"); + console.info("===================ANS_Remove_2800 onCancel end=======================>"); } /* @@ -2341,14 +2315,14 @@ describe('ActsAnsNotificationRemove', function () { * to delete the notification information */ it('ANS_Remove_2800', 0, async function (done) { - console.info("===============ANS_Remove_2800==========================>"); + console.info("===============ANS_Remove_2800 start==========================>"); timesOfOnCancelCallbackRemoveAll2TimesPromise = 0 var subscriber ={ onConsume:onConsumeCallbackRemoveAll2TimesPromise, onCancel:onCancelCallbackRemoveAll2TimesPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_2800_promise==================>"); + console.info("================ANS_Remove_2800 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2380,23 +2354,23 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2800_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2800_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2800 done==================>"); - }),1000); + console.info("================ANS_Remove_2800 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2800 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2800 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveByNotificationKey(err, data) { - console.info("================OnConsume_removeByNotificationKey_2900 start=======================>"); - console.info("================OnConsume_2900 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_2900 err: =======================>" + JSON.stringify(err)); - console.info("OnConsume_2900 creatorBundleName: =======================>" + data.request.creatorBundleName); - console.info("================OnConsume_2900 creatorUid: =======================>" + data.request.creatorUid); - console.info("================OnConsume_2900 id: =======================>" + data.request.id); - console.info("================OnConsume_2900 label: =======================>" + data.request.label); + function onConsumeRemoveByNotificationKey(data) { + console.info("=======ANS_Remove_2900 onConsume start=======================>"); + console.info("=======ANS_Remove_2900 onConsume data: =======================>" + JSON.stringify(data)); + console.info("=======ANS_Remove_2900 onConsume creatorBundleName:====>" + data.request.creatorBundleName); + console.info("=======ANS_Remove_2900 onConsume creatorUid:==============>" + data.request.creatorUid); + console.info("=======ANS_Remove_2900 onConsume id: =======================>" + data.request.id); + console.info("=======ANS_Remove_2900 onConsume label: =======================>" + data.request.label); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -2406,22 +2380,23 @@ describe('ActsAnsNotificationRemove', function () { label:data.request.label } notify.remove(bundleOption,notificationKey,removeByNotificationKeyCB); - console.info("================OnConsume_removeByNotificationKey_2900 remove=======================>"); - console.info("================OnConsume_removeByNotificationKey_2900 end=======================>"); - } - function onCancelRemoveByNotificationKey(err, data) { - console.info("================OnCancel_removeByNotificationKey_2900 start=======================>"); - console.info("================OnCancel_removeByNotificationKey_2900 err: ===========>" + JSON.stringify(err)); - console.info("================OnCancel_removeByNotificationKey_2900 data: ==========>" + JSON.stringify(data)); - expect(data.request.label).assertequal("2900"); - expect(data.request.id).assertequal(29); - console.info("================OnCancel_removeByNotificationKey_2900 end=======================>"); + console.info("=============ANS_Remove_2900 onConsume remove=======================>"); + console.info("=============ANS_Remove_2900 onConsume end=======================>"); + } + function onCancelRemoveByNotificationKey(data) { + console.info("=============ANS_Remove_2900 onCancel start================>"); + console.info("=============ANS_Remove_2900 onCancel data:==========>" + JSON.stringify(data)); + expect(data.request.label).assertEqual("2900"); + console.info("=============ANS_Remove_2900 onCancel label:==========>" + JSON.stringify(data.request.label)); + expect(data.request.id).assertEqual(29); + console.info("=============ANS_Remove_2900 onCancel id:==========>" + JSON.stringify(data.request.id)); + console.info("=============ANS_Remove_2900 onCancel end================>"); } function removeByNotificationKeyCB(err, data) { - console.info("================removeByNotificationKeyCB_2900 start=======================>"); - console.info("================removeByNotificationKeyCB_2900=======================>" + JSON.stringify(err)); - console.info("================removeByNotificationKeyCB_2900=======================>" + JSON.stringify(data)); - console.info("================removeByNotificationKeyCB_2900 end=======================>"); + console.info("==========ANS_Remove_2900 removeCalback start============>"); + console.info("==========ANS_Remove_2900 removeCalback err==============>" + JSON.stringify(err)); + console.info("==========ANS_Remove_2900 removeCalback data=============>" + JSON.stringify(data)); + console.info("==========ANS_Remove_2900 removeCalback end============>"); } /* @@ -2432,13 +2407,13 @@ describe('ActsAnsNotificationRemove', function () { * NotificationKey */ it('ANS_Remove_2900', 0, async function (done) { - console.info("===============ANS_Remove_2900==========================>"); + console.info("===============ANS_Remove_2900 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveByNotificationKey, onCancel:onCancelRemoveByNotificationKey, } await notify.subscribe(subscriber); - console.info("==================subscribe_2900_promise==================>"); + console.info("================ANS_Remove_2900 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2470,19 +2445,19 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_2900_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_2900_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_2900 done==================>"); - }),1000); + console.info("==============ANS_Remove_2900 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_2900 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_2900 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveByNotificationKeyPromise(err, data) { - console.info("================OnConsume_removeByNotificationKey_promise_3000 start=======================>"); - console.info("================OnConsume_3000 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_3000 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveByNotificationKeyPromise(data) { + console.info("==========ANS_Remove_3000 onConsume start==============>"); + console.info("==========ANS_Remove_3000 data: =======================>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -2492,16 +2467,15 @@ describe('ActsAnsNotificationRemove', function () { label:"3000" } notify.remove(bundleOption,notificationKey) - console.info("================OnConsume_removeByNotificationKey_promise_3000 remove=======================>"); - console.info("================OnConsume_removeByNotificationKey_promise_3000 end=======================>"); + console.info("==========ANS_Remove_3000 onConsume remove==============>"); + console.info("==========ANS_Remove_3000 onConsume end=================>"); } - function onCancelRemoveByNotificationKeyPromise(err, data) { - console.info("================OnCancel_removeByNotificationKey_promise_3000 start=======================>"); - console.info("================OnCancel_3000 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_3000 data: =======================>" + JSON.stringify(data)); - expect(data.request.label).assertequal("3000"); - expect(data.request.id).assertequal(30); - console.info("================OnCancel_removeByNotificationKey_promise_3000 end=======================>"); + function onCancelRemoveByNotificationKeyPromise(data) { + console.info("========ANS_Remove_3000 onCancel start========>"); + console.info("========ANS_Remove_3000 onCancel data:========>" + JSON.stringify(data)); + expect(data.request.label).assertEqual("3000"); + expect(data.request.id).assertEqual(30); + console.info("========ANS_Remove_3000 onCancel end==========>"); } /* @@ -2512,13 +2486,13 @@ describe('ActsAnsNotificationRemove', function () { deletes notification information through BundleOption and NotificationKey */ it('ANS_Remove_3000', 0, async function (done) { - console.info("===============ANS_Remove_3000==========================>"); + console.info("===============ANS_Remove_3000 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveByNotificationKeyPromise, onCancel:onCancelRemoveByNotificationKeyPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_3000_promise==================>"); + console.info("===============ANS_Remove_3000 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2550,19 +2524,19 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3000_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3000_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3000 done==================>"); - }),1000); + console.info("=============ANS_Remove_3000 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3000 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3000 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveByNotificationKeyWrongKey(err, data) { - console.info("================OnConsume_removeByNotificationKey_wrongKey_3100 start=======================>"); - console.info("================OnConsume_3100 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_3100 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveByNotificationKeyWrongKey(data) { + console.info("==========ANS_Remove_3100 onConsume start=============>"); + console.info("==========ANS_Remove_3100 onConsume data:=============>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -2572,22 +2546,21 @@ describe('ActsAnsNotificationRemove', function () { label:"wrongLabel" } notify.remove(bundleOption,notificationKey,removeByNotificationKeyCBWrongKey); - console.info("================OnConsume_removeByNotificationKey_wrongKey_3100 remove=======================>"); - console.info("================OnConsume_removeByNotificationKey_wrongKey_3100 end=======================>"); + console.info("==========ANS_Remove_3100 onConsume remove==========>"); + console.info("==========ANS_Remove_3100 onConsume end=============>"); } - function onCancelRemoveByNotificationKeyWrongKey(err, data) { - console.info("================OnCancel_removeByNotificationKey_wrongKey_3100 start=======================>"); - console.info("================OnCancel_3100 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_3100 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveByNotificationKeyWrongKey(data) { + console.info("==========ANS_Remove_3100 onCancel start===========>"); + console.info("==========ANS_Remove_3100 onCancel data:===========>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeByNotificationKey_wrongKey_3100 end=======================>"); - } + console.info("==========ANS_Remove_3100 onCancel end===========>"); +} function removeByNotificationKeyCBWrongKey(err, data) { - console.info("================removeByNotificationKeyCB_3100 start=======================>"); - console.info("================removeByNotificationKeyCB_3100=======================>" + JSON.stringify(err)); - expect(err.code).assertNotEqual(0); - console.info("================removeByNotificationKeyCB_3100=======================>" + JSON.stringify(data)); - console.info("================removeByNotificationKeyCB_3100 end=======================>"); + console.info("==========ANS_Remove_3100 removeCallback start===========>"); + console.info("==========ANS_Remove_3100 removeCallback err=============>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("==========ANS_Remove_3100 removeCallback data============>" + JSON.stringify(data)); + console.info("==========ANS_Remove_3100 removeCallback end===========>"); } /* @@ -2598,13 +2571,13 @@ describe('ActsAnsNotificationRemove', function () { * NotificationKey correct bundleOption,wrong notificationKey. */ it('ANS_Remove_3100', 0, async function (done) { - console.info("===============ANS_Remove_3100==========================>"); + console.info("===============ANS_Remove_3100 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveByNotificationKeyWrongKey, onCancel:onCancelRemoveByNotificationKeyWrongKey, } await notify.subscribe(subscriber); - console.info("==================subscribe_3100_promise==================>"); + console.info("==============ANS_Remove_3100 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2636,19 +2609,19 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3100_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3100_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3100 done==================>"); - }),1000); + console.info("=============ANS_Remove_3100 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3100 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3100 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveByNotificationKeyWrongKeyPromise(err, data) { - console.info("================OnConsume_removeByNotificationKey_wrongKey_promise_3200 start===============>"); - console.info("================OnConsume_3200 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_3200 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveByNotificationKeyWrongKeyPromise(data) { + console.info("===========ANS_Remove_3200 onConsume start===============>"); + console.info("===========ANS_Remove_3200 onConsume data:===============>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -2658,15 +2631,14 @@ describe('ActsAnsNotificationRemove', function () { label:"wrongLabel" } notify.remove(bundleOption, notificationKey); - console.info("================removeByNotificationKey_wrongKey_promise_3200 end=======================>"); - console.info("================OnConsume_removeByNotificationKey_wrongKey_promise_3200 end==================>"); + console.info("===========ANS_Remove_3200 onConsume remove============>"); + console.info("===========ANS_Remove_3200 onConsume end===============>"); } - function onCancelRemoveByNotificationKeyWrongKeyPromise(err, data) { - console.info("================OnCancel_removeByNotificationKey_wrongKey_promise_3200 start=================>"); - console.info("================OnCancel_3200 err: =====================>" + JSON.stringify(err)); - console.info("================OnCancel_3200 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveByNotificationKeyWrongKeyPromise(data) { + console.info("===========ANS_Remove_3200 onCancel start=================>"); + console.info("===========ANS_Remove_3200 onCanceldata:==================>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeByNotificationKey_wrongKey_promise_3200 end===================>"); + console.info("===========ANS_Remove_3200 onCancel end=================>"); } /* @@ -2677,13 +2649,13 @@ describe('ActsAnsNotificationRemove', function () { * bundleOption,wrong notificationKey. */ it('ANS_Remove_3200', 0, async function (done) { - console.info("===============ANS_Remove_3200==========================>"); + console.info("===============ANS_Remove_3200 start=================>"); var subscriber ={ onConsume:onConsumeRemoveByNotificationKeyWrongKeyPromise, onCancel:onCancelRemoveByNotificationKeyWrongKeyPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_3200_promise==================>"); + console.info("===============ANS_Remove_3200 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2715,20 +2687,19 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3200_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3200_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3200 done==================>"); - }),1000); - done(); + console.info("===========ANS_Remove_3200 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3200 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3200 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function OnConsumeRemoveByNotificationKeyWrongBundle(err, data) { - console.info("================OnConsume_removeByNotificationKey_wrongBundle_3300 start==================>"); - console.info("================OnConsume_3300 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_3300 err: =======================>" + JSON.stringify(err)); + function OnConsumeRemoveByNotificationKeyWrongBundle(data) { + console.info("==============ANS_Remove_3300 onConsume start===============>"); + console.info("==============ANS_Remove_3300 onConsume data:===============>" + JSON.stringify(data)); var bundleOption = { bundle:"wrongBundleName", uid:0, @@ -2738,22 +2709,21 @@ describe('ActsAnsNotificationRemove', function () { label:"3300" } notify.remove(bundleOption,notificationKey,removeByNotificationKeyCBWrongBundle); - console.info("================OnConsume_3300 remove=======================>"); - console.info("================OnConsume_removeByNotificationKey_wrongBundle_3300 end=====================>"); + console.info("==============ANS_Remove_3300 onConsume remove===============>"); + console.info("==============ANS_Remove_3300 onConsume end==================>"); } - function OnCancelRemoveByNotificationKeyWrongBundle(err, data) { - console.info("OnCancel_removeByNotificationKey_wrongBundle_3300 start==========>"); - console.info("OnCancel_removeByNotificationKey_wrongBundle_3300 err:============>" + JSON.stringify(err)); - console.info("OnCancel_removeByNotificationKey_wrongBundle_3300 data:===========>" + JSON.stringify(data)); + function OnCancelRemoveByNotificationKeyWrongBundle(data) { + console.info("==============ANS_Remove_3300 onCancel start=============>"); + console.info("==============ANS_Remove_3300 onCancel data:===========>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeByNotificationKey_wrongBundle_3300 end======================>"); + console.info("==============ANS_Remove_3300 onCancel end=============>"); } function removeByNotificationKeyCBWrongBundle(err, data) { - console.info("================removeByNotificationKeyCB_wrongBundle_3300 start=======================>"); - console.info("removeByNotificationKeyCB_wrongBundle_3300=======================>" + JSON.stringify(err)); - expect(err.code).assertNotEqual(0); - console.info("removeByNotificationKeyCB_wrongBundle_3300=======================>" + JSON.stringify(data)); - console.info("================removeByNotificationKeyCB_wrongBundle_3300 end=======================>"); + console.info("===========ANS_Remove_3300 removeCallback start==========>"); + console.info("===========ANS_Remove_3300 removeCallback err============>" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + console.info("===========ANS_Remove_3300 removeCallback data===========>" + JSON.stringify(data)); + console.info("===========ANS_Remove_3300 removeCallback end============>"); } /* @@ -2764,13 +2734,13 @@ describe('ActsAnsNotificationRemove', function () { * NotificationKey wrong bundleOption,correct notificationKey. */ it('ANS_Remove_3300', 0, async function (done) { - console.info("===============ANS_Remove_3300==========================>"); + console.info("===============ANS_Remove_3300 start==========================>"); var subscriber ={ onConsume:OnConsumeRemoveByNotificationKeyWrongBundle, onCancel:OnCancelRemoveByNotificationKeyWrongBundle, } await notify.subscribe(subscriber); - console.info("==================subscribe_3300_promise==================>"); + console.info("================ANS_Remove_3300 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2802,19 +2772,19 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3300_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3300_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3300 done==================>"); - }),1000); + console.info("================ANS_Remove_3300 publish promise=================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3300 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3300 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveByNotificationKeyWrongBundlePromise(err, data) { - console.info("================OnConsume_removeByNotificationKey_wrongBundle_promise_3400 start============>"); - console.info("================OnConsume_3400 data: =======================>" + JSON.stringify(data)); - console.info("================OnConsume_3400 err: =======================>" + JSON.stringify(err)); + function onConsumeRemoveByNotificationKeyWrongBundlePromise(data) { + console.info("===========ANS_Remove_3400 onConsume start============>"); + console.info("===========ANS_Remove_3400 onConsume data:============>" + JSON.stringify(data)); var bundleOption = { bundle:"wrongBundleName", uid:0, @@ -2824,15 +2794,14 @@ describe('ActsAnsNotificationRemove', function () { label:"3400" } notify.remove(bundleOption, notificationKey) - console.info("================removeByNotificationKey_wrongBundle_promise_3400 end=====================>"); - console.info("================OnConsume_removeByNotificationKey_wrongBundle_promise_3400 end==============>"); + console.info("===========ANS_Remove_3400 onConsume remove=========>"); + console.info("===========ANS_Remove_3400 onConsume end============>"); } - function onCancelRemoveByNotificationKeyWrongBundlePromise(err, data) { - console.info("================OnCancel_removeByNotificationKey_wrongBundle_promise_3400 start=============>"); - console.info("================OnCancel_3400 err: =======================>" + JSON.stringify(err)); - console.info("================OnCancel_3400 data: =======================>" + JSON.stringify(data)); + function onCancelRemoveByNotificationKeyWrongBundlePromise(data) { + console.info("===========ANS_Remove_3400 onCancel start=============>"); + console.info("===========ANS_Remove_3400 onCancel data: ============>" + JSON.stringify(data)); expect().assertFail(); - console.info("================OnCancel_removeByNotificationKey_wrongBundle_promise_3400 end================>"); + console.info("===========ANS_Remove_3400 onCancel end===============>"); } /* @@ -2843,13 +2812,13 @@ describe('ActsAnsNotificationRemove', function () { * bundleOption,wrong notificationKey. */ it('ANS_Remove_3400', 0, async function (done) { - console.info("===============ANS_Remove_3400==========================>"); + console.info("===============ANS_Remove_3400 start==========================>"); var subscriber ={ onConsume:onConsumeRemoveByNotificationKeyWrongBundlePromise, onCancel:onCancelRemoveByNotificationKeyWrongBundlePromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_3400_promise==================>"); + console.info("============ANS_Remove_3400 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2881,27 +2850,28 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3400_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3400_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3400 done==================>"); - }),1000); + console.info("============ANS_Remove_3400 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3400 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3400 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) function removeByNotificationKey2Times2CB(err,data) { - console.info("================removeByNotificationKey2Times2CB_3500 start=======================>"); - console.info("================removeByNotificationKey2Times2CB_3500 err==============>" + JSON.stringify(err)); - console.info("================removeByNotificationKey2Times2CB_3500 data============>" + JSON.stringify(data)); - expect(err.code).assertNotEqual(0); - console.info("================removeByNotificationKey2Times2CB_3500 end=======================>"); + console.info("==========ANS_Remove_3500 removeCallback2Times2 start============>"); + console.info("==========ANS_Remove_3500 removeCallback2Times2 err==============>" + JSON.stringify(err)); + console.info("==========ANS_Remove_3500 removeCallback2Times2 data============>" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + console.info("==========ANS_Remove_3500 removeCallback2Times2 end================>"); } function removeByNotificationKey2Times1CB(err,data) { - console.info("================removeByNotificationKey2Times1CB_3500 start=======================>"); - console.info("================removeByNotificationKey2Times1CB_3500 err==============>" + JSON.stringify(err)); - console.info("================removeByNotificationKey2Times1CB_3500 data============>" + JSON.stringify(data)); - expect(err.code).assertequal(0); + console.info("==========ANS_Remove_3500 removeCallback2Times1 start===========>"); + console.info("==========ANS_Remove_3500 removeCallback2Times1 err=============>" + JSON.stringify(err)); + console.info("==========ANS_Remove_3500 removeCallback2Times1 data============>" + JSON.stringify(data)); + expect(err.code).assertEqual(0); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -2911,12 +2881,12 @@ describe('ActsAnsNotificationRemove', function () { label:"3500" } notify.remove(bundleOption,notificationKey,removeByNotificationKey2Times2CB); - console.info("================removeByNotificationKey2Times1CB_3500 removeCallBack2TimesOf2===============>"); - console.info("================removeByNotificationKey2Times1CB_3500 end=======================>"); + console.info("==========ANS_Remove_3500 removeCallback2Times1 remove===========>"); + console.info("==========ANS_Remove_3500 removeCallback2Times1 end==============>"); } - function onConsumeRemoveByNotificationKey2Times(err, data) { - console.info("================OnConsume_removeByNotificationKey2Times_3500 start=======================>"); - console.info("================OnConsume_3500 data: ========>" + JSON.stringify(data)); + function onConsumeRemoveByNotificationKey2Times(data) { + console.info("=========ANS_Remove_3500 onConsume start=======================>"); + console.info("=========ANS_Remove_3500 onConsume data:=========>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -2926,22 +2896,21 @@ describe('ActsAnsNotificationRemove', function () { label:"3500" } notify.remove(bundleOption,notificationKey,removeByNotificationKey2Times1CB); - console.info("================OnConsume_removeByNotificationKey2Times_3500 remove=======================>"); - console.info("================OnConsume_removeByNotificationKey2Times_3500 end=======================>"); + console.info("=========ANS_Remove_3500 onConsume remove==============>"); + console.info("=========ANS_Remove_3500 onConsume end=================>"); } var timesOfOnCancelRemoveByNotificationKey2Times - function onCancelRemoveByNotificationKey2Times(err, data) { + function onCancelRemoveByNotificationKey2Times(data) { timesOfOnCancelRemoveByNotificationKey2Times = timesOfOnCancelRemoveByNotificationKey2Times + 1 - console.info("================OnCancelCallback_removeAll2Times_2700 start=======================>"); - console.info("================OnCancelCallback_removeAll2Times_2700 data : ========>" + JSON.stringify(data)); - console.info("================OnCancelCallback_removeAll2Times_2700 err : =======>" + JSON.stringify(err)); + console.info("=========ANS_Remove_3500 onCancel start===============>"); + console.info("=========ANS_Remove_3500 onCancel data : ========>" + JSON.stringify(data)); if (timesOfOnCancelRemoveByNotificationKey2Times == 1){ - expect(data.request.id).assertequal(35); - expect(data.request.label).assertequal("3500"); + expect(data.request.id).assertEqual(35); + expect(data.request.label).assertEqual("3500"); } else if (timesOfOnCancelRemoveByNotificationKey2Times == 2){ expect().assertFail(); } - console.info("================OnCancelCallback_removeAll2Times_2700 end=======================>"); + console.info("=========ANS_Remove_3500 onCancel end=======================>"); } /* @@ -2951,14 +2920,14 @@ describe('ActsAnsNotificationRemove', function () { * AsyncCallback): void; void; is called twice in a row to delete the notification information */ it('ANS_Remove_3500', 0, async function (done) { - console.info("===============ANS_Remove_3500==========================>"); + console.info("===============ANS_Remove_3500 start==========================>"); timesOfOnCancelRemoveByNotificationKey2Times = 0 var subscriber ={ onConsume:onConsumeRemoveByNotificationKey2Times, onCancel:onCancelRemoveByNotificationKey2Times, } await notify.subscribe(subscriber); - console.info("==================subscribe_3500_promise==================>"); + console.info("===========ANS_Remove_3500 subscribe promise==================>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -2990,18 +2959,19 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3500_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3500_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3500 done==================>"); - }),1000); + console.info("============ANS_Remove_3500 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3500 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3500 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) - function onConsumeRemoveByNotificationKey2TimesPromise(err, data) { - console.info("================OnConsumeCallback_removeByNotificationKey2Times_promise_3600 start===========>"); - console.info("================OnConsumeCallback_3600 data: =======================>" + JSON.stringify(data)); + function onConsumeRemoveByNotificationKey2TimesPromise(data) { + console.info("=========ANS_Remove_3600 onConsume start===========>"); + console.info("=========ANS_Remove_3600 onConsume data: =======================>" + JSON.stringify(data)); var bundleOption = { bundle:data.request.creatorBundleName, uid:data.request.creatorUid, @@ -3011,24 +2981,23 @@ describe('ActsAnsNotificationRemove', function () { label:"3600" } notify.remove(bundleOption, notificationKey) - console.info("================removeByNotificationKey2Times1_promise_3600 end=======================>"); + console.info("=========ANS_Remove_3600 onConsume remove1===========>"); notify.remove(bundleOption, notificationKey); - console.info("================removeByNotificationKey2Times2_promise_3600 end=====================>"); - console.info("================OnConsumeCallback_removeByNotificationKey2Times_promise_3600 end============>"); + console.info("=========ANS_Remove_3600 onConsume remove2===========>"); + console.info("=========ANS_Remove_3600 onConsume end===========>"); } var timesOnCancelcbRemoveByKey2TimesPromise - function onCancelRemoveByNotificationKey2TimesPromise(err, data) { + function onCancelRemoveByNotificationKey2TimesPromise(data) { timesOnCancelcbRemoveByKey2TimesPromise = timesOnCancelcbRemoveByKey2TimesPromise + 1 - console.info("OnCancelCallback_removeByNotificationKey2Times_promise_3600 start=======================>"); - console.info("OnCancelCallback_removeByNotificationKey2Times_promise_3600 data:====>" + JSON.stringify(data)); - console.info("OnCancelCallback_removeByNotificationKey2Times_promise_3600 err:====>" + JSON.stringify(err)); + console.info("=========ANS_Remove_3600 onCancel start=============>"); + console.info("=========ANS_Remove_3600 onCancel data:=============>" + JSON.stringify(data)); if (timesOnCancelcbRemoveByKey2TimesPromise == 1){ - expect(data.request.id).assertequal(36); - expect(data.request.label).assertequal("3600"); + expect(data.request.id).assertEqual(36); + expect(data.request.label).assertEqual("3600"); } else if (timesOnCancelcbRemoveByKey2TimesPromise == 2){ expect().assertFail(); } - console.info("================OnCancelCallback_removeByNotificationKey2Times_promise_3600 end============>"); + console.info("=========ANS_Remove_3600 onCancel end=============>"); } /* @@ -3038,7 +3007,7 @@ describe('ActsAnsNotificationRemove', function () { * Promise is called twice in a row to delete the notification information */ it('ANS_Remove_3600', 0, async function (done) { - console.info("===============ANS_Remove_3600==========================>"); + console.info("===============ANS_Remove_3600 start==========================>"); timesOnCancelcbRemoveByKey2TimesPromise = 0 timesOnCancelcbRemoveByKey2TimesPromise = 0 var subscriber ={ @@ -3046,7 +3015,7 @@ describe('ActsAnsNotificationRemove', function () { onCancel:onCancelRemoveByNotificationKey2TimesPromise, } await notify.subscribe(subscriber); - console.info("==================subscribe_3600_promise==================>"); + console.info("========ANS_Remove_3600 subscribe promise=============>"); var notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, @@ -3078,12 +3047,13 @@ describe('ActsAnsNotificationRemove', function () { showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================publish_3600_promise==================>"); - await notify.unsubscribe(subscriber); - console.info("==================unsubscribe_3600_promise==================>"); - done(); - setTimeout((function(){ - console.info("==================ANS_Remove_3600 done==================>"); - }),1000); + console.info("============ANS_Remove_3600 publish promise==================>"); + setTimeout((async function(){ + console.info("======ANS_Remove_3600 setTimeout============>"); + await notify.unsubscribe(subscriber); + console.info("======ANS_Remove_3600 setTimeout unsubscribe============>"); + await notify.cancelAll(); + done(); + }),timeout); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/List.test.js index 98ef456533c8363c16c019f1c740933cf5b799ee..28213b642a96aa1eeb9cbca96f91767a18e2b793 100644 --- a/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansnotificationremove/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* -* Copyright (c) 2021 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. -*/ +/* +* Copyright (c) 2021 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. +*/ require('./ActsAnsNotificationRemove.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/BUILD.gn b/notification/ans_standard/actsansslottest/BUILD.gn index 12b17a4c77c8fffe00c8b46c03be1498e08b58ed..1d094bc12bed7cdba8192e9b191524e77f3f35ce 100644 --- a/notification/ans_standard/actsansslottest/BUILD.gn +++ b/notification/ans_standard/actsansslottest/BUILD.gn @@ -17,11 +17,14 @@ group("ActsAnsSlotTest") { testonly = true if (is_standard_system) { deps = [ + "actsansgetslotWithoutadd:ActsAnsGetSlotWithoutAdd", "actsansgetslottestcallback:ActsAnsGetSlotTestCallback", "actsansgetslottestpromise:ActsAnsGetSlotTestPromise", "actsansremoveslottest:ActsAnsRemoveSlotTest", + "actsansremoveslotwithoutadd:ActsAnsRemoveSlotWithoutAdd", #"actsansslotbybundle:ActsAnsSlotByBundle", + #"actsansaddslotsystem:ActsAnsAddSlotSystem", #"actsansslotsystemcallback:ActsAnsSlotSystemCallback", #"actsansslotsystempromise:ActsAnsSlotSystemPromise", #"actsansslottaddremoveall:ActsAnsSlotAddRemoveAll", diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/BUILD.gn b/notification/ans_standard/actsansslottest/actsansaddslotsystem/BUILD.gn old mode 100644 new mode 100755 similarity index 92% rename from notification/ans_standard/publish_test/getactive/getactivenormal/active/BUILD.gn rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/BUILD.gn index e244dcb6447df0f9e15d22c46aad00918c380582..1ee3ed6fbade73e9df09c0fef6e7845331b4af69 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/BUILD.gn +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsGetActiveTest") { +ohos_js_hap_suite("ActsAnsAddSlotSystem") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetActiveTest" + hap_name = "ActsAnsAddSlotSystem" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/activeButton/Test.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/Test.json old mode 100644 new mode 100755 similarity index 77% rename from notification/ans_standard/publish_test/activeButton/Test.json rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/Test.json index d61a931ff2002b8d458f458e11c333ec27a7140d..d06731f8aed4b5df2373e8a4d62c78096132a158 --- a/notification/ans_standard/publish_test/activeButton/Test.json +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.actsansactionbuttontest", + "package": "com.example.actsansaddslotsystem", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "ActsAnsActionButtonTest" + "ActsAnsAddSlotSystem.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 76% rename from notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/config.json index 730f1958ad069e7eb57b45e126249a8fa0fa518e..de49c2158755e7dd161d9370cd06b7b6ca3ee928 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansicontest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansicontest", - "name": ".actsansicontest", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansicontest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansaddslotsystem", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansaddslotsystem", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansaddslotsystem.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 97% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/app.js rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 77% rename from notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.hml index aa3c315a654f57cc17e475108f24b775d5d559d1..c45422b42d0bf788a1c2c0eb299a981f07ce8613 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- contentType + {{title}}
diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000000000000000000000000000000000000..561d77bb99e3cdfcad7a86fcc25f302596c48b80 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 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 file from '@system.file' +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "测试addSlot(slot: NotificationSlot)接口" + }, + onInit() { + this.title = "测试addSlot(slot: NotificationSlot)接口"; + }, + onShow() { + console.info('onShow finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, +} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..d72e9b5082dd736e5edef2041303460fcb5d64f7 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsSlotSystemCallback" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js new file mode 100755 index 0000000000000000000000000000000000000000..b51d0950144ea69b1d8ace2ecf2b690ca52a7ba9 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/ExampleJsunit.test.js @@ -0,0 +1,481 @@ +/* + * Copyright (c) 2021 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 notification from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +const TIMEOUT = 2000; +describe('ActsAnsAddSlotSystem', function () { + + /* + * @tc.number : ActsAnsAddSlotSystem_0100 + * @tc.name : addSlot notification + * @tc.desc : Get the added SOCIAL_COMMUNICATION type slot + */ + it('ActsAnsAddSlotSystem_0100', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0100 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsAddSlotSystem_0100 enter====>"); + console.debug("====>getSlot 0100 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot 0100 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(1); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot ActsAnsAddSlotSystem_0100 err====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) + } + console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); + notification.addSlot( + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SOCIAL_COMMUNICATION_sound", + lightEnabled: true, + lightColor: 1 + }, + (err)=>{ + console.debug("====>addSlot SOCIAL_COMMUNICATION callback====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); + notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, getSlotCallback); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0100====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0200 + * @tc.name : addSlot notification + * @tc.desc : Get the added SERVICE_INFORMATION type slot + */ + it('ActsAnsAddSlotSystem_0200', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0200 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsAddSlotSystem_0200 enter====>"); + console.debug("====>getSlot 0200 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot 0200 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data.desc).assertEqual("slot_SERVICE_INFORMATION_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_SERVICE_INFORMATION_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(2); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot ActsAnsAddSlotSystem_0200 err====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) + } + console.debug("====>addSlot SERVICE_INFORMATION====>"); + notification.addSlot( + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SERVICE_INFORMATION_sound", + lightEnabled: true, + lightColor: 2 + }, + (err)=>{ + console.debug("====>addSlot SERVICE_INFORMATION callback====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.SERVICE_INFORMATION====>"); + notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotCallback); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0200====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0300 + * @tc.name : addSlot notification + * @tc.desc : Get the added CONTENT_INFORMATION type slot + */ + it('ActsAnsAddSlotSystem_0300', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0300 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsAddSlotSystem_0300 enter====>"); + console.debug("====>getSlot 0300 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot 0300 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data.desc).assertEqual("slot_CONTENT_INFORMATION_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_CONTENT_INFORMATION_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(3); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot ActsAnsAddSlotSystem_0300 err====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) + } + console.debug("====>addSlot CONTENT_INFORMATION====>"); + notification.addSlot( + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_CONTENT_INFORMATION_sound", + lightEnabled: true, + lightColor: 3 + }, + (err)=>{ + console.debug("====>addSlot CONTENT_INFORMATION callback====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.CONTENT_INFORMATION====>"); + notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotCallback); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0300====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0400 + * @tc.name : addSlot notification + * @tc.desc : Get the added OTHER_TYPES type slot + */ + it('ActsAnsAddSlotSystem_0400', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0400 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsAddSlotSystem_0400 enter====>"); + console.debug("====>getSlot 0400 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot 0400 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(4); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot ActsAnsAddSlotSystem_0400 err====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) + } + console.debug("====>addSlot OTHER_TYPES====>"); + notification.addSlot( + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound", + lightEnabled: true, + lightColor: 4 + }, + (err)=>{ + console.debug("====>addSlot OTHER_TYPES callback====>"); + expect(err.code).assertEqual(0); + }) + console.debug("====>getSlot SlotType.OTHER_TYPES====>"); + notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallback); + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0400====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0500 + * @tc.name : addSlot notification + * @tc.desc : Get the added UNKNOWN_TYPE type slot + */ + it('ActsAnsAddSlotSystem_0500', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0500 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsAddSlotSystem_0500 enter====>"); + console.debug("====>getSlot 0500 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot 0500 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(4); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot ActsAnsAddSlotSystem_0500 err====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) + } + console.debug("====>addSlot UNKNOWN_TYPE====>"); + await notification.addSlot( + { + type: notification.SlotType.UNKNOWN_TYPE, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound", + lightEnabled: true, + lightColor: 4 + }, + (err)=>{ + console.debug("====>addSlot UNKNOWN_TYPE callback====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.UNKNOWN_TYPE====>"); + notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotCallback); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0500====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0600 + * @tc.name : addSlot notification promise + * @tc.desc : Get the added SOCIAL_COMMUNICATION type slot + */ + it('ActsAnsAddSlotSystem_0600', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0600 start====>"); + console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); + await notification.addSlot( + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SOCIAL_COMMUNICATION_sound", + lightEnabled: true, + lightColor: 1 + }); + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); + var data = await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlot 0600 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(1); + console.debug("====>removeSlot ActsAnsAddSlotSystem_0600 start====>"); + await notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>ActsAnsAddSlotSystem_0600 end====>"); + done(); + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0600====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0700 + * @tc.name : addSlot notification promise + * @tc.desc : Get the added SERVICE_INFORMATION type slot + */ + it('ActsAnsAddSlotSystem_0700', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0700 start====>"); + console.debug("====>addSlot SERVICE_INFORMATION====>"); + await notification.addSlot( + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SERVICE_INFORMATION_sound", + lightEnabled: true, + lightColor: 2 + }); + console.debug("====>getSlot SlotType.SERVICE_INFORMATION====>"); + var data = await notification.getSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlot 0700 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data.desc).assertEqual("slot_SERVICE_INFORMATION_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_SERVICE_INFORMATION_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(2); + console.debug("====>removeSlot ActsAnsAddSlotSystem_0700 start====>"); + await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>ActsAnsAddSlotSystem_0700 end====>"); + done(); + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0700====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0800 + * @tc.name : addSlot notification promise + * @tc.desc : Get the added CONTENT_INFORMATION type slot + */ + it('ActsAnsAddSlotSystem_0800', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0800 start====>"); + console.debug("====>addSlot CONTENT_INFORMATION====>"); + await notification.addSlot( + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_CONTENT_INFORMATION_sound", + lightEnabled: true, + lightColor: 3 + }); + console.debug("====>getSlot SlotType.CONTENT_INFORMATION====>"); + var data = await notification.getSlot(notification.SlotType.CONTENT_INFORMATION); + console.debug("====>getSlot 0800 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data.desc).assertEqual("slot_CONTENT_INFORMATION_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_CONTENT_INFORMATION_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(3); + console.debug("====>removeSlot ActsAnsAddSlotSystem_0800 start====>"); + await notification.removeSlot(notification.SlotType.CONTENT_INFORMATION); + console.debug("====>ActsAnsAddSlotSystem_0800 end====>"); + done(); + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0800====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_0900 + * @tc.name : addSlot notification promise + * @tc.desc : Get the added OTHER_TYPES type slot + */ + it('ActsAnsAddSlotSystem_0900', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_0900 start====>"); + console.debug("====>addSlot OTHER_TYPES====>"); + notification.addSlot( + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound", + lightEnabled: true, + lightColor: 4 + }) + console.debug("====>getSlot SlotType.OTHER_TYPES====>"); + var data = await notification.getSlot(notification.SlotType.OTHER_TYPES); + console.debug("====>getSlot 0900 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(4); + console.debug("====>removeSlot ActsAnsAddSlotSystem_0900 start====>"); + await notification.removeSlot(notification.SlotType.OTHER_TYPES); + console.debug("====>ActsAnsAddSlotSystem_0900 end====>"); + done(); + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_0900====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsAddSlotSystem_1000 + * @tc.name : addSlot notification promise + * @tc.desc : Get the added UNKNOWN_TYPE type slot + */ + it('ActsAnsAddSlotSystem_1000', 0, async function (done) { + console.debug("====>ActsAnsAddSlotSystem_1000 start====>"); + console.debug("====>addSlot UNKNOWN_TYPE====>"); + await notification.addSlot( + { + type: notification.SlotType.UNKNOWN_TYPE, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound", + lightEnabled: true, + lightColor: 4 + }); + console.debug("====>getSlot SlotType.UNKNOWN_TYPE====>"); + var data = await notification.getSlot(notification.SlotType.UNKNOWN_TYPE); + console.debug("====>getSlot enter====>"); + console.debug("====>getSlot data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(4); + console.debug("====>removeSlot ActsAnsAddSlotSystem_1000 start====>"); + await notification.removeSlot(notification.SlotType.OTHER_TYPES); + console.debug("====>ActsAnsAddSlotSystem_1000 end====>"); + done(); + setTimeout(function(){ + console.debug("====>time out ActsAnsAddSlotSystem_1000====>"); + }, TIMEOUT); + }) +}) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/List.test.js new file mode 100755 index 0000000000000000000000000000000000000000..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansaddslotsystem/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansaddslotsystem/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b rename to notification/ans_standard/actsansslottest/actsansaddslotsystem/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/BUILD.gn b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/BUILD.gn old mode 100644 new mode 100755 similarity index 92% rename from notification/ans_standard/publish_test/getactive/getactivenormal/publish/BUILD.gn rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/BUILD.gn index 1ce0eb7222a98988859964c7ea8995c7983a8333..7277fabc2a301265813d87802a9dd2d7281fba5b --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/BUILD.gn +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsActivePublishTest") { +ohos_js_hap_suite("ActsAnsGetSlotWithoutAdd") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsActivePublishTest" + hap_name = "ActsAnsGetSlotWithoutAdd" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/Test.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/Test.json old mode 100644 new mode 100755 similarity index 76% rename from notification/ans_standard/publish_test/getactive/getactivenormal/publish/Test.json rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/Test.json index b976ad835e251ed2b9d50a68b95153b58d6332bd..b64f11bb9f065f4638a92454589c08eb4d94ce2e --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/Test.json +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.actsansactivepublishtest", + "package": "com.example.actsansgetslotwithoutadd", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "ActsAnsActivePublishTest.hap" + "ActsAnsGetSlotWithoutAdd.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/notification/ans_standard/publishicontest/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 76% rename from notification/ans_standard/publishicontest/entry/src/main/config.json rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/config.json index 730f1958ad069e7eb57b45e126249a8fa0fa518e..d743a79975b957d5ee1e2e1cd28069a2cdea35a0 --- a/notification/ans_standard/publishicontest/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansicontest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansicontest", - "name": ".actsansicontest", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansicontest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansgetslotwithoutadd", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansgetslotwithoutadd", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansgetslotwithoutadd.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 97% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/app.js rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 76% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.hml index 485c1ea4f2631a1045e84574a6e492429c6152db..c45422b42d0bf788a1c2c0eb299a981f07ce8613 --- a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- activeButton + {{title}}
diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000000000000000000000000000000000000..70a7f59612a57e7922635da3eb9a45611f2c4480 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 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 file from '@system.file' +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "测试GetSlot接口" + }, + onInit() { + this.title = "测试GetSlot接口"; + }, + onShow() { + console.info('onShow finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, +} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..754b2f285a7e24f9f6bac79868bd9cff48810575 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsSlotSystemPromise" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/test/ExampleJsunit.test.js new file mode 100755 index 0000000000000000000000000000000000000000..5f228023b6669cd5f5092d0eea6dd8370d9938a2 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/test/ExampleJsunit.test.js @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2021 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 notification from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +const TIMEOUT = 2000; +describe('ActsAnsGetSlotWithoutAdd', function () { + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0100 + * @tc.name : getSlot by type callback + * @tc.desc : Get the SOCIAL_COMMUNICATION type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0100', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0100 start====>"); + function getSlotCallback(err, data) { + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0100 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0100 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0100 data:" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>getSlot callback SlotType.SOCIAL_COMMUNICATION====>"); + await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, getSlotCallback); + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0100====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0200 + * @tc.name : getSlot by type callback + * @tc.desc : Get the SERVICE_INFORMATION type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0200', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0200 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0200 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0200 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0200 data:" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>getSlot callback SlotType.SERVICE_INFORMATION====>"); + await notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotCallback); + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0200====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0300 + * @tc.name : getSlot by type callback + * @tc.desc : Get the CONTENT_INFORMATION type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0300', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0300 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0300 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0300 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0300 data:" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>getSlot callback SlotType.CONTENT_INFORMATION====>"); + await notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotCallback); + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0300====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0400 + * @tc.name : getSlot by type callback + * @tc.desc : Get the OTHER_TYPES type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0400', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0400 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0400 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0400 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0400 data:" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>getSlot callback SlotType.OTHER_TYPES====>"); + await notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallback); + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0400====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0500 + * @tc.name : getSlot by type callback + * @tc.desc : Get the UNKNOWN_TYPE type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0500', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0500 start====>"); + function getSlotCallback(err, data) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0500 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0500 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0500 data:" + JSON.stringify(data)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>getSlot callback SlotType.UNKNOWN_TYPE====>"); + await notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotCallback); + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0500====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0600 + * @tc.name : getSlot by type promise + * @tc.desc : Get the SOCIAL_COMMUNICATION type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0600', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0600 start====>"); + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); + notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION).then((data)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0600 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0600 err:" + JSON.stringify(err)); + console.debug("====>ActsAnsGetSlotWithoutAdd_0600 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0600====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0700 + * @tc.name : getSlot by type promise + * @tc.desc : Get the SERVICE_INFORMATION type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0700', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0700 start====>"); + console.debug("====>getSlot SlotType.SERVICE_INFORMATION====>"); + notification.getSlot(notification.SlotType.SERVICE_INFORMATION).then((data)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0700 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0700 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0700 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0700====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0800 + * @tc.name : getSlot by type promise + * @tc.desc : Get the UNKNOWN_TYPE type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0800', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0800 start====>"); + console.debug("====>getSlot SlotType.UNKNOWN_TYPE====>"); + notification.getSlot(notification.SlotType.UNKNOWN_TYPE).then((data)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0800 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0800 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0800 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0800====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_0900 + * @tc.name : getSlot by type promise + * @tc.desc : Get the OTHER_TYPES type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_0900', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_0900 start====>"); + console.debug("====>getSlot SlotType.OTHER_TYPES====>"); + notification.getSlot(notification.SlotType.OTHER_TYPES).then((data)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0900 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0900 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0900 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_0900====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsGetSlotWithoutAdd_1000 + * @tc.name : getSlot by type promise + * @tc.desc : Get the CONTENT_INFORMATION type slot without adding + */ + it('ActsAnsGetSlotWithoutAdd_1000', 0, async function (done) { + console.debug("====>ActsAnsGetSlotWithoutAdd_1000 start====>"); + console.debug("====>getSlot SlotType.CONTENT_INFORMATION====>"); + notification.getSlot(notification.SlotType.CONTENT_INFORMATION).then((data)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_1000 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_1000 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_1000 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsGetSlotWithoutAdd_1000====>"); + }, TIMEOUT); + }) +}) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/test/List.test.js new file mode 100755 index 0000000000000000000000000000000000000000..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/signature/openharmony_sx.p7b rename to notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/BUILD.gn b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/Test.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/Test.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/config.json old mode 100644 new mode 100755 index bc71a4bea29edf7f311968463265cdf7585bfff6..8c933d0f3ffecaa6ea148efc1c51f65557464597 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansgetslottestcallback", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetslottestcallback", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetslottestcallback.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansgetslottestcallback", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansgetslottestcallback", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansgetslottestcallback.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index 67104a206159f75558a60caef0d1e9a45339241e..cfaa70be46a80c033dcc40adce8cb3887de27e21 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试GetSlot接口:callback形式" }, onInit() { - this.title = this.data.title; + this.title = "测试GetSlot接口:callback形式"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index d40392d3a9296eddd46d6dd8e3fcd2a5258201f7..9be230df7c8e641f849504b9dc5065d9e392c04a --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsGetSlotTestCallback" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsGetSlotTestCallback" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 09fb5edb0c952e6ce4d3a24396c34bfb7c3d4d72..c866e237b32ca866c5f7139729f101a6783fb9cd --- 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 @@ -15,38 +15,10 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +const TIMEOUT = 2000; +const SOUNDURL = "file://system/etc/Light.ogg"; describe('ActsAnsGetSlotTestCallback', function () { - function addSlotActsAnsGetSlotTestCallbackFirst(err){ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0100 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0100 err: ====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0100 finish====>"); - } - function addSlotActsAnsGetSlotTestCallbackSecond(err, data){ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0200 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0200 err: ====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0200 finish====>"); - } - function addSlotActsAnsGetSlotTestCallbackThird(err){ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 err: ====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 finish====>"); - } - function addSlotActsAnsGetSlotTestCallbackFourth(err){ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 err: ====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 finish====>"); - } - function addSlotActsAnsGetSlotTestCallbackFifth(err){ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 err: ====>" + JSON.stringify(err)); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 finish====>"); - } - /* * @tc.number : ActsAnsGetSlotTestCallback_0100 * @tc.name : Verify getSlot SOCIAL_COMMUNICATION @@ -54,30 +26,38 @@ describe('ActsAnsGetSlotTestCallback', function () { */ it('ActsAnsGetSlotTestCallback_0100', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestCallback_0100 start====>"); - console.debug("====>addSlot SlotType.SOCIAL_COMMUNICATION: ====>"); - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION, addSlotActsAnsGetSlotTestCallbackFirst); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION: ====>"); - await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, function (err, data){ - console.debug("====>getSlotActsAnsGetSlotTestCallback_0100 enter====>"); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0100 err====>" + JSON.stringify(err)); + console.debug("====>addSlot SlotType.SOCIAL_COMMUNICATION start====>"); + notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>addSlot 0100 enter====>"); + console.debug("====>addSlot 0100 err:" + JSON.stringify(err)); 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(4); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0100 finish====>"); - done(); + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION start====>"); + notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data)=>{ + console.debug("====>getSlot 0100 enter====>"); + console.debug("====>getSlot 0100 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0100 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data.level).assertEqual(4); + expect(data.desc).assertEqual(""); + expect(data.badgeFlag).assertEqual(true); + expect(data.bypassDnd).assertEqual(false); + expect(data.lockscreenVisibility).assertEqual(2); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual(SOUNDURL); + expect(data.lightEnabled).assertEqual(false); + expect(data.lightColor).assertEqual(0); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0100 finish====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION enter====>"); + expect(err.code).assertEqual(0); + done(); + }) + }); }); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestCallback_0100====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -87,11 +67,11 @@ describe('ActsAnsGetSlotTestCallback', function () { */ it('ActsAnsGetSlotTestCallback_0200', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestCallback_0200 start====>"); - function getSlotActsAnsGetSlotTestCallbackSecond(err, data) { - console.debug("====>getSlotActsAnsGetSlotTestCallback_0200 enter====>"); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0200 err====>" + JSON.stringify(err)); + function getSlotCallbackSecond(err, data) { + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 err:" + JSON.stringify(err)); expect(err.code).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0200 data====>" + JSON.stringify(data)); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); expect(data.level).assertEqual(3); expect(data.desc).assertEqual(""); @@ -99,19 +79,27 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(data.bypassDnd).assertEqual(false); expect(data.lockscreenVisibility).assertEqual(2); expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(""); + expect(data.sound).assertEqual(SOUNDURL); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0200 finish====>"); - done(); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 finish====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION enter====>"); + expect(err.code).assertEqual(0); + done(); + }) } - console.debug("====>addSlot SlotType.SERVICE_INFORMATION: ====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION, addSlotActsAnsGetSlotTestCallbackSecond); - console.debug("====>getSlot SlotType.SERVICE_INFORMATION: ====>"); - await notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotActsAnsGetSlotTestCallbackSecond); + console.debug("====>addSlot SlotType.SERVICE_INFORMATION start====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>addSlot ActsAnsGetSlotTestCallback_0200 enter====>"); + console.debug("====>addSlot ActsAnsGetSlotTestCallback_0200 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.SERVICE_INFORMATION start====>"); + notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotCallbackSecond); + }); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestCallback_0200====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -121,11 +109,11 @@ describe('ActsAnsGetSlotTestCallback', function () { */ it('ActsAnsGetSlotTestCallback_0300', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestCallback_0300 start====>"); - function getSlotActsAnsGetSlotTestCallbackThird(err, data) { - console.debug("====>getSlotActsAnsGetSlotTestCallback_0300 enter====>"); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0300 err====>" + JSON.stringify(err)); + function getSlotCallbackThird(err, data) { + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 err:" + JSON.stringify(err)); expect(err.code).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0300 data====>" + JSON.stringify(data)); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); expect(data.level).assertEqual(2); expect(data.desc).assertEqual(""); @@ -136,16 +124,24 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(data.sound).assertEqual(""); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0300 finish====>"); - done(); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 finish====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION enter====>"); + expect(err.code).assertEqual(0); + done(); + }) } - console.debug("====>addSlot SlotType.CONTENT_INFORMATION: ====>"); - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION, addSlotActsAnsGetSlotTestCallbackThird); - console.debug("====>getSlot SlotType.CONTENT_INFORMATION: ====>"); - await notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotActsAnsGetSlotTestCallbackThird); + console.debug("====>addSlot SlotType.CONTENT_INFORMATION start====>"); + notification.addSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 enter====>"); + console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.CONTENT_INFORMATION start====>"); + notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotCallbackThird); + }); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestCallback_0300====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -155,11 +151,11 @@ describe('ActsAnsGetSlotTestCallback', function () { */ it('ActsAnsGetSlotTestCallback_0400', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestCallback_0400 start====>"); - function getSlotActsAnsGetSlotTestCallbackFourth(err, data) { - console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 enter====>"); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 err====>" + JSON.stringify(err)); + function getSlotCallbackFourth(err, data) { + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0400 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0400 err:" + JSON.stringify(err)); expect(err.code).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 data====>" + JSON.stringify(data)); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0400 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); @@ -171,15 +167,23 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 finish====>"); - done(); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES enter====>"); + expect(err.code).assertEqual(0); + done(); + }) } - console.debug("====>addSlot SlotType.OTHER_TYPES: ====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES, addSlotActsAnsGetSlotTestCallbackFourth); - console.debug("====>getSlot SlotType.OTHER_TYPES: ====>"); - await notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotActsAnsGetSlotTestCallbackFourth); + console.debug("====>addSlot SlotType.OTHER_TYPES start====>"); + notification.addSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 enter====>"); + console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.OTHER_TYPES start====>"); + notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallbackFourth); + }); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestCallback_0400====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -189,11 +193,11 @@ describe('ActsAnsGetSlotTestCallback', function () { */ it('ActsAnsGetSlotTestCallback_0500', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestCallback_0500 start====>"); - function getSlotActsAnsGetSlotTestCallbackFifth(err, data) { - console.debug("====>getSlotActsAnsGetSlotTestCallback_0500 enter====>"); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0500 err====>" + JSON.stringify(err)); + function getSlotCallbackFifth(err, data) { + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 err:" + JSON.stringify(err)); expect(err.code).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0500 data====>" + JSON.stringify(data)); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); @@ -204,15 +208,23 @@ describe('ActsAnsGetSlotTestCallback', function () { expect(data.sound).assertEqual(""); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0500 finish====>"); - done(); + console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 finish====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES enter====>"); + expect(err.code).assertEqual(0); + done(); + }) } - console.debug("====>addSlot SlotType.UNKNOWN_TYPE: ====>"); - await notification.addSlot(notification.SlotType.UNKNOWN_TYPE, addSlotActsAnsGetSlotTestCallbackFifth); - console.debug("====>getSlot SlotType.UNKNOWN_TYPE: ====>"); - await notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotActsAnsGetSlotTestCallbackFifth); + console.debug("====>addSlot SlotType.UNKNOWN_TYPE start====>"); + notification.addSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 enter====>"); + console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlot SlotType.UNKNOWN_TYPE start====>"); + notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotCallbackFifth); + }); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestCallback_0500====>"); - }, 1000); + }, TIMEOUT); }) -}) \ No newline at end of file +}) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/BUILD.gn b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/Test.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/Test.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/config.json old mode 100644 new mode 100755 index e1ff8d1dcfc788b2957cea6155e63c1249258454..de893cf8809f0686d7ef4645bbbf3301bc6d5326 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansgetslottestpromise", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetslottestpromise", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetslottestpromise.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansgetslottestpromise", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansgetslottestpromise", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansgetslottestpromise.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index ed9307d28dfb20ec4b37bc44fa57e42eb5bca0e5..5b46b75d8b03daa20a4a43fd41d24f7bd5409a17 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试GetSlot接口:promise形式" }, onInit() { - this.title = this.data.title; + this.title = "测试GetSlot接口:promise形式"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index dbb877ef34c369d57448c80a72ffdd818b2537a8..2bdfb7ef812eeb2cd3b2b80f1acf99546a6749d2 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsGetSlotTestPromise" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsGetSlotTestPromise" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 52d839f55eaaea90f0bc557f7851e33a3da1d8c1..18c93b4f79cc4da08b20be56b467cb1017807656 --- 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 @@ -15,6 +15,8 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +const TIMEOUT = 2000; +const SOUNDURL = "file://system/etc/Light.ogg"; describe('ActsAnsGetSlotTestPromise', function () { /* @@ -24,13 +26,19 @@ describe('ActsAnsGetSlotTestPromise', function () { */ it('ActsAnsGetSlotTestPromise_0100', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestPromise_0100 start====>"); - notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION).then(() => { - console.debug("====>addSlotActsAnsGetSlotTestPromise_0100 enter====>"); - }) - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION: ====>"); + console.debug("====>addSlot SlotType.SOCIAL_COMMUNICATION start====>"); + try{ + await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); + } + catch(err){ + console.error("====>addSlotActsAnsGetSlotTestPromise_0100 err:" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION start====>"); notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION).then((data) => { - console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 enter====>"); - console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 data====>" + JSON.stringify(data)); + console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 enter====>"); + console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); expect(data.level).assertEqual(4); expect(data.desc).assertEqual(""); @@ -38,16 +46,20 @@ describe('ActsAnsGetSlotTestPromise', function () { expect(data.bypassDnd).assertEqual(false); expect(data.lockscreenVisibility).assertEqual(2); expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(""); + expect(data.sound).assertEqual(SOUNDURL); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 finish====>"); - done(); + console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 finish====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>ActsAnsGetSlotTestPromise_0100 end====>"); + done(); + }) }) - console.debug("====>ActsAnsGetSlotTestPromise_0100 end====>"); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestPromise_0100====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -57,13 +69,19 @@ describe('ActsAnsGetSlotTestPromise', function () { */ it('ActsAnsGetSlotTestPromise_0200', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestPromise_0200 start====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION).then(() => { - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 enter"); - }) - console.debug("====>getSlot SlotType.SERVICE_INFORMATION: ====>"); + console.debug("====>addSlot SlotType.SERVICE_INFORMATION start====>"); + try{ + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + } + catch(err){ + console.error("====>addSlot ActsAnsGetSlotTestPromise_0200 err:" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>getSlot SlotType.SERVICE_INFORMATION start====>"); notification.getSlot(notification.SlotType.SERVICE_INFORMATION).then((data) => { - console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 enter====>"); - console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0200 data====>" + JSON.stringify(data)); + console.debug("====>getSlot Promise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 enter====>"); + console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0200 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); expect(data.level).assertEqual(3); expect(data.desc).assertEqual(""); @@ -71,16 +89,20 @@ describe('ActsAnsGetSlotTestPromise', function () { expect(data.bypassDnd).assertEqual(false); expect(data.lockscreenVisibility).assertEqual(2); expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(""); + expect(data.sound).assertEqual(SOUNDURL); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 finish====>"); - done(); + console.debug("====>getSlot Promise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 finish====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>ActsAnsGetSlotTestPromise_0200 end====>"); + done(); + }) }) - console.debug("====>ActsAnsGetSlotTestPromise_0200 end====>"); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestPromise_0200====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -90,14 +112,19 @@ describe('ActsAnsGetSlotTestPromise', function () { */ it('ActsAnsGetSlotTestPromise_0300', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestPromise_0300 Promise start====>"); - console.debug("====>addSlot SlotType.CONTENT_INFORMATION: ====>"); - notification.addSlot(notification.SlotType.CONTENT_INFORMATION).then(() => { - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 enter"); - }) - console.debug("====>getSlot SlotType.CONTENT_INFORMATION: ====>"); + console.debug("====>addSlot SlotType.CONTENT_INFORMATION start====>"); + try{ + await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); + } + catch(err){ + console.error("====>addSlot ActsAnsGetSlotTestPromise_0300 err:" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>getSlot SlotType.CONTENT_INFORMATION start====>"); notification.getSlot(notification.SlotType.CONTENT_INFORMATION).then((data) => { - console.debug("====>getSlotPromise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 enter====>"); - console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0300 data====>" + JSON.stringify(data)); + console.debug("====>getSlot Promise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 enter====>"); + console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0300 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); expect(data.level).assertEqual(2); expect(data.desc).assertEqual(""); @@ -108,13 +135,17 @@ describe('ActsAnsGetSlotTestPromise', function () { expect(data.sound).assertEqual(""); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotPromise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 finish====>"); - done(); + console.debug("====>getSlot Promise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 finish====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) }) console.info("====>ActsAnsGetSlotTestPromise_0300 end====>"); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestPromise_0300====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -124,14 +155,19 @@ describe('ActsAnsGetSlotTestPromise', function () { */ it('ActsAnsGetSlotTestPromise_0400', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestPromise_0400 start====>"); - console.debug("====>addSlot SlotType.OTHER_TYPES: ====>"); - notification.addSlot(notification.SlotType.OTHER_TYPES).then(() => { - console.debug("====>addSlotByTypePromise AnsGetSlotByTypeAfterAddPromiseTest_0400 enter====>"); - }) - console.debug("====>getSlot SlotType.OTHER_TYPES: ====>"); + console.debug("====>addSlot SlotType.OTHER_TYPES start====>"); + try{ + await notification.addSlot(notification.SlotType.OTHER_TYPES); + } + catch(err){ + console.error("====>addSlot ActsAnsGetSlotTestPromise_0400 err:" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>getSlot SlotType.OTHER_TYPES start====>"); notification.getSlot(notification.SlotType.OTHER_TYPES).then((data) => { - console.debug("====>getSlotPromise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 enter====>"); - console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0400 data====>" + JSON.stringify(data)); + console.debug("====>getSlot Promise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 enter====>"); + console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0400 data====>" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); @@ -142,13 +178,17 @@ describe('ActsAnsGetSlotTestPromise', function () { expect(data.sound).assertEqual(""); expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotPromise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 finish====>"); - done(); + console.debug("====>getSlot Promise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 finish====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) }) console.debug("====>ActsAnsGetSlotTestPromise_0400 end====>"); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestPromise_0400====>"); - }, 1000); + }, TIMEOUT); }) /* @@ -158,14 +198,19 @@ describe('ActsAnsGetSlotTestPromise', function () { */ it('ActsAnsGetSlotTestPromise_0500', 0, async function (done) { console.debug("====>ActsAnsGetSlotTestPromise_0500 start====>"); - console.debug("====>addSlot SlotType.UNKNOWN_TYPE: ====>"); - notification.addSlot(notification.SlotType.UNKNOWN_TYPE).then(() => { - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 enter====>"); - }) - console.debug("====>getSlot SlotType.UNKNOWN_TYPE: ====>"); + console.debug("====>addSlot SlotType.UNKNOWN_TYPE start====>"); + try{ + await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); + } + catch(err){ + console.error("====>addSlot ActsAnsGetSlotTestPromise_0500 err:" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>getSlot SlotType.UNKNOWN_TYPE start====>"); notification.getSlot(notification.SlotType.UNKNOWN_TYPE).then((data) => { - console.debug("====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 enter====>"); - console.debug("====>getSlotPromise ActsAnsGetSlotTestPromise_0500 data====>" + JSON.stringify(data)); + console.debug("====>getSlot Promise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 enter====>"); + console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0500 data:" + JSON.stringify(data)); expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); expect(data.level).assertEqual(1); expect(data.desc).assertEqual(""); @@ -177,11 +222,15 @@ describe('ActsAnsGetSlotTestPromise', function () { expect(data.lightEnabled).assertEqual(false); expect(data.lightColor).assertEqual(0); console.debug("====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 finish====>"); - done(); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) }) console.debug("====>ActsAnsGetSlotTestPromise_0500 end====>"); setTimeout(function(){ console.debug("====>time out ActsAnsGetSlotTestPromise_0500====>"); - }, 1000); + }, TIMEOUT); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/BUILD.gn b/notification/ans_standard/actsansslottest/actsansremoveslottest/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/Test.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/Test.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/config.json old mode 100644 new mode 100755 index 564829ee24c3c51354bd5c7fe416e3055f99e45a..e7cd8196229dfa61be6a7c1e30cd8ece55c7dea0 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansremoveslottest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansremoveslottest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansremoveslottest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansremoveslottest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansremoveslottest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansremoveslottest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index 81bdb39b76a5c664ff9a6319d39e16459c021a4b..0fc4a41cad1e406f1b953497e020c972f9fb2982 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试RemoveSlot接口" }, onInit() { - this.title = this.data.title; + this.title = "测试RemoveSlot接口"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 3fa5dacb29c76262853ba0fc48b55db12ea9f68b..81f19cbc815934626101d0c57459578c417129c4 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsRemoveSlotTest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsRemoveSlotTest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 1f25c347ea2b28b92618f28e8a8f7c42eddab325..403e67f05c1d865f9be30a3e8e1bfc69b4c0ecc3 --- 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 @@ -15,44 +15,44 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +const TIMEOUT = 3000; +const SOUNDURL = "file://system/etc/Light.ogg"; describe('ActsAnsRemoveSlotTest', function () { /* * @tc.number : ActsAnsRemoveSlotTest_0100 - * @tc.name : Verify that the slot is removed twice - * @tc.desc : Remove the added slot and then remove it again + * @tc.name : Verify that the slot is removed twice callback + * @tc.desc : Remove the added SOCIAL_COMMUNICATION slot and then remove it again */ it('ActsAnsRemoveSlotTest_0100', 0, async function (done) { console.debug("====>ActsAnsRemoveSlotTest_0100 start====>"); - notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION).then(() => { - console.debug("====>addSlotActsAnsGetSlotTestPromise_0100 enter====>"); - }) - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION: ====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION).then((data) => { - 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(4); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestPromise_0100 finish====>"); - }) + console.debug("====>addSlot ActsAnsRemoveSlotTest_0100 start====>"); + await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION start====>"); + var data = await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 enter====>"); + console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 data====>" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data.level).assertEqual(4); + expect(data.desc).assertEqual(""); + expect(data.badgeFlag).assertEqual(true); + expect(data.bypassDnd).assertEqual(false); + expect(data.lockscreenVisibility).assertEqual(2); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual(SOUNDURL); + expect(data.lightEnabled).assertEqual(false); + expect(data.lightColor).assertEqual(0); + console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 finish====>"); notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ console.debug("====>removeSlot first time callback err====>" + JSON.stringify(err)); expect(err.code).assertEqual(0); notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data)=>{ - console.debug("====>second getSlot enter====>"); - console.debug("====>second getSlot enter err====>" + JSON.stringify(err)); + console.debug("====>getSlot second time enter====>"); + console.debug("====>getSlot second time err:" + JSON.stringify(err)); expect(err.code != 0).assertEqual(true); - console.debug("====>second getSlot data====>" + JSON.stringify(data)); + console.debug("====>getSlot second data:" + JSON.stringify(data)); notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot second time callback err====>" + JSON.stringify(err)); + console.debug("====>removeSlot second time callback err:" + JSON.stringify(err)); console.debug("====>ActsAnsRemoveSlotTest_0100 end====>"); expect(err.code != 0).assertEqual(true); done(); @@ -61,45 +61,42 @@ describe('ActsAnsRemoveSlotTest', function () { }) setTimeout(function(){ console.debug("====>time out ActsAnsRemoveSlotTest_0100====>"); - }, 5000); + }, TIMEOUT); }) /* * @tc.number : ActsAnsRemoveSlotTest_0200 - * @tc.name : Verify that the slot is removed twice - * @tc.desc : Remove the added slot and then remove it again + * @tc.name : Verify that the slot is removed twice + * @tc.desc : Remove the added SERVICE_INFORMATION slot and then remove it again */ it('ActsAnsRemoveSlotTest_0200', 0, async function (done) { console.debug("====>ActsAnsRemoveSlotTest_0200 start====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION).then(() => { - console.debug("====>addSlotActsAnsRemoveSlotTest_0200 enter====>"); - }) - console.debug("====>getSlot SlotType.SERVICE_INFORMATION: ====>"); - notification.getSlot(notification.SlotType.SERVICE_INFORMATION).then((data) => { - console.debug("====>getSlotActsAnsRemoveSlotTest_0200 enter====>"); - console.debug("====>getSlotActsAnsRemoveSlotTest_0200 data====>" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(3); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsRemoveSlotTest_0200 finish====>"); - }) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION).then(()=>{ - console.debug("====>removeSlot first time promise====>"); - }) + console.debug("====>addSlot ActsAnsRemoveSlotTest_0200 start====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlot SlotType.SERVICE_INFORMATION start====>"); + var data = await notification.getSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 enter====>"); + console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data.level).assertEqual(3); + expect(data.desc).assertEqual(""); + expect(data.badgeFlag).assertEqual(true); + expect(data.bypassDnd).assertEqual(false); + expect(data.lockscreenVisibility).assertEqual(2); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual(SOUNDURL); + expect(data.lightEnabled).assertEqual(false); + expect(data.lightColor).assertEqual(0); + console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 finish====>"); + console.debug("====>removeSlot first time promise start====>"); + await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION); notification.getSlot(notification.SlotType.SERVICE_INFORMATION, (err, data)=>{ - console.debug("====>second getSlot enter====>"); - console.debug("====>second getSlot enter err====>" + JSON.stringify(err)); + console.debug("====>getSlot second time enter====>"); + console.debug("====>getSlot second time err:" + JSON.stringify(err)); expect(err.code != 0).assertEqual(true); console.debug("====>second getSlot data====>" + JSON.stringify(data)); notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot second time err====>" + JSON.stringify(err)); + console.debug("====>removeSlot second time err:" + JSON.stringify(err)); console.debug("====>ActsAnsRemoveSlotTest_0200 end====>"); expect(err.code != 0).assertEqual(true); done(); @@ -107,6 +104,6 @@ describe('ActsAnsRemoveSlotTest', function () { }) setTimeout(function(){ console.debug("====>time out ActsAnsRemoveSlotTest_0200====>"); - }, 15000); + }, TIMEOUT); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansremoveslottest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/BUILD.gn b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/BUILD.gn old mode 100644 new mode 100755 similarity index 91% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/BUILD.gn rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/BUILD.gn index 700bae3231b23e734eb733c7641f5bdeff114b0e..f847851146adfb63fbd88bde7af53ed1cf3d9e73 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/BUILD.gn +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsBadgeDisplayFourTest") { +ohos_js_hap_suite("ActsAnsRemoveSlotWithoutAdd") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplayFourTest" + hap_name = "ActsAnsRemoveSlotWithoutAdd" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/Test.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/Test.json old mode 100644 new mode 100755 similarity index 75% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/Test.json rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/Test.json index 27fd7ba6c04e39df7093e683290d6b799af8d1bb..48cfe54b3db5fc2f96f478a70be2a89f66831561 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/Test.json +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.actsansbadgedisplayfourtest", + "package": "com.example.actsansremoveslotwithoutadd", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "ActsAnsBadgeDisplayFourTest.hap" + "ActsAnsRemoveSlotWithoutAdd.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 75% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/config.json rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/config.json index 9fb1bec41279df5dab0db88f0c2f6620c2a57f16..42fae4b937b96362c7337dcf9fd37249fb6e4236 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/config.json @@ -1,62 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaytreetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaytreetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaytreetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} +{ + "app": { + "bundleName": "com.example.actsansremoveslotwithoutadd", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansremoveslotwithoutadd", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansremoveslotwithoutadd.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 97% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 74% rename from notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.hml index 60c117fb35d180619185b62bee24293514f4e896..c45422b42d0bf788a1c2c0eb299a981f07ce8613 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- icon_pixcelMap + {{title}}
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000000000000000000000000000000000000..f2ab16064f567608f6a045e1f78e6400894a0396 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 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 file from '@system.file' +import {Core, ExpectExtend} from 'deccjsunit/index' + +const injectRef = Object.getPrototypeOf(global) || global +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') + +export default { + data: { + title: "测试removeSlot接口" + }, + onInit() { + this.title = "测试removeSlot接口"; + }, + onShow() { + console.info('onShow finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + core.init() + + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, +} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..754b2f285a7e24f9f6bac79868bd9cff48810575 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsSlotSystemPromise" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/test/ExampleJsunit.test.js new file mode 100755 index 0000000000000000000000000000000000000000..d4efcbcb268c563756149d5960c6e93abcad8bb4 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/test/ExampleJsunit.test.js @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2021 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 notification from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +const TIMEOUT = 2000; +describe('ActsAnsRemoveSlotWithoutAdd', function () { + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0100 + * @tc.name : removeSlot callback + * @tc.desc : remove the SOCIAL_COMMUNICATION type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0100', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0100 start====>"); + function removeSlotCallbck(err) { + console.debug("====>removeSlotActsAnsGetSlotWithoutAdd_0100 enter====>"); + console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0100 err:" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>removeSlot callback SlotType.SOCIAL_COMMUNICATION====>"); + await notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, removeSlotCallbck); + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0100====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0200 + * @tc.name : removeSlot callback + * @tc.desc : remove the SERVICE_INFORMATION type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0200', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0200 start====>"); + function removeSlotCallbck(err) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0200 enter====>"); + console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0200 err:" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>removeSlot callback SlotType.SERVICE_INFORMATION====>"); + await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, removeSlotCallbck); + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0200====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0300 + * @tc.name : removeSlot callback + * @tc.desc : remove the CONTENT_INFORMATION type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0300', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0300 start====>"); + function removeSlotCallbck(err) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0300 enter====>"); + console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0300 err:" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>removeSlot callback SlotType.CONTENT_INFORMATION====>"); + await notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, removeSlotCallbck); + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0300====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0400 + * @tc.name : removeSlot callback + * @tc.desc : remove the OTHER_TYPES type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0400', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0400 start====>"); + function removeSlotCallbck(err) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0400 enter====>"); + console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0400 err:" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>removeSlot callback SlotType.OTHER_TYPES====>"); + await notification.removeSlot(notification.SlotType.OTHER_TYPES, removeSlotCallbck); + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0400====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0500 + * @tc.name : removeSlot callback + * @tc.desc : remove the UNKNOWN_TYPE type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0500', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0500 start====>"); + function removeSlotCallbck(err) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0500 enter====>"); + console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0500 err:" + JSON.stringify(err)); + expect(err.code != 0).assertEqual(true); + done(); + } + console.debug("====>removeSlot callback SlotType.UNKNOWN_TYPE====>"); + await notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, removeSlotCallbck); + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0500====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0600 + * @tc.name : removeSlot promise + * @tc.desc : remove the SOCIAL_COMMUNICATION type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0600', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0600 start====>"); + console.debug("====>removeSlot SlotType.SOCIAL_COMMUNICATION====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION).then(()=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0600 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0600 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0600 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0600====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0700 + * @tc.name : removeSlot promise + * @tc.desc : remove the SERVICE_INFORMATION type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0700', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0700 start====>"); + console.debug("====>removeSlot SlotType.SERVICE_INFORMATION====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION).then(()=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0700 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0700 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0700 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0700====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0800 + * @tc.name : removeSlot promise + * @tc.desc : remove the CONTENT_INFORMATION type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0800', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0800 start====>"); + console.debug("====>removeSlot SlotType.CONTENT_INFORMATION====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION).then(()=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0800 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0800 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0800 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0800====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_0900 + * @tc.name : removeSlot promise + * @tc.desc : remove the OTHER_TYPES type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_0900', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_0900 start====>"); + console.debug("====>removeSlot SlotType.OTHER_TYPES====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES).then(()=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0900 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0900 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0900 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0900====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsRemoveSlotWithoutAdd_1000 + * @tc.name : removeSlot promise + * @tc.desc : remove the UNKNOWN_TYPE type slot without adding + */ + it('ActsAnsRemoveSlotWithoutAdd_1000', 0, async function (done) { + console.debug("====>ActsAnsRemoveSlotWithoutAdd_1000 start====>"); + console.debug("====>removeSlot SlotType.UNKNOWN_TYPE====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE).then(()=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_1000 enter====>"); + expect().assertFail(); + done(); + }).catch((err)=>{ + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_1000 err:" + JSON.stringify(err)); + console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_1000 end====>"); + expect(err.code != 0).assertEqual(true); + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_1000====>"); + }, TIMEOUT); + }) +}) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/test/List.test.js new file mode 100755 index 0000000000000000000000000000000000000000..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- /dev/null +++ b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/signature/openharmony_sx.p7b rename to notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslotbybundle/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/config.json index b9fe960ed443b29559f0498caaf23bc36a67859d..3d93c8601f8e10916fdc99e1bbe7b1a133006eb2 100644 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansslotbybundle", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotbybundle", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansslotbybundle.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansslotbybundle", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansslotbybundle", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansslotbybundle.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index 13c23c07ba2c814cfb6af9e66a7ce0c84fa05b59..86e94d5eedc8cf3c99c3541f7bc6a292e7b4368e --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/default/pages/index/index.js @@ -20,10 +20,10 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') export default { data: { - title: "测试slot接口promise形式:系统应用" + title: "测试slotbybundle接口" }, onInit() { - this.title = this.data.title; + this.title = "测试slotbybundle接口"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/resources/base/element/string.json index 4e8a57c156bc8c53069f82bedc32bd703e2c2f35..6fdf5cecb3cbe3692524ffd403e5185d1e98b8cc 100644 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotByBundle" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsSlotByBundle" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/ExampleJsunit.test.js index 1976c436f614b702dac0a47109a782e13813a79f..b6983dbcd4b9c1dd861af241971c820076fe1326 100644 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/ExampleJsunit.test.js @@ -17,27 +17,194 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' describe('ActsAnsSlotByBundle', function () { /* - * @tc.number : ActsAnsSlotByBundle_0100 + * @tc.number : ActsAnsGetSlotsByBundle_0100 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, + * call getsbybundle for information.(promise) + */ + it('ActsAnsGetSlotsByBundle_0100', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0100====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0200 + * @tc.name : Verify getSlot UNKNOWN_TYPE + * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, + * call getsbybundle for information.(promise) + */ + it('ActsAnsGetSlotsByBundle_0200', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0200 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); + await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0200====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>removeSlot UNKNOWN_TYPE====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0300 * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After setSlot, call the getSlotsByBundle interface to - * check whether the information is consistent.(promise) + * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, + * call getsbybundle for information.(promise) */ - it('ActsAnsSlotByBundle_0100', 0, async function (done) { - console.debug("====>ActsAnsSlotByBundle_0100 start====>"); - var ret = false + it('ActsAnsGetSlotsByBundle_0300', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0300 start====>"); var bundleoption = { bundle: "com.example.actsansslotbybundle" } - var notificationslot = { - type: notification.SlotType.SERVICE_INFORMATION, - level: 4 + console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); + await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0300====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0400 + * @tc.name : Verify getSlot CONTENT_INFORMATION + * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, + * call getsbybundle for information.(promise) + */ + it('ActsAnsGetSlotsByBundle_0400', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0400 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" } - notification.addSlot(notification.SlotType.SERVICE_INFORMATION).then(() => { - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0400====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>ActsAnsGetSlotsByBundle_0400 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) }) + + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0500 + * @tc.name : Verify getSlot OTHER_TYPES + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information.(promise) + */ + it('ActsAnsGetSlotsByBundle_0500', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0500 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); + await notification.addSlot(notification.SlotType.OTHER_TYPES); console.debug("====>getSlotsByBundle1 start====>"); notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>getSlotsByBundle1====>" + JSON.stringify(data)); + console.debug("====>ActsAnsGetSlotsByBundle_0500====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0600 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, + * call getsbybundle for information.(callback) + */ + it('ActsAnsGetSlotsByBundle_0600', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0600 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0600====>" + JSON.stringify(data)); expect(data[0].type).assertEqual(2) expect(data[0].level).assertEqual(3) expect(data[0].badgeFlag).assertEqual(true) @@ -48,13 +215,186 @@ describe('ActsAnsSlotByBundle', function () { expect(data[0].lightColor).assertEqual(0) console.debug("====>getSlotsByBundle1 finish====>"); console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0700 + * @tc.name : Verify getSlot UNKNOWN_TYPE + * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, + * call getsbybundle for information.(callback) + */ + it('ActsAnsGetSlotsByBundle_0700', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0700 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); + await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0700====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>removeSlot UNKNOWN_TYPE====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0800 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, + * call getsbybundle for information.(callback) + */ + it('ActsAnsGetSlotsByBundle_0800', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0800 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); + await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0800====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); + expect(err.code).assertEqual(0); + done(); + }) }) - notification.setSlotByBundle(bundleoption, notificationslot).then(() => { - console.debug("====>setSlotsByBundle====>") + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_0900 + * @tc.name : Verify getSlot CONTENT_INFORMATION + * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, + * call getsbybundle for information.(callback) + */ + it('ActsAnsGetSlotsByBundle_0900', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_0900 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotsByBundle_0900====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) }) + }) + + /* + * @tc.number : ActsAnsGetSlotsByBundle_1000 + * @tc.name : Verify getSlot OTHER_TYPES + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information.(callback) + */ + it('ActsAnsGetSlotsByBundle_1000', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_1000 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); + await notification.addSlot(notification.SlotType.OTHER_TYPES); + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotsByBundle_1000====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0100 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_0100', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_0100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.SERVICE_INFORMATION, + level: 4 + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_0100====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle====>") + await notification.setSlotByBundle(bundleoption, notificationslot); console.debug("====>getSlotsByBundle1.1 start====>"); notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>getSlotsByBundle1.1====>" + JSON.stringify(data)); + console.debug("====>ActsAnsSetSlotByBundle_0100.1====>" + JSON.stringify(data)); expect(data[0].type).assertEqual(2) expect(data[0].level).assertEqual(4) expect(data[0].badgeFlag).assertEqual(true) @@ -64,42 +404,103 @@ describe('ActsAnsSlotByBundle', function () { expect(data[0].lightEnabled).assertEqual(false) expect(data[0].lightColor).assertEqual(0) console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.getSlotNumByBundle(bundleoption).then((data) => { - console.debug("====>getSlotNumAsBundle1====>" + JSON.stringify(data)); - expect(data).assertEqual(1) - ret = true - + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); }) }) - done(); - setTimeout(function () { - expect(ret).assertEqual(true) - }, 1000) }) /* - * @tc.number : ActsAnsSlotByBundle_0100 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After setSlot, call the getSlotsByBundle interface to - * check whether the information is consistent.(callback) + * @tc.number : ActsAnsSetSlotByBundle_0200 + * @tc.name : Verify getSlot UNKNOWN_TYPE + * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(promise) */ it('ActsAnsSetSlotByBundle_0200', 0, async function (done) { - var ret = false - console.debug("====>ActsAnsSlotByBundle_0200 start====>"); + console.debug("====>ActsAnsSetSlotByBundle_0200 start====>"); var bundleoption = { bundle: "com.example.actsansslotbybundle" } var notificationslot = { - type: notification.SlotType.SERVICE_INFORMATION, + type: notification.SlotType.UNKNOWN_TYPE, level: 4 } - notification.addSlot(notification.SlotType.SERVICE_INFORMATION).then(() => { - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); + await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_0200====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle====>") + await notification.setSlotByBundle(bundleoption, notificationslot); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_0200.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>removeSlot UNKNOWN_TYPE====>"); + expect(err.code).assertEqual(0); + done(); + }) }) - console.debug("====>getSlotsByBundle2 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>getSlotsByBundle2====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0300 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_0300', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_0300 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: 3 + } + console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); + await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_0300====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + await notification.setSlotByBundle(bundleoption, notificationslot); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_0300.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) expect(data[0].level).assertEqual(3) expect(data[0].badgeFlag).assertEqual(true) expect(data[0].bypassDnd).assertEqual(false) @@ -107,33 +508,1316 @@ describe('ActsAnsSlotByBundle', function () { expect(data[0].vibrationEnabled).assertEqual(true) expect(data[0].lightEnabled).assertEqual(false) expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle2 finish====>"); + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); + expect(err.code).assertEqual(0); + done(); + }) }) - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot, () => { - console.debug("====>setSlotsByBundle====>") + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0400 + * @tc.name : Verify getSlot CONTENT_INFORMATION + * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_0400', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_0400 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.CONTENT_INFORMATION, + level: 4 + } + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_0400====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle====>") + await notification.setSlotByBundle(bundleoption, notificationslot); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_0400.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) }) - console.debug("====>getSlotsByBundle2.1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>getSlotsByBundle2.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0500 + * @tc.name : Verify getSlot OTHER_TYPES + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_0500', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_0500 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.OTHER_TYPES, + level: 4 + } + console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); + await notification.addSlot(notification.SlotType.OTHER_TYPES); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_0500====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle====>") + await notification.setSlotByBundle(bundleoption, notificationslot); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_0500.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) expect(data[0].level).assertEqual(4) expect(data[0].badgeFlag).assertEqual(true) expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) expect(data[0].lightEnabled).assertEqual(false) expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle2.1 finish====>"); + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0600 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_0600', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_0600 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.SERVICE_INFORMATION, + level: 4 + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION,()=>{ + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0600====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot, () => { + console.debug("====>setSlotsByBundle====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0600.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0700 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_0700', 0, async function (done) { + console.debug("====>ActsAnsSlotByBundle_0100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.UNKNOWN_TYPE, + level: 4 + } + console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); + notification.addSlot(notification.SlotType.UNKNOWN_TYPE,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0700====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot, () => { + console.debug("====>setSlotsByBundle====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0700.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>removeSlot UNKNOWN_TYPE====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0800 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_0800', 0, async function (done) { + console.debug("====>ActsAnsSlotByBundle_0100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: 3 + } + console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); + notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0800====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot, () => { + console.debug("====>setSlotsByBundle====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0800.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_0900 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_0900', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_0900 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.CONTENT_INFORMATION, + level: 4 + } + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.CONTENT_INFORMATION,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0900====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + + notification.setSlotByBundle(bundleoption, notificationslot, () => { + console.debug("====>setSlotsByBundle====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_0900.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1000 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information, and then call setSlotByBundle + * to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_1000', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1000 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.OTHER_TYPES, + level: 4 + } + console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); + await notification.addSlot(notification.SlotType.OTHER_TYPES,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1000====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot, () => { + console.debug("====>setSlotsByBundle====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1000.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1100 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_1100', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.SERVICE_INFORMATION, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.SERVICE_INFORMATION, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_1100====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle1====>") + await notification.setSlotByBundle(bundleoption, notificationslot1); + console.debug("====>setSlotsByBundle2====>") + await notification.setSlotByBundle(bundleoption, notificationslot2); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_1100.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1200 + * @tc.name : Verify getSlot UNKNOWN_TYPE + * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_1200', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1200 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.UNKNOWN_TYPE, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.UNKNOWN_TYPE, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); + await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_1200====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle1====>") + await notification.setSlotByBundle(bundleoption, notificationslot1); + console.debug("====>setSlotsByBundle2====>") + await notification.setSlotByBundle(bundleoption, notificationslot2); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_1200.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>removeSlot UNKNOWN_TYPE====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1300 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_1300', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1300 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.SOCIAL_COMMUNICATION, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); + await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_1300====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle1====>") + await notification.setSlotByBundle(bundleoption, notificationslot1); + console.debug("====>setSlotsByBundle2====>") + await notification.setSlotByBundle(bundleoption, notificationslot2); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_1300.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1400 + * @tc.name : Verify getSlot CONTENT_INFORMATION + * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_1400', 0, async function (done) { + console.debug("====>ActsAnsSlotByBundle_0100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.CONTENT_INFORMATION, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.CONTENT_INFORMATION, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_1400====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle1====>") + await notification.setSlotByBundle(bundleoption, notificationslot1); + console.debug("====>setSlotsByBundle2====>") + await notification.setSlotByBundle(bundleoption, notificationslot2); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_1400.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1500 + * @tc.name : Verify getSlot OTHER_TYPES + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(promise) + */ + it('ActsAnsSetSlotByBundle_1500', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1500 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.OTHER_TYPES, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.OTHER_TYPES, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); + await notification.addSlot(notification.SlotType.OTHER_TYPES); + console.debug("====>getSlotsByBundle1 start====>"); + var data = await notification.getSlotsByBundle(bundleoption) + console.debug("====>ActsAnsSetSlotByBundle_1500====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + console.debug("====>setSlotsByBundle1====>") + await notification.setSlotByBundle(bundleoption, notificationslot1); + console.debug("====>setSlotsByBundle2====>") + await notification.setSlotByBundle(bundleoption, notificationslot2); + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsSetSlotByBundle_1500.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1600 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_1600', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1600 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.SERVICE_INFORMATION, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.SERVICE_INFORMATION, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1600====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot1, () => { + console.debug("====>setSlotsByBundle1====>") + notification.setSlotByBundle(bundleoption, notificationslot2, () => { + console.debug("====>setSlotsByBundle2====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1600.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(2) + expect(data[0].level).assertEqual(3) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + }) + + + /* + * @tc.number : ActsAnsSetSlotByBundle_1700 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_1700', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1700 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.UNKNOWN_TYPE, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.UNKNOWN_TYPE, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); + notification.addSlot(notification.SlotType.UNKNOWN_TYPE,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1700====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot1, () => { + console.debug("====>setSlotsByBundle1====>") + notification.setSlotByBundle(bundleoption, notificationslot2, () => { + console.debug("====>setSlotsByBundle2====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1700.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ + console.debug("====>removeSlot UNKNOWN_TYPE====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1800 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_1800', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1800 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.SOCIAL_COMMUNICATION, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); + notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1800====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(2) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot1, () => { + console.debug("====>setSlotsByBundle1====>") + notification.setSlotByBundle(bundleoption, notificationslot2, () => { + console.debug("====>setSlotsByBundle2====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1800.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(1) + expect(data[0].level).assertEqual(4) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(true) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_1900 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_1900', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_1900 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.CONTENT_INFORMATION, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.CONTENT_INFORMATION, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.CONTENT_INFORMATION,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1900====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot1, () => { + console.debug("====>setSlotsByBundle1====>") + notification.setSlotByBundle(bundleoption, notificationslot2, () => { + console.debug("====>setSlotsByBundle2====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_1900.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(3) + expect(data[0].level).assertEqual(2) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_2000 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information, and then call setSlotByBundle + * twice to update the information.(callback) + */ + it('ActsAnsSetSlotByBundle_2000', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_2000 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot1 = { + type: notification.SlotType.OTHER_TYPES, + level: 4 + } + var notificationslot2 = { + type: notification.SlotType.OTHER_TYPES, + lockscreenVisibility: 1 + } + console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); + notification.addSlot(notification.SlotType.OTHER_TYPES,() => { + console.debug("====>getSlotsByBundle1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_2000====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(3) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1 finish====>"); + console.debug("====>setSlotByBundle start====>"); + notification.setSlotByBundle(bundleoption, notificationslot1, () => { + console.debug("====>setSlotsByBundle1====>") + notification.setSlotByBundle(bundleoption, notificationslot2, () => { + console.debug("====>setSlotsByBundle2====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_2000.1====>" + JSON.stringify(data)); + expect(data[0].type).assertEqual(65535) + expect(data[0].level).assertEqual(1) + expect(data[0].badgeFlag).assertEqual(true) + expect(data[0].bypassDnd).assertEqual(false) + expect(data[0].lockscreenVisibility).assertEqual(1) + expect(data[0].vibrationEnabled).assertEqual(false) + expect(data[0].lightEnabled).assertEqual(false) + expect(data[0].lightColor).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ + console.debug("====>removeSlot OTHER_TYPES====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_2100 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : Do not call addSlot, call setSlotByBundle directly, + * and then call getSlotsByBundle query results.(callback) + */ + it('ActsAnsSetSlotByBundle_2100', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_2100 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.OTHER_TYPES, + level: 4 + } + notification.setSlotByBundle(bundleoption, notificationslot, (err) => { + console.debug("====>setSlotsByBundle1====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption,(err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_2100.1====>" + JSON.stringify(data)); + expect(data.length).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsSetSlotByBundle_2200 + * @tc.name : Verify getSlot OTHER_TYPES + * @tc.desc : Do not call addSlot, call setSlotByBundle directly, + * and then call getSlotsByBundle query results.(promise) + */ + it('ActsAnsSetSlotByBundle_2200', 0, async function (done) { + console.debug("====>ActsAnsSetSlotByBundle_2200 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + var notificationslot = { + type: notification.SlotType.OTHER_TYPES, + level: 4 + } + notification.setSlotByBundle(bundleoption, notificationslot).then(() => { + }).catch((err)=>{ + console.debug("====>setSlotsByBundle1====>") + console.debug("====>getSlotsByBundle1.1 start====>"); + notification.getSlotsByBundle(bundleoption, (err,data) => { + console.debug("====>ActsAnsSetSlotByBundle_2200.1====>" + JSON.stringify(data)); + expect(data.length).assertEqual(0) + console.debug("====>getSlotsByBundle1.1 finish====>"); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0100 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding slot, call getSlotNumByBundle for information.(callback) + */ + it('ActsAnsGetSlotNumByBundle_0100', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0600 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION,() => { + notification.getSlotNumByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0100====>" + JSON.stringify(data)); + expect(data).assertEqual(1) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0200 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding slot, call getSlotNumByBundle for information.(promise) + */ + it('ActsAnsGetSlotNumByBundle_0200', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0200 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + notification.getSlotNumByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0200====>" + JSON.stringify(data)); + expect(data).assertEqual(1) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + + + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0300 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding twice different type slot, + * call getSlotNumByBundle for information.(callback) + */ + it('ActsAnsGetSlotNumByBundle_0300', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0300 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION, () => { + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.CONTENT_INFORMATION, () => { + notification.getSlotNumByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0300====>" + JSON.stringify(data)); + expect(data).assertEqual(2) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + console.debug("====>SERVICE_INFORMATION err.code====>" + JSON.stringify(err.code)); + expect(err.code).assertEqual(0); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + console.debug("====>CONTENT_INFORMATION err.code====>" + JSON.stringify(err.code)); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0400 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding twice different type slot, + * call getSlotNumByBundle for information.(promise) + */ + it('ActsAnsGetSlotNumByBundle_0400', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0400 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); + notification.getSlotNumByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0400====>" + JSON.stringify(data)); + expect(data).assertEqual(2) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ + console.debug("====>removeSlot CONTENT_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0500 + * @tc.name : Verify getSlot null + * @tc.desc : Call getSlotNumByBundle for information.(callback) + */ + it('ActsAnsGetSlotNumByBundle_0500', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0700 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } notification.getSlotNumByBundle(bundleoption, (err, data) => { - console.debug("====>getSlotNumAsBundle2====>" + JSON.stringify(data)); + console.debug("====>ActsAnsGetSlotNumByBundle_0500====>" + JSON.stringify(data)); + expect(data).assertEqual(0) + done(); + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0600 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : Call getSlotNumByBundle for information.(promise) + */ + it('ActsAnsGetSlotNumByBundle_0600', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0600 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + notification.getSlotNumByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0600====>" + JSON.stringify(data)); + expect(data).assertEqual(0) + done(); + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0700 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : After adding twice same type slot, + * call getSlotNumByBundle for information.(callback) + */ + it('ActsAnsGetSlotNumByBundle_0700', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0700 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION, ()=>{ + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION, ()=>{ + notification.getSlotNumByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0700====>" + JSON.stringify(data)); + expect(data).assertEqual(1) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0800 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : After adding twice same type slot, + * call getSlotNumByBundle for information.(promise) + */ + it('ActsAnsGetSlotNumByBundle_0800', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0800 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundle" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + notification.getSlotNumByBundle(bundleoption).then((data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0800====>" + JSON.stringify(data)); expect(data).assertEqual(1) - ret = true + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_0900 + * @tc.name : Verify getSlot SERVICE_INFORMATION + * @tc.desc : Bundlename incorrectly adds slot after calling + * getSlotNumByBundle to get information.(callback) + */ + it('ActsAnsGetSlotNumByBundle_0900', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_0900 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundleerr" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + notification.addSlot(notification.SlotType.SERVICE_INFORMATION, ()=>{ + notification.getSlotNumByBundle(bundleoption, (err, data) => { + console.debug("====>ActsAnsGetSlotNumByBundle_0900====>" + JSON.stringify(data)); + expect(data).assertEqual(0) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + expect(err.code).assertEqual(0); + done(); + }) + }) + }) + }) + + /* + * @tc.number : ActsAnsGetSlotNumByBundle_1000 + * @tc.name : Verify getSlot SOCIAL_COMMUNICATION + * @tc.desc : Bundlename incorrectly adds slot after calling + * getSlotNumByBundle to get information.(promise) + */ + it('ActsAnsGetSlotNumByBundle_1000', 0, async function (done) { + console.debug("====>ActsAnsGetSlotNumByBundle_1000 start====>"); + var bundleoption = { + bundle: "com.example.actsansslotbybundleerr" + } + console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); + await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); + notification.getSlotNumByBundle(bundleoption).then((data) => { + }).catch((err)=>{ + expect(err!=0).assertEqual(true) + notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ + console.debug("====>removeSlot SERVICE_INFORMATION err:" + JSON.stringify(err)); + }) + done(); }) - done(); - setTimeout(function () { - expect(ret).assertEqual(true) - }, 1000) }) }) + diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansslotbybundle/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslotbybundle/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json old mode 100644 new mode 100755 index 89343b335270eb0e18dc9f99da2d9ae58c370a1b..4b45c096602f21bcbc483f800f29a03daf431427 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "180000", + "test-timeout": "60000", "package": "com.example.actsansslotsystemcallback", "shell-timeout": "60000" }, diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/config.json old mode 100644 new mode 100755 index aa09224fd22b4834a06f8ed707f3f592656c694d..044a903cd3feeb911b55eac07e443659ecfaabfd --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansslotsystemcallback", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotsystemcallback", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansslotsystemcallback.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansslotsystemcallback", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansslotsystemcallback", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansslotsystemcallback.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index e5bf8be4b4a16debba3c1f83c2b438b378050bb0..ad2fa97911b4055d416362117d8f5351710ba32d --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试slot接口callback形式:系统应用" }, onInit() { - this.title = this.data.title; + this.title = "测试slot接口callback形式:系统应用"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 25533f10ff47eba4e522d5018d5ad2d9de284728..d72e9b5082dd736e5edef2041303460fcb5d64f7 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemCallback" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsSlotSystemCallback" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/ExampleJsunit.test.js old mode 100644 new mode 100755 index 1e18628d2a31ca437fd7e9283baf45d69c1610fb..7674a18ab18c80ed016aa690240608b30a084be7 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/ExampleJsunit.test.js @@ -15,12 +15,13 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +const TIMEOUT = 2000; describe('ActsAnsSlotSystemCallback', function () { /* * @tc.number : ActsAnsSlotSystemCallback_0100 - * @tc.name : Verify getSlots after adding slots and removeSlot - * @tc.desc : getSlots after adding all type slots and removing slot + * @tc.name : Verify getSlots after adding slots and removeAllSlots + * @tc.desc : getSlots after adding all type slots and remove all slots */ it('ActsAnsSlotSystemCallback_0100', 0, async function (done) { console.debug("====>ActsAnsSlotSystemCallback_0100 start====>"); @@ -39,11 +40,7 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_SOCIAL_COMMUNICATION_sound", lightEnabled: true, lightColor: 1 - }, - (err)=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION callback====>"); - expect(err.code).assertEqual(0); - }) + }); console.debug("====>addSlot SERVICE_INFORMATION====>"); await notification.addSlot( { @@ -56,12 +53,7 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_SERVICE_INFORMATION_sound", lightEnabled: true, lightColor: 2 - }, - (err)=>{ - console.debug("====>addSlot SERVICE_INFORMATION callback====>"); - expect(err.code).assertEqual(0); - }) - console.debug("====>addSlot CONTENT_INFORMATION====>"); + }); await notification.addSlot( { type: notification.SlotType.CONTENT_INFORMATION, @@ -73,11 +65,7 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_CONTENT_INFORMATION_sound", lightEnabled: true, lightColor: 3 - }, - (err)=>{ - console.debug("====>addSlot CONTENT_INFORMATION callback====>"); - expect(err.code).assertEqual(0); - }) + }); console.debug("====>addSlot OTHER_TYPES====>"); await notification.addSlot( { @@ -90,11 +78,7 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_OTHER_TYPES_sound", lightEnabled: true, lightColor: 4 - }, - (err)=>{ - console.debug("====>addSlot OTHER_TYPES callback====>"); - expect(err.code).assertEqual(0); - }) + }); console.debug("====>addSlot UNKNOWN_TYPE====>"); await notification.addSlot( { @@ -107,13 +91,8 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_UNKNOWN_TYPE_sound", lightEnabled: true, lightColor: 5 - }, - (err)=>{ - console.debug("====>addSlot UNKNOWN_TYPE callback====>"); - expect(err.code).assertEqual(0); - }) - - await notification.getSlots((err, data)=>{ + }); + notification.getSlots((err, data)=>{ console.debug("====>getSlots enter====>"); console.debug("====>getSlots data====>" + JSON.stringify(err)); expect(err.code).assertEqual(0); @@ -159,18 +138,19 @@ describe('ActsAnsSlotSystemCallback', function () { expect(data[3].lightEnabled).assertEqual(true); expect(data[3].lightColor).assertEqual(4); console.debug("====>getSlots end====>"); - console.debug("====>ActsAnsSlotSystemCallback_0100 end====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot ActsAnsSlotSystemCallback_0100 err====>" + JSON.stringify(err)); + notification.removeAllSlots((err)=>{ + console.debug("====>removeAllSlots ActsAnsSlotSystemCallback_0100 err====>" + JSON.stringify(err)); + console.debug("====>ActsAnsSlotSystemCallback_0100 end====>"); expect(err.code).assertEqual(0); done(); }) }catch(err){ console.error("====>getSlots catch err====>" + JSON.stringify(err)); expect().assertFail(); + done(); } }) - setTimeout(timeOut, 10000); + setTimeout(timeOut, TIMEOUT); }) /* @@ -184,7 +164,7 @@ describe('ActsAnsSlotSystemCallback', function () { console.debug("====>time out enter ActsAnsSlotSystemCallback_0200====>"); } console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.SOCIAL_COMMUNICATION, level: notification.SlotLevel.LEVEL_NONE, @@ -195,11 +175,8 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_SOCIAL_COMMUNICATION_Sound_First", lightEnabled: true, lightColor: 1 - } - ).then(()=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION callback====>"); - }) - notification.addSlot( + }); + await notification.addSlot( { type: notification.SlotType.SOCIAL_COMMUNICATION, level: notification.SlotLevel.LEVEL_DEFAULT, @@ -210,12 +187,9 @@ describe('ActsAnsSlotSystemCallback', function () { sound: "slot_SOCIAL_COMMUNICATION_Sound_Second", lightEnabled: true, lightColor: 1 - } - ).then(()=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION callback====>"); - }) + }); console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION: ====>"); - await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data) => { + notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data) => { console.debug("====>getSlotActsAnsSlotSystemCallback_0200 enter====>"); console.debug("====>getSlotActsAnsSlotSystemCallback_0200 err====>" + JSON.stringify(err)); expect(err.code).assertEqual(0); @@ -230,9 +204,13 @@ describe('ActsAnsSlotSystemCallback', function () { expect(data.lightEnabled).assertEqual(true); expect(data.lightColor).assertEqual(1); console.debug("====>getSlotActsAnsSlotSystemCallback_0200 finish====>"); - console.debug("====>ActsAnsSlotSystemCallback_0200 end====>"); - done(); + notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ + console.debug("====>removeSlot SOCIAL_COMMUNICATION err====>" + JSON.stringify(err)); + console.debug("====>ActsAnsSlotSystemCallback_0200 end====>"); + expect(err.code).assertEqual(0); + done(); + }) }) - setTimeout(timeOutTwo, 10000); + setTimeout(timeOutTwo, TIMEOUT); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslotsystempromise/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json old mode 100644 new mode 100755 index 4faaf4430610f95852e2fcc5ec1f9eafbcc89aa0..affaa959951dc57c442efb8cfd24434e9381e363 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "180000", + "test-timeout": "60000", "package": "com.example.actsansslotsystempromise", "shell-timeout": "60000" }, diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/config.json old mode 100644 new mode 100755 index 2f782ae5a7dad5eff4bac2eec0eccfe18c8d6d80..25b845cb00399524e0248a14bf056ed781aff039 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsansslotsystempromise", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotsystempromise", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansslotsystempromise.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsansslotsystempromise", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsansslotsystempromise", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsansslotsystempromise.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index 7d49e8b9f689e9ef57ebb880683dd2a99933fffa..960cef8552121c5a70842e7fe339b31ef1299915 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试slot接口promise形式:系统应用" }, onInit() { - this.title = this.data.title; + this.title = "测试slot接口promise形式:系统应用"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 603bef8182a94b74bb5d342039782848e71c12dd..754b2f285a7e24f9f6bac79868bd9cff48810575 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemPromise" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsSlotSystemPromise" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/ExampleJsunit.test.js old mode 100644 new mode 100755 index acbae78c837b2028c7f817c606c1b2ebefefbe02..61cb356c90c9b34b225e9773e413ba994c78d725 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/ExampleJsunit.test.js @@ -15,6 +15,7 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +const TIMEOUT = 2000; describe('ActsAnsSlotSystemPromise', function () { /* @@ -25,7 +26,7 @@ describe('ActsAnsSlotSystemPromise', function () { it('ActsAnsSlotSystemPromise_0100', 0, async function (done) { console.debug("====>ActsAnsSlotTestSystem_0100 start====>"); console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.SOCIAL_COMMUNICATION, level: notification.SlotLevel.LEVEL_NONE, @@ -36,12 +37,9 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_SOCIAL_COMMUNICATION_sound", lightEnabled: true, lightColor: 1 - } - ).then(()=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION promise====>"); - }) + }); console.debug("====>addSlot SERVICE_INFORMATION====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.SERVICE_INFORMATION, level: notification.SlotLevel.LEVEL_MIN, @@ -52,12 +50,9 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_SERVICE_INFORMATION_sound", lightEnabled: true, lightColor: 2 - } - ).then(()=>{ - console.debug("====>addSlot SERVICE_INFORMATION promise====>"); - }) + }); console.debug("====>addSlot CONTENT_INFORMATION====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.CONTENT_INFORMATION, level: notification.SlotLevel.LEVEL_LOW, @@ -68,12 +63,9 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_CONTENT_INFORMATION_sound", lightEnabled: true, lightColor: 3 - } - ).then(()=>{ - console.debug("====>addSlot CONTENT_INFORMATION promise====>"); - }) + }); console.debug("====>addSlot OTHER_TYPES====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.OTHER_TYPES, level: notification.SlotLevel.LEVEL_DEFAULT, @@ -84,12 +76,9 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_OTHER_TYPES_sound", lightEnabled: true, lightColor: 4 - } - ).then(()=>{ - console.debug("====>addSlot OTHER_TYPES promise====>"); - }) + }); console.debug("====>addSlot UNKNOWN_TYPE====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.UNKNOWN_TYPE, level: notification.SlotLevel.LEVEL_HIGH, @@ -100,70 +89,63 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_UNKNOWN_TYPE_sound", lightEnabled: true, lightColor: 5 - } - ).then(()=>{ - console.debug("====>addSlot UNKNOWN_TYPE promise====>"); - }) - notification.getSlots().then((data)=>{ - console.debug("====>getSlots enter====>"); - console.debug("====>getSlots data====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); + }); + var data = await notification.getSlots(); + console.debug("====>getSlots enter====>"); + console.debug("====>getSlots data====>" + JSON.stringify(data)); + try{ + expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); + expect(data[0].badgeFlag).assertEqual(false); + expect(data[0].bypassDnd).assertEqual(true); + expect(data[0].vibrationEnabled).assertEqual(true); + expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); + expect(data[0].lightEnabled).assertEqual(true); + expect(data[0].lightColor).assertEqual(1); - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); + expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); + expect(data[1].badgeFlag).assertEqual(false); + expect(data[1].bypassDnd).assertEqual(true); + expect(data[1].vibrationEnabled).assertEqual(true); + expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); + expect(data[1].lightEnabled).assertEqual(true); + expect(data[1].lightColor).assertEqual(2); - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); + expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); + expect(data[2].badgeFlag).assertEqual(false); + expect(data[2].bypassDnd).assertEqual(true); + expect(data[2].vibrationEnabled).assertEqual(true); + expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); + expect(data[2].lightEnabled).assertEqual(true); + expect(data[2].lightColor).assertEqual(3); - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end====>"); - }catch(err){ - console.error("====>getSlots catch err====>" + JSON.stringify(err)); - expect().assertFail(); - } - }) - - notification.removeAllSlots().then(()=>{ - console.debug("====>removeAllSlots ActsAnsSlotSystemPromise_0100====>"); - }) - - notification.getSlots().then((data)=>{ - console.debug("====>getSlots enter====>"); - console.debug("====>getSlots data====>" + JSON.stringify(data)); - }) + expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data[3].badgeFlag).assertEqual(false); + expect(data[3].bypassDnd).assertEqual(true); + expect(data[3].vibrationEnabled).assertEqual(true); + expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data[3].lightEnabled).assertEqual(true); + expect(data[3].lightColor).assertEqual(4); + console.debug("====>getSlots end====>"); + }catch(err){ + console.error("====>getSlots catch err====>" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>removeAllSlots ActsAnsSlotSystemPromise_0100====>"); + await notification.removeAllSlots(); + console.debug("====>getSlots after remove all slots====>"); + var dataTwo = notification.getSlots(); + console.debug("====>getSlots dataTwo:" + JSON.stringify(dataTwo)); console.debug("====>addSlot SERVICE_INFORMATION second====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.SERVICE_INFORMATION, level: notification.SlotLevel.LEVEL_DEFAULT, @@ -174,30 +156,26 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_SERVICE_INFORMATION_Sound_Second", lightEnabled: true, lightColor: 2 - } - ).then(()=>{ - console.debug("====>addSlot SERVICE_INFORMATION second====>"); - }) - notification.getSlot(notification.SlotType.SERVICE_INFORMATION).then((data) => { - console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsSlotSystemPromise_0100 enter====>"); - console.debug("====>getSlotPromise ActsAnsSlotSystemPromise_0100 data====>" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data.desc).assertEqual("slot_SERVICE_INFORMATION_Desc_Second"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SERVICE_INFORMATION_Sound_Second"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(2); - console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsSlotSystemPromise_0100 finish====>"); - done(); - }) - console.debug("====>ActsAnsSlotTestSystem_0100 end====>"); + }); + var dataThree = await notification.getSlot(notification.SlotType.SERVICE_INFORMATION); + console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsSlotSystemPromise_0100 enter====>"); + console.debug("====>getSlotPromise ActsAnsSlotSystemPromise_0100 dataThree:" + JSON.stringify(dataThree)); + expect(dataThree.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(dataThree.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(dataThree.desc).assertEqual("slot_SERVICE_INFORMATION_Desc_Second"); + expect(dataThree.badgeFlag).assertEqual(false); + expect(dataThree.bypassDnd).assertEqual(true); + expect(dataThree.vibrationEnabled).assertEqual(true); + expect(dataThree.sound).assertEqual("slot_SERVICE_INFORMATION_Sound_Second"); + expect(dataThree.lightEnabled).assertEqual(true); + expect(dataThree.lightColor).assertEqual(2); + console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsSlotSystemPromise_0100 finish====>"); + console.debug("====>removeSlot SERVICE_INFORMATION====>"); + await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION); + done(); setTimeout(function (){ console.debug("====>time out ActsAnsSlotTestSystem_0100====>"); - }, 10000); - + }, TIMEOUT); }) /* @@ -208,7 +186,7 @@ describe('ActsAnsSlotSystemPromise', function () { it('ActsAnsSlotSystemPromise_0200', 0, async function (done) { console.debug("====>ActsAnsSlotSystemPromise_0200 start====>"); console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - notification.addSlot( + await notification.addSlot( { type: notification.SlotType.SOCIAL_COMMUNICATION, level: notification.SlotLevel.LEVEL_NONE, @@ -219,11 +197,8 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_SOCIAL_COMMUNICATION_Sound_First", lightEnabled: true, lightColor: 1 - } - ).then(()=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION promise====>"); - }) - notification.addSlot( + }); + await notification.addSlot( { type: notification.SlotType.SOCIAL_COMMUNICATION, level: notification.SlotLevel.LEVEL_DEFAULT, @@ -234,29 +209,27 @@ describe('ActsAnsSlotSystemPromise', function () { sound: "slot_SOCIAL_COMMUNICATION_Sound_Second", lightEnabled: true, lightColor: 1 - } - ).then(()=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION promise====>"); - }) - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION: ====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION).then((data) => { - console.debug("====>getSlotActsAnsSlotSystemPromise_0200 enter====>"); - console.debug("====>getSlotActsAnsSlotSystemPromise_0200 data====>" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_Desc_First"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_Sound_First"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(1); - console.debug("====>getSlotActsAnsSlotSystemPromise_0200 finish====>"); - done(); - }) + }); + console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); + var data = await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION); + console.debug("====>getSlot ActsAnsSlotSystemPromise_0200 enter====>"); + console.debug("====>getSlot ActsAnsSlotSystemPromise_0200 data:" + JSON.stringify(data)); + expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_Desc_First"); + expect(data.badgeFlag).assertEqual(false); + expect(data.bypassDnd).assertEqual(true); + expect(data.vibrationEnabled).assertEqual(true); + expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_Sound_First"); + expect(data.lightEnabled).assertEqual(true); + expect(data.lightColor).assertEqual(1); + console.debug("====>getSlot ActsAnsSlotSystemPromise_0200 finish====>"); + console.debug("====>removeSlot SOCIAL_COMMUNICATION start====>"); + await notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION); console.debug("====>ActsAnsSlotSystemPromise_0200 end====>"); + done(); setTimeout(function (){ console.debug("====>time out ActsAnsSlotSystemPromise_0200====>"); - }, 10000); + }, TIMEOUT); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansslotsystempromise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslotsystempromise/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json old mode 100644 new mode 100755 index d192e65c6fd06254998eda4d3848e0055af12072..2325780daf1d89da874936f208cc9ddcf6a22fb3 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json @@ -2,9 +2,9 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "150000", + "test-timeout": "60000", "package": "com.example.actsansslotaddremoveall", - "shell-timeout": "150000" + "shell-timeout": "60000" }, "kits": [ { diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/config.json old mode 100644 new mode 100755 index 86a9d7d47936b9075168de6a6eab79f675b7d155..7bab190ad04168472960a8074f11645216d42ac7 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/config.json +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app":{ - "bundleName":"com.example.actsansslotaddremoveall", - "vendor":"example", - "version":{ - "code":1, - "name":"1.0" - }, - "apiVersion":{ - "compatible":4, - "target":5, - "releaseType":"Beta1" - } - }, - "deviceConfig":{}, - "module":{ - "package":"com.example.actsansslotaddremoveall", - "name":".MyApplication", - "deviceType":[ - "phone" - ], - "distro":{ - "deliveryWithInstall":true, - "moduleName":"entry", - "moduleType":"entry" - }, - "abilities":[ - { - "skills":[ - { - "entities":[ - "entity.system.home" - ], - "actions":[ - "action.system.home" - ] - } - ], - "name":"com.example.actsansslotaddremoveall.MainAbility", - "icon":"$media:icon", - "description":"$string:mainability_description", - "label":"$string:app_name", - "type":"page", - "visible": true, - "launchType":"standard" - } - ], - "js":[ - { - "pages":[ - "pages/index/index" - ], - "name":"default", - "window":{ - "designWidth":720, - "autoDesignWidth":false - } - } - ] - } +{ + "app":{ + "bundleName":"com.example.actsansslotaddremoveall", + "vendor":"example", + "version":{ + "code":1, + "name":"1.0" + }, + "apiVersion":{ + "compatible":4, + "target":5, + "releaseType":"Beta1" + } + }, + "deviceConfig":{}, + "module":{ + "package":"com.example.actsansslotaddremoveall", + "name":".MyApplication", + "deviceType":[ + "phone" + ], + "distro":{ + "deliveryWithInstall":true, + "moduleName":"entry", + "moduleType":"entry" + }, + "abilities":[ + { + "skills":[ + { + "entities":[ + "entity.system.home" + ], + "actions":[ + "action.system.home" + ] + } + ], + "name":"com.example.actsansslotaddremoveall.MainAbility", + "icon":"$media:icon", + "description":"$string:mainability_description", + "label":"$string:app_name", + "type":"page", + "visible": true, + "launchType":"standard" + } + ], + "js":[ + { + "pages":[ + "pages/index/index" + ], + "name":"default", + "window":{ + "designWidth":720, + "autoDesignWidth":false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/app.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/app.js +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index 1500ad7f117e8a5f4647ff3096b2be7425008dc8..ea014a94c7ead9bd7c952e58d736ff2125d8079b --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试addSlots接口和removeAllSlots接口" }, onInit() { - this.title = this.data.title; + this.title = "测试addSlots接口和removeAllSlots接口"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 4d519fa266241bea7de1ade3f736a0196841fc9a..fbcbece49df991081a6d6da4be9d83c50d15adc4 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ActsAnsSlotAddRemoveAll" - }, - { - "name":"mainability_description", - "value":"JS_Phone_Empty Feature Ability" - } - ] +{ + "string":[ + { + "name":"app_name", + "value":"ActsAnsSlotAddRemoveAll" + }, + { + "name":"mainability_description", + "value":"JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/ExampleJsunit.test.js old mode 100644 new mode 100755 index dd2ab70e071e08df5bb57fc8e21870ca619cac5c..1e1e1cf51b7a034ccfb5a2186c8578e5ce085951 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/ExampleJsunit.test.js @@ -15,321 +15,307 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +const TIMEOUT = 2000; describe('ActsAnsSlotAddRemoveAll', function () { /* * @tc.number : ActsAnsSlotAddRemoveAll_0100 - * @tc.name : Verify that removeAllSlots after addSlots - * @tc.desc : removeAllSlots after addSlots + * @tc.name : removeAllSlots after addSlots callback + * @tc.desc : Verify that removeAllSlots after addSlots */ it('ActsAnsSlotAddRemoveAll_0100', 0, async function (done) { console.debug("====>ActsAnsSlotAddRemoveAll_0100 start====>"); console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0100====>"); notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - } + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SOCIAL_COMMUNICATION_sound", + lightEnabled: true, + lightColor: 1 + }, + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SERVICE_INFORMATION_sound", + lightEnabled: true, + lightColor: 2 + }, + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_CONTENT_INFORMATION_sound", + lightEnabled: true, + lightColor: 3 + }, + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound", + lightEnabled: true, + lightColor: 4 + } ], (err)=>{ console.debug("====>addSlots callback ActsAnsSlotAddRemoveAll_0100====>"); expect(err.code).assertEqual(0); - }) - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0100====>"); - await notification.getSlots((err, data)=>{ - console.debug("====>getSlots callback ActsAnsSlotAddRemoveAll_0100====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); + console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0100====>"); + notification.getSlots((err, data)=>{ + console.debug("====>getSlots callback ActsAnsSlotAddRemoveAll_0100====>"); + console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(data)); + try{ + expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); + expect(data[0].badgeFlag).assertEqual(false); + expect(data[0].bypassDnd).assertEqual(true); + expect(data[0].vibrationEnabled).assertEqual(true); + expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); + expect(data[0].lightEnabled).assertEqual(true); + expect(data[0].lightColor).assertEqual(1); - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); + expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); + expect(data[1].badgeFlag).assertEqual(false); + expect(data[1].bypassDnd).assertEqual(true); + expect(data[1].vibrationEnabled).assertEqual(true); + expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); + expect(data[1].lightEnabled).assertEqual(true); + expect(data[1].lightColor).assertEqual(2); - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); + expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); + expect(data[2].badgeFlag).assertEqual(false); + expect(data[2].bypassDnd).assertEqual(true); + expect(data[2].vibrationEnabled).assertEqual(true); + expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); + expect(data[2].lightEnabled).assertEqual(true); + expect(data[2].lightColor).assertEqual(3); + + expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data[3].badgeFlag).assertEqual(false); + expect(data[3].bypassDnd).assertEqual(true); + expect(data[3].vibrationEnabled).assertEqual(true); + expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data[3].lightEnabled).assertEqual(true); + expect(data[3].lightColor).assertEqual(4); + console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0100====>"); + console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0100====>"); + notification.removeAllSlots((err)=>{ + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0100 callback====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0100====>"); + notification.getSlots((err, data)=>{ + console.debug("====>getSlots second 0100 err====>" + JSON.stringify(err)); + console.debug("====>getSlots second 0100 data====>" + JSON.stringify(data)); + console.debug("====>getSlots second 0100 data.length====>"+ data.length); + expect(data.length).assertEqual(0); + console.debug("====>ActsAnsSlotAddRemoveAll_0100 end====>"); + done(); + }) + }) + }catch(err){ + console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + }) - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0100====>"); - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(err)); - expect().assertFail(); - } - }) - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0100====>"); - await notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0100 callback====>"); - expect(err.code).assertEqual(0); - }) - console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0100====>"); - await notification.getSlots((err, data)=>{ - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0100 err====>" + JSON.stringify(err)); - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0100 data====>" + JSON.stringify(data)); - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0100 data.length====>"+ data.length); - expect(data.length).assertEqual(0); - console.debug("====>ActsAnsSlotAddRemoveAll_0100 end====>"); - done(); }) setTimeout(function (){ console.debug("====>time out ActsAnsSlotAddRemoveAll_0100====>"); - }, 20000); + }, TIMEOUT); }) /* * @tc.number : ActsAnsSlotAddRemoveAll_0200 - * @tc.name : Verify that removeAllSlots after addSlots - * @tc.desc : removeAllSlots after addSlots + * @tc.name : removeAllSlots after addSlots promise + * @tc.desc : Verify that removeAllSlots after addSlots */ it('ActsAnsSlotAddRemoveAll_0200', 0, async function (done) { console.debug("====>ActsAnsSlotAddRemoveAll_0200 start====>"); console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0200====>"); - notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_second", - lightEnabled: false, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SERVICE_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_CONTENT_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_OTHER_TYPES_sound_second", - lightColor: 4 - } - - ]).then((err)=>{ - console.debug("====>addSlots ActsAnsSlotAddRemoveAll_0200====>"); - }) - + await notification.addSlots([ + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_SOCIAL_COMMUNICATION_sound_second", + lightEnabled: false, + lightColor: 1 + }, + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_SERVICE_INFORMATION_sound_second", + lightEnabled: false, + lightColor: 2 + }, + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_CONTENT_INFORMATION_sound_second", + lightEnabled: false, + lightColor: 3 + }, + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_OTHER_TYPES_sound_second", + lightColor: 4 + } + ]); console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0200====>"); - await notification.getSlots((err, data)=>{ - console.debug("====>getSlots enter ActsAnsSlotAddRemoveAll_0200====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0200====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0200====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc_second"); - expect(data[0].badgeFlag).assertEqual(true); - expect(data[0].bypassDnd).assertEqual(false); - expect(data[0].vibrationEnabled).assertEqual(false); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound_second"); - expect(data[0].lightEnabled).assertEqual(false); - expect(data[0].lightColor).assertEqual(1); + var data = await notification.getSlots(); + console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0200 data:" + JSON.stringify(data)); + try{ + expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc_second"); + expect(data[0].badgeFlag).assertEqual(true); + expect(data[0].bypassDnd).assertEqual(false); + expect(data[0].vibrationEnabled).assertEqual(false); + expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound_second"); + expect(data[0].lightEnabled).assertEqual(false); + expect(data[0].lightColor).assertEqual(1); - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); - expect(data[1].badgeFlag).assertEqual(true); - expect(data[1].bypassDnd).assertEqual(false); - expect(data[1].vibrationEnabled).assertEqual(false); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound_second"); - expect(data[1].lightEnabled).assertEqual(false); - expect(data[1].lightColor).assertEqual(2); + expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); + expect(data[1].badgeFlag).assertEqual(true); + expect(data[1].bypassDnd).assertEqual(false); + expect(data[1].vibrationEnabled).assertEqual(false); + expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound_second"); + expect(data[1].lightEnabled).assertEqual(false); + expect(data[1].lightColor).assertEqual(2); - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc_second"); - expect(data[2].badgeFlag).assertEqual(true); - expect(data[2].bypassDnd).assertEqual(false); - expect(data[2].vibrationEnabled).assertEqual(false); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound_second"); - expect(data[2].lightEnabled).assertEqual(false); - expect(data[2].lightColor).assertEqual(3); + expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc_second"); + expect(data[2].badgeFlag).assertEqual(true); + expect(data[2].bypassDnd).assertEqual(false); + expect(data[2].vibrationEnabled).assertEqual(false); + expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound_second"); + expect(data[2].lightEnabled).assertEqual(false); + expect(data[2].lightColor).assertEqual(3); - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc_second"); - expect(data[3].badgeFlag).assertEqual(true); - expect(data[3].bypassDnd).assertEqual(false); - expect(data[3].vibrationEnabled).assertEqual(false); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound_second"); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0200====>"); - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0200====>" + JSON.stringify(err)); - expect().assertFail(); - } - }) - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0200====>"); - notification.removeAllSlots().then((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0200 callback====>"); - }) - console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0200====>"); - notification.getSlots().then((data)=>{ - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0200 data====>"+ JSON.stringify(data)); - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0200 data.length====>"+ data.length); - expect(data.length).assertEqual(0); - console.debug("====>ActsAnsSlotAddRemoveAll_0200 end====>"); + expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc_second"); + expect(data[3].badgeFlag).assertEqual(true); + expect(data[3].bypassDnd).assertEqual(false); + expect(data[3].vibrationEnabled).assertEqual(false); + expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound_second"); + expect(data[3].lightColor).assertEqual(4); + console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0200====>"); + }catch(err){ + console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0200====>" + JSON.stringify(err)); + expect().assertFail(); done(); - }) + } + console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0200====>"); + await notification.removeAllSlots(); + console.debug("====>ActsAnsSlotAddRemoveAll_0200 end====>"); + done(); setTimeout(function (){ console.debug("====>time out ActsAnsSlotAddRemoveAll_0200====>"); - }, 20000); + }, TIMEOUT); }) /* * @tc.number : ActsAnsSlotAddRemoveAll_0300 - * @tc.name : Verify that removeAllSlots after addSlots repeatedly - * @tc.desc : removeAllSlots after addSlots repeatedly + * @tc.name : removeAllSlots after addSlots repeatedly callback + * @tc.desc : Verify that removeAllSlots after addSlots repeatedly */ it('ActsAnsSlotAddRemoveAll_0300', 0, async function (done) { console.debug("====>ActsAnsSlotAddRemoveAll_0300 start====>"); console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0300====>"); - await notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - } + notification.addSlots([ + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SOCIAL_COMMUNICATION_sound", + lightEnabled: true, + lightColor: 1 + }, + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SERVICE_INFORMATION_sound", + lightEnabled: true, + lightColor: 2 + }, + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_CONTENT_INFORMATION_sound", + lightEnabled: true, + lightColor: 3 + }, + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound", + lightEnabled: true, + lightColor: 4 + } ], (err)=>{ console.debug("====>addSlots callback ActsAnsSlotAddRemoveAll_0300====>"); expect(err.code).assertEqual(0); - }) - - console.debug("====>addSlots twice start ActsAnsSlotAddRemoveAll_0300====>"); - await notification.addSlots([ + console.debug("====>addSlots second time ActsAnsSlotAddRemoveAll_0300====>"); + notification.addSlots([ { type: notification.SlotType.SOCIAL_COMMUNICATION, level: notification.SlotLevel.LEVEL_NONE, @@ -374,253 +360,365 @@ describe('ActsAnsSlotAddRemoveAll', function () { lightEnabled: true, lightColor: 8 } - ], (err)=>{ - console.debug("====>addSlots twice callback ActsAnsSlotAddRemoveAll_0300====>"); - expect(err.code).assertEqual(0); - }) - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0300====>"); - await notification.getSlots((err, data)=>{ - console.debug("====>getSlots callback ActsAnsSlotAddRemoveAll_0300====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); + ], (err)=>{ + console.debug("====>addSlots twice callback ActsAnsSlotAddRemoveAll_0300====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0300====>"); + notification.getSlots((err, data)=>{ + console.debug("====>getSlots callback ActsAnsSlotAddRemoveAll_0300====>"); + console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(data)); + try{ + expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); + expect(data[0].badgeFlag).assertEqual(false); + expect(data[0].bypassDnd).assertEqual(true); + expect(data[0].vibrationEnabled).assertEqual(true); + expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); + expect(data[0].lightEnabled).assertEqual(true); + expect(data[0].lightColor).assertEqual(1); - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); + expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); + expect(data[1].badgeFlag).assertEqual(false); + expect(data[1].bypassDnd).assertEqual(true); + expect(data[1].vibrationEnabled).assertEqual(true); + expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); + expect(data[1].lightEnabled).assertEqual(true); + expect(data[1].lightColor).assertEqual(2); - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); + expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); + expect(data[2].badgeFlag).assertEqual(false); + expect(data[2].bypassDnd).assertEqual(true); + expect(data[2].vibrationEnabled).assertEqual(true); + expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); + expect(data[2].lightEnabled).assertEqual(true); + expect(data[2].lightColor).assertEqual(3); + + expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); + expect(data[3].badgeFlag).assertEqual(false); + expect(data[3].bypassDnd).assertEqual(true); + expect(data[3].vibrationEnabled).assertEqual(true); + expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); + expect(data[3].lightEnabled).assertEqual(true); + expect(data[3].lightColor).assertEqual(4); + console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0300====>"); + console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0300====>"); + notification.removeAllSlots((err)=>{ + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0300 callback====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0300====>"); + notification.getSlots((err, data)=>{ + console.debug("====>getSlots second 0300 err====>" + JSON.stringify(err)); + console.debug("====>getSlots second 0300 data====>" + JSON.stringify(data)); + console.debug("====>getSlots second 0300 data.length====>"+ data.length); + expect(data.length).assertEqual(0); + console.debug("====>ActsAnsSlotAddRemoveAll_0300 end====>"); + done(); + }) + }) + }catch(err){ + console.error("====>getSlots catch err 0300====>" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + }) + }) - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0300====>"); - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(err)); - expect().assertFail(); - } - }) - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0300====>"); - await notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0300 callback====>"); - expect(err.code).assertEqual(0); - }) - console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0300====>"); - await notification.getSlots((err, data)=>{ - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0300 err====>" + JSON.stringify(err)); - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0300 data====>" + JSON.stringify(data)); - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0300 data.length====>"+ data.length); - expect(data.length).assertEqual(0); - console.debug("====>ActsAnsSlotAddRemoveAll_0300 end====>"); - done(); }) setTimeout(function (){ console.debug("====>time out ActsAnsSlotAddRemoveAll_0300====>"); - }, 20000); + }, TIMEOUT); }) /* * @tc.number : ActsAnsSlotAddRemoveAll_0400 - * @tc.name : Verify that removeAllSlots after addSlots repeatedly - * @tc.desc : removeAllSlots after addSlots repeatedly + * @tc.name : removeAllSlots after addSlots repeatedly promise + * @tc.desc : Verify that removeAllSlots after addSlots repeatedly */ it('ActsAnsSlotAddRemoveAll_0400', 0, async function (done) { console.debug("====>ActsAnsSlotAddRemoveAll_0400 start====>"); console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0400====>"); - notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_second", - lightEnabled: false, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SERVICE_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_CONTENT_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_OTHER_TYPES_sound_second", - lightColor: 4 - } + await notification.addSlots([ + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_SOCIAL_COMMUNICATION_sound_second", + lightEnabled: false, + lightColor: 1 + }, + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_SERVICE_INFORMATION_sound_second", + lightEnabled: false, + lightColor: 2 + }, + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_CONTENT_INFORMATION_sound_second", + lightEnabled: false, + lightColor: 3 + }, + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc_second", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_OTHER_TYPES_sound_second", + lightColor: 4 + } + ]); + console.debug("====>addSlots twice start ActsAnsSlotAddRemoveAll_0400====>"); + await notification.addSlots([ + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + level: notification.SlotLevel.LEVEL_NONE, + desc: "slot_SOCIAL_COMMUNICATION_desc_second_twice", + badgeFlag: false, + bypassDnd: false, + vibrationEnabled: false, + sound: "slot_SOCIAL_COMMUNICATION_sound_second_twice", + lightEnabled: true, + lightColor: 1 + }, + { + type: notification.SlotType.SERVICE_INFORMATION, + level: notification.SlotLevel.LEVEL_MIN, + desc: "slot_SERVICE_INFORMATION_desc_second_twice", + badgeFlag: true, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_SERVICE_INFORMATION_sound_second_twice", + lightEnabled: true, + lightColor: 2 + }, + { + type: notification.SlotType.CONTENT_INFORMATION, + level: notification.SlotLevel.LEVEL_LOW, + desc: "slot_CONTENT_INFORMATION_desc_second_twice", + badgeFlag: true, + bypassDnd: false, + vibrationEnabled: true, + sound: "slot_CONTENT_INFORMATION_sound_second_twice", + lightEnabled: false, + lightColor: 3 + }, + { + type: notification.SlotType.OTHER_TYPES, + level: notification.SlotLevel.LEVEL_DEFAULT, + desc: "slot_OTHER_TYPES_desc_second_twice", + badgeFlag: false, + bypassDnd: true, + vibrationEnabled: true, + sound: "slot_OTHER_TYPES_sound_second_twice", + lightColor: 4 + } + ]); + console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0400====>"); + var data = await notification.getSlots(); + console.debug("====>getSlots enter ActsAnsSlotAddRemoveAll_0400====>"); + console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(data)); + try{ + expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); + expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc_second"); + expect(data[0].badgeFlag).assertEqual(true); + expect(data[0].bypassDnd).assertEqual(false); + expect(data[0].vibrationEnabled).assertEqual(false); + expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound_second"); + expect(data[0].lightEnabled).assertEqual(false); + expect(data[0].lightColor).assertEqual(1); - ]).then((err)=>{ - console.debug("====>addSlots ActsAnsSlotAddRemoveAll_0400====>"); - }) + expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); + expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); + expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); + expect(data[1].badgeFlag).assertEqual(true); + expect(data[1].bypassDnd).assertEqual(false); + expect(data[1].vibrationEnabled).assertEqual(false); + expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound_second"); + expect(data[1].lightEnabled).assertEqual(false); + expect(data[1].lightColor).assertEqual(2); - console.debug("====>addSlots twice start ActsAnsSlotAddRemoveAll_0400====>"); - notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_second_twice", - badgeFlag: false, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_second_twice", - lightEnabled: true, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc_second_twice", - badgeFlag: true, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound_second_twice", - lightEnabled: true, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_second_twice", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound_second_twice", - lightEnabled: false, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_second_twice", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound_second_twice", - lightColor: 4 - } + expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); + expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); + expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc_second"); + expect(data[2].badgeFlag).assertEqual(true); + expect(data[2].bypassDnd).assertEqual(false); + expect(data[2].vibrationEnabled).assertEqual(false); + expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound_second"); + expect(data[2].lightEnabled).assertEqual(false); + expect(data[2].lightColor).assertEqual(3); - ]).then((err)=>{ - console.debug("====>addSlots twice ActsAnsSlotAddRemoveAll_0400====>"); - }) + expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); + expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc_second"); + expect(data[3].badgeFlag).assertEqual(true); + expect(data[3].bypassDnd).assertEqual(false); + expect(data[3].vibrationEnabled).assertEqual(false); + expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound_second"); + expect(data[3].lightColor).assertEqual(4); + console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0400====>"); + }catch(err){ + console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0400====>"); + await notification.removeAllSlots(); + console.debug("====>ActsAnsSlotAddRemoveAll_0400 end====>"); + done(); + setTimeout(function (){ + console.debug("====>time out ActsAnsSlotAddRemoveAll_0400====>"); + }, TIMEOUT); + }) - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0400====>"); - await notification.getSlots((err, data)=>{ - console.debug("====>getSlots enter ActsAnsSlotAddRemoveAll_0400====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(err)); + /* + * @tc.number : ActsAnsSlotAddRemoveAll_0500 + * @tc.name : removeAllSlots callback + * @tc.desc : Verify that removeAllSlots without adding slots + */ + it('ActsAnsSlotAddRemoveAll_0500', 0, async function (done) { + console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0500====>"); + notification.removeAllSlots((err)=>{ + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0500 err:" + JSON.stringify(err)); expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc_second"); - expect(data[0].badgeFlag).assertEqual(true); - expect(data[0].bypassDnd).assertEqual(false); - expect(data[0].vibrationEnabled).assertEqual(false); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound_second"); - expect(data[0].lightEnabled).assertEqual(false); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); - expect(data[1].badgeFlag).assertEqual(true); - expect(data[1].bypassDnd).assertEqual(false); - expect(data[1].vibrationEnabled).assertEqual(false); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound_second"); - expect(data[1].lightEnabled).assertEqual(false); - expect(data[1].lightColor).assertEqual(2); + done(); + }) + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0500====>"); + setTimeout(function (){ + console.debug("====>time out ActsAnsSlotAddRemoveAll_0500====>"); + }, TIMEOUT); + }) - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc_second"); - expect(data[2].badgeFlag).assertEqual(true); - expect(data[2].bypassDnd).assertEqual(false); - expect(data[2].vibrationEnabled).assertEqual(false); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound_second"); - expect(data[2].lightEnabled).assertEqual(false); - expect(data[2].lightColor).assertEqual(3); + /* + * @tc.number : ActsAnsSlotAddRemoveAll_0600 + * @tc.name : removeAllSlots promise + * @tc.desc : Verify that removeAllSlots without adding slots + */ + it('ActsAnsSlotAddRemoveAll_0600', 0, async function (done) { + console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0600====>"); + notification.removeAllSlots().then(()=>{ + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0600====>"); + done(); + }).catch((err)=>{ + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0600 err:" + JSON.stringify(err)); + expect().assertFail(); + done(); + }) + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0600====>"); + setTimeout(function (){ + console.debug("====>time out ActsAnsSlotAddRemoveAll_0600====>"); + }, TIMEOUT); + }) - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc_second"); - expect(data[3].badgeFlag).assertEqual(true); - expect(data[3].bypassDnd).assertEqual(false); - expect(data[3].vibrationEnabled).assertEqual(false); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound_second"); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0400====>"); - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(err)); - expect().assertFail(); + /* + * @tc.number : ActsAnsSlotAddRemoveAll_0700 + * @tc.name : addSlots callback + * @tc.desc : Verify that addSlots with same type of slot + */ + it('ActsAnsSlotAddRemoveAll_0700', 0, async function (done) { + console.debug("====>start ActsAnsSlotAddRemoveAll_0700====>"); + await notification.addSlots([ + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + desc: "slot_SOCIAL_COMMUNICATION_desc_first" + }, + { + type: notification.SlotType.SOCIAL_COMMUNICATION, + desc: "slot_SERVICE_INFORMATION_desc_second" } + ], (err)=>{ + console.debug("====>addSlots callback ActsAnsSlotAddRemoveAll_0700====>"); + expect(err.code).assertEqual(0); + console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0700====>"); + notification.getSlots((err, data)=>{ + console.debug("====>getSlots enter ActsAnsSlotAddRemoveAll_0700====>"); + console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0700====>" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0700====>" + JSON.stringify(data)); + try{ + console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0700 data.length:====>" + data.length); + expect(data.length).assertEqual(1); + expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); + expect(data[0].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); + console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0700====>"); + notification.removeAllSlots((err)=>{ + console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0700 err:" + JSON.stringify(err)); + console.debug("====>ActsAnsSlotAddRemoveAll_0700 end====>"); + expect(err.code).assertEqual(0); + done(); + }) + }catch(err){ + console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0700====>" + JSON.stringify(err)); + expect().assertFail(); + done(); + } + }) }) - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0400====>"); - notification.removeAllSlots().then((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0400 callback====>"); - }) - console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0400====>"); - notification.getSlots().then((data)=>{ - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0400 data====>"+ JSON.stringify(data)); - console.debug("====>getSlots second ActsAnsSlotAddRemoveAll_0400 data.length====>"+ data.length); - expect(data.length).assertEqual(0); - console.debug("====>ActsAnsSlotAddRemoveAll_0400 end====>"); + setTimeout(function (){ + console.debug("====>time out ActsAnsSlotAddRemoveAll_0700====>"); + }, TIMEOUT); + }) + + /* + * @tc.number : ActsAnsSlotAddRemoveAll_0800 + * @tc.name : addSlots promise + * @tc.desc : Verify that addSlots with same type of slot + */ + it('ActsAnsSlotAddRemoveAll_0800', 0, async function (done) { + console.debug("====>start ActsAnsSlotAddRemoveAll_0800====>"); + await notification.addSlots([ + { + type: notification.SlotType.OTHER_TYPES, + desc: "slot_SOCIAL_COMMUNICATION_desc_first" + }, + { + type: notification.SlotType.OTHER_TYPES, + desc: "slot_SERVICE_INFORMATION_desc_second" + } + ]); + console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0800====>"); + var data = await notification.getSlots(); + console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0800 data:" + JSON.stringify(data)); + try{ + console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0800 data.length:====>" + data.length); + expect(data.length).assertEqual(1); + expect(data[0].type).assertEqual(notification.SlotType.OTHER_TYPES); + expect(data[0].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); + console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0800====>"); + await notification.removeAllSlots(); + console.debug("====>ActsAnsSlotAddRemoveAll_0800 end====>"); done(); - }) + }catch(err){ + console.error("====>getSlots err ActsAnsSlotAddRemoveAll_0800====>" + JSON.stringify(err)); + expect().assertFail(); + done(); + } setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0400====>"); - }, 20000); + console.debug("====>time out ActsAnsSlotAddRemoveAll_0800====>"); + }, TIMEOUT); }) }) \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/BUILD.gn b/notification/ans_standard/publish_test/BUILD.gn index 2f26a77fc6d49d3a1bacf320ba2f1c13d5b41f70..59dab58b8a2d9b9d7ca6a708d6e15dfb3db68790 100644 --- a/notification/ans_standard/publish_test/BUILD.gn +++ b/notification/ans_standard/publish_test/BUILD.gn @@ -18,19 +18,13 @@ group("publish_test") { deps = [ #"actsanspublishcontroltest:ActsAnsPublishControlTest", #"badgedisplayed:badgedisplayed", - #"badgedisplayedset:badgedisplayedset", - "enablenotification:enablenotification", + #"enablenotification:enablenotification", + "getactive:getactive", + "getwantagentinfo:ActsAnsGetWantAgentInfoTest", - #"enablenotificationset:enablenotificationset", - #"getactive:getactive", - "getwantagentinfo:getwantagentinfo", - - #"publishcontentype:ActsAnsNotificationTest", + #"publishcontentype:publishcontentype", #"subscribe:subscribe", #"unsubscribe:ActsAnsUnSubscriberTest", - #"activeButton:ActsAnsActionButtonTest", - #"publishicontest:ActsAnsIconTest", - #"publishimage:ActsAnsPublishImageTest", "wantagent:wantagent", ] } diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js deleted file mode 100644 index 1601e14ac914e859b5a80b17e179e3c13eb45380..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import wantagent from '@ohos.wantAgent' -import image from '@ohos.multimedia.image' -import { OperationType, Flags } from '@ohos.wantagent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -var largeBuffer -var smallBuffer -var opts -var subInfo -var largeIcon -var smallIcon -var time = 1000 -describe('ActsAnsActionButtonTest', function () { - console.info("===========ActsDoNotSubscriberTest start====================>"); - - //consume - function consumeCallback(err,data) { - console.debug("==========================>consumeDoNotCallbackOne data : =======================>" +err+ JSON.stringify(data)); - expect(typeof(data.request.actionButtons)).assertEqual('object') - for(let i=0; i" + data.request.actionButtons[i].title); - console.debug("======consumeCallback====sortings.hashCode:====>" + data.request.actionButtons[i].wantAgent); - console.debug("======consumeCallback====sortings.hashCode:====>" + data.request.actionButtons[i].icon); - } - } - //consume - function consumeCallbackTwo(err,data) { - console.debug("==========================>consumeDoNotCallbackTwo data : =======================>" +err+ JSON.stringify(data)); - expect(typeof(data.request.actionButtons)).assertEqual('object') - for(let i=0; i" + data.request.actionButtons[i].title); - console.debug("======consumeDoNotCallbackTwo====sortings.hashCode:====>" + data.request.actionButtons[i].wantAgent); - console.debug("======consumeCallback====sortings.hashCode:====>" + data.request.actionButtons[i].icon); - } - } - //subscribe - function subscribeCallback(err) { - console.debug("==========================>subscribeDoNotCallback=======================>"); - } - function publishCallback200(){ - console.debug("==========================>publishCallback200=======================>"); - } - /* - * @tc.number: ActsDoNotSubscriber_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsActiveButton_test_0100', 0, async function (done) { - console.debug("===============ActsActiveButton_test_0100======begin====================>"); - - var subInfo ={ - onConsume:consumeCallback - } - try{ - await notify.subscribe(subInfo,subscribeCallback); - }catch(err) { - console.error('=ActsActiveButton_test_0100 订阅 activeButton err:'+err); - } - console.debug("===============ActsActiveButton_test_0100=======end3===================>"); - - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.example.test", - abilityName: "com.example.test.TriggerAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - }; - var wantAgentData = await wantagent.getWantAgent(agentInfo); - largeBuffer = new ArrayBuffer(64); - smallBuffer = new ArrayBuffer(32); - opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}} - const promise_Large = image.createPixelMap(largeBuffer, opts); - promise_Large.then((data) => { - console.debug("==========================createPixelMap_promise_Large=======================>"); - largeIcon = data; - console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+largeIcon); - - const promise_Small = image.createPixelMap(smallBuffer, opts); - promise_Small.then((data) => { - console.debug("==========================createPixelMap_promise_Small=======================>"); - smallIcon = data; - console.debug("==========================createPixelMap_promise_Small smallIcon=======================>"+smallIcon); - - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText : { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText: "long_text", - briefText: "long_briefText", - expandedTitle: "long_expandedTitle" - }, - }, - id: 1, - slotType : notify.SlotType.SERVICE_INFORMATION, - actionButtons: [{title:"button", wantAgent:wantAgentData,icon:largeIcon},{title:"button", wantAgent:wantAgentData,icon:smallIcon}] - } - notify.publish(notificationRequest, publishCallback200); - console.info("===============ActsActiveButton_test_0100==========================>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsActiveButton_test_0100====>"); - }, time); - }) - }) -}) -}) - diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/BUILD.gn b/notification/ans_standard/publish_test/actsanspublishcontroltest/BUILD.gn old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/Test.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/Test.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/config.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/config.json old mode 100644 new mode 100755 index 13898821904192135b5ecb4bf5cb5e6b906f1d94..0ab36beed83e874add1fb96314287e896550d6e8 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/config.json @@ -1,61 +1,61 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishcontroltest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishcontroltest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsanspublishcontroltest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.actsanspublishcontroltest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsanspublishcontroltest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsanspublishcontroltest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/app.js old mode 100644 new mode 100755 index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 index cf6ad4f21641b69b7e05b937d75d0404eb9da329..de74958697100dce2557892fe8bfaca418d9f60b --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/default/pages/index/index.js @@ -23,7 +23,7 @@ export default { title: "测试发布流控" }, onInit() { - this.title = this.data.title; + this.title = "测试发布流控"; }, onShow() { console.info('onShow finish') diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index ac45ce5da44bc16e08d49e380565c417fc49e1e2..61e3e877a99d6ee0f54a8a345ab131158dfa2569 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsPublishControlTest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ActsAnsPublishControlTest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/ExampleJsunit.test.js old mode 100644 new mode 100755 index 4ab876f207f4299052f708f3f1dc1b0d37e0d40b..f1b7c6de6b5e735d1e694c35243871cb18f49ad1 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/ExampleJsunit.test.js @@ -26,9 +26,10 @@ var notificationSubscriber = { var idRecord = new Array(20).fill(0); const publishFrequence = 10; +const TIMEOUT = 3000; -function consumeCallback(err,data) { - console.debug("====>consumeCallback err: ====>" + JSON.stringify(err)); +function consumeCallback(data) { + console.debug("====>consumeCallback data: ====>" + JSON.stringify(data)); console.debug("====>consumeCallback id: ====>" + data.request.id); switch(data.request.id){ case 1: @@ -119,9 +120,8 @@ function consumeCallback(err,data) { } } -function subscribeOnCallback(err) { - console.debug("====>subscribeOnCallback err: ====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); +function subscribeOnCallback() { + console.debug("====>subscribeOnCallback enter====>"); } function subscribeCallback(err) { @@ -192,7 +192,8 @@ describe('ActsAnsPublishControlTest', function () { /* * @tc.number : ActsAnsPublishControlTest_0100 * @tc.name : Verify rejection of publishing notifications that exceed the threshold - * @tc.desc : Twenty notifications are published continuously within one second, and the first ten notifications can be received, the last ten notifications cannot be received + * @tc.desc : Twenty notifications are published continuously within one second, and the first + * ten notifications can be received, the last ten notifications cannot be received */ it('ActsAnsPublishControlTest_0100', 0, async function (done) { console.debug("====>ActsAnsPublishControlTest_0100 start====>"); @@ -223,10 +224,10 @@ describe('ActsAnsPublishControlTest', function () { function publish_the_twentieth_notification(err){ console.debug("====>publish the twentieth notification 20 20 err: ====>" + JSON.stringify(err)); console.debug("====>time out start====>"); - setTimeout(timeOut, 5000); + setTimeout(timeOut, TIMEOUT); } - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -237,7 +238,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 1 }, publish_the_first_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -248,7 +249,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 2 }, publish_the_second_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -259,7 +260,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 3 }, publish_the_third_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -270,7 +271,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 4 }, publish_the_fourth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -281,7 +282,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 5 }, publish_the_fifth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -292,7 +293,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 6 }, publish_the_sixth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -303,7 +304,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 7 }, publish_the_seventh_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -314,7 +315,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 8 }, publish_the_eighth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -325,7 +326,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 9 }, publish_the_ninth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -336,7 +337,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 10 }, publish_the_tenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -347,7 +348,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 11 }, publish_the_eleventh_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -358,7 +359,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 12 }, publish_the_twelfth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -369,7 +370,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 13 }, publish_the_thirteenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -380,7 +381,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 14 }, publish_the_fourteenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -391,7 +392,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 15 }, publish_the_fifteenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -402,7 +403,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 16 }, publish_the_sixteenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -413,7 +414,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 17 }, publish_the_seventeenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -424,7 +425,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 18 }, publish_the_eighteenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { @@ -435,7 +436,7 @@ describe('ActsAnsPublishControlTest', function () { }, id: 19 }, publish_the_nineteenth_notification); - await notification.publish({ + notification.publish({ content: { contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/actsanspublishcontroltest/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/actsanspublishcontroltest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn index 55ff52e34c5ebc4397e185b77c6f96007f4f810c..d74a19a8421c8e0b1bb175acb6ca1b79bcaf9865 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn +++ b/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn @@ -17,13 +17,8 @@ group("badgedisplayed") { testonly = true if (is_standard_system) { deps = [ - #"badgedisplayfive:ActsAnsBadgeDisplayFiveTest", - #"badgedisplayfour:ActsAnsBadgeDisplayFourTest", - #"badgedisplayone:ActsAnsBadgeDisplayOneTest", - #"badgedisplaysix:ActsAnsBadgeDisplaySixTest", - #"badgedisplaytree:ActsAnsBadgeDisplayTreeTest", - #"badgedisplaytwo:ActsAnsBadgeDisplayTwoTest", - "localcandisplay:ActsAnsLocalCanDisplayTest", + #"badgedisplay:ActsAnsBadgeDisplayTest", + #"localcandisplay:localcandisplay", ] } } diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..94b4210e39dd731a9371775bddc60ec574fd7879 --- /dev/null +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAnsBadgeDisplayTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsAnsBadgeDisplayTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/Test.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..917c8457fa0150add1cc775595d0a0b15869fd05 --- /dev/null +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansbadgedisplaytest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsBadgeDisplayTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/publishimage/entry/.gitignore b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/.gitignore similarity index 87% rename from notification/ans_standard/publish_test/publishimage/entry/.gitignore rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/.gitignore index 796b96d1c402326528b4ba3c12ee9d92d0e212e9..3543521e9fef8e7322940a87c2b45dd0061b0f45 100644 --- a/notification/ans_standard/publish_test/publishimage/entry/.gitignore +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/.gitignore @@ -1 +1 @@ -/build +/build diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/config.json similarity index 86% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/config.json rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/config.json index 947e90b4ed016b2593f66ce7438ee66a5167ea49..e2cd0228cd2272a375f61bfb0f45ce679748e3c8 100644 --- a/notification/ans_standard/publish_test/activeButton/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsansactionbuttontest", + "bundleName": "com.example.actsansbadgedisplaytest", "vendor": "example", "version": { "code": 1, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.actsansactionbuttontest", + "package": "com.example.actsansbadgedisplaytest", "name": ".MyApplication", "deviceType": [ "phone" @@ -36,7 +36,7 @@ ] } ], - "name": "com.example.actsansactionbuttontest.MainAbility", + "name": "com.example.actsansbadgedisplaytest.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/app.js similarity index 97% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/app.js rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.hml similarity index 67% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.hml index b38c1cd9aa7ac84d9ef07c26323b6cbcbfe99dd5..e9b8110a492149cd16dad7ab210103710bd77f54 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- 角标设定-显示 + 角标是否隐藏测试
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/resources/base/element/string.json similarity index 82% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/resources/base/element/string.json index e23250b079230b0a0411c2b4938c5a34f0cf959c..76b35df6bebdaaa67b965025f9ce0d04087dbdb1 100644 --- a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActiveBtn" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Badge" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/test/BadgeDisplay.js new file mode 100644 index 0000000000000000000000000000000000000000..4e17c834398195d28820eff7e607a9f337db3952 --- /dev/null +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/test/BadgeDisplay.js @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +var ERR_ANS_INVALID_BUNDLE = 67108870 +describe('ActsAnsBadgeDisplayTest', function () { + console.info("===ActsAnsBadgeDisplayTest start===>"); + /* + * @tc.number: ActsGetDisplay_test_0100 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0100', 0, async function (done) { + await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + },(err,data) => { + console.log("===>ActsGetDisplay_test_0100 success===>"+JSON.stringify(err)+data) + expect(typeof(data)).assertEqual('boolean') + done(); + }) + }) + /* + * @tc.number: ActsGetDisplay_test_0200 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0200', 0, async function (done) { + notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + }).then((promise)=>{ + console.log("===>ActsGetDisplay_test_0200 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + done()} + ).catch((err)=>{ + console.log("===>ActsGetDisplay_test_0200 err===>"+err.code) + }) + }) + /* + * @tc.number: ActsGetDisplay_test_0300 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0300', 0, async function (done) { + await notify.isBadgeDisplayed({ + bundle:"wrong BundleName", + },(err,data) => { + console.log("===>ActsGetDisplay_test_0300 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(false) + done(); + }) + }) + /* + * @tc.number: ActsGetDisplay_test_0400 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0400', 0, async function (done) { + notify.isBadgeDisplayed({ + bundle:"wrong BundleName", + }).then().catch((err)=>{ + console.log("===>ActsGetDisplay_test_0400 success===>"+err.code) + expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) + done(); + }) + + }) + /* + * @tc.number: ActsGetDisplay_test_0500 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsGetDisplay_test_0500', 0, async function (done) { + await notify.isBadgeDisplayed("#$#$%$%^",(err,data) => { + console.log("===>ActsGetDisplay_test_0500 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + }) + done(); + }) + /* + * @tc.number: ActsGetDisplay_test_0600 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0600', 0, async function (done) { + var promise = await notify.isBadgeDisplayed("#$#$%$%^") + expect(promise).assertEqual(undefined) + done(); + }) + /* + * @tc.number: ActsGetDisplay_test_0700 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0700', 0, async function (done) { + await notify.isBadgeDisplayed({},(err,data) => { + console.log("===>ActsGetDisplay_test_0700 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + }) + done(); + }) + /* + * @tc.number: ActsGetDisplay_test_0800 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0800', 0, async function (done) { + var promise = await notify.isBadgeDisplayed({}) + expect(promise).assertEqual(undefined) + done(); + }) + /* + * @tc.number: ActsGetDisplay_test_0900 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_0900', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },true,async(err) => { + console.log("===>ActsGetDisplay_test_0900 success===>"+err) + await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + },(err,data) => { + console.log("===>ActsGetDisplay_test_0900 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(true) + done(); + }) + }) + }) + /* + * @tc.number: ActsGetDisplay_test_1000 + * @tc.name: isBadgeDisplayed() + * @tc.desc: verify the function of isBadgeDisplayed + */ + it('ActsGetDisplay_test_1000', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },true,async(err) => { + console.log("===>ActsGetDisplay_test_1000 success===>"+err) + var promise = await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + }) + console.log("===>ActsGetDisplay_test_1000 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + }) + }) + /* + * @tc.number: ActsSetDisplay_test_0100 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0100', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },100,(err) => { + console.log("===>ActsSetDisplay_test_0100 success===>"+err) + }) + done(); + }) + /* + * @tc.number: ActsSetDisplay_test_0200 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0200', 0, async function (done) { + var promise = await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },100) + expect(promise).assertEqual(undefined) + done(); + }) + /* + * @tc.number: ActsSetDisplay_test_0300 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0300', 0, async function (done) { + await notify.displayBadge({ + bundle:"Wrong BundleName" + },true,(err) => { + console.log("===>ActsSetDisplay_test_0300 success===>"+err.code) + expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) + }) + done(); + }) + /* + * @tc.number: ActsSetDisplay_test_0400 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0400', 0, async function (done) { + notify.displayBadge({ + bundle:"Wrong BundleName" + },true).then().catch((err)=>{ + console.log("===>ActsSetDisplay_test_0400 err===>"+err.code) + expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) + done(); + }) + }) + /* + * @tc.number: ActsSetDisplay_test_0500 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0500', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },true,async(err) => { + await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + },(err,data) => { + console.log("===>ActsSetDisplay_test_0500 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(true) + done(); + }) + }) + }) + /* + * @tc.number: ActsSetDisplay_test_0600 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0600', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },true).then(async(err) => { + var promise = await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + }) + console.log("===>ActsSetDisplay_test_0600 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + }) + }) + /* + * @tc.number: ActsSetDisplay_test_0700 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0700', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },false,async(err) => { + await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + },(err,data) => { + console.log("===>ActsSetDisplay_test_0700 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(false) + done(); + }) + }) + }) + /* + * @tc.number: ActsSetDisplay_test_0800 + * @tc.name: displayBadge() + * @tc.desc: verify the function of displayBadge + */ + it('ActsSetDisplay_test_0800', 0, async function (done) { + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },false).then(async(err) => { + var promise = await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + }) + console.log("===>ActsSetDisplay_test_0800 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(false) + done(); + }) + }) + /* + * @tc.number: ActsSetDisplay_test_0900 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetDisplay_test_0900', 0, async function (done) { + await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + },(err,data) => { + console.log("===>ActsSetDisplay_test_0900 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(false) + }) + await notify.displayBadge({ + bundle:"com.example.actsanslocalcandisplaytest" + },true).then(async(err) => { + var promise = await notify.isBadgeDisplayed({ + bundle:"com.example.actsanslocalcandisplaytest", + }) + console.log("===>ActsSetDisplay_test_0900 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + }) + }) +}) + + diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/test/List.test.js similarity index 93% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/test/List.test.js rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/test/List.test.js index 630d30d02fe26d4c0b1941e035cc82103658afb2..ed9fd1c0dd5d364a51da6527d04d50468b12a048 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/badgedisplayed/badgedisplay/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/BUILD.gn deleted file mode 100644 index a39045d6d57e8082bd3b1d8a4aae2d9831869e30..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplayFiveTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplayFiveTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/config.json deleted file mode 100644 index aa47e197639c5f53cc7bba93452bbf44321db39a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplayfivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplayfivetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplayfivetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index d29d412452f4f2cd0a216fc17a88b914019207ad..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-参数传空 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 5a4276ff914b648e171b61f8aa195996f10ba885..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplayFiveTest', function () { - console.info("====ActsDoNotDisturbModeTest5 start=====>"); - - /* - * @tc.number: ActsBadgeDisplay_test_0900 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0900', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },"",(err) => { - console.log("====>ActsBadgeDisplay_test_0900 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplay_test_1000 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_1000', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },"").then(console.log("====>ActsBadgeDisplay_test_1000 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_1000====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0900 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0900', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplay_test_0900 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_1000 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_1000', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplay_test_1000 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_1000====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/config.json deleted file mode 100644 index a7dda6b176581af8b528bc5cb887012583c6e4f2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplayfourtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplayfourtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplayfourtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index cd037198c53a22adbf7ef7dcbad030e6b21d0e5e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-参数类型错误 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 5651e7f69959fb1fc06b1dc823402864837a304e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplayFourTest', function () { - console.info("====ActsDoNotDisturbModeTest4 start====>"); - - /* - * @tc.number: ActsBadgeDisplay_test_0700 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0700', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },100,(err) => { - console.log("====>ActsBadgeDisplay_test_0700 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplay_test_0800 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0800', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },100).then(console.log("====>ActsBadgeDisplay_test_0800 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0800====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0700 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0700', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplay_test_0700 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0800 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0800', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplay_test_0800 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0800====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/BUILD.gn deleted file mode 100644 index af1b7377bb193a7b04411d23db633b0cb2adead3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplayOneTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplayOneTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/config.json deleted file mode 100644 index c1bf383cab8ee2698d6de13cedae793dfeb38a75..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplayonetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplayonetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplayonetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 607625d16c41ce306bdf4b1c10aa1178d6b9b6aa..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplayOneTest', function () { - console.info("====ActsDoNotDisturbModeTest1 start====>"); - - /* - * @tc.number: ActsBadgeDisplay_test_0100 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0100', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },true,(err) => { - console.log("====>ActsBadgeDisplay_test_0100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplay_test_0200 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0200', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },true).then(console.log("====>ActsBadgeDisplay_test_0200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0200====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0100 - * @tc.name: canDisplayBadge(bundle) - * @tc.desc: verify the function of canDisplayBadge - */ - it('ActsSystemCanDisplay_test_0100', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplay_test_0100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0100====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0200 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0200', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplay_test_0200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0200====>"); - }, time) - }) -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/Test.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/Test.json deleted file mode 100644 index ff563bc1ea79b81e3c6a9db06d92559196f0ea4c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysixtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySixTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/config.json deleted file mode 100644 index 3387286308e403a515c561028fe5daa6e5e5e00d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysixtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysixtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaysixtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 368e049d576a5f86554a80fc95156c93892de4ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge6" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index d79c9a37cf46e69331c5b5501f37c9d88c31ef29..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySixTest', function () { - console.info("====ActsDoNotDisturbModeTest1 start====>"); - - /* - * @tc.number: ActsBadgeDisplay_test_0100 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsBadgeDisplay_test_1100', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },true,(err) => { - console.log("====>ActsBadgeDisplay_test_1100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplay_test_1200 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_1200', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },true).then(console.log("====>ActsBadgeDisplay_test_1200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_1200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_1100 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_1100', 0, async function (done) { - await notify.isBadgeDisplayed({bundle:""},(err,data) => { - console.log("====>ActsSystemCanDisplay_test_1100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_1200 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_1200', 0, async function (done) { - var promise = await notify.isBadgeDisplayed({bundle:""}) - console.log("====>ActsSystemCanDisplay_test_1200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_1200====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/BUILD.gn deleted file mode 100644 index 1b8c0c8df51ebe906eabbf22e0d9becbd93ce753..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplayTreeTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplayTreeTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/Test.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/Test.json deleted file mode 100644 index 56769f0d8f2c5a3ee86d859cf8dea556fafd2a8b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaytreetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplayTreeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index a34b1af02abb383950feced23913f0f5c60ae664..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 9f9c70c2c7ed565bb403179233e36a2df650a33a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplayTreeTest', function () { - console.info("====ActsDoNotDisturbModeTest3 start====>"); - - /* - * @tc.number: ActsBadgeDisplay_test_0500 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0500', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },true,(err) => { - console.log("====>ActsBadgeDisplay_test_0500 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0500====>"); - }, time) - }) - - /* - * @tc.number: ActsBadgeDisplay_test_0600 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0600', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },false).then(console.log("====>ActsBadgeDisplay_test_0600 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0600====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0500 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0500', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplay_test_0500 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0500====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0600 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0600', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplay_test_0600 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0600====>"); - }, time) - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/BUILD.gn deleted file mode 100644 index 701f65c7b0eae3fa0f7f9d468fb59d38127f5b54..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplayTwoTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplayTwoTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/Test.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/Test.json deleted file mode 100644 index e30e5bb83cc0d9393375945dd5627b471bccf7cc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaytwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplayTwoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/config.json deleted file mode 100644 index 437730aba60e1ddb2701f7fcd476400e856f850e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaytwotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaytwotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaytwotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 23deacb23641543f0969e252761b2a63f85f1a6c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-隐藏 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 8155816047c61c4948af3b4438b7fb32d164079d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 7a7ebd963baec546a73bf2613a01530137b99b5f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplayTwoTest', function () { - console.info("====ActsDoNotDisturbModeTest2 start====>"); - - /* - * @tc.number: ActsBadgeDisplay_test_0300 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0300', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },false,(err) => { - console.log("====>ActsBadgeDisplay_test_0300 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0300====>"); - }, time) - }) - - /* - * @tc.number: ActsBadgeDisplay_test_0400 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplay_test_0400', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },false).then(console.log("====>ActsBadgeDisplay_test_0400 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplay_test_0400====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0300 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0300', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("==========================>ActsSystemCanDisplay_test_0300 success=======================>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestCallback_0100====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplay_test_0400 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplay_test_0400', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplay_test_0400 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplay_test_0400====>"); - }, time) - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn index 66dba9b9c7d1a6ba8d53f766c978f498dcba77c8..3a6f8047d1d126ecedb068db9f227a87bc85bb77 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn @@ -10,20 +10,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import("//test/xts/tools/build/suite.gni") -ohos_hap("ActsAnsLocalCanDisplayTest") { +ohos_js_hap_suite("localcandisplay") { hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsLocalCanDisplayTest" - subsystem_name = XTS_SUITENAME - final_hap_path = - "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" - testonly = true deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "localcandisplay" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/Test.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/Test.json index 7a88763ed8d2ac31dd30211b9574f47273e84549..fd2b84059ded89eccdaa96c479873e0c1bc5d090 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/Test.json +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/Test.json @@ -1,3 +1,3 @@ -{ - "description": "Configuration for hjunit demo Tests", -} +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/notification/ans_standard/publish_test/activeButton/entry/.gitignore b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/.gitignore similarity index 87% rename from notification/ans_standard/publish_test/activeButton/entry/.gitignore rename to notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/.gitignore index 796b96d1c402326528b4ba3c12ee9d92d0e212e9..3543521e9fef8e7322940a87c2b45dd0061b0f45 100644 --- a/notification/ans_standard/publish_test/activeButton/entry/.gitignore +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/.gitignore @@ -1 +1 @@ -/build +/build diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json index d6767a0d34490106a114831a60cdd9cd74d831f1..ee6da12eeeb7246ae1bf194d0eeba1bc1b3eaf64 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json @@ -59,4 +59,4 @@ } ] } -} +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml index b378e739c19d9ed6237e7647a31e7a984f461297..ad5ca901ca45de7eef38dba985dc0a9a3b5d32f8 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- 第三方角标获取 + 角标显示设置-依赖包
diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..564fb917e86558511fcd08d438b143c939f8ef70 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js @@ -37,8 +37,6 @@ export default { const configService = core.getDefaultService('config') configService.setConfig(this) - - require('../../../test/List.test') core.execute() }, onReady() { diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json index e90aaa2dcbc32424f901899a6d2a12b0eac3618a..6ea0fda516299f695326dd17795c04b3e779b040 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "LocalCan" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "BadgeTest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index e2d81b0e430251e5679919258b13451387c59692..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsLocalCanDisplayTest', function () { - console.info("===ActsLocalCanDisplayTest start===>"); - - /* - * @tc.number: ActsLocalCanDisplay_test_0100 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsLocalCanDisplay_test_0100', 0, async function (done) { - await notify.isBadgeDisplayed((err,data) => { - console.log("====>ActsLocalCanDisplay_test_0100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsLocalCanDisplay_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsLocalCanDisplay_test_0200 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsLocalCanDisplay_test_0200', 0, async function (done) { - var promise = await notify.isBadgeDisplayed() - console.log("===>ActsLocalCanDisplay_test_0200 success===>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsLocalCanDisplay_test_0200====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/BUILD.gn deleted file mode 100644 index f415b9a084bb6cf245ad3083d0b356dde09591c7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/BUILD.gn +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("badgedisplayedset") { - testonly = true - if (is_standard_system) { - deps = [ - #"badgedisplaysetfive:ActsAnsBadgeDisplaySetFiveTest", - #"badgedisplaysetfour:ActsAnsBadgeDisplaySetFourTest", - #"badgedisplaysetone:ActsAnsBadgeDisplaySetOneTest", - #"badgedisplaysetsix:ActsAnsBadgeDisplaySetSixTest", - #"badgedisplaysettree:ActsAnsBadgeDisplaySetTreeTest", - #"badgedisplaysettwo:ActsAnsBadgeDisplaySetTwoTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/BUILD.gn deleted file mode 100644 index d29d00777970978d5f3f78785d89616c8c91afd7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplaySetFiveTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySetFiveTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/Test.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/Test.json deleted file mode 100644 index 780f01e6f0232437051f219d7a29945b05299bb7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysetfivetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySetFiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/config.json deleted file mode 100644 index d1330929a6cb0917d27753c8de4db5fb6582ee8e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysetfivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysetfivetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplayfivesettest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index d29d412452f4f2cd0a216fc17a88b914019207ad..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-参数传空 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 7f5c61f365e499aea5017d310263efac67f0c62d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 95203ad9ebbe8379fd496b9b9e7d54088719bed1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySetFiveTest', function () { - console.info("===ActsDoNotDisturbModeSetTest5 start===>"); - - /* - * @tc.number: ActsBadgeDisplaySet_test_0900 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0900', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },"",(err) => { - console.log("====>ActsBadgeDisplaySet_test_0900 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplaySet_test_1000 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_1000', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },"").then(console.log("====>ActsBadgeDisplaySet_test_1000 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_1000====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0900 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0900', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplaySet_test_0900 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_1000 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_1000', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplaySet_test_1000 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_1000====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/BUILD.gn deleted file mode 100644 index 02c7f9d5d37ee3e478726ff3a720ae7066bd3c18..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplaySetFourTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySetFourTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/Test.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/Test.json deleted file mode 100644 index baf7d5fb27b0fc4e4e2931caff0511ba5fbb68ed..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysetfourtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySetFourTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/config.json deleted file mode 100644 index 00f6af42e7a21cec3a5c0c9d710bc01e61ffa4b3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysetfourtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysetfourtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaysetfourtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index cd037198c53a22adbf7ef7dcbad030e6b21d0e5e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-参数类型错误 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 2f247a2a40a0412230fedbc5e0470035aadfa9ec..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 7f5c78e3b54526e5b846be835270b03a1e9087df..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySetFourTest', function () { - console.info("===ActsDoNotDisturbModeSetTest4 start====>"); - - /* - * @tc.number: ActsBadgeDisplaySet_test_0700 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0700', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },100,(err) => { - console.log("====>ActsBadgeDisplaySet_test_0700 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0700====>"); - }, time) - }) - - /* - * @tc.number: ActsBadgeDisplay_test_0800 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0800', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },100).then(console.log("====>ActsBadgeDisplaySet_test_0800 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0800====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0700 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0700', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplaySet_test_0700 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0700====>"); - }, time) - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0800 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0800', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplaySet_test_0800 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0800====>"); - }, time) - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/BUILD.gn deleted file mode 100644 index 2671a3e486385b469bc0ccc09d4b5d9f63e5909f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplaySetOneTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySetOneTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/Test.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/Test.json deleted file mode 100644 index a3521cecb3fe5f65c0cc7210a28ed3e5d9197325..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysetonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySetOneTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/config.json deleted file mode 100644 index b77e8f8fcfdcb5b541b791df61eb138da2e84209..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysetonetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysetonetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaysetonetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index b38c1cd9aa7ac84d9ef07c26323b6cbcbfe99dd5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-显示 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 1ea61e659c3ae952790a574d65392d039be3277e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index e1df8f4f55977630bc1d8aae1250e9bc37a99f51..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySetOneTest', function () { - console.info("===ActsAnsBadgeDisplaySetTest1 start===>"); - - /* - * @tc.number: ActsBadgeDisplaySet_test_0100 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0100', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },true,(err) => { - console.log("====>ActsBadgeDisplaySet_test_0100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0100====>"); - }, time); - }) - /* - * @tc.number: ActsBadgeDisplaySet_test_0200 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0200', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },true).then(console.log("====>ActsBadgeDisplaySet_test_0200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0100 - * @tc.name: canDisplayBadge(bundle) - * @tc.desc: verify the function of canDisplayBadge - */ - it('ActsSystemCanDisplaySet_test_0100', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplaySet_test_0100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0200 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0200', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplaySet_test_0200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0200====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/BUILD.gn deleted file mode 100644 index 2a345a66ce3910065baef79d2558bd187951e0d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplaySetSixTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySetSixTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/Test.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/Test.json deleted file mode 100644 index 6b91c8e74d9166eb13150ff7fa82c5af82bf729c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysetsixtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySetSixTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/config.json deleted file mode 100644 index d55ab796f62bc7e787454b5ef76c7e9da670fff9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysetsixtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysetsixtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaysetsixtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index b38c1cd9aa7ac84d9ef07c26323b6cbcbfe99dd5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-显示 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 368e049d576a5f86554a80fc95156c93892de4ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge6" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 79b564cd97a95d02f417e56d4991ea75753ce7cf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySetSixTest', function () { - console.info("===ActsDoNotDisturbModeSetTest1 start===>"); - - /* - * @tc.number: ActsBadgeDisplaySet_test_1100 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsBadgeDisplaySet_test_1100', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },true,(err) => { - console.log("====>ActsBadgeDisplaySet_test_1100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplaySet_test_1200 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_1200', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },true).then(console.log("====>ActsBadgeDisplaySet_test_1200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_1200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_1100 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_1100', 0, async function (done) { - await notify.isBadgeDisplayed({bundle:""},(err,data) => { - console.log("====>ActsSystemCanDisplaySet_test_1100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_1200 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_1200', 0, async function (done) { - var promise = await notify.isBadgeDisplayed({bundle:""}) - console.log("====>ActsSystemCanDisplaySet_test_1200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_1200====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/BUILD.gn deleted file mode 100644 index 6f1ae9e2a50b0254e0c07abaead657757098721e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplaySetTreeTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySetTreeTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/Test.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/Test.json deleted file mode 100644 index 3bd0a8c47fc5f860ae80aadce4156780cad55c6b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysettreetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySetTreeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/config.json deleted file mode 100644 index 6efde87809718c683817148ab4f6901bb97e85f3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysettreetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysettreetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaysettreetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index ae21a6b0449d004916cd7b981a81277230b9d48d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-显隐 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index a34b1af02abb383950feced23913f0f5c60ae664..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 2de1d954d9a66753548770e5998057adf445fe34..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySetTreeTest', function () { - console.info("===ActsDoNotDisturbModeSetTest3 start===>"); - - /* - * @tc.number: ActsBadgeDisplaySet_test_0500 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0500', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },true,(err) => { - console.log("====>ActsBadgeDisplaySet_test_0500 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplaySet_test_0600 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0600', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },false).then(console.log("====>ActsBadgeDisplaySet_test_0600 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0600====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0500 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0500', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplaySet_test_0500 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0600 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0600', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplaySet_test_0600 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0600====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/BUILD.gn deleted file mode 100644 index f342a040a642db195e9ade55592f2b5ee0cf1ee0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplaySetTwoTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySetTwoTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/Test.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/Test.json deleted file mode 100644 index 4385a4cdd711a8514d4385e8481f437948428ba4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplaysettwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplaySetTwoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/config.json deleted file mode 100644 index ed2e5c830cb1a4334bab9f43a139f35049a47ee7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaysettwotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaysettwotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansbadgedisplaysettwotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 23deacb23641543f0969e252761b2a63f85f1a6c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 角标设定-隐藏 - -
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 8155816047c61c4948af3b4438b7fb32d164079d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 82569b44732757c76d739bf0b22e1de3e2764bd3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsBadgeDisplaySetTwoTest', function () { - console.info("===ActsDoNotDisturbModeSetTest2 start===>"); - - /* - * @tc.number: ActsBadgeDisplaySet_test_0300 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0300', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },false,(err) => { - console.log("====>ActsBadgeDisplaySet_test_0300 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsBadgeDisplaySet_test_0400 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsBadgeDisplaySet_test_0400', 0, async function (done) { - await notify.displayBadge( - { - bundle:"com.example.actsanslocalcandisplaytest" - },false).then(console.log("====>ActsBadgeDisplaySet_test_0400 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsBadgeDisplaySet_test_0400====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0300 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0300', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("====>ActsSystemCanDisplaySet_test_0300 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemCanDisplaySet_test_0400 - * @tc.name: isBadgeDisplayed(bundle) - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsSystemCanDisplaySet_test_0400', 0, async function (done) { - var promise = await notify.isBadgeDisplayed( - { - bundle:"com.example.actsanslocalcandisplaytest", - }) - console.log("====>ActsSystemCanDisplaySet_test_0400 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemCanDisplaySet_test_0400====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/BUILD.gn index 007f94e3311ec1cee6b6a1700c58e02e3d9d6766..88e1eaf0af6c6c43196715c20bf391c0b599c27b 100644 --- a/notification/ans_standard/publish_test/enablenotification/BUILD.gn +++ b/notification/ans_standard/publish_test/enablenotification/BUILD.gn @@ -17,15 +17,8 @@ group("enablenotification") { testonly = true if (is_standard_system) { deps = [ - #"enablenotificationfive:ActsAnsEnableNotificationFiveTest", - - #"enablenotificationfour:ActsAnsEnableNotificationFourTest", - #"enablenotificationone:ActsAnsEnableNotificationOneTest", - #"enablenotificationsix:ActsAnsEnableNotificationSixTest", - - #"enablenotificationtree:ActsAnsEnableNotificationTreeTest", - #"enablenotificationtwo:ActsAnsEnableNotificationTwoTest", - "localnotificationenable:ActsAnsLocalNotificationTest", + #"enablenotification:ActsAnsEnableNotificationTest", + #"localnotificationenable:ActsAnsLocalNotificationTest", ] } } diff --git a/notification/ans_standard/publish_test/activeButton/.gitignore b/notification/ans_standard/publish_test/enablenotification/enablenotification/.gitignore similarity index 93% rename from notification/ans_standard/publish_test/activeButton/.gitignore rename to notification/ans_standard/publish_test/enablenotification/enablenotification/.gitignore index 37a4eb8b43d978ea05b2c6e3fb934f9b40dddd4d..82dc42bd41e44f0a17e007c62feabac9a3f35d72 100644 --- a/notification/ans_standard/publish_test/activeButton/.gitignore +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/.gitignore @@ -1,15 +1,15 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -/entry/.preview -.cxx +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/publishimage/.idea/.gitignore b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/.gitignore similarity index 94% rename from notification/ans_standard/publish_test/publishimage/.idea/.gitignore rename to notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/.gitignore index 26d33521af10bcc7fd8cea344038eaaeb78d0ef5..eaf91e2ac647df635a09f01b8a2a254252aae8d7 100644 --- a/notification/ans_standard/publish_test/publishimage/.idea/.gitignore +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/.gitignore @@ -1,3 +1,3 @@ -# Default ignored files -/shelf/ -/workspace.xml +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/publishimage/.idea/compiler.xml b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/compiler.xml similarity index 91% rename from notification/ans_standard/publish_test/publishimage/.idea/compiler.xml rename to notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/compiler.xml index 61a9130cd9669c3843e6445dfe1fee2d493869bc..245a82c8279131bde0c8c09a1f1791c8b0312984 100644 --- a/notification/ans_standard/publish_test/publishimage/.idea/compiler.xml +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/compiler.xml @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/.idea/gradle.xml b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/gradle.xml similarity index 96% rename from notification/ans_standard/publish_test/publishimage/.idea/gradle.xml rename to notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/gradle.xml index 982182efb32e276aa75e12894a11d90e4d8f5650..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171 100644 --- a/notification/ans_standard/publish_test/publishimage/.idea/gradle.xml +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/gradle.xml @@ -1,22 +1,22 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/jarRepositories.xml similarity index 96% rename from notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml rename to notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/jarRepositories.xml index 1dfcd020d2b2774ad414ac5c0acc344e9b9479b4..aa00d771aa98b60cc8db06b5e24919c06b208cda 100644 --- a/notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/jarRepositories.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/.idea/misc.xml b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/misc.xml similarity index 94% rename from notification/ans_standard/publish_test/activeButton/.idea/misc.xml rename to notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/misc.xml index 58918f50335428f2efb3af4d621f9f405ed659d4..9883d055f8725da2d0f5c1cecc525b815e5dfcec 100644 --- a/notification/ans_standard/publish_test/activeButton/.idea/misc.xml +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/.idea/misc.xml @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotification/BUILD.gn similarity index 91% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/BUILD.gn rename to notification/ans_standard/publish_test/enablenotification/enablenotification/BUILD.gn index 1570b073b31f2335ac04aa473ea6f93c064aee87..35f8112136fd884abae873bf889867433be82e22 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/BUILD.gn +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsBadgeDisplaySixTest") { +ohos_js_hap_suite("ActsAnsEnableNotificationTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplaySixTest" + hap_name = "ActsAnsEnableNotificationTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..71acd318939868352a1e58d02189f4cc1455ccdd --- /dev/null +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansenablenotificationtest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsEnableNotificationTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/.gitignore b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/config.json similarity index 94% rename from notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/config.json rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/config.json index 06a9cf2d786975fbe40bf4b2c551e8ede260f260..d8811b53aeba020aa06c62ca61c265d859357cca 100644 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsansenablenotificationonetest", + "bundleName": "com.example.actsansenablenotificationtest", "vendor": "example", "version": { "code": 1, @@ -59,4 +59,4 @@ } ] } -} +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.hml similarity index 67% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.hml index b38c1cd9aa7ac84d9ef07c26323b6cbcbfe99dd5..8d17dc48011199900de0651a5d8ddcf57bb1f446 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- 角标设定-显示 + 通知许可设定测试
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/resources/base/element/string.json similarity index 81% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/resources/base/element/string.json index 7f5c61f365e499aea5017d310263efac67f0c62d..93bdd8f04b22134fd1bf886b69675f3a42ee45e5 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "EnNoti" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/test/EnableNotification.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/test/EnableNotification.js new file mode 100644 index 0000000000000000000000000000000000000000..9ebf8c22ef12e7b0101738e0160282ec4e6de51e --- /dev/null +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/test/EnableNotification.js @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +var ERR_ANS_INVALID_BUNDLE = 67108870 +describe('ActsAnsEnableNotificationTest', function () { + console.info("===========ActsAnsEnableNotificationTest start====================>"); + /* + * @tc.number: ActsGetEnable_test_0100 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0100', 0, async function (done) { + await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + },(err,data) => { + console.log("===>ActsGetEnable_test_0100 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(true) + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsGetEnable_test_0100====>"); + }, time); + }) + /* + * @tc.number: ActsGetEnable_test_0200 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0200', 0, async function (done) { + var promise = await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + }) + console.log("===>ActsGetEnable_test_0200 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + setTimeout(function(){ + console.debug("====>time out ActsGetEnable_test_0200====>"); + }, time); + }) + /* + * @tc.number: ActsGetEnable_test_0300 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0300', 0, async function (done) { + await notify.isNotificationEnabled({ + bundle:"wrong BundleName", + },(err,data) => { + console.log("===>ActsGetEnable_test_0300 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(false) + done(); + }) + setTimeout(function(){ + console.debug("====>time out ActsGetEnable_test_0300====>"); + }, time); + }) + /* + * @tc.number: ActsGetEnable_test_0400 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0400', 0, async function (done) { + notify.isNotificationEnabled({ + bundle:"wrong BundleName", + }).then().catch((err)=>{ + console.debug("====>ActsGetEnable_test_0400 promsie====>"+err.code); + expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) + done(); + }) + }) + /* + * @tc.number: ActsGetEnable_test_0500 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0500', 0, async function (done) { + await notify.isNotificationEnabled("#$#$%$%^",(err,data) => { + console.log("===>ActsGetEnable_test_0500 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + }) + done(); + }) + /* + * @tc.number: ActsGetEnable_test_0600 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0600', 0, async function (done) { + var promise = await notify.isNotificationEnabled("#$#$%$%^") + expect(promise).assertEqual(undefined) + done(); + }) + /* + * @tc.number: ActsGetDisplay_test_0700 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0700', 0, async function (done) { + await notify.isNotificationEnabled({},(err,data) => { + console.log("===>ActsGetEnable_test_0700 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + }) + done(); + }) + /* + * @tc.number: ActsGetEnable_test_0800 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0800', 0, async function (done) { + var promise = await notify.isNotificationEnabled({}) + expect(promise).assertEqual(undefined) + done(); + }) + /* + * @tc.number: ActsGetEnable_test_0900 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_0900', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },true,async(err) => { + console.log("===>ActsGetEnable_test_0900 success===>"+err) + await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + },(err,data) => { + console.log("===>ActsGetEnable_test_0900 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(true) + done(); + }) + }) + }) + /* + * @tc.number: ActsGetEnable_test_1000 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsGetEnable_test_1000', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },true,async(err) => { + console.log("===>ActsGetEnable_test_1000 success===>"+err) + var promise = await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + }) + console.log("===>ActsGetEnable_test_1000 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + }) + }) + /* + * @tc.number: ActsSetEnable_test_0100 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0100', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },100,(err) => { + console.log("===>ActsSetEnable_test_0100 success===>"+err) + }) + done(); + }) + /* + * @tc.number: ActsSetEnable_test_0200 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0200', 0, async function (done) { + var promise = await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },100) + expect(promise).assertEqual(undefined) + done(); + }) + /* + * @tc.number: ActsSetEnable_test_0300 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0300', 0, async function (done) { + await notify.enableNotification({ + bundle:"Wrong BundleName" + },true,(err) => { + console.log("===>ActsSetEnable_test_0300 success===>"+err.code) + expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) + }) + done(); + }) + /* + * @tc.number: ActsSetEnable_test_0400 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0400', 0, async function (done) { + notify.enableNotification({ + bundle:"Wrong BundleName" + },true).then().catch((err)=>{ + console.log("===>ActsSetEnable_test_0400 err===>"+err.code) + expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) + done(); + }) + }) + /* + * @tc.number: ActsSetEnable_test_0500 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0500', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },true,async(err) => { + await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + },(err,data) => { + console.log("===>ActsSetEnable_test_0500 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(true) + done(); + }) + }) + setTimeout(function(){ + console.debug("====>time out ActsGetDisplay_test_0900====>"); + }, time); + }) + /* + * @tc.number: ActsSetEnable_test_0600 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0600', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },true).then(async(err) => { + var promise = await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + }) + console.log("===>ActsSetEnable_test_0600 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + }) + setTimeout(function(){ + console.debug("===>time out ActsSetEnable_test_0600===>"); + }, time); + }) + /* + * @tc.number: ActsSetEnable_test_0700 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0700', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },false,async(err) => { + await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + },(err,data) => { + console.log("===>ActsSetEnable_test_0700 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(false) + done(); + }) + }) + setTimeout(function(){ + console.debug("====>time out ActsSetEnable_test_0700====>"); + }, time); + }) + /* + * @tc.number: ActsSetEnable_test_0800 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0800', 0, async function (done) { + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },false).then(async(err) => { + var promise = await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + }) + console.log("===>ActsSetEnable_test_0800 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(false) + done(); + }) + setTimeout(function(){ + console.debug("===>time out ActsSetEnable_test_0800===>"); + }, time); + }) + /* + * @tc.number: ActsSetEnable_test_0900 + * @tc.name: enableNotification() + * @tc.desc: verify the function of enableNotification + */ + it('ActsSetEnable_test_0900', 0, async function (done) { + await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + },(err,data) => { + console.log("===>ActsSetEnable_test_0900 success===>"+err+data) + expect(typeof(data)).assertEqual('boolean') + expect(data).assertEqual(false) + }) + await notify.enableNotification({ + bundle:"com.example.actsanslocalnotificationtest" + },true).then(async(err) => { + var promise = await notify.isNotificationEnabled({ + bundle:"com.example.actsanslocalnotificationtest", + }) + console.log("===>ActsSetEnable_test_0900 success===>"+promise) + expect(typeof(promise)).assertEqual('boolean') + expect(promise).assertEqual(true) + done(); + }) + setTimeout(function(){ + console.debug("===>time out ActsSetEnable_test_0900===>"); + }, time); + }) +}) + diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..56f85889d3ca14906b7782c87d42079038f46726 --- /dev/null +++ b/notification/ans_standard/publish_test/enablenotification/enablenotification/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./EnableNotification.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotification/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/enablenotification/enablenotification/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/BUILD.gn deleted file mode 100644 index ea593f41d0e40ec614374d1f1f6080f15c7f4b08..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationFiveTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationFiveTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/Test.json deleted file mode 100644 index 8ccd430116226a4921cc883369e0ea73161e1e8b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationfivetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationFiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/config.json deleted file mode 100644 index 5ce4fa9cc7612a4d8ef984f8cabfacac449a59ee..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationfivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationfivetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationfivetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 50917a52f5704e51eb545f191f0f68bd376e0e40..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--参数传空1111 - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index c6d7e14954bbd5099bcc04994853928e79f4def5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 92eed88d9284bc5e02755424e2efea27c93ef9d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationFiveTest', function () { - console.info("===ActsEnableNotificationTest5 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_0900 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0900', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },"",(err) => { - console.log("====>ActsEnableNotification_test_0900 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotification_test_1000 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_1000', 0, async function (done) { - var promise = notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },"") - expect(promise).assertEqual(undefined) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_1000====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0900 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0900', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotification_test_0900 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_1000 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_1000', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotification_test_1000 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_1000====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/BUILD.gn deleted file mode 100644 index e0c1064879547890f10b07ae5bdf1020e80866ad..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationFourTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationFourTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/Test.json deleted file mode 100644 index 269a78b7bf1e7610c6a237a89af975980eddd242..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationfourtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationFourTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/config.json deleted file mode 100644 index ac9b0d5e6904df6164b8ada9d3ca803f7b1a1dbd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationfourtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationfourtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationfourtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 171ae99b0b78b32f140b76809051175d3f26b66d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--错误参数 - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 91e839d448d257e159b0e8af21fffa7bd9a03294..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 07ffffa42920eab6db13a9668aa5812eda3d0133..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationFourTest', function () { - console.info("===ActsEnableNotificationTest4 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_0700 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0700', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },100,(err) => { - console.log("====>ActsEnableNotification_test_0700 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotification_test_0800 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0800', 0, async function (done) { - var promise = notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },100) - expect(promise).assertEqual(undefined) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0800====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0700 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0700', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotification_test_0700 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0800 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0800', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotification_test_0800 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0800====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/BUILD.gn deleted file mode 100644 index fd30a59c15389cc4f6e72431e9f0bc1d23d0438b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationOneTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationOneTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/Test.json deleted file mode 100644 index ff875e3fb4f5279f1c9617b7df2cc8af359b353c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationOneTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 6e2068f420d5692db6e02737daab2964cd866202..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定-允许 - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index da3745cf7630294cd005702309308a9e95cdf1d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 25c9b09e96ac77ea9fc11e17e9b0b0d448485076..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationOneTest', function () { - console.info("===ActsEnableNotificationTest1 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_0100 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0100', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },true,(err) => { - console.log("====>ActsEnableNotification_test_0100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotification_test_0200 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0200', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },true).then(console.log("====>ActsEnableNotification_test_0200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0100 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0100', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotification_test_0100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0200 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0200', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotification_test_0200 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0200====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotificationone/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationone/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/BUILD.gn deleted file mode 100644 index 5e48ab82a95e13d41a909c2d0c92566a170d3c3f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSixTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSixTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/Test.json deleted file mode 100644 index ea9927f828761c3e830383578416f95aa0c8ead6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsixtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSixTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/config.json deleted file mode 100644 index 46f8819c8727ec976b35daaafd10271ae91a12dc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsixtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsixtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsixtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 6e2068f420d5692db6e02737daab2964cd866202..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定-允许 - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index dc482b39e8f1d0e893fe4c67e2526de7e50846fe..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti6" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index ce6bcdbb4b8cb889f1686b3941665295187c5487..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSixTest', function () { - console.info("===ActsEnableNotificationTest1 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_1100 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_1100', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },true,(err) => { - console.log("====>ActsEnableNotification_test_1100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotification_test_1200 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_1200', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },true).then(console.log("====>ActsEnableNotification_test_1200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_1200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_1100 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_1100', 0, async function (done) { - await notify.isNotificationEnabled({bundle:""},(err,data) => { - console.log("====>ActsSystemNotification_test_1100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_1200 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_1200', 0, async function (done) { - var promise = await notify.isNotificationEnabled() - console.log("====>ActsSystemNotification_test_1200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_1200====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationsix/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/BUILD.gn deleted file mode 100644 index 27957d74726cf8cc59e92265b1d3c23e16fc6f7e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationTreeTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationTreeTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/Test.json deleted file mode 100644 index 36a8bfa3c48c90c2f667ef0dcb251c0fb3708c7f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationtreetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationTreeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/config.json deleted file mode 100644 index 5e87ea33b7201dda963f3c390b67d6b20fa57098..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationtreetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationtreetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationtreetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/i18n/en-US.json deleted file mode 100755 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100755 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 21a8ff417f5197f8eed648181dfa887f4d3586c6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--允许->禁止 - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 83d3151039dde81d26caaeb5a2498a723e711ddc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 836dcd7c12478772c55490ede6277503cbea60f8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationTreeTest', function () { - console.info("===ActsEnableNotificationTest3 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_0500 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0500', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },false,(err) => { - console.log("====>ActsEnableNotification_test_0500 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotification_test_0600 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0600', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },true).then(console.log("====>ActsEnableNotification_test_0600 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0600====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0500 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0500', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotification_test_0500 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0600 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0600', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotification_test_0600 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0600====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationtree/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/BUILD.gn deleted file mode 100644 index 20fbb01e87aa8d2503c27e3167d4fc560c3a547a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationTwoTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationTwoTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/Test.json deleted file mode 100644 index 9c13c7f82895478aada1e0d8eb19ebdca4b336ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationtwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationTwoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/config.json deleted file mode 100644 index a6f5b0ade06d35b6e68295980d8639941b0b0e21..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationtwotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationtwotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationtwotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index af99fce36f4f9d8538a446fbbb5006ba6c49fb01..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--禁止 - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 8ae09ada9ca6ba13e644d0ad712bfbf894ef0528..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 0b0198f5d9728ff78decd239b71d37804ff9e618..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationTwoTest', function () { - console.info("===ActsEnableNotificationTest2 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_0300 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0300', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },false,(err) => { - console.log("====>ActsEnableNotification_test_0300 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotification_test_0400 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotification_test_0400', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },false).then(console.log("====>ActsEnableNotification_test_0400 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotification_test_0400====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0300 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0300', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotification_test_0300 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0400 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotification_test_0400', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotification_test_0400 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotification_test_0400====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotificationtwo/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishimage/.gitignore b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.gitignore similarity index 93% rename from notification/ans_standard/publish_test/publishimage/.gitignore rename to notification/ans_standard/publish_test/enablenotification/localnotificationenable/.gitignore index 37a4eb8b43d978ea05b2c6e3fb934f9b40dddd4d..82dc42bd41e44f0a17e007c62feabac9a3f35d72 100644 --- a/notification/ans_standard/publish_test/publishimage/.gitignore +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.gitignore @@ -1,15 +1,15 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -/entry/.preview -.cxx +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/activeButton/.idea/.gitignore b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/.gitignore similarity index 94% rename from notification/ans_standard/publish_test/activeButton/.idea/.gitignore rename to notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/.gitignore index 26d33521af10bcc7fd8cea344038eaaeb78d0ef5..eaf91e2ac647df635a09f01b8a2a254252aae8d7 100644 --- a/notification/ans_standard/publish_test/activeButton/.idea/.gitignore +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/.gitignore @@ -1,3 +1,3 @@ -# Default ignored files -/shelf/ -/workspace.xml +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/activeButton/.idea/compiler.xml b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/compiler.xml similarity index 91% rename from notification/ans_standard/publish_test/activeButton/.idea/compiler.xml rename to notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/compiler.xml index 61a9130cd9669c3843e6445dfe1fee2d493869bc..245a82c8279131bde0c8c09a1f1791c8b0312984 100644 --- a/notification/ans_standard/publish_test/activeButton/.idea/compiler.xml +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/compiler.xml @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/.idea/gradle.xml b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/gradle.xml similarity index 96% rename from notification/ans_standard/publish_test/activeButton/.idea/gradle.xml rename to notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/gradle.xml index 982182efb32e276aa75e12894a11d90e4d8f5650..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171 100644 --- a/notification/ans_standard/publish_test/activeButton/.idea/gradle.xml +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/gradle.xml @@ -1,22 +1,22 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/jarRepositories.xml similarity index 96% rename from notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml rename to notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/jarRepositories.xml index 1dfcd020d2b2774ad414ac5c0acc344e9b9479b4..aa00d771aa98b60cc8db06b5e24919c06b208cda 100644 --- a/notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/jarRepositories.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/.idea/misc.xml b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/misc.xml similarity index 94% rename from notification/ans_standard/publish_test/publishimage/.idea/misc.xml rename to notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/misc.xml index 58918f50335428f2efb3af4d621f9f405ed659d4..9883d055f8725da2d0f5c1cecc525b815e5dfcec 100644 --- a/notification/ans_standard/publish_test/publishimage/.idea/misc.xml +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/.idea/misc.xml @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/Test.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/Test.json index 8a4b7f79567a8ad09adaedfe8981f35c2cd555ed..5248d49eef03ba3f032249156ccca7cb4b587927 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/Test.json +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsanslocalnotificationtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsLocalNotificationTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsanslocalnotificationtest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsLocalNotificationTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/.gitignore b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json index bb6a8e56d6c9cf6eb2cc039ad27520eb3758e78f..0035c7d5f2cac0ad12734131a11e302d6aa7ac44 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json @@ -59,4 +59,4 @@ } ] } -} +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml index a6eb16f9f122d77319cb7962fd7cbec9caca0d1e..4469be610661633278dfdeda350537cf41ce88da 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- 第三方获取通知许可 + 获取自身通知许可
diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json index 2d8e4b4747286f00b226c1b07c8ae6c45cc1c5ea..2a3c6ad694f9de382ca3663a50c4caccdfafa42a 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "LocNotiEn" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "LocNotiEn" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/List.test.js index 74deb32fca370e9afd01cd9f1c282fe09acdfaa8..cf2baaf7a32ff0a7c90a8c3464bcbd111e39203f 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./LocalNotificationEnable.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/LocalNotificationEnable.js b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/LocalNotificationEnable.js index 5af0256186e85b60e2bb3f93bcae044d5606b154..027304cce0b69931ce5331c92cc48a8024b819af 100644 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/LocalNotificationEnable.js +++ b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/test/LocalNotificationEnable.js @@ -1,54 +1,52 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsLocalNotificationTest', function () { - console.info("===ActsLocalNotificationTest start===>"); - - /* - * @tc.number: ActsLocalNotification_test_0100 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsLocalNotification_test_0100', 0, async function (done) { - await notify.isNotificationEnabled((err,data) => { - console.log("====>ActsLocalNotification_test_0100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsLocalNotification_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsLocalNotification_test_0200 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsLocalNotification_test_0200', 0, async function (done) { - var promise = await notify.isNotificationEnabled() - console.log("====>ActsLocalNotification_test_0200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsLocalNotification_test_0200====>"); - }, time); - }) - -}) - +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +describe('ActsAnsLocalNotificationTest', function () { + console.info("===========ActsLocalNotificationTest start====================>"); + /* + * @tc.number: ActsLocalNotification_test_0100 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsLocalNotification_test_0100', 0, async function (done) { + await notify.isNotificationEnabled((err,data) => { + console.log("==========================>ActsLocalNotification_test_0100 success=======================>"+err+data) + expect(typeof(data)).assertEqual('boolean') + }) + done(); + setTimeout(function(){ + console.debug("====>time out ActsLocalNotification_test_0100====>"); + }, time); + }) + /* + * @tc.number: ActsLocalNotification_test_0200 + * @tc.name: isNotificationEnabled() + * @tc.desc: verify the function of isNotificationEnabled + */ + it('ActsLocalNotification_test_0200', 0, async function (done) { + var promise = await notify.isNotificationEnabled() + console.log("==========================>ActsLocalNotification_test_0200 success=======================>"+promise) + expect(typeof(promise)).assertEqual('boolean') + done(); + setTimeout(function(){ + console.debug("====>time out ActsLocalNotification_test_0200====>"); + }, time); + }) + +}) + diff --git a/notification/ans_standard/publish_test/enablenotificationset/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/BUILD.gn deleted file mode 100644 index 7f61812fcf35d9f4be5877e3b8a04a875d04d3e0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/BUILD.gn +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("enablenotificationset") { - testonly = true - if (is_standard_system) { - deps = [ - #"enablenotificationfive:ActsAnsEnableNotificationSetFiveTest", - #"enablenotificationfour:ActsAnsEnableNotificationSetFourTest", - #"enablenotificationone:ActsAnsEnableNotificationSetOneTest", - #"enablenotificationsix:ActsAnsEnableNotificationSetSixTest", - #"enablenotificationtree:ActsAnsEnableNotificationSetTreeTest", - #"enablenotificationtwo:ActsAnsEnableNotificationSetTwoTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/BUILD.gn deleted file mode 100644 index 5d307612125f0aaa7bfbe4a7fe8aba1cc7a9aa5d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSetFiveTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSetFiveTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/Test.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/Test.json deleted file mode 100644 index f18956eb52bda7c621da71d7f59ac9e30bc6a210..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsetfivetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSetFiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/config.json deleted file mode 100644 index 98717b9a04ab13c932a540ad8cf989f8a54b7a32..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsetfivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsetfivetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsetfivetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index cbe7302b08624ff35665ba89fb9c682cc8f650fb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--参数传空 - -
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index c6d7e14954bbd5099bcc04994853928e79f4def5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 173346b1077b38df87bfc11be06a1ec5a3e4c787..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSetFiveTest', function () { - console.info("===ActsEnableNotificationSetTest5 start===>"); - - /* - * @tc.number: ActsEnableNotificationSet_test_0900 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0900', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },"",(err) => { - console.log("====>ActsEnableNotificationSet_test_0900 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotificationSet_test_1000 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_1000', 0, async function (done) { - var promise = notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },"") - expect(promise).assertEqual(undefined) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_1000====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0900 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0900', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotificationSet_test_0900 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_1000 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_1000', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotificationSet_test_1000 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_1000====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/BUILD.gn deleted file mode 100644 index 3c458c10f9c450855d0db1d63027bf42ad0a590c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSetFourTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSetFourTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/Test.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/Test.json deleted file mode 100644 index 4d3973c86dd6e3a1fb8529cc8060612e24f32d7f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsetfourtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSetFourTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/config.json deleted file mode 100644 index f490c14ae35ac47bd7ba4a99aebf91d008172bde..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsetfourtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsetfourtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsetfourtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 171ae99b0b78b32f140b76809051175d3f26b66d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--错误参数 - -
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 91e839d448d257e159b0e8af21fffa7bd9a03294..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 5cc9bec9e55e1cfeb935b55798c3e7b5a15a5117..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSetFourTest', function () { - console.info("===ActsEnableNotificationSetTest4 start===>"); - - /* - * @tc.number: ActsEnableNotificationSet_test_0700 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0700', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },100,(err) => { - console.log("====>ActsEnableNotificationSet_test_0700 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotificationSet_test_0800 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0800', 0, async function (done) { - var promise = notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },100) - expect(promise).assertEqual(undefined) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0800====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotification_test_0700 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0700', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotificationSet_test_0700 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0800 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0800', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotificationSet_test_0800 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0800====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/BUILD.gn deleted file mode 100644 index 06ffde3fd6cc130a5c80268f4ea5dac9227ce956..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSetOneTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSetOneTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/Test.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/Test.json deleted file mode 100644 index 3a4def60d5b9321ed1495b70d472d8c9dc821f5c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsetonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSetOneTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/config.json deleted file mode 100644 index d1d5a31aed2bc92a251a4d0ab5a984f9026a6295..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsetonetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsetonetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsetonetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 6e2068f420d5692db6e02737daab2964cd866202..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定-允许 - -
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index da3745cf7630294cd005702309308a9e95cdf1d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index abf3ffab21ae7d9cc30f7b0f8ad0721a33f08d9c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSetOneTest', function () { - console.info("===ActsEnableNotificationSetTest1 start===>"); - - /* - * @tc.number: ActsEnableNotification_test_0100 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0100', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },true,(err) => { - console.log("====>ActsEnableNotificationSet_test_0100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotificationSet_test_0200 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0200', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },true).then(console.log("====>ActsEnableNotificationSet_test_0200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0100 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0100', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotificationSet_test_0100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0200 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0200', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotificationSet_test_0200 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0200====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationone/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/BUILD.gn deleted file mode 100644 index b499580de9d75de0fbddb5031d5de3c07355e147..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSetSixTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSetSixTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/Test.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/Test.json deleted file mode 100644 index fb72e06f959303514024e70a03ec97f854187e95..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsetsixtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSetSixTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/config.json deleted file mode 100644 index 19a38e8beb2b60865639589b98f344cb5eee1e9a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsetsixtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsetsixtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsetsixtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 6e2068f420d5692db6e02737daab2964cd866202..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定-允许 - -
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index da3745cf7630294cd005702309308a9e95cdf1d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index 282f540e8707ea6dd38dd1f550bad58959fb10bc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSetSixTest', function () { - console.info("===ActsEnableNotificationSetTest1 start===>"); - - /* - * @tc.number: ActsEnableNotificationSet_test_1100 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_1100', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },true,(err) => { - console.log("====>ActsEnableNotificationSet_test_1100 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotificationSet_test_1200 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_1200', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },true).then(console.log("====>ActsEnableNotificationSet_test_1200 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_1200====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_1100 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_1100', 0, async function (done) { - await notify.isNotificationEnabled({bundle:""},(err,data) => { - console.log("====>ActsSystemNotificationSet_test_1100 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_1200 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_1200', 0, async function (done) { - var promise = await notify.isNotificationEnabled() - console.log("====>ActsSystemNotificationSet_test_1200 success====>"+promise) - expect(typeof(promise)).assertEqual('boolean') - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_1200====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationsix/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/BUILD.gn deleted file mode 100644 index d528ecd6232a06d0e702df451a531c4c1d4b1675..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSetTreeTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSetTreeTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/Test.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/Test.json deleted file mode 100644 index 3d4ebe00ae3fa12e6a121e6bfaf785f8bf143b1e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsettreetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSetTreeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/config.json deleted file mode 100644 index f66cf2a9260af7ae37fee25f9ab9c353b2bfffa5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsettreetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsettreetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsettreetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 21a8ff417f5197f8eed648181dfa887f4d3586c6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--允许->禁止 - -
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 83d3151039dde81d26caaeb5a2498a723e711ddc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index a0d315c2e6246261ec94ea407ffa524c5f4ba0e9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSetTreeTest', function () { - console.info("===ActsEnableNotificationSetTest3 start===>"); - - /* - * @tc.number: ActsEnableNotificationSet_test_0500 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0500', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },false,(err) => { - console.log("====>ActsEnableNotificationSet_test_0500 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotificationSet_test_0600 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0600', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },true).then(console.log("====>ActsEnableNotificationSet_test_0600 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0600====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0500 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0500', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotificationSet_test_0500 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0600 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0600', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotificationSet_test_0600 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0600====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtree/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/BUILD.gn b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/BUILD.gn deleted file mode 100644 index d2ccf12d5c3eb1dc8bc00297056a265081b36e40..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationSetTwoTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationSetTwoTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/Test.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/Test.json deleted file mode 100644 index 6b7d06a793464bbe23e71ecd496363abde345f94..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansenablenotificationsettwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationSetTwoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/config.json deleted file mode 100644 index a8890e83793d348f2fa0e0677d83c9befd39177b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationsettwotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationsettwotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansenablenotificationsettwotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index af99fce36f4f9d8538a446fbbb5006ba6c49fb01..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 通知许可设定--禁止 - -
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 8ae09ada9ca6ba13e644d0ad712bfbf894ef0528..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index baa8ca8b7c0cb8033b23cb62a49b1da9a6f36420..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsEnableNotificationSetTwoTest', function () { - console.info("===ActsEnableNotificationSetTest2 start===>"); - - /* - * @tc.number: ActsEnableNotificationSet_test_0300 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0300', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest", - },false,(err) => { - console.log("====>ActsEnableNotificationSet_test_0300 success====>"+err) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsEnableNotificationSet_test_0400 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsEnableNotificationSet_test_0400', 0, async function (done) { - await notify.enableNotification( - { - bundle:"com.example.actsanslocalnotificationtest", - },false).then(console.log("====>ActsEnableNotificationSet_test_0400 success====>")) - done(); - setTimeout(function(){ - console.debug("====>time out ActsEnableNotificationSet_test_0400====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0300 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0300', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("====>ActsSystemNotificationSet_test_0300 success====>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsSystemNotificationSet_test_0400 - * @tc.name: isNotificationEnabled(bundle) - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsSystemNotificationSet_test_0400', 0, async function (done) { - var promise = await notify.isNotificationEnabled( - { - bundle:"com.example.actsanslocalnotificationtest", - }) - expect(typeof(promise)).assertEqual('boolean') - console.log("====>ActsSystemNotificationSet_test_0400 success====>"+promise) - done(); - setTimeout(function(){ - console.debug("====>time out ActsSystemNotificationSet_test_0400====>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/test/List.test.js deleted file mode 100644 index 630d30d02fe26d4c0b1941e035cc82103658afb2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationtwo/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/BUILD.gn b/notification/ans_standard/publish_test/getactive/BUILD.gn index c197203201f27bd338a798fa293ab5ee021c055c..7e57c65150eb836062679f8c620318b7f4877d94 100644 --- a/notification/ans_standard/publish_test/getactive/BUILD.gn +++ b/notification/ans_standard/publish_test/getactive/BUILD.gn @@ -17,8 +17,9 @@ group("getactive") { testonly = true if (is_standard_system) { deps = [ - #"getactivenormal:getactivenormal", - #"getcancelactivenum:ActsAnsGetCancelActiveNumTest", + "actsansgetactive:ActsAnsActiveTest", + #"actsansgetallactive:ActsAnsAllActiveTestOne", + #"getactiveotherapp:ActsAnsGetActiveOtherApp" ] } } diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/.gitignore b/notification/ans_standard/publish_test/getactive/actsansgetactive/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/.gitignore b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/compiler.xml b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/gradle.xml b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..86cf9d664ea4912cf947aeabc735747c8a1faeec --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/misc.xml b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/notification/ans_standard/publishicontest/BUILD.gn b/notification/ans_standard/publish_test/getactive/actsansgetactive/BUILD.gn similarity index 93% rename from notification/ans_standard/publishicontest/BUILD.gn rename to notification/ans_standard/publish_test/getactive/actsansgetactive/BUILD.gn index d0933e80ac6cb59c8d41ed41584e8952118c31be..a4bbd35fcd1d4fb6568c18d870ca81f8a047f5e6 100644 --- a/notification/ans_standard/publishicontest/BUILD.gn +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsIconTest") { +ohos_js_hap_suite("ActsAnsActiveTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsIconTest" + hap_name = "ActsAnsActiveTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/Test.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/Test.json similarity index 87% rename from notification/ans_standard/publish_test/getactive/getactivenormal/active/Test.json rename to notification/ans_standard/publish_test/getactive/actsansgetactive/Test.json index eeacef8c588ba28bebefa5ab661e9c5e883c16d7..33a02c7171e3993fad39bbef0842e07b59e45715 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/Test.json +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansgetactivetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetActiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansgetactivetest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsActiveTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/.gitignore b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/config.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/config.json similarity index 99% rename from notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/config.json rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/config.json index c0f7877313ffd40cc04d2b662b6ee5d87b5483bf..f45ddfca45d62b134a44eff1f003d9694bf10258 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/config.json @@ -59,4 +59,4 @@ } ] } -} +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.hml similarity index 74% rename from notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.hml index 60c117fb35d180619185b62bee24293514f4e896..4ebf4a3ed6e61257d32e6b5bddb74805068415c8 100644 --- a/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- icon_pixcelMap + active
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/resources/base/element/string.json similarity index 80% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/resources/base/element/string.json index 2f247a2a40a0412230fedbc5e0470035aadfa9ec..e02719ea45ffc832ff107d81bcac9cc2e6fe2474 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "getActive" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/test/List.test.js similarity index 93% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/test/List.test.js rename to notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/test/List.test.js index 630d30d02fe26d4c0b1941e035cc82103658afb2..2507b95253b96b2350af466f9b8c5a60406fa571 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfour/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file +/* + * Copyright (c) 2021 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. + */ +require('./getActive.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/test/getActive.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/test/getActive.js new file mode 100644 index 0000000000000000000000000000000000000000..c7d9cd7af38e8ae7b8a88d47ebb65a226ed61067 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetactive/entry/src/main/js/test/getActive.js @@ -0,0 +1,1071 @@ +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +var ERR_ANS_NON_SYSTEM_APP = 67108877 +describe('ActsAnsActiveTest', function () { + console.info("===========ActsAnsActiveTest start====================>"); + function getCallback(err, data){ + console.log("Ans_GetActive_0100 getCallback ============>"); + var i; + console.log("Ans_GetActive_0100 getCallback data.length============>"+data.length); + console.log("Ans_GetActive_0100 getCallback data============>"+JSON.stringify(data)); + for (i = 0; i < data.length; i++) { + expect(data[i].content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT); + console.log("Ans_GetActive_0100 getCallback contentType============>"+data[i].content.contentType) + expect(data[i].content.normal.title).assertEqual("test_title"); + console.log("=========Ans_GetActive_0100 getCallback title============>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text"); + console.log("==========Ans_GetActive_0100 getCallback text============>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText"); + console.log("========Ans_GetActive_0100 getCallback text========>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(1); + console.log("============Ans_GetActive_0100 getCallback id============>"+data[i].id) + expect(data[i].slotType).assertEqual(notify.SlotType.OTHER_TYPES); + console.log("============Ans_GetActive_0100 getCallback slotType============>"+data[i].slotType) + expect(data[i].deliveryTime).assertEqual(1624950453); + console.log("============Ans_GetActive_0100 getCallback deliveryTime========>"+data[i].deliveryTime) + expect(data[i].autoDeletedTime).assertEqual(1625036817); + console.log("===========Ans_GetActive_0100 getCallback autoDeletedTime=====>"+data[i].autoDeletedTime) + expect(data[i].statusBarText).assertEqual("statusBarText"); + console.log("============Ans_GetActive_0100 getCallback statusBarText=====>"+data[i].statusBarText) + expect(data[i].label).assertEqual("0100"); + console.log("============Ans_GetActive_0100 getCallback label=====>"+data[i].label) + expect(data[i].badgeIconStyle).assertEqual(1); + console.log("============Ans_GetActive_0100 getCallback badgeIconStyle=====>"+data[i].badgeIconStyle) + } + } + + /* + * @tc.number: Ans_GetActive_0100 + * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: after publishing a notification, get all active notification info(callback) + */ + it('Ans_GetActive_0100', 0, async function (done) { + console.debug("===============Ans_GetActive_0100 start==================>"); + await notify.cancelAll(); + var notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 1, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + statusBarText: "statusBarText", + label: "0100", + badgeIconStyle: 1, + } + await notify.publish(notificationRequest); + console.debug("===============Ans_GetActive_0100 publish end==================>"); + notify.getActiveNotifications(getCallback); + console.debug("===============Ans_GetActive_0100 getActiveNotifications end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============Ans_GetActive_0100 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_0200 + * @tc.name: getActiveNotifications(): Promise>; + * @tc.desc: Verify: after publishing a notification, get all active notification info(promise) + */ + it('Ans_GetActive_0200', 0, async function (done) { + console.debug("===============Ans_GetActive_0200 start==================>"); + await notify.cancelAll(); + var notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 2, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "0200", + badgeIconStyle: 1, + } + await notify.publish(notificationRequest); + console.debug("===============Ans_GetActive_0200 publish end==================>"); + var promiseData = await notify.getActiveNotifications(); + var i; + for (i = 0; i < promiseData.length; i++) { + expect(promiseData[i].content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT); + console.log("Ans_GetActive_0200 getCallback contentType============>"+promiseData[i].content.contentType) + expect(promiseData[i].content.normal.title).assertEqual("test_title"); + console.log("====Ans_GetActive_0200 getCallback title============>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text"); + console.log("=====Ans_GetActive_0200 getCallback text============>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText"); + console.log("==Ans_GetActive_0200 getCallback text========>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(2); + console.log("============Ans_GetActive_0200 getCallback id============>"+promiseData[i].id) + expect(promiseData[i].slotType).assertEqual(notify.SlotType.OTHER_TYPES); + console.log("============Ans_GetActive_0200 getCallback slotType============>"+promiseData[i].slotType) + expect(promiseData[i].deliveryTime).assertEqual(1624950453); + console.log("=======Ans_GetActive_0200 getCallback deliveryTime========>"+promiseData[i].deliveryTime) + expect(promiseData[i].autoDeletedTime).assertEqual(1625036817); + console.log("=======Ans_GetActive_0200 getCallback autoDeletedTime=====>"+promiseData[i].autoDeletedTime) + // expect(data[i].color).assertEqual(2); + console.log("============Ans_GetActive_0200 getCallback color=====>"+promiseData[i].color) + expect(promiseData[i].statusBarText).assertEqual("statusBarText"); + console.log("=======Ans_GetActive_0200 getCallback statusBarText=====>"+promiseData[i].statusBarText) + expect(promiseData[i].label).assertEqual("0200"); + console.log("============Ans_GetActive_0200 getCallback label=====>"+promiseData[i].label) + expect(promiseData[i].badgeIconStyle).assertEqual(1); + console.log("=======Ans_GetActive_0200 getCallback badgeIconStyle=====>"+promiseData[i].badgeIconStyle) + } + console.debug("===============Ans_GetActive_0200 getActiveNotifications end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============Ans_GetActive_0200 done==================>"); + }, time); + }) + + function getCallbackTwo(err, data){ + console.log("Ans_GetActive_0300 getCallback data.length============>"+data.length); + expect(data.length).assertEqual(2); + console.log("Ans_GetActive_0300 getCallback data============>"+JSON.stringify(data)); + var i; + for (i = 0; i < data.length; i++) { + if (i == 0){ + expect(data[i].content.normal.title).assertEqual("test_title_1"); + console.log("==========Ans_GetActive_0300 getCallback title=========>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text_1"); + console.log("==========Ans_GetActive_0300 getCallback text============>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_1"); + console.log("======Ans_GetActive_0300 getCallback text=======>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(1); + console.log("============Ans_GetActive_0300 getCallback id============>"+data[i].id) + expect(data[i].label).assertEqual("0300_1"); + console.log("============Ans_GetActive_0300 getCallback label=====>"+data[i].label) + }else if(i == 1){ + expect(data[i].content.normal.title).assertEqual("test_title_2"); + console.log("==========Ans_GetActive_0300 getCallback title=========>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text_2"); + console.log("==========Ans_GetActive_0300 getCallback text============>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_2"); + console.log("======Ans_GetActive_0300 getCallback text=======>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(2); + console.log("============Ans_GetActive_0300 getCallback id============>"+data[i].id) + expect(data[i].label).assertEqual("0300_2"); + console.log("============Ans_GetActive_0300 getCallback label=====>"+data[i].label) + } + } + } + + /* + * @tc.number: Ans_GetActive_0300 + * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: after publishing two notifications, get all active notifications info(callback) + */ + it('Ans_GetActive_0300', 0, async function (done) { + console.debug("===============Ans_GetActive_0300 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "0300_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "0300_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_0300 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_0300 publish2 end==================>"); + notify.getActiveNotifications(getCallbackTwo); + console.debug("===============Ans_GetActive_0300 getActiveNotifications end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============Ans_GetActive_0300 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_0400 + * @tc.name: getActiveNotifications(): Promise>; + * @tc.desc: Verify: after publishing two notifications, get all active notifications info(promise) + */ + it('Ans_GetActive_0400', 0, async function (done) { + console.debug("===============Ans_GetActive_0400 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "0400_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "0400_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_0400 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_0400 publish2 end==================>"); + var promiseData = await notify.getActiveNotifications(); + expect(promiseData.length).assertEqual(2); + var i; + for (i = 0; i < promiseData.length; i++) { + if (i == 0){ + expect(promiseData[i].content.normal.title).assertEqual("test_title_1"); + console.log("====Ans_GetActive_0400 getCallback title=====>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text_1"); + console.log("===Ans_GetActive_0400 getCallback text========>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_1"); + console.log("Ans_GetActive_0400 getCallback text=====>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(1); + console.log("============Ans_GetActive_0400 getCallback id============>"+promiseData[i].id) + expect(promiseData[i].label).assertEqual("0400_1"); + console.log("============Ans_GetActive_0400 getCallback label=====>"+promiseData[i].label) + }else if(i == 1){ + expect(promiseData[i].content.normal.title).assertEqual("test_title_2"); + console.log("===Ans_GetActive_0400 getCallback title=========>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text_2"); + console.log("====Ans_GetActive_0400 getCallback text============>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_2"); + console.log("Ans_GetActive_0400 getCallback text=====>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(2); + console.log("============Ans_GetActive_0400 getCallback id============>"+promiseData[i].id) + expect(promiseData[i].label).assertEqual("0400_2"); + console.log("============Ans_GetActive_0400 getCallback label=====>"+promiseData[i].label) + } + } + console.debug("===============Ans_GetActive_0400 getActiveNotifications end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============Ans_GetActive_0400 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_0500 + * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: before publishing any notifications, no active notifications can be get(callback) + */ + it('Ans_GetActive_0500', 0, async function (done) { + console.debug("===============Ans_GetActive_0500 start==================>"); + await notify.cancelAll(); + notify.getActiveNotifications((err, data)=>{ + console.log("Ans_GetActive_0500 getCallback data.length============>" + data.length); + console.log("Ans_GetActive_0500 getCallback JSON.stringify(data)============>" + JSON.stringify(data)); + expect(data.length).assertEqual(0); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_0500 done==================>"); + }, time); + }); + }) + + /* + * @tc.number: Ans_GetActive_0600 + * @tc.name: getActiveNotifications(): Promise>; + * @tc.desc: Verify: before publishing any notifications, no active notifications can be get(promise) + */ + it('Ans_GetActive_0600', 0, async function (done) { + console.debug("===============Ans_GetActive_0600 start==================>"); + await notify.cancelAll(); + var promiseData = await notify.getActiveNotifications(); + console.debug("===============Ans_GetActive_0600 getActiveNotifications end==================>"); + expect(promiseData.length).assertEqual(0); + console.debug("=========Ans_GetActive_0600 promiseData.length=============>"+promiseData.length); + console.debug("==Ans_GetActivcae_0600 JSON.stringify(promiseData)========>"+JSON.stringify(promiseData)); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_0600 done==================>"); + }, time); + }) + + function getCallbackFour(err, data){ + console.log("Ans_GetActive_0700 getCallback ============>"); + console.log("Ans_GetActive_0700 getCallback data.length============>"+data.length); + console.log("Ans_GetActive_0700 getCallback data============>"+JSON.stringify(data)); + expect(data.length).assertEqual(1); + var i; + for (i = 0; i < data.length; i++) { + expect(data[i].content.normal.title).assertEqual("test_title_2"); + console.log("==========Ans_GetActive_0700 getCallback title=========>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text_2"); + console.log("==========Ans_GetActive_0700 getCallback text============>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_2"); + console.log("======Ans_GetActive_0700 getCallback text=======>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(2); + console.log("============Ans_GetActive_0700 getCallback id============>"+data[i].id) + expect(data[i].label).assertEqual("0700_2"); + console.log("============Ans_GetActive_0700 getCallback label=====>"+data[i].label) + } + } + + /* + * @tc.number: Ans_GetActive_0700 + * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications info(callback) + */ + it('Ans_GetActive_0700', 0, async function (done) { + console.debug("===============Ans_GetActive_0700 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "0700_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "0700_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_0700 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_0700 publish2 end==================>"); + await notify.cancel(1, "0700_1"); + console.debug("===============Ans_GetActive_0700 cancel end==================>"); + notify.getActiveNotifications(getCallbackFour); + console.debug("===============Ans_GetActive_0700 getActiveNotifications end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============Ans_GetActive_0700 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_0800 + * @tc.name: getActiveNotifications(): Promise>; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications info(promise) + */ + it('Ans_GetActive_0800', 0, async function (done) { + console.debug("===============Ans_GetActive_0800 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "0800_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "0800_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_0800 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_0800 publish2 end==================>"); + await notify.cancel(1, "0800_1"); + console.debug("===============Ans_GetActive_0700 cancel end==================>"); + var promiseData = await notify.getActiveNotifications(); + var i; + for (i = 0; i < promiseData.length; i++) { + expect(promiseData[i].content.normal.title).assertEqual("test_title_2"); + console.log("======Ans_GetActive_0800 getCallback title=========>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text_2"); + console.log("======Ans_GetActive_0800 getCallback text============>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_2"); + console.log("==Ans_GetActive_0800 getCallback text=======>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(2); + console.log("============Ans_GetActive_0800 getCallback id============>"+promiseData[i].id) + expect(promiseData[i].label).assertEqual("0800_2"); + console.log("============Ans_GetActive_0800 getCallback label=====>"+promiseData[i].label) + } + console.debug("===============Ans_GetActive_0800 getActiveNotifications end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_0800 done==================>"); + }, time); + }) + + function getCallbackFive(err, data){ + console.log("Ans_GetActive_0900 getCallback ============>"); + console.log("Ans_GetActive_0900 getCallback data.length============>"+data.length); + console.log("Ans_GetActive_0900 getCallback data============>"+JSON.stringify(data)); + expect(data.length).assertEqual(0); + } + + /* + * @tc.number: Ans_GetActive_0900 + * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: after publishing two notifications, + cancel all the notifications, get all active notifications info(callback) + */ + it('Ans_GetActive_0900', 0, async function (done) { + console.debug("===============Ans_GetActive_0900 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "0900_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "0900_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_0900 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_0900 publish2 end==================>"); + await notify.cancelAll(); + console.debug("===============Ans_GetActive_0900 cancelAll end==================>"); + notify.getActiveNotifications(getCallbackFive); + console.debug("===============Ans_GetActive_0900 getActiveNotifications end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_0900 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_1000 + * @tc.name: getActiveNotifications(): Promise>; + * @tc.desc: Verify: after publishing two notifications, + cancel all the notifications, get all active notifications info(promise) + */ + it('Ans_GetActive_1000', 0, async function (done) { + console.debug("===============Ans_GetActive_1000 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "1000_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "1000_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_1000 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_1000 publish2 end==================>"); + await notify.cancelAll(); + console.debug("===============Ans_GetActive_1000 cancelAll end==================>"); + var promiseData = await notify.getActiveNotifications(); + console.log("Ans_GetActive_1000 getCallback data.length============>"+promiseData.length); + console.log("Ans_GetActive_1000 getCallback data============>"+JSON.stringify(promiseData)); + expect(promiseData.length).assertEqual(0); + console.debug("===============Ans_GetActive_1000 getActiveNotifications end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1000 done==================>"); + }, time); + }) + + function getCountCallback(err, count){ + console.debug("===============Ans_GetActive_1100 getNumCallback count==================>"+count); + expect(count).assertEqual(1); + } + + /* + * @tc.number: Ans_GetActive_1100 + * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; + * @tc.desc: Verify: after publishing a notification, get active notification count(callback) + */ + it('Ans_GetActive_1100', 0, async function (done) { + console.debug("===============Ans_GetActive_1100 start==================>"); + await notify.cancelAll(); + var notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 1, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "1100", + badgeIconStyle: 1, + } + await notify.publish(notificationRequest); + console.debug("===============Ans_GetActive_1100 publish end==================>"); + notify.getActiveNotificationCount(getCountCallback); + console.debug("===============Ans_GetActive_1100 getActiveNotificationCount end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1100 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_1200 + * @tc.name: getActiveNotificationCount(): Promise; + * @tc.desc: Verify: after publishing a notification, get active notification number(promise) + */ + it('Ans_GetActive_1200', 0, async function (done) { + console.debug("===============Ans_GetActive_1200 start==================>"); + await notify.cancelAll(); + var notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 1, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "1200", + badgeIconStyle: 1, + } + await notify.publish(notificationRequest); + console.debug("===============Ans_GetActive_1200 publish end==================>"); + var promiseCount = await notify.getActiveNotificationCount(); + expect(promiseCount).assertEqual(1); + console.debug("===============Ans_GetActive_1200 promiseCount==================>"+promiseCount); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1200 done==================>"); + }, time); + }) + + + function getCountCallbackTwo(err, count){ + console.debug("===============Ans_GetActive_1300 getCountCallbackTwo count==================>"+count); + expect(count).assertEqual(2); + } + + /* + * @tc.number: Ans_GetActive_1300 + * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; + * @tc.desc: Verify: after publishing two notifications, get active notification count(callback) + */ + it('Ans_GetActive_1300', 0, async function (done) { + console.debug("===============Ans_GetActive_1300 start==================>"); + await notify.cancelAll(); + var notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 1, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "1300_1", + badgeIconStyle: 1, + } + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 2, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "1300_2", + badgeIconStyle: 1, + } + await notify.publish(notificationRequest); + console.debug("===============Ans_GetActive_1300 publish end==================>"); + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_1300 publish end==================>"); + notify.getActiveNotificationCount(getCountCallbackTwo); + console.debug("===============Ans_GetActive_1300 getActiveNotificationCount end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1300 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_1400 + * @tc.name: getActiveNotificationCount(): Promise; + * @tc.desc: Verify: after publishing two notifications, get active notification number(promise) + */ + it('Ans_GetActive_1400', 0, async function (done) { + console.debug("===============Ans_GetActive_1400 start==================>"); + await notify.cancelAll(); + var notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 1, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "1400_1", + badgeIconStyle: 1, + } + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + id: 2, + slotType : notify.SlotType.OTHER_TYPES, + deliveryTime : 1624950453, + autoDeletedTime: 1625036817, + color: 2, + statusBarText: "statusBarText", + label: "1400_2", + badgeIconStyle: 1, + } + await notify.publish(notificationRequest); + console.debug("===============Ans_GetActive_1400 publish1 end==================>"); + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_1400 publish2 end==================>"); + var promiseCount = await notify.getActiveNotificationCount(); + expect(promiseCount).assertEqual(2); + console.debug("===============Ans_GetActive_1400 promiseCount==================>"+promiseCount); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1400 done==================>"); + }, time); + }) + + function getCountCallbackThree(err, count){ + console.debug("===============Ans_GetActive_1500 getCountCallbackThree count==================>"+count); + expect(count).assertEqual(0); + } + + /* + * @tc.number: Ans_GetActive_1500 + * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; + * @tc.desc: Verify: before publishing any notifications, no active notifications count can be get(callback) + */ + it('Ans_GetActive_1500', 0, async function (done) { + console.debug("===============Ans_GetActive_1500 start==================>"); + await notify.cancelAll(); + notify.getActiveNotificationCount(getCountCallbackThree); + console.debug("===============Ans_GetActive_1500 getActiveNotificationCount end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1500 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_1600 + * @tc.name: getActiveNotificationCount(): Promise; + * @tc.desc: Verify: before publishing any notifications, no active notifications count can be get(promise) + */ + it('Ans_GetActive_1600', 0, async function (done) { + console.debug("===============Ans_GetActive_1600 start==================>"); + await notify.cancelAll(); + var promiseCount = await notify.getActiveNotificationCount(); + expect(promiseCount).assertEqual(0); + console.debug("===============Ans_GetActive_1600 promiseCount==================>"+promiseCount); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1600 done==================>"); + }, time); + }) + + + function getCountCallbackFour(err, count){ + console.debug("===============Ans_GetActive_1700 getCountCallbackFour count==================>"+count); + expect(count).assertEqual(1); + } + + /* + * @tc.number: Ans_GetActive_1700 + * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications count(callback) + */ + it('Ans_GetActive_1700', 0, async function (done) { + console.debug("===============Ans_GetActive_1700 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "1700_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "1700_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_1700 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_1700 publish2 end==================>"); + await notify.cancel(1, "1700_1"); + console.debug("===============Ans_GetActive_1700 cancel end==================>"); + notify.getActiveNotificationCount(getCountCallbackFour); + console.debug("===============Ans_GetActive_1700 getActiveNotifications end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1700 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_1800 + * @tc.name: getActiveNotificationCount(): Promise; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications count(promise) + */ + it('Ans_GetActive_1800', 0, async function (done) { + console.debug("===============Ans_GetActive_1800 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "1800_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "1800_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_1800 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_1800 publish2 end==================>"); + await notify.cancel(1, "1800_1"); + console.debug("===============Ans_GetActive_1800 cancel end==================>"); + var promiseCount = await notify.getActiveNotificationCount(); + expect(promiseCount).assertEqual(1); + console.debug("===============Ans_GetActive_1800 promiseCount===========>"+promiseCount); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1800 done==================>"); + }, time); + }) + + function getCountCallbackFive(err, count){ + console.debug("===============Ans_GetActive_1900 getCountCallbackFour count==================>"+count); + expect(count).assertEqual(0); + } + + /* + * @tc.number: Ans_GetActive_1900 + * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications count(callback) + */ + it('Ans_GetActive_1900', 0, async function (done) { + console.debug("===============Ans_GetActive_1900 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "1900_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "1900_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_1900 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_1900 publish2 end==================>"); + await notify.cancelAll(); + console.debug("===============Ans_GetActive_1900 cancel end==================>"); + notify.getActiveNotificationCount(getCountCallbackFive); + console.debug("===============Ans_GetActive_1900 getActiveNotifications end==================>"); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_1900 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetActive_2000 + * @tc.name: getActiveNotificationCount(): Promise; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications count(promise) + */ + it('Ans_GetActive_2000', 0, async function (done) { + console.debug("===============Ans_GetActive_2000 start==================>"); + await notify.cancelAll(); + var notificationRequest1 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_1", + text: "test_text_1", + additionalText: "test_additionalText_1" + }, + }, + id: 1, + label: "2000_1", + } + var notificationRequest2 = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_2", + text: "test_text_2", + additionalText: "test_additionalText_2" + }, + }, + id: 2, + label: "2000_2", + } + await notify.publish(notificationRequest1); + console.debug("===============Ans_GetActive_2000 publish1 end==================>"); + await notify.publish(notificationRequest2); + console.debug("===============Ans_GetActive_2000 publish2 end==================>"); + await notify.cancelAll(); + console.debug("===============Ans_GetActive_2000 cancelAll end==================>"); + var promiseCount = await notify.getActiveNotificationCount(); + expect(promiseCount).assertEqual(0); + console.debug("===============Ans_GetActive_2000 promiseCount===========>"+promiseCount); + done(); + setTimeout(function(){ + console.debug("===============Ans_GetActive_2000 done==================>"); + }, time); + }) + + function getAllCallbackNine(err, data){ + console.debug("========Ans_GetAllActive_0900 getAllCallbackNine data.length========>"+data.length); + console.debug("========Ans_GetAllActive_0900 getAllCallbackNine err.code========>"+err.code); + expect(err.code).assertEqual(67108877); + expect(data).assertEqual(undefined); + } + + /* + * @tc.number: Ans_GetAllActive_0900 + * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: Under non system permission, after the current app publish a notification, + get all active notifications in the system(callback) + */ + it('Ans_GetAllActive_0900', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0900 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0900", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_0900 publish CurrentApp notify end==================>"); + notify.getAllActiveNotifications(getAllCallbackNine); + console.debug("===============Ans_GetAllActive_0900 getAllActiveNotifications end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============Ans_GetAllActive_0900 done==================>"); + }, time); + }) + + /* + * @tc.number: Ans_GetAllActive_1000 + * @tc.name: getAllActiveNotifications(): Promise>; + * @tc.desc: Verify: Under non system permission, after the current app publish a notification, + get all active notifications in the system(promise) + */ + it('Ans_GetAllActive_1000', 0, async function (done) { + console.debug("===============Ans_GetAllActive_1000 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_1000", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_1000 publish CurrentApp notify end==================>"); + await notify.getAllActiveNotifications().then().catch((err)=>{ + expect(err.code).assertEqual(ERR_ANS_NON_SYSTEM_APP); + console.debug("==Ans_GetAllActive_1000 err==>"+err.code); + done(); + }); + }) +}) + diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/actsansgetactive/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/getactive/actsansgetactive/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/.gitignore b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/.gitignore b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/compiler.xml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/gradle.xml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..86cf9d664ea4912cf947aeabc735747c8a1faeec --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/misc.xml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/BUILD.gn b/notification/ans_standard/publish_test/getactive/actsansgetallactive/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e3f4f2bae4b170ad056cf1963f5c7631084945d5 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAnsAllActiveTestOne") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsAnsAllActiveTestOne" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/Test.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..a8d089f2446f66829e290eedf4ceca202413aa97 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansgetallactivetest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsAllActiveTestOne.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/.gitignore b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/config.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/config.json similarity index 86% rename from notification/ans_standard/publish_test/publishimage/entry/src/main/config.json rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/config.json index a0444515dc3d45f62f3f89ac642d5b49a1f1c16b..2d45e8efdfea2a6230dfa4ecf0282310364b32e3 100644 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsanspublishimagetest", + "bundleName": "com.example.actsansgetallactivetest", "vendor": "example", "version": { "code": 1, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.actsanspublishimagetest", + "package": "com.example.actsansgetallactivetest", "name": ".MyApplication", "deviceType": [ "phone" @@ -36,7 +36,7 @@ ] } ], - "name": "com.example.actsanspublishimagetest.MainAbility", + "name": "com.example.actsansgetallactivetest.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..3fdb0466384608079be93abece190eb553f8a31f --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,8 @@ +
+ + currentApp + + + ForGetAllActive + +
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7c94eba4129f8c546988d1fddc6eb2dd484897c2 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "getAllActive" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..5021215acff6fc659e99e5f0ae64c5e5c49625e3 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./getAllActive.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/test/getAllActive.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/test/getAllActive.js new file mode 100644 index 0000000000000000000000000000000000000000..aea3d6135d58b60f0e89741507d7e4874d8da159 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/actsansgetallactive/entry/src/main/js/test/getAllActive.js @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 500 +describe('ActsAnsAllActiveTestOne', function () { + console.info("===========ActsAnsAllActiveTestOne start====================>"); + function getAllCallback(err, data){ + console.log("Ans_GetAllActive_0100 getAllCallback ============>"); + var i; + console.log("Ans_GetAllActive_0100 getAllCallback data.length============>"+data.length); + expect(data.length).assertEqual(2); + console.log("Ans_GetAllActive_0100 getAllCallback data============>"+JSON.stringify(data)); + for (i = 0; i < data.length; i++) { + if (i == 0){ + expect(data[i].content.normal.title).assertEqual("test_title_otherApp"); + console.log("=======Ans_GetAllActive_0100 getCallback title=====>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text_otherApp"); + console.log("=======Ans_GetAllActive_0100 getCallback text========>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); + console.log("===Ans_GetAllActive_0100 getCallback text====>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(2); + console.log("============Ans_GetAllActive_0100 getCallback id============>"+data[i].id) + expect(data[i].label).assertEqual("otherApp"); + console.log("============Ans_GetAllActive_0100 getCallback label=====>"+data[i].label) + }else if(i == 1){ + expect(data[i].content.normal.title).assertEqual("test_title_currentApp"); + console.log("======Ans_GetAllActive_0100 getCallback title=========>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text_currentApp"); + console.log("==========Ans_GetAllActive_0100 getCallback text=======>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_currentApp"); + console.log("===Ans_GetAllActive_0100 getCallback text=====>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(1); + console.log("============Ans_GetAllActive_0100 getCallback id============>"+data[i].id) + expect(data[i].label).assertEqual("currentApp_0100"); + console.log("============Ans_GetAllActive_0100 getCallback label=====>"+data[i].label) + } + } + } + + /* + * @tc.number: Ans_GetAllActive_0100 + * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: After the current app and other apps publish two notifications, + get all active notifications in the system(callback) + */ + it('Ans_GetAllActive_0100', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0100 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0100", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_0100 publish CurrentApp notify end==================>"); + notify.getAllActiveNotifications(getAllCallback); + console.debug("===============Ans_GetAllActive_0100 getAllActiveNotifications end==================>"); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0100 setTimeout==================>"); + done(); + }, time); + }) + + /* + * @tc.number: Ans_GetAllActive_0200 + * @tc.name: getAllActiveNotifications(): Promise> + * @tc.desc: Verify: After the current app and other apps publish two notifications, + get all active notifications in the system(promise) + */ + it('Ans_GetAllActive_0200', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0200 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0200", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_0200 publish CurrentApp notify end==================>"); + var promiseData = await notify.getAllActiveNotifications(); + console.debug("===============Ans_GetAllActive_0200 getActiveNotifications end==================>"); + expect(promiseData.length).assertEqual(2); + var i; + for (i = 0; i < promiseData.length; i++) { + if (i == 0){ + expect(promiseData[i].content.normal.title).assertEqual("test_title_otherApp"); + console.log("=======Ans_GetAllActive_0200 title=====>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text_otherApp"); + console.log("=======Ans_GetAllActive_0200 text========>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); + console.log("===Ans_GetAllActive_0200 text====>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(2); + console.log("============Ans_GetAllActive_0200 id============>"+promiseData[i].id) + expect(promiseData[i].label).assertEqual("otherApp"); + console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label) + }else if(i == 1){ + expect(promiseData[i].content.normal.title).assertEqual("test_title_currentApp"); + console.log("====Ans_GetAllActive_0200 title=====>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text_currentApp"); + console.log("======Ans_GetAllActive_0200 text=====>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_currentApp"); + console.log("Ans_GetAllActive_0200 text===>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(1); + console.log("============Ans_GetAllActive_0200 id============>"+promiseData[i].id) + expect(promiseData[i].label).assertEqual("currentApp_0200"); + console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label) + } + } + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0200 setTimeout==================>"); + done(); + }, time); + }) + + function getAllCallbackThree(err, data){ + console.log("Ans_GetAllActive_0300 getAllCallbackThree ============>"); + console.log("Ans_GetAllActive_0300 getAllCallbackThree data.length============>"+data.length); + console.log("Ans_GetAllActive_0300 getAllCallbackThree data============>"+JSON.stringify(data)); + expect(data.length).assertEqual(1); + var i; + for (i = 0; i < data.length; i++) { + expect(data[i].content.normal.title).assertEqual("test_title_otherApp"); + console.log("==========Ans_GetAllActive_0300 getCallback title=========>"+data[i].content.normal.title) + expect(data[i].content.normal.text).assertEqual("test_text_otherApp"); + console.log("==========Ans_GetAllActive_0300 getCallback text============>"+data[i].content.normal.text) + expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); + console.log("======Ans_GetAllActive_0300 getCallback text=======>"+data[i].content.normal.additionalText) + expect(data[i].id).assertEqual(2); + console.log("============Ans_GetAllActive_0300 getCallback id============>"+data[i].id) + expect(data[i].label).assertEqual("otherApp"); + console.log("============Ans_GetAllActive_0300 getCallback label=====>"+data[i].label) + } + } + + /* + * @tc.number: Ans_GetAllActive_0300 + * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: After the current app and other apps publish two notifications, cancel the notifications + of the current app, get all active notifications in the system(callback) + */ + it('Ans_GetAllActive_0300', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0300 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0300", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_0300 publish CurrentApp notify end==================>"); + await notify.cancel(1, "currentApp_0300"); + notify.getAllActiveNotifications(getAllCallbackThree); + console.debug("===============Ans_GetAllActive_0300 getAllActiveNotifications end==================>"); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0300 setTimeout==================>"); + done(); + }, time); + }) + + /* + * @tc.number: Ans_GetAllActive_0400 + * @tc.name: getAllActiveNotifications(): Promise>; + * @tc.desc: Verify: after publishing two notifications, + cancel one of the notifications, get all active notifications info(promise) + */ + it('Ans_GetAllActive_0400', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0400 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0400", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_0400 publish CurrentApp notify end==================>"); + await notify.cancel(1, "currentApp_0400"); + console.debug("===============Ans_GetAllActive_0400 cancel end==================>"); + var promiseData = await notify.getAllActiveNotifications(); + var i; + for (i = 0; i < promiseData.length; i++) { + expect(promiseData[i].content.normal.title).assertEqual("test_title_otherApp"); + console.log("=======Ans_GetAllActive_0400 title=====>"+promiseData[i].content.normal.title) + expect(promiseData[i].content.normal.text).assertEqual("test_text_otherApp"); + console.log("=======Ans_GetAllActive_0400 text========>"+promiseData[i].content.normal.text) + expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); + console.log("===Ans_GetAllActive_0400 text====>"+promiseData[i].content.normal.additionalText) + expect(promiseData[i].id).assertEqual(2); + console.log("============Ans_GetAllActive_0400 id============>"+promiseData[i].id) + expect(promiseData[i].label).assertEqual("otherApp"); + console.log("============Ans_GetAllActive_0400 label=====>"+promiseData[i].label) + } + console.debug("===============Ans_GetAllActive_0400 getAllActiveNotifications end==================>"); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0400 setTimeout==================>"); + done(); + }, time); + }) + + function getAllCallbackFive(err, data){ + console.log("Ans_GetAllActive_0500 getAllCallbackFive data.length============>"+data.length); + console.log("Ans_GetAllActive_0500 getAllCallbackFive data============>"+JSON.stringify(data)); + expect(data.length).assertEqual(0); + } + /* + * @tc.number: Ans_GetAllActive_0500 + * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify: After the current app and other apps publish two notifications, remove all the notifications + of the system, get all active notifications in the system(callback) + */ + it('Ans_GetAllActive_0500', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0500 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0500", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("===============Ans_GetAllActive_0500 publish CurrentApp notify end==================>"); + await notify.removeAll(); + notify.getAllActiveNotifications(getAllCallbackFive); + console.debug("===============Ans_GetAllActive_0500 getAllActiveNotifications end==================>"); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0500 setTimeout==================>"); + done(); + }, time); + }) + + /* + * @tc.number: Ans_GetAllActive_0600 + * @tc.name: getAllActiveNotifications(): Promise>; + * @tc.desc: Verify: After the current app and other apps publish two notifications, remove all the notifications + of the system, get all active notifications in the system(promise) + */ + it('Ans_GetAllActive_0600', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0600 start==================>"); + await notify.cancelAll(); + var notificationRequestOfCurrentApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_currentApp", + text: "test_text_currentApp", + additionalText: "test_additionalText_currentApp" + }, + }, + id: 1, + label: "currentApp_0600", + } + await notify.publish(notificationRequestOfCurrentApp); + console.debug("==========Ans_GetAllActive_0600 publish CurrentApp notify end==================>"); + await notify.removeAll(); + var promiseData = await notify.getAllActiveNotifications(); + expect(promiseData.length).assertEqual(0); + console.debug("=======Ans_GetAllActive_0600 promiseData.length==========>"+promiseData.length); + console.debug("=======Ans_GetAllActive_0600 promiseData==========>"+JSON.stringify(promiseData)); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0600 setTimeout==================>"); + done(); + }, time); + }) + + function getAllCallbackSeven(err, data){ + console.log("Ans_GetAllActive_0700 getAllCallbackSeven data.length============>"+data.length); + console.log("Ans_GetAllActive_0700 getAllCallbackSeven data============>"+JSON.stringify(data)); + expect(data.length).assertEqual(0); + } + /* + * @tc.number: Ans_GetAllActive_0700 + * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Verify:No active notifications in the system, get all active notifications in the system(callback) + */ + it('Ans_GetAllActive_0700', 0, async function (done) { + console.debug("===============Ans_GetAllActive_0700 start==================>"); + await notify.removeAll(); + notify.getAllActiveNotifications(getAllCallbackSeven); + console.debug("===============Ans_GetAllActive_0700 getAllActiveNotifications end==================>"); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0700 setTimeout==================>"); + done(); + }, time); + }) + + /* + * @tc.number: Ans_GetAllActive_0800 + * @tc.name: getAllActiveNotifications(): Promise>; + * @tc.desc: Verify: No active notifications in the system, get all active notifications in the system(promise) + */ + it('Ans_GetAllActive_0800', 0, async function (done) { + console.debug("==========Ans_GetAllActive_0800 start==================>"); + await notify.removeAll(); + var promiseData = await notify.getAllActiveNotifications(); + console.debug("=========Ans_GetAllActive_0800 promiseData.length=============>"+promiseData.length); + expect(promiseData.length).assertEqual(0); + setTimeout(function(){ + console.debug("===============Ans_GetAllActive_0800 setTimeout==================>"); + done(); + }, time); + }) +}) + diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/actsansgetallactive/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/getactive/actsansgetallactive/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/BUILD.gn b/notification/ans_standard/publish_test/getactive/getactivenormal/BUILD.gn deleted file mode 100644 index ca554d8372d5fca0164f751bbae2b984cd829c0e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/BUILD.gn +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("getactivenormal") { - testonly = true - if (is_standard_system) { - deps = [ - "active:ActsAnsGetActiveTest", - - #"sub:ActsAnsActiveSubscriberTest", - "publish:ActsAnsActivePublishTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 3a41734828f69436adf321074f39fa8bb48d5a89..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Active" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/test/GetActiveInfo.test.js b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/test/GetActiveInfo.test.js deleted file mode 100644 index 2197823333edc8d04c42ed423645be44f0d637da..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/test/GetActiveInfo.test.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsGetActiveTest', function () { - console.info("===ActsSubscriberTest start===>"); - - /* - * @tc.number: ActsActive_test_0100 - * @tc.name: getAllActiveNotifications() - * @tc.desc: verify the function of getAllActiveNotifications - */ - it('ActsActive_test_0100', 0, async function (done) { - await notify.getAllActiveNotifications((error, data) => { - console.log("===>getAllActiveNotifications1===>" + data) - expect(typeof(data)).assertEqual('object') - for (let i = 0; i < data.length; i++) { - console.log("===>getAllActiveNotificationshashCode1===>" + data[i].hashCode) - console.log("===>getAllActiveNotificationsid1===>" + data[i].id) - console.log("===>getAllActiveNotificationslotType1===>" + data[i].slotType) - console.log("===>getAllActiveNotificationclassification1===>" + data[i].classification) - console.log("===>getAllActiveNotificationsortingKey1===>" + data[i].sortingKey) - console.log("===>getAllActiveNotificationscontentType1===>" + data[i].content.contentType) - console.log("===>getAllActiveNotificationstitle1===>" + data[i].content.normal.title) - console.log("===>getAllActiveNotificationstext1===>" + data[i].content.normal.text) - console.log("===>getAllActiveNotificationsadditionalText1===>" + data[i].content.normal.additionalText) - } - }) - - var promise = await notify.getAllActiveNotifications() - expect(typeof(promise)).assertEqual('object') - for (let i = 0; i < promise.length; i++) { - console.log("===>getAllActiveNotificationsPromisehashCode1===>" + promise[i].hashCode) - console.log("===>getAllActiveNotificationsPromiseid1===>" + promise[i].id) - console.log("===>getAllActiveNotificationsPromiseslotType1===>" + promise[i].slotType) - console.log("===>getAllActiveNotificationsPromiseclassification1===>" + promise[i].classification) - console.log("===>getAllActiveNotificationsPromisesortingKey1===>" + promise[i].sortingKey) - console.log("===>getAllActiveNotificationsPromisecontentType1===>" + promise[i].content.contentType) - console.log("===>getAllActiveNotificationsPromisetitle1===>" + promise[i].content.normal.title) - console.log("===>getAllActiveNotificationsPromisetext1===>" + promise[i].content.normal.text) - console.log("===>getAllActiveNotificationsPromiseadditionalText1===>" + promise[i].content.normal.additionalText) - } - done(); - setTimeout(function(){ - console.debug("====>time out ActsActive_test_0100====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/test/List.test.js deleted file mode 100644 index 74a6fad5df1678b8420cab85b9eec0bda8814c06..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./GetActiveInfo.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/getactivenormal/active/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactivenormal/active/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index b1152b6b6a495d44a7428fe4bc7ca89c16e94b35..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "publish1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 6c7b69992197af98eff1f3a1eac25a677f4ec87b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2021 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 notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsActivePublishTest', function () { - function publishCallback001(){ - console.log('ActsNotificationTest ACTS_Publish_0100 asyncCallback') - } - - /* - * @tc.number: ACTS_GetActiveNumTest_0100 - * @tc.name: getActiveNotifications(),getActiveNotificationNums() - * @tc.desc: verify the function of getActiveNotifications,getActiveNotificationNums - */ - it('ACTS_GetActiveNumTest_0100', 0,async function (done) { - await notification.publish({ - id: 1, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", - },publishCallback001); - await notification.publish({ - id: 2, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test2_title", - text: "test2_text", - additionalText: "test2_additionalText" - }, - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION, - classification:"classification2", - sortingKey:"sortingKey2", - },publishCallback001); - - await notification.getActiveNotifications( - (error,data) => { - console.log("==PublishgetActiveNotificationsTest1=="+data) - expect(typeof(data)).assertEqual('object') - for (let i = 0; i < data.length; i++) { - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].hashCode) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].id) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].classification) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].sortingKey) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].slotType) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].content.contentType) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].content.normal.title) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].content.normal.text) - console.log("===>PublishgetActiveNotificationsTest1===>" + data[i].content.normal.additionalText) - } - }) - - var promise = await notification.getActiveNotifications(); - expect(typeof(promise)).assertEqual('object') - for (let i = 0; i < promise.length; i++) { - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].hashCode) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].id) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].slotType) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].classification) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].sortingKey) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].content.contentType) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].content.normal.title) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].content.normal.text) - console.log("==>publishgetAllActiveNotificationsPromisehashCode==>" + promise[i].content.normal.additionalText) - } - - await notification.getActiveNotificationCount((error,data) => { - console.log("==getActiveNotificationNumsTest1=="+JSON.stringify(data)) - expect(typeof(data)).assertEqual('number') - }) - - var promise = await notification.getActiveNotificationCount(); - console.log("==getActiveNotificationNumsTest1Promise=="+JSON.stringify(promise)) - console.log("==ACTS_PublishTest1_0100 finished==") - expect(typeof(promise)).assertEqual('number') - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_GetActiveNumTest_0100====>"); - }, time); - }) -}) diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/test/List.test.js deleted file mode 100644 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/getactivenormal/publish/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/BUILD.gn b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/BUILD.gn deleted file mode 100644 index 19f81bfe930bef22db042d0c7b1258521c0ff739..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsActiveSubscriberTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsActiveSubscriberTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json deleted file mode 100644 index 07282f710a4c25c1129190f716335b8c9569026b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.actsansactivesubscribertest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsActiveSubscriberTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 0ac24eaf6f6b6e2b1ff1f01dc0c724b2692299c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 订阅程序1启动 - -
diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/test/List.test.js deleted file mode 100644 index 0ce6d94a15c59e53ae647cc1afbffc13094a5a96..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/test/Subscriber.js deleted file mode 100644 index d98f023858e158397239af2fb7704675b74c30dc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/test/Subscriber.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsActiveSubscriberTest', function () { - console.info("===ActsSubscriberTest start===>"); - - //consume - function consumeCallback(err, data) { - console.debug("===>consumeCallback data : ===>" + JSON.stringify(data)); - } - //subscribeOn - function subscribeOnCallback(err) { - console.debug("===>subscribeOnCallback===>"); - } - //subscribe - function subscribeCallback(err) { - console.debug("===>subscribeCallback===>"); - } - - /* - * @tc.number: ActsWantAgent_test_0100 - * @tc.name: createSubscriber(),subscribe() - * @tc.desc: verify the function of createSubscriber,subscribe - */ - it('ActsActiveSubscriber_test_0100', 0, async function (done) { - console.debug("==ActsWantAgent_test_0100==begin==>"); - - var subInfo ={ - onConsume:consumeCallback, - onConnect:subscribeOnCallback, - } - try{ - await notify.subscribe(subInfo,subscribeCallback); - }catch(err) { - console.error('=ActsActiveSubscriber_test_0100 订阅 subscribeCallback err:'+err); - } - console.debug("==ActsActiveSubscriber_test_0100==end==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsActiveSubscriber_test_0100====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/.gitignore b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/.gitignore b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/compiler.xml b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/gradle.xml b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..86cf9d664ea4912cf947aeabc735747c8a1faeec --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/misc.xml b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/BUILD.gn b/notification/ans_standard/publish_test/getactive/getactiveotherapp/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e60138c473f1d79cef812e7eb90cf0e5b1defa43 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAnsGetActiveOtherApp") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsAnsGetActiveOtherApp" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/Test.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..a936dceed651eddd439e78041dd67819eee294c2 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansgetactiveotherapp", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsGetActiveOtherApp.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/.gitignore b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/config.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/config.json similarity index 86% rename from notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/config.json rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/config.json index 38706dca82ff979aa8da236fbd26fe0044b43a8d..9613bd3a40626d64962ecb92b5cf145fee0c32d9 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsansactivepublishtest", + "bundleName": "com.example.actsansgetactiveotherapp", "vendor": "example", "version": { "code": 1, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.actsansactivepublishtest", + "package": "com.example.actsansgetactiveotherapp", "name": ".MyApplication", "deviceType": [ "phone" @@ -36,7 +36,7 @@ ] } ], - "name": "com.example.actsansactivepublishtest.MainAbility", + "name": "com.example.actsansgetactiveotherapp.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.hml similarity index 71% rename from notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.hml index 8e5bbd698cf7316754b1666319656dfd7bae644f..045688345cc0da854a479668f662704bf8c4d65b 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/active/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- active程序启动 + otherAppForPublish
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaysix/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b416327547106048167f800df4b1b79f1804376d --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "activeotherapp" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..8f93037489a3bfbef3415aab8b9ff3f88501e87d --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./activeotherapp.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/activeotherapp.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/activeotherapp.js new file mode 100644 index 0000000000000000000000000000000000000000..ee1320ad52914d08f8784e2ba7c3c7215fdedb4d --- /dev/null +++ b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/activeotherapp.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +describe('ActsAnsGetActiveOtherApp', function () { + console.info("===========ActsAnsAllActiveTestOne start====================>"); + + /* + * @tc.number: Ans_GetAllActive_0100(publish) + * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; + * @tc.desc: Send notification as other apps. + */ + it('ActPublish_0100', 0, async function (done) { + console.debug("===============ActPublish_0100 start==================>"); + await notify.removeAll(); + var notificationRequestOfOtherApp = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title_otherApp", + text: "test_text_otherApp", + additionalText: "test_additionalText_otherApp" + }, + }, + id: 2, + label: "otherApp", + } + await notify.publish(notificationRequestOfOtherApp); + console.debug("===============ActPublish_0100 publish CurrentApp notify end==================>"); + done(); + setTimeout(async function(){ + console.debug("===============ActPublish_0100 done==================>"); + }, time); + }) + +}) + diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/getactiveotherapp/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/getactive/getactiveotherapp/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/BUILD.gn b/notification/ans_standard/publish_test/getactive/getcancelactivenum/BUILD.gn deleted file mode 100644 index 4c8b8a239aa508386a7a21375c99c0edbe866043..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetCancelActiveNumTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetCancelActiveNumTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json b/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json deleted file mode 100644 index 1025c5fdfc1a6e4c65b23fc8785775f53f26ed05..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.actsansgetcancelactivenumtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetCancelActiveNumTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/config.json b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/config.json deleted file mode 100644 index 55b5bb843fc576b59b2308d49c5b55adade9b421..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetcancelactivenumtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetcancelactivenumtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetcancelactivenumtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 4a5287619f9cfd05dd47ad8bc78fe606a254d45b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - GetCancelActiveNum启动 - -
diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index d5da657a34e2b9b86463d8c6684a0c613b0227f9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "CancelActiveNum" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/test/GetCancelActiveNum.test.js b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/test/GetCancelActiveNum.test.js deleted file mode 100644 index 9514e1c54322ec8e9d77d028e4c6cdb7adba3883..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/test/GetCancelActiveNum.test.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsGetCancelActiveNumTest', function () { - console.info("===========ActsGetCancelActiveNumTest start====================>"); - - //consume - function consumeCallback(err, data) { - console.debug("==========================>consumeCallback data : =======================>" + JSON.stringify(data)); - console.debug("==========================>consumeCallback===notificationId:====================>" + data.request.id); - console.debug("==========================>consumeCallback===sortingMap.sortedHashCode.length:====================>" + data.sortingMap.sortedHashCode.length); - } - - function cancelAllCallBack(){ - console.info("==========================>cancelAllCallBack start=======================>"); - } - - //subscribeOn - function subscribeOnCallback(err) { - console.debug("==========================>subscribeOnCallback=======================>"); - } - //subscribe - function subscribeCallback(err) { - console.debug("==========================>subscribeCallback=======================>"); - - } - //publish - function publishCallback001(){ - console.log('ActsAnsGetCancelActiveNumTest ActsGetCancelActiveNum_test_0200 publish asyncCallback') - } - - /* - * @tc.number: ActsGetCancelActiveNum_test_0100 - * @tc.name: createSubscriber(),subscriber() - * @tc.desc: verify the function of createSubscriber,subscriber - */ - it('ActsGetCancelActiveNum_test_0100', 0, async function (done) { - console.debug("===============ActsGetCancelActiveNum_test_0100======begin====================>"); - var subInfo ={ - onConsume:consumeCallback, - onConnecte:subscribeOnCallback, - } - try{ - await notify.subscribe(subInfo,subscribeCallback); - }catch(err) { - console.error('=ActsWantAgent_test_0100 订阅 subscribeCallback err:'+err); - } - console.debug("===============ActsGetCancelActiveNum_test_0100=======end===================>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsGetCancelActiveNum_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsGetCancelActiveNum_test_0200 - * @tc.name: getActiveNotifications(),getActiveNotificationNums() - * @tc.desc: verify the function of getActiveNotifications,getActiveNotificationNums - */ - it('ActsGetCancelActiveNum_test_0200', 0,async function (done) { - await notify.publish({ - id: 1, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - } - },publishCallback001); - await notify.publish({ - id: 2, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test2_title", - text: "test2_text", - additionalText: "test2_additionalText" - }, - } - },publishCallback001); - await notify.publish({ - id: 3, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test3_title", - text: "test3_text", - additionalText: "test3_additionalText" - }, - } - },publishCallback001); - - await notify.getActiveNotifications( - (error,data) => { - console.log("============PublishGetActiveNotificationsTest1============"+data) - expect(typeof(data)).assertEqual('object') - for (let i = 0; i < data.length; i++) { - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].hashCode) - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].Id) - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].slotType) - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].content.contentType) - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].content.normal.title) - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].content.normal.text) - console.log("==========================>PublishGetActiveNotificationsTest1=======================>" + data[i].content.normal.additionalText) - } - }) - - var promise = await notify.getActiveNotifications(); - expect(typeof(promise)).assertEqual('object') - for (let i = 0; i < promise.length; i++) { - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].hashCode) - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].Id) - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].slotType) - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].content.contentType) - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].content.normal.title) - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].content.normal.text) - console.log("==========================>publishGetAllActiveNotificationsPromisehashCode=======================>" + promise[i].content.normal.additionalText) - } - - await notify.getActiveNotificationCount((error,data) => { - console.log("============getActiveNotificationNumsTest1============"+JSON.stringify(data)) - expect(typeof(data)).assertEqual('number') - }) - - var promise = await notify.getActiveNotificationCount(); - expect(typeof(promise)).assertEqual('number') - console.log("============getActiveNotificationNumsTest1Promise============"+JSON.stringify(promise)) - console.log("============ActsGetCancelActiveNum_test_0200 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ActsGetCancelActiveNum_test_0200====>"); - }, time); - }) - - /* - * @tc.number: ActsGetCancelActiveNum_test_0300 - * @tc.name: cancel(),getActiveNotificationNums() - * @tc.desc: verify the function of cancel,getActiveNotificationNums - */ - it('ActsGetCancelActiveNum_test_0300', 0,async function (done) { - - await notify.cancel(1,cancelAllCallBack); - - await notify.getActiveNotificationCount((error,data) => { - expect(typeof(data)).assertEqual('number') - console.log("============getActiveNotificationCancelNums============"+data) - }) - - var promise = await notify.getActiveNotificationCount(); - expect(typeof(promise)).assertEqual('number') - console.log("============getActiveNotificationCancelNumsPromise============"+JSON.stringify(promise)) - console.log("============ActsGetCancelActiveNum_test_0300 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ActsGetCancelActiveNum_test_0300====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/test/List.test.js deleted file mode 100644 index 65ec9488cb1e1100ff5e53d525c952da68aea936..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./GetCancelActiveNum.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/getcancelactivenum/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getcancelactivenum/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn b/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn index 25ebc0a4e580414edd54e97c6b46067d723a2f6b..6ec8a2ba44313ef8873c46e81ad024284a8673a1 100644 --- a/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn +++ b/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn @@ -13,14 +13,19 @@ import("//test/xts/tools/build/suite.gni") -group("getwantagentinfo") { - testonly = true - if (is_standard_system) { - deps = [ - "getwantagentinfoone:ActsAnsGetWantAgentInfoOneTest", - #"getwantagentinfoonepro:ActsAnsGetWantAgentInfoOneProTest", - #"getwantagentinfotwo:ActsAnsGetWantAgentInfoTwoTest", - #"getwantagentinfotwopro:ActsAnsGetWantAgentInfoTwoProTest", - ] - } +ohos_js_hap_suite("ActsAnsGetWantAgentInfoTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsAnsGetWantAgentInfoTest" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" } diff --git a/notification/ans_standard/publish_test/getwantagentinfo/Test.json b/notification/ans_standard/publish_test/getwantagentinfo/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..d9a0115a67952e0ac17f044d60fa58ed0f1c5177 --- /dev/null +++ b/notification/ans_standard/publish_test/getwantagentinfo/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansgetwantagentinfotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsGetWantAgentInfoTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/entry/.gitignore b/notification/ans_standard/publish_test/getwantagentinfo/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/config.json similarity index 85% rename from notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/config.json index 4cda20ec3957315bc5503730b7d4f245f232ff69..0167dc4b496e9b38bbe845efea2c2cc6d9d9c536 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsansactivesubscribertest", + "bundleName": "com.example.actsansgetwantagentinfotest", "vendor": "example", "version": { "code": 1, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.actsansactivesubscribertest", + "package": "com.example.actsansgetwantagentinfotest", "name": ".MyApplication", "deviceType": [ "phone" @@ -36,7 +36,7 @@ ] } ], - "name": "com.example.actsansactivesubscribertest.MainAbility", + "name": "com.example.actsansgetwantagentinfotest.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", @@ -59,4 +59,4 @@ } ] } -} +} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.hml similarity index 69% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.hml index ae21a6b0449d004916cd7b981a81277230b9d48d..633f6b00b49a8029936ba4cdb83713b02c720e3d 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- 角标设定-显隐 + 获取AgentInfo测试
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytree/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/resources/base/element/string.json similarity index 80% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/resources/base/element/string.json index 1ea61e659c3ae952790a574d65392d039be3277e..fdceea250aa040f33c1fdd5d70a9046fd35e45e1 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "AgentInfo" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..680626aa64dc7a7d91516062ca239fdf5540d142 --- /dev/null +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js new file mode 100644 index 0000000000000000000000000000000000000000..f9498c45fc2e80f46bd647aa2ef184e15219bcb2 --- /dev/null +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js @@ -0,0 +1,975 @@ +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; + +var WantAgenta; +var WantAgentb; +var WantAgentc; +var WantAgentd; +var WantAgente; +var time = 1000 +describe('ActsAnsGetWantAgentInfoTest', function () { + console.info('----ActsGetWantAgentInfoTest----'); + /* + * @tc.number: ACTS_SetWantInfo_0100 + * @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel() + * @tc.desc: verify the function of getWantAgent(),getBundleName(),getUid(),getWant(),cancel() + */ + it('ACTS_SetWantInfo_0100', 0, async function (done) { + console.info('----ACTS_SetWantInfo_0100----'); + var agentInfoa = { + wants: [ + { + bundleName: "com.example.WantAgentTest", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfoa, + (err, data) => { + if (err.code == 0) { + WantAgenta = data; + console.info('----getWantAgenta success!----'+data); + expect(typeof(data)).assertEqual("object"); + + wantAgent.getBundleName(data, + (err1, data1) => { + if (err1.code == 0) { + console.info('----getBundleNameA success!----'+err.code+data1); + expect(typeof(data1)).assertEqual('string') + } else { + console.info('----getBundleNameA failed!----'); + } + } + ); + wantAgent.getUid(data, + (err2, data2) => { + if (err2.code == 0) { + console.info('----getUidA success!----'+err.code+data2); + expect(typeof(data2)).assertEqual('number') + } else { + console.info('----getUidA failed!----'); + } + } + ); + wantAgent.getWant(data,(err3, data3) => { + if (err3.code == 0) { + console.info('----getWantA success!----'+err.code+data3); + expect(typeof(data3)).assertEqual('object') + } else { + console.info('----getWantA failed!----'); + } + }); + wantAgent.cancel(data,(err)=>{ + console.info("========cancelA========"+err.code) + }); + } else { + console.info('----getWantAgenta failed!----'+err.code+data); + expect(typeof(data)).assertEqual("object"); + } + done(); + }), + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0100====>"); + }, time); + console.info('----getWantAgenta after----'); + }) + /* + * @tc.number: ACTS_SetWantInfo_0200 + * @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel() + * @tc.desc: verify the function of getWantAgent(),getBundleName(),getUid(),getWant(),cancel() promise + */ + it('ACTS_SetWantInfo_0200', 0, async function (done) { + var agentInfod = { + wants: [ + { + bundleName: "com.example.WantAgentTest", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfod).then( + (data) => { + console.info('----getWantAgent Promise success!----'+data); + expect(typeof(data)).assertEqual("object"); + wantAgent.getBundleName(data).then( + (data1) => { + console.info('----getBcanundleName Promise success!----'+data1); + expect(typeof(data1)).assertEqual('string') + } + ); + wantAgent.getUid(data).then( + (data2) => { + console.info('----getUid Promise success!----'+data2); + expect(typeof(data2)).assertEqual('number') + } + ); + wantAgent.getWant(data).then( + (data3) => { + console.info('----getWant Promise success!----'+data3); + console.info('Want = ' + data3); + expect(typeof(data3)).assertEqual('object') + } + ); + wantAgent.cancel(data).then( + console.info("========cancelPromise========") + ); + }) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0200====>"); + }, time) + }) + /* + * @tc.number: ACTS_SetWantInfo_0300 + * @tc.name: equal(normal) + * @tc.desc: verify the function of equal(normal)Callback + */ + it('ACTS_SetWantInfo_0300', 0, async function (done) { + var agentInfob = { + wants: [ + { + bundleName: "bundleName", + abilityName: "abilityName", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfob,(err,data)=>{ + WantAgentb = data + }) + + var agentInfoc = { + wants: [ + { + bundleName: "com.example.WantAgentTest", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfoc, + (err, data) => { + if (err.code == 0) { + WantAgentc = data; + console.log("=======WantAgentb======="+JSON.stringify(WantAgentb)) + console.log("=======WantAgentc======="+JSON.stringify(WantAgentc)) + expect(typeof(data)).assertEqual("object"); + wantAgent.equal(WantAgentb,WantAgentc, + (error,data) => { + if(error.code == 0) { + console.info('----equala success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + expect(data).assertEqual(false); + } + else{ + console.info('----equala failed!----') + } + } + ) + wantAgent.equal(WantAgentb,WantAgentb, + (error,data) => { + if(error.code == 0) { + console.info('----equalb success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + expect(data).assertEqual(true); + } + else{ + console.info('----equalb failed!----') + } + } + ) + } + else{ + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0300====>"); + }, time); + }); + }) + + /* + * @tc.number: ACTS_SetWantInfo_0400 + * @tc.name: equal(normal) + * @tc.desc: verify the function of equal(normal) promise + */ + it('ACTS_SetWantInfo_0400', 0, async function (done) { + var agentInfoe = { + wants: [ + { + bundleName: "bundleName", + abilityName: "abilityName", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfoe,(err,data)=>{ + console.log("=======agentInfoe======="+err.code+JSON.stringify(data)) + WantAgentd = data + }) + + var agentInfof = { + wants: [ + { + bundleName: "com.example.WantAgentTest", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfof, + (err, data) => { + console.log("=======agentInfof======="+err.code+JSON.stringify(data)) + if (err.code == 0) { + WantAgente = data; + console.log("=======WantAgente======="+JSON.stringify(WantAgentd)) + console.log("=======WantAgentf======="+JSON.stringify(WantAgente)) + wantAgent.equal(WantAgentd,WantAgente).then( + (data) => { + console.info('----equalc success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + expect(data).assertEqual(false); + } + ) + wantAgent.equal(WantAgentd,WantAgentd).then( + (data) => { + console.info('----equald success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + expect(data).assertEqual(true); + } + ) + } + else{ + console.info('----getWantAgent failed!----'+err.code+data); + } + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0400====>"); + }, time); + }); + }) + /* + * @tc.number: ACTS_SetWantInfo_0500 + * @tc.name: equal(),cancel() + * @tc.desc: verify the function of equal(),cancel() promise + */ + it('ACTS_SetWantInfo_0500', 0, async function (done) { + var agentInfoe = { + wants: [ + { + bundleName: "$%^%^%&^%&", + abilityName: "$%^&%&*^&*^", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfoe,(err,data)=>{ + WantAgentd = data + }) + + var agentInfof = { + wants: [ + { + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + wantAgent.getWantAgent(agentInfof, + (err, data) => { + if (err.code == 0) { + WantAgente = data; + console.log("=======WantAgente======="+JSON.stringify(WantAgentd)) + console.log("=======WantAgentf======="+JSON.stringify(WantAgente)) + expect(typeof(data)).assertEqual("object"); + wantAgent.equal(WantAgentd,WantAgente).then( + (data) => { + console.info('----equale success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + } + ) + wantAgent.cancel(WantAgentd).then( + console.info("========cancelPromise========") + ); + wantAgent.equal(WantAgentd,WantAgente).then( + (data) => { + console.info('----equalf success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + } + ) + wantAgent.equal(WantAgentd,WantAgentd).then( + (data) => { + console.info('----equalg success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + } + ) + } + else{ + console.info('----getWantAgent failed!----'+err.code); + } + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0500====>"); + }, time); + }); + }) + /* + * @tc.number: ACTS_SetWantInfo_0600 + * @tc.name: equal() + * @tc.desc: verify the function of equal("$%$%^$%^","$%$%^$%^")callback + */ + it('ACTS_SetWantInfo_0600', 0, async function (done) { + wantAgent.equal("$%$%^$%^","$%$%^$%^", + (error,data) => { + if(error.code == 0) { + console.info('----equalh success!----'+data) + expect(typeof(data)).assertEqual("boolean"); + } + else{ + console.info('----equalh failed!----') + } + } + ) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0600====>"); + }, time); + }); + /* + * @tc.number: ACTS_SetWantInfo_0700 + * @tc.name: equal() + * @tc.desc: verify the function of equal("$%$%^$%^","$%$%^$%^")promise + */ + it('ACTS_SetWantInfo_0700', 0, async function (done) { + var promise = await wantAgent.equal("$%$%^$%^","$%$%^$%^") + console.info('----equali success!----'+promise) + expect(promise).assertEqual(undefined); + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0700====>"); + }, time); + }); + /* + * @tc.number: ACTS_SetWantInfo_0800 + * @tc.name: equal() + * @tc.desc: verify the function of equal({},{})callback + */ + it('ACTS_SetWantInfo_0800', 0, async function (done) { + wantAgent.equal({},{}, + (err,data) => { + console.info('----equalj success!----'+err.code+data) + expect(typeof(data)).assertEqual("boolean"); + } + ) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0800====>"); + }, time); + }); + /* + * @tc.number: ACTS_SetWantInfo_0900 + * @tc.name: equal() + * @tc.desc: verify the function of equal({},{})promise + */ + it('ACTS_SetWantInfo_0900', 0, async function (done) { + var promise = wantAgent.equal({},{}) + console.info('----equalk success!----'+promise) + expect(promise).assertEqual(null); + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_0900====>"); + }, time); + }); + /* + * @tc.number: ACTS_SetWantInfo_1000 + * @tc.name: equal() + * @tc.desc: verify the function of equal(100,100)callback + */ + it('ACTS_SetWantInfo_1000', 0, async function (done) { + wantAgent.equal(100,100, + (err,data) => { + console.info('----equalm success!----'+err.code+data) + expect(typeof(data)).assertEqual("boolean"); + } + ) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1000====>"); + }, time); + }); + /* + * @tc.number: ACTS_SetWantInfo_2200 + * @tc.name: equal() + * @tc.desc: verify the function of equal(100,100)promise + */ + it('ACTS_SetWantInfo_1100', 0, async function (done) { + var promise = await wantAgent.equal(100,100) + console.info('----equaln success!----'+promise) + expect(promise).assertEqual(undefined); + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1100====>"); + }, time); + }); + /* + * @tc.number: ACTS_SetWantInfo_1200 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent("")callback + */ + it('ACTS_SetWantInfo_1200', 0, async function (done) { + console.info('----ACTS_SetWantInfo_0300 begin----'); + wantAgent.getWantAgent("",(err,data) => { + console.log("===getWantAgenta==="+err.code+data)}) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1200====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1300 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent("")promise + */ + it('ACTS_SetWantInfo_1300', 0, async function (done) { + console.info('----ACTS_SetWantInfo_0300 begin----'); + var promise = wantAgent.getWantAgent("") + console.log("===getWantAgentb==="+promise) + expect(promise).assertEqual(null); + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1300====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1400 + * @tc.name: getBundleName() + * @tc.desc: verify the function of getBundleName("")callback + */ + it('ACTS_SetWantInfo_1400', 0, async function (done) { + wantAgent.getBundleName("",(err,data) => { + console.info('----getBundleNamea success!----'+err.code+data); + expect(typeof(data)).assertEqual('string')}); + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1400====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1500 + * @tc.name: getBundleName() + * @tc.desc: verify the function of getBundleName("")promise + */ + it('ACTS_SetWantInfo_1500', 0, async function (done) { + var promise = await wantAgent.getBundleName("") + console.info('----getBundleNameb success!----'+promise); + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1500====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1600 + * @tc.name: getUid() + * @tc.desc: verify the function of getUid("")callback + */ + it('ACTS_SetWantInfo_1600', 0, async function (done) { + wantAgent.getUid("",(err,data) => { + console.info('----getUida success!----'+err.code+data); + expect(typeof(data)).assertEqual('number')}); + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1600====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1700 + * @tc.name: getUid() + * @tc.desc: verify the function of getUid("")promise + */ + it('ACTS_SetWantInfo_1700', 0, async function (done) { + var promise =await wantAgent.getUid("") + console.info('----getUidb success!----'+promise); + expect(promise).assertEqual(undefined) + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1700====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1800 + * @tc.name: getWant() + * @tc.desc: verify the function of getWant("")callback + */ + it('ACTS_SetWantInfo_1800', 0, async function (done) { + wantAgent.getWant("",(err,data) => { + console.info('----getWanta success!----'+err.code+data); + expect(typeof(data)).assertEqual('object') + }); + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1800====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_1900 + * @tc.name: getWant() + * @tc.desc: verify the function of getWant("")promise + */ + it('ACTS_SetWantInfo_1900', 0, async function (done) { + var promise = await wantAgent.getWant("") + console.info('----getWantb success!----'+promise); + expect(promise).assertEqual(undefined) + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_1900====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2000 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent(100)callback + */ + it('ACTS_SetWantInfo_2000', 0, async function (done) { + console.info('----ACTS_SetWantInfo_1000 begin----'); + wantAgent.getWantAgent(100,(err,data) => { + console.log('----getWantAgenta success!----'+err.code+data) + }) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2000====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2100 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent(100)promises + */ + it('ACTS_SetWantInfo_2100', 0, async function (done) { + var promise = wantAgent.getWantAgent(100) + console.log("----getWantAgentb success!----"+promise) + expect(promise).assertEqual(null) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2100====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2200 + * @tc.name: getBundleName() + * @tc.desc: verify the function of getBundleName(100)callback + */ + it('ACTS_SetWantInfo_2200', 0, async function (done) { + wantAgent.getBundleName(100,(err,data) => { + console.info('----getBundleNamec success!----'+err.code+data); + expect(typeof(data)).assertEqual('string') + }); + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2200====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2300 + * @tc.name: getBundleName() + * @tc.desc: verify the function of getBundleName(100)promise + */ + it('ACTS_SetWantInfo_2300', 0, async function (done) { + var promise =await wantAgent.getBundleName(100) + console.info('----getBundleNamed success!----'+promise); + expect(promise).assertEqual(undefined) + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2300====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2400 + * @tc.name: getUid() + * @tc.desc: verify the function of getUid(100)callback + */ + it('ACTS_SetWantInfo_2400', 0, async function (done) { + wantAgent.getUid(100,(err,data) => { + console.info('----getUidc success!----'+err.code+data); + }); + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2400====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2500 + * @tc.name: getUid() + * @tc.desc: verify the function of getUid(100)promise + */ + it('ACTS_SetWantInfo_2500', 0, async function (done) { + var promise =await wantAgent.getUid(100) + console.info('----getUidd success!----'+promise); + expect(promise).assertEqual(undefined) + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2500====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2600 + * @tc.name: getWant() + * @tc.desc: verify the function of getWant(100)callback + */ + it('ACTS_SetWantInfo_2600', 0, async function (done) { + wantAgent.getWant(100,(err,data) => { + console.info('----getWantc success!----'+err.code+data); + expect(typeof(data)).assertEqual('object') + }); + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2600====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2700 + * @tc.name: getWant() + * @tc.desc: verify the function of getWant(100)promise + */ + it('ACTS_SetWantInfo_2700', 0, async function (done) { + var promise = await wantAgent.getWant(100) + console.info('----getWantd success!----'+promise); + expect(promise).assertEqual(undefined) + done() + setTimeout(function(){ + console.debug("====>time out ACTS_SetWantInfo_2700====>"); + }, time); + }) + /* + * @tc.number: ACTS_SetWantInfo_2800 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent({})callback + */ + it('ACTS_SetWantInfo_2800', 0, async function (done) { + console.info('----ACTS_SetWantInfo_2800 begin----'); + wantAgent.getWantAgent({},(err,data) => { + console.log("----getWantAgentc success!----"+err.code+data) + }) + done(); + }) + /* + * @tc.number: ACTS_SetWantInfo_2900 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent({})promise + */ + it('ACTS_SetWantInfo_2900', 0, async function (done) { + console.info('----ACTS_SetWantInfo_2900 begin----'); + wantAgent.getWantAgent({}).then((data)=>{ + console.log("----getWantAgentd success!----"+data) + expect(data).assertEqual("object") + }) + done(); + }) + /* + * @tc.number: ACTS_SetWantInfo_3000 + * @tc.name: getBundleName() + * @tc.desc: verify the function of getBundleName({})callback + */ + it('ACTS_SetWantInfo_3000', 0, async function (done) { + wantAgent.getBundleName({},(err,data) => { + console.info('----getBundleNamee success!----'+err.code+data); + expect(typeof(data)).assertEqual('string') + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3100 + * @tc.name: getBundleName() + * @tc.desc: verify the function of getBundleName({})promise + */ + it('ACTS_SetWantInfo_3100', 0, async function (done) { + var promise = wantAgent.getBundleName({}) + console.info('----getBundleNamef success!----'+promise); + expect(promise).assertEqual(null) + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3200 + * @tc.name: getUid() + * @tc.desc: verify the function of getUid({})callback + */ + it('ACTS_SetWantInfo_3200', 0, async function (done) { + wantAgent.getUid({},(err,data) => { + console.info('----getUide success!----'+err.code+data); + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3300 + * @tc.name: getUid() + * @tc.desc: verify the function of getUid({})promise + */ + it('ACTS_SetWantInfo_3300', 0, async function (done) { + var promise = wantAgent.getUid({}) + console.info('----getUidf success!----'+promise); + expect(promise).assertEqual(null) + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3400 + * @tc.name: getWant() + * @tc.desc: verify the function of getWant({})callback + */ + it('ACTS_SetWantInfo_3400', 0, async function (done) { + wantAgent.getWant({},(err,data) => { + console.info('----getWante success!----'+err.code+data); + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3500 + * @tc.name: getWant() + * @tc.desc: verify the function of getWant({})promise + */ + it('ACTS_SetWantInfo_3500', 0, async function (done) { + var promise = wantAgent.getWant({}) + console.info('----getWantf success!----'+promise); + expect(promise).assertEqual(null) + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3600 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel({})callback + */ + it('ACTS_SetWantInfo_3600', 0, async function (done) { + wantAgent.cancel({},(err,data) => { + console.info('----cancela success!----'+err.code+data); + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3700 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel({})promise + */ + it('ACTS_SetWantInfo_3700', 0, async function (done) { + var promise = await wantAgent.cancel({}) + console.info('----cancelb success!----'+promise); + expect(promise).assertEqual(null) + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3800 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel(100)callback + */ + it('ACTS_SetWantInfo_3800', 0, async function (done) { + wantAgent.cancel(100,(err) => { + console.info('----cancelc success!----'+err.code); + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_3900 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel(100)promise + */ + it('ACTS_SetWantInfo_3900', 0, async function (done) { + var promise =await wantAgent.cancel(100) + console.info('----canceld success!----'+promise); + expect(promise).assertEqual(undefined) + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_4000 + * @tc.name: getWant() + * @tc.desc: verify the function of cancel("")callback + */ + it('ACTS_SetWantInfo_4000', 0, async function (done) { + wantAgent.cancel("",(err) => { + console.info('----cancele success!----'+err.code); + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_4100 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel("")promise + */ + it('ACTS_SetWantInfo_4100', 0, async function (done) { + var promise = await wantAgent.cancel("") + console.info('----cancelf success!----'+promise); + expect(promise).assertEqual(undefined) + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_4200 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel("%^%^%^")callback + */ + it('ACTS_SetWantInfo_4200', 0, async function (done) { + wantAgent.cancel("%^%^%^",(err) => { + console.info('----cancelg success!----'+err.code); + }); + done() + }) + /* + * @tc.number: ACTS_SetWantInfo_4300 + * @tc.name: cancel() + * @tc.desc: verify the function of cancel("%^%^%^")promise + */ + it('ACTS_SetWantInfo_4300', 0, async function (done) { + var promise =await wantAgent.cancel("%^%^%^") + console.info('----cancelh success!----'+promise); + expect(promise).assertEqual(undefined) + done() + }) +}) + + diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/BUILD.gn b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/BUILD.gn deleted file mode 100644 index 47c85b202107e69e9265b23959aab499c22d7947..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetWantAgentInfoOneTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetWantAgentInfoOneTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/Test.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/Test.json deleted file mode 100644 index 94b0c1154cb61e2e14104adf5568dfd0d08cb85a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansgetwantagentinfoonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetWantAgentInfoOneTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/config.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/config.json deleted file mode 100644 index 6d8f460a2acfca8e34a9adbf0dd084b003c8320e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetwantagentinfoonetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetwantagentinfoonetest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetwantagentinfoonetest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 3a5163b019963c9c68eb3a07f50350f1a032fec8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AgentInfo1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/test/List.test.js deleted file mode 100644 index b9556322bf41111d632585be3c2648966cae85d8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/test/WantAgent.test.js deleted file mode 100644 index e6f6f7adea840244a6830b22dcda4cf464f44d86..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -var WantAgent1; -var WantAgent2; -var time = 1000 -describe('ActsAnsGetWantAgentInfoOneTest', function () { - console.info('----ActsGetWantAgentInfoTest----'); - - /* - * @tc.number: ACTS_SetWantInfo_0100 - * @tc.name: getWantAgent(),getBundleName(),getUid(),getWant() - * @tc.desc: verify the function of getWantAgent(),getBundleName(),getUid(),getWant() - */ - it('ACTS_SetWantInfo_0100', 0, async function (done) { - console.info('----scene_test_callback_1----'); - var agentInfo1 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - - - console.info('----getWantAgent1 before----'); - wantAgent.getWantAgent(agentInfo1, - (err, data) => { - if (err.code == 0) { - WantAgent1 = data; - console.info('----getWantAgent1 success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - - wantAgent.getBundleName(data, - (err1, data1) => { - if (err1.code == 0) { - console.info('----getBundleName success!----'); - console.info('bundleName = ' + data1); - expect(typeof(data1)).assertEqual('string') - } else { - console.info('----getBundleName failed!----'); - } - } - ); - wantAgent.getUid(data, - (err2, data2) => { - if (err2.code == 0) { - console.info('----getUid success!----'); - console.info('Uid = ' + data2); - expect(typeof(data2)).assertEqual('number') - } else { - console.info('----getUid failed!----'); - } - } - ); - wantAgent.getWant(data,(err3, data3) => { - if (err3.code == 0) { - console.info('----getWant success!----'); - console.info('Want = ' + data3); - expect(typeof(data3)).assertEqual('object') - } else { - console.info('----getWant failed!----'); - } - }); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }), - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0100====>"); - }, time); - console.info('----getWantAgent1 after----'); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0200 - * @tc.name: getWantAgent(),equal() - * @tc.desc: verify the function of getWantAgent(),equal() - */ - it('ACTS_SetWantInfo_0200', 0, async function (done) { - var agentInfo2 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent2 before----'); - wantAgent.getWantAgent(agentInfo2, - (err, data) => { - if (err.code == 0) { - WantAgent2 = data; - console.info('----getWantAgent2 success!----'); - console.log("==WantAgent1=="+JSON.stringify(WantAgent1)) - console.log("===WantAgent2=="+JSON.stringify(WantAgent2)) - console.info(data); - expect(typeof(data)).assertEqual("object"); - wantAgent.equal(WantAgent1,WantAgent2, - (error,data) => { - if(error.code == 0) { - console.info('----equal1 success!----') - console.info(data); - expect(typeof(data)).assertEqual("boolean"); - } - else{ - console.info('----equal1 failed!----') - } - } - ) - wantAgent.equal(WantAgent1,WantAgent1, - (error,data) => { - if(error.code == 0) { - console.info('----equal2 success!----') - console.info(data); - expect(typeof(data)).assertEqual("boolean"); - } - else{ - console.info('----equal2 failed!----') - } - } - ) - } - else{ - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0200====>"); - }, time); - console.info('----getWantAgent2 after----'); - }) -}) - diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/BUILD.gn b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/BUILD.gn deleted file mode 100644 index 5415b2410e073689df141c7e0293f6b31d14ca97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetWantAgentInfoOneProTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetWantAgentInfoOneProTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/Test.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/Test.json deleted file mode 100644 index 093f1009159f2177a9e544ae9fb369e4e332bc3b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsansgetwantagentinfooneprotest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetWantAgentInfoOneProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/config.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/config.json deleted file mode 100644 index 58aa4a4cd9ee82a5f52d47194659a7644fce1cc0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetwantagentinfooneprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetwantagentinfooneprotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetwantagentinfooneprotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 4485661aeee26cf6b597e2a2a0588b8e27e7f243..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 获取AgentInfo-Promise - -
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index cbde59429ecdb954844e0102238e41e401203416..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AgentInfoPro" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/List.test.js deleted file mode 100644 index b9556322bf41111d632585be3c2648966cae85d8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 4eb48b7a8f1251ed338a6127856875debf98498c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -var WantAgent1; -var WantAgent2; -var time = 5000 -describe('ActsAnsGetWantAgentInfoOneProTest', function () { - console.info('----ActsGetWantAgentInfoTest----'); - - /* - * @tc.number: ACTS_SetWantInfo_0300 - * @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel() - * @tc.desc: verify the function of getWantAgent(),getBundleName(),getUid(),getWant(),cancel() promise - */ - it('ACTS_SetWantInfo_0300', 0, async function (done) { - var agentInfo1 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - - - console.info('----getWantAgent1 before----'); - wantAgent.getWantAgent(agentInfo1, - (err, data) => { - if (err.code == 0) { - WantAgent1 = data; - console.info('----getWantAgent1 Promise success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - - wantAgent.getBundleName(data).then( - (data1) => { - console.info('----getBundleName Promise success!----'); - console.info('bundleName = ' + data1); - expect(typeof(data1)).assertEqual('string') - } - ); - wantAgent.getUid(data).then( - (data2) => { - console.info('----getUid Promise success!----'); - console.info('Uid = ' + data2); - expect(typeof(data2)).assertEqual('number') - } - ); - wantAgent.getWant(data).then( - (data3) => { - console.info('----getWant Promise success!----'); - console.info('Want = ' + data3); - expect(typeof(data3)).assertEqual('object') - } - ); - - wantAgent.cancel(data).then( - console.info("========cancelPromise========") - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }), - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0300====>"); - }, time) - console.info('----getWantAgent1 after----'); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0400 - * @tc.name: getWantAgent(),equal() - * @tc.desc: verify the function of getWantAgent(),equal() promise - */ - it('ACTS_SetWantInfo_0400', 0, async function (done) { - var agentInfo2 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent2 before----'); - wantAgent.getWantAgent(agentInfo2, - (err, data) => { - if (err.code == 0) { - WantAgent2 = data; - console.info('----getWantAgent2 Promise success!----'); - console.log("==WantAgent1=="+JSON.stringify(WantAgent1)) - console.log("==WantAgent2=="+JSON.stringify(WantAgent2)) - console.info(data); - expect(typeof(data)).assertEqual("object"); - wantAgent.equal(WantAgent1,WantAgent2).then( - (data) => { - console.info('----equalPromise1 success!----') - console.info(data); - expect(data).assertEqual(false); - } - ) - wantAgent.equal(WantAgent1,WantAgent1).then( - (data) => { - console.info('----equalPromise2 success!----') - console.info(data); - expect(data).assertEqual(true); - } - ) - } - else{ - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0400====>"); - }, time) - console.info('----getWantAgent2 after----'); - }) -}) - diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/BUILD.gn b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/BUILD.gn deleted file mode 100644 index ef151694f1abe0b23155322c3c9bbefcc0ac27f2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetWantAgentInfoTwoTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetWantAgentInfoTwoTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/Test.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/Test.json deleted file mode 100644 index c5fbde8be277fa2fa7d981109a140388384fb9bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansgetwantagentinfotwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetWantAgentInfoTwoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/config.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/config.json deleted file mode 100644 index 3a611f023a011eb227403c2d6403c30ec62b820c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetwantagentinfotwotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetwantagentinfotwotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetwantagentinfotwotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 14dace840b438719d5f6ad3bce9883b2f9d1009c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 获取AgentInfo - -
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 3a5163b019963c9c68eb3a07f50350f1a032fec8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AgentInfo1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/test/List.test.js deleted file mode 100644 index b9556322bf41111d632585be3c2648966cae85d8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 423cabdf5c19df22053bf85ba9d38f6c8f293b85..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/entry/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -var WantAgent1; -var WantAgent2; -var time = 1000 -describe('ActsAnsGetWantAgentInfoTwoTest', function () { - console.info('----ActsGetWantAgentInfoTest----'); - - function CancelWantCallback(){ - console.log("=========CancelWantCallback===========") - } - - /* - * @tc.number: ACTS_SetWantInfo_0500 - * @tc.name: getWantAgent(),cancel() - * @tc.desc: verify the function of getWantAgent(),cancel() - */ - it('ACTS_SetWantInfo_0500', 0, async function (done) { - console.info('----scene_test_callback_1----'); - var agentInfo1 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - - - console.info('----getWantAgent1 before----'); - wantAgent.getWantAgent(agentInfo1, - (err, data) => { - if (err.code == 0) { - WantAgent1 = data; - console.info('----getWantAgent1 success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - wantAgent.cancel(data,CancelWantCallback); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }), - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0500====>"); - }, time) - console.info('----getWantAgent1 after----'); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0600 - * @tc.name: getWantAgent(),equal() - * @tc.desc: verify the function of getWantAgent(),equal() - */ - it('ACTS_SetWantInfo_0600', 0, async function (done) { - var agentInfo2 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent2 before----'); - wantAgent.getWantAgent(agentInfo2, - (err, data) => { - if (err.code == 0) { - WantAgent2 = data; - console.info('----getWantAgent2 success!----'); - console.log("==WantAgent1=="+JSON.stringify(WantAgent1)) - console.log("==WantAgent2=="+JSON.stringify(WantAgent2)) - console.info(data); - expect(typeof(data)).assertEqual("object"); - wantAgent.equal(WantAgent1,WantAgent2, - (error,data) => { - if(error.code == 0) { - console.info('----equal1 success!----') - console.info(data); - } - else{ - console.info('----equal1 failed!----') - } - } - ) - wantAgent.equal(WantAgent1,WantAgent1, - (error,data) => { - if(error.code == 0) { - console.info('----equal2 success!----') - console.info(data); - } - else{ - console.info('----equal2 failed!----') - } - } - ) - } - else{ - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0600====>"); - }, time) - console.info('----getWantAgent2 after----'); - }) - -}) - diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwo/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/BUILD.gn b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/BUILD.gn deleted file mode 100644 index 9eadad3847dce728fa5c1d733a83cb4555f0f9c1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetWantAgentInfoTwoProTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetWantAgentInfoTwoProTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/Test.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/Test.json deleted file mode 100644 index c8978b97bc409ae51cea01b518d4b52de63e02a4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansgetwantagentinfotwoprotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetWantAgentInfoTwoProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/config.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/config.json deleted file mode 100644 index 01e35e7980b4bf542f68cb945aeca5f1b2f9deb6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetwantagentinfotwoprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetwantagentinfotwoprotest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetwantagentinfotwoprotest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index a609d09209149406a084fbdd6ea5f8ca714e4e16..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 获取AgentInfo-Promise2 - -
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 4cc5a33c373fb80d25aa1fa8c6a232524576b8c8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AgentInfoPro2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/List.test.js deleted file mode 100644 index b9556322bf41111d632585be3c2648966cae85d8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 231a0c8cc507aae49039871a1bee84ec3c554197..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -var WantAgent1; -var WantAgent2; -var time = 1000 -describe('ActsAnsGetWantAgentInfoTwoProTest', function () { - console.info('----ActsGetWantAgentInfoTest----'); - - /* - * @tc.number: ACTS_SetWantInfo_0700 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent() - */ - it('ACTS_SetWantInfo_0700', 0, async function (done) { - var agentInfo1 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - - - console.info('----getWantAgent1 before----'); - wantAgent.getWantAgent(agentInfo1, - (err, data) => { - if (err.code == 0) { - WantAgent1 = data; - console.info('----getWantAgent1 Promise success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0700====>"); - }, time) - }), - console.info('----getWantAgent1 after----'); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0800 - * @tc.name: getWantAgent(),equal() - * @tc.desc: verify the function of getWantAgent(),equal() promise - */ - it('ACTS_SetWantInfo_0800', 0, async function (done) { - var agentInfo2 = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent2 before----'); - wantAgent.getWantAgent(agentInfo2, - (err, data) => { - if (err.code == 0) { - WantAgent2 = data; - console.info('----getWantAgent2 Promise success!----'); - console.log("==WantAgent1=="+JSON.stringify(WantAgent1)) - console.log("==WantAgent2=="+JSON.stringify(WantAgent2)) - console.info(data); - expect(typeof(data)).assertEqual("object"); - wantAgent.equal(WantAgent1,WantAgent2).then( - (data) => { - console.info('----equalPromise1 success!----') - console.info(data); - expect(data).assertEqual(false); - } - ) - wantAgent.equal(WantAgent1,WantAgent1).then( - (data) => { - console.info('----equalPromise2 success!----') - console.info(data); - expect(data).assertEqual(true); - } - ) - } - else{ - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0800====>"); - }, time) - }); - - console.info('----getWantAgent2 after----'); - }) -}) - diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getwantagentinfo/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/getwantagentinfo/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/publishcontentype/BUILD.gn b/notification/ans_standard/publish_test/publishcontentype/BUILD.gn index 08c6cff2ad0da28da79d75e8dfe432081083f3c6..23b9a8882bd5fa948a1d30267b09444dd08f0e1b 100644 --- a/notification/ans_standard/publish_test/publishcontentype/BUILD.gn +++ b/notification/ans_standard/publish_test/publishcontentype/BUILD.gn @@ -10,21 +10,15 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsNotificationTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsNotificationTest" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" +group("publishcontentype") { + testonly = true + if (is_standard_system) { + deps = [ + #"publishtype:ActsAnsNotificationTest", + #"sub:ActsAnsCommonEventTest", + ] + } } diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index a8a93f0e9a80a524326e28e88978515ddecf0cee..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,1280 +0,0 @@ -/* - * Copyright (c) 2021 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 notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var comsumData -var time = 1000 -describe('ActsAnsNotificationTest', function () { - function publishMULTILINEContentCallback001(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishMULTILINEContentCallback002(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishMULTILINEContentCallback003(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishLONGContentCallback001(error){ - console.log('ActsNotificationTest ACTS_PublishLONGContent_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishLONGContentCallback002(error){ - console.log('ActsNotificationTest ACTS_PublishLONGContent_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishLONGContentCallback003(error){ - console.log('ActsNotificationTest ACTS_PublishLONGContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - //consume - function consumeCallback(err,data) { - console.debug("==========================>consumeDoNotCallback1 data : =======================>" + err + JSON.stringify(data)); - comsumData = data - } - //subscribeOn - function subscribeOnCallback(err) { - console.debug("==========================>subscribeDoNotOnCallback=======================>"); - } - //subscribe - function subscribeCallback(err) { - console.debug("==========================>subscribeDoNotCallback=======================>"); - } - /* - * @tc.number: ActsDoNotSubscriber_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0100', 0, async function (done) { - console.debug("===============ActsDoNotSubscriber_test_0100======begin====================>"); - - var subInfo ={ - onConsume:consumeCallback, - onConnect:subscribeOnCallback, - } - try { - await notification.subscribe(subInfo, subscribeCallback); - } - catch(err) { - console.error('ActsSubscriber_test_0100 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("===============ActsSubscriber_test_0100=======end3===================>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) - */ - it('ACTS_PublishMULTILINEContent_0100', 0,async function (done) { - try { - await notification.publish({ - id: 1, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["123", "234", "345", "456"] - }, - } - }, publishMULTILINEContentCallback001); - }catch(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0100 error'+JSON.stringify(error.code))} -// console.log("============ACTS_PublishMULTILINEContent_0100 finished============"+comsumData.request.id) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0100====>"); - }, time); - expect(comsumData.request.id).assertEqual(1) - - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish() - */ - it('ACTS_PublishMULTILINEContent_0200', 0,async function (done) { - try { - var notificationInfo = { - id: 2, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["123", "234", "345", "456"] - }, - } - } - }catch(err){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent11111111'+err) - } - try{ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent222222222222') - await notification.publish(notificationInfo,publishMULTILINEContentCallback002); - }catch(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0200 asyncCallback'+error) - } -// console.log("============ACTS_PublishMULTILINEContent_0200 finished============"+comsumData.request.id) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0200====>"); - }, time); - expect(comsumData.request.id).assertEqual(2) - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_PICTURE) - */ - it('ACTS_PublishMULTILINEContent_0300', 0,async function (done) { - try { - await notification.publish({ - id: 3, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["123", "234", "345", "456"] - }, - } - }, publishMULTILINEContentCallback003); - }catch(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0300====>"); - }, time); - expect(comsumData.request.id).assertEqual(3) - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) promise - */ - it('ACTS_PublishMULTILINEContent_0400', 0,async function (done) { - notification.publish({ - id: 4, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText:"briefText", - longTitle:"longTitle", - lines:["123","234","345","456"] - }, - } - }).then(console.log("============ACTS_PublishMULTILINEContent_0400 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0400====>"); - }, time); - expect(comsumData.request.id).assertEqual(4) - }) - /* - * @tc.number: ACTS_PublishMULTILINEContent_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish() promise - */ - it('ACTS_PublishMULTILINEContent_0500', 0,async function (done) { - notification.publish({ - id: 5, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText:"briefText", - longTitle:"longTitle", - lines:["123","234","345","456"] - }, - } - }).then(console.log("============ACTS_PublishMULTILINEContent_0500 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0500====>"); - }, time); - expect(comsumData.request.id).assertEqual(5) - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_PICTURE) promise - */ - it('ACTS_PublishMULTILINEContent_0600', 0,async function (done) { - notification.publish({ - id: 6, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText:"briefText", - longTitle:"longTitle", - lines:["123","234","345","456"] - }, - } - }).then(console.log("============ACTS_PublishMULTILINEContent_0300 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0600====>"); - }, time); - expect(comsumData.request.id).assertEqual(6) - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) - */ - it('ACTS_PublishLONGContent_0100', 0,async function (done) { - await notification.publish({ - id: 7, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - },publishLONGContentCallback001); - console.log("============ACTS_PublishLONGContent_0100 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0100====>"); - }, time); - expect(comsumData.request.id).assertEqual(7) - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish() - */ - it('ACTS_PublishLONGContent_0200', 0,async function (done) { - await notification.publish({ - id: 8, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - },publishLONGContentCallback002); - console.log("============ACTS_PublishLONGContent_0200 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0200====>"); - }, time); - expect(comsumData.request.id).assertEqual(8) - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MEDIA) - */ - it('ACTS_PublishLONGContent_0300', 0,async function (done) { - await notification.publish({ - id: 9, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - },publishLONGContentCallback003); - console.log("============ACTS_PublishLONGContent_0300 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0300====>"); - }, time); - expect(comsumData.request.id).assertEqual(9) - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) promise - */ - it('ACTS_PublishLONGContent_0400', 0,async function (done) { - notification.publish({ - id: 10, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - }).then(console.log("============ACTS_PublishLONGContent_0400 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0400====>"); - }, time); - expect(comsumData.request.id).assertEqual(10) - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish() promise - */ - it('ACTS_PublishLONGContent_0500', 0,async function (done) { - notification.publish({ - id: 11, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - }).then(console.log("============ACTS_PublishLONGContent_0500 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0500====>"); - }, time); - expect(comsumData.request.id).assertEqual(11) - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MEDIA) promise - */ - it('ACTS_PublishLONGContent_0600', 0,async function (done) { - notification.publish({ - id: 12, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - }).then(console.log("============ACTS_PublishLONGContent_0600 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0600====>"); - }, time); - expect(comsumData.request.id).assertEqual(12) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) - */ - it('ACTS_Publish_SlotTypeContent_0100', 0,async function (done) { - await notification.publish({ - id: 13, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - },publishSlotTypeContentCallback001); - console.log("============ACTS_Publish_SlotTypeContent_0100 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0100====>"); - }, time); - expect(comsumData.request.id).assertEqual(13) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:CONTENT_INFORMATION) - */ - it('ACTS_Publish_SlotTypeContent_0200', 0,async function (done) { - await notification.publish({ - id: 14, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - },publishSlotTypeContentCallback002); - console.log("============ACTS_Publish_SlotTypeContent_0200 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0200====>"); - }, time); - expect(comsumData.request.id).assertEqual(14) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_Publish_SlotTypeContent_0300', 0,async function (done) { - await notification.publish({ - id: 15, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - // slotType:notification.SlotType.CONTENT_INFORMATION - },publishSlotTypeContentCallback003); - console.log("============ACTS_Publish_SlotTypeContent_0300 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0300====>"); - }, time); - expect(comsumData.request.id).assertEqual(15) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) - */ - it('ACTS_Publish_SlotTypeContent_0400', 0,async function (done) { - await notification.publish({ - id: 16, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotTypeContentCallback004); - console.log("============ACTS_Publish_SlotTypeContent_0400 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0400====>"); - }, time); - expect(comsumData.request.id).assertEqual(16) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_Publish_SlotTypeContent_0500', 0,async function (done) { - notification.publish({ - id: 17, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - }).then( console.log("============ACTS_Publish_SlotTypeContent_0500 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0500====>"); - }, time); - expect(comsumData.request.id).assertEqual(17) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_Publish_SlotTypeContent_0600', 0,async function (done) { - notification.publish({ - id: 18, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - }).then(console.log("============ACTS_Publish_SlotTypeContent_0600 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0600====>"); - }, time); - expect(comsumData.request.id).assertEqual(18) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_Publish_SlotTypeContent_0700', 0,async function (done) { - notification.publish({ - id: 19, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - // slotType:notification.SlotType.CONTENT_INFORMATION - }).then(console.log("============ACTS_Publish_SlotTypeContent_0700 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0700====>"); - }, time); - expect(comsumData.request.id).assertEqual(19) - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0800 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_Publish_SlotTypeContent_0800', 0,async function (done) { - notification.publish({ - id: 20, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("============ACTS_Publish_SlotTypeContent_0800 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0800====>"); - }, time); - expect(comsumData.request.id).assertEqual(20) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:OTHER_TYPES) - */ - it('ACTS_PublishSlotTypeOther_0100', 0,async function (done) { - await notification.publish({ - id:21, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - },publishSlotOtherCallback001); - console.log("============ACTS_PublishSlotTypeOther_0100 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0100====>"); - }, time); - expect(comsumData.request.id).assertEqual(21) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:OTHER_TYPES) - */ - it('ACTS_PublishSlotTypeOther_0200', 0,async function (done) { - await notification.publish({ - id:22, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - },publishSlotOtherCallback002); - console.log("============ACTS_PublishSlotTypeOther_0200 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0200====>"); - }, time); - expect(comsumData.request.id).assertEqual(22) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeOther_0300', 0,async function (done) { - await notification.publish({ - id:23, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - // slotType:notification.SlotType.OTHER_TYPES - } - },publishSlotOtherCallback003); - console.log("============ACTS_PublishSlotTypeOther_0300 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0300====>"); - }, time); - expect(comsumData.request.id).assertEqual(23) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeOther_0400', 0,async function (done) { - await notification.publish({ - id:24, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotOtherCallback004); - console.log("============ACTS_PublishSlotTypeOther_0400 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0400====>"); - }, time); - expect(comsumData.request.id).assertEqual(24) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:OTHER_TYPES) promise - */ - it('ACTS_PublishSlotTypeOther_0500', 0,async function (done) { - notification.publish({ - id:25, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - }).then(console.log("============ACTS_PublishSlotTypeOther_0500 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0500====>"); - }, time); - expect(comsumData.request.id).assertEqual(25) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:OTHER_TYPES) promise - */ - it('ACTS_PublishSlotTypeOther_0600', 0,async function (done) { - notification.publish({ - id:26, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - }).then(console.log("============ACTS_PublishSlotTypeOther_0600 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0600====>"); - }, time); - expect(comsumData.request.id).assertEqual(26) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeOther_0700', 0,async function (done) { - notification.publish({ - id:27, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - // slotType:notification.SlotType.OTHER_TYPES - } - }).then(console.log("============ACTS_PublishSlotTypeOther_0700 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0700====>"); - }, time); - expect(comsumData.request.id).assertEqual(27) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeOther_0800', 0,async function (done) { - notification.publish({ - id:28, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("============ACTS_PublishSlotTypeOther_0800 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0800====>"); - }, time); - expect(comsumData.request.id).assertEqual(28) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) - */ - it('ACTS_PublishSlotTypeService_0100', 0,async function (done) { - await notification.publish({ - id:29, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback001); - console.log("============ACTS_PublishSlotTypeService_0100 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0100====>"); - }, time); - expect(comsumData.request.id).assertEqual(29) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) - */ - it('ACTS_PublishSlotTypeService_0200', 0,async function (done) { - await notification.publish({ - id: 30, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback002); - console.log("============ACTS_PublishSlotTypeService_0200 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0200====>"); - }, time); - expect(comsumData.request.id).assertEqual(30) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeService_0300', 0,async function (done) { - await notification.publish({ - id: 31, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - // slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback003); - console.log("============ACTS_PublishSlotTypeService_0300 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0300====>"); - }, time); - expect(comsumData.request.id).assertEqual(31) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) - */ - it('ACTS_PublishSlotTypeService_0400', 0,async function (done) { - await notification.publish({ - id: 32, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.UNKNOWN_TYPE - },publishSlotServiceCallback004); - console.log("============ACTS_PublishSlotTypeService_0400 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0400====>"); - }, time); - expect(comsumData.request.id).assertEqual(32) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeService_0500', 0,async function (done) { - notification.publish({ - id: 33, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("============ACTS_PublishSlotTypeService_0500 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0500====>"); - }, time); - expect(comsumData.request.id).assertEqual(33) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeService_0600', 0,async function (done) { - notification.publish({ - id: 34, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("============ACTS_PublishSlotTypeService_0600 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0600====>"); - }, time); - expect(comsumData.request.id).assertEqual(34) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeService_0700', 0,async function (done) { - notification.publish({ - id: 35, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - // slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("============ACTS_PublishSlotTypeService_0700 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0700====>"); - }, time); - expect(comsumData.request.id).assertEqual(35) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0800 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) promise - */ - it('ACTS_PublishSlotTypeService_0800', 0,async function (done) { - notification.publish({ - id: 36, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.UNKNOWN_TYPE - }).then(console.log("============ACTS_PublishSlotTypeService_0800 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0800====>"); - }, time); - expect(comsumData.request.id).assertEqual(36) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeSocial_0100', 0,async function (done) { - await notification.publish({ - id: 37, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback001); - console.log("============ACTS_PublishSlotTypeSocial_0600 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0100====>"); - }, time); - expect(comsumData.request.id).assertEqual(37) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeSocial_0200', 0,async function (done) { - await notification.publish({ - id: 38, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback002); - console.log("============ACTS_PublishSlotTypeSocial_0600 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0200====>"); - }, time); - expect(comsumData.request.id).assertEqual(38) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeSocial_0300', 0,async function (done) { - await notification.publish({ - id: 39, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - // slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback003); - console.log("============ACTS_PublishSlotTypeSocial_0300 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0300====>"); - }, time); - expect(comsumData.request.id).assertEqual(39) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) - */ - it('ACTS_PublishSlotTypeSocial_0400', 0,async function (done) { - await notification.publish({ - id: 40, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.CONTENT_INFORMATION - } - },publishSlotSocialCallback004); - console.log("============ACTS_PublishSlotTypeSocial_0400 finished============") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0400====>"); - }, time); - expect(comsumData.request.id).assertEqual(40) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeSocial_0500', 0,async function (done) { - notification.publish({ - id: 41, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("============ACTS_PublishSlotTypeSocial_0500 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0500====>"); - }, time); - expect(comsumData.request.id).assertEqual(41) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeSocial_0600', 0,async function (done) { - notification.publish({ - id: 42, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("============ACTS_PublishSlotTypeSocial_0600 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0600====>"); - }, time); - expect(comsumData.request.id).assertEqual(42) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeSocial_0700', 0,async function (done) { - notification.publish({ - id: 43, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - // slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("============ACTS_PublishSlotTypeSocial_0700 finished============"), - ) - done() - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0700====>"); - }, time); - expect(comsumData.request.id).assertEqual(43) - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0800 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeSocial_0800', 0,async function (done) { - notification.publish({ - id: 44, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.CONTENT_INFORMATION - } - }).then(console.log("============ACTS_PublishSlotTypeSocial_0800 finished============")) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0800====>"); - }, time); - expect(comsumData.request.id).assertEqual(44) - }) -}) \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/test/List.test.js deleted file mode 100644 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/.gitignore b/notification/ans_standard/publish_test/publishcontentype/publishtype/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/.gitignore b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/compiler.xml b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/gradle.xml b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/misc.xml b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activeButton/BUILD.gn b/notification/ans_standard/publish_test/publishcontentype/publishtype/BUILD.gn similarity index 92% rename from notification/ans_standard/publish_test/activeButton/BUILD.gn rename to notification/ans_standard/publish_test/publishcontentype/publishtype/BUILD.gn index 5ec08a43df39a215c9d3aff065dbd4aa5f7b05d5..08c6cff2ad0da28da79d75e8dfe432081083f3c6 100644 --- a/notification/ans_standard/publish_test/activeButton/BUILD.gn +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/BUILD.gn @@ -12,14 +12,14 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsActionButtonTest") { +ohos_js_hap_suite("ActsAnsNotificationTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsActionButtonTest" + hap_name = "ActsAnsNotificationTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/publishcontentype/Test.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json similarity index 100% rename from notification/ans_standard/publish_test/publishcontentype/Test.json rename to notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/.gitignore b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/config.json similarity index 100% rename from notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/config.json diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..ef4a0629d7470ce3a48a555b55eb4208c690346b --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + ANS发布11 + +
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplaytwo/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/resources/base/element/string.json similarity index 94% rename from notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/resources/base/element/string.json index fc51baa56b4564645a8fd50ce4eb168f313dc4d5..e95e981b01b0db8c7b3b033a7cb790815eb09abd 100644 --- a/notification/ans_standard/publish_test/publishcontentype/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ContentType" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "ContentType" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js new file mode 100644 index 0000000000000000000000000000000000000000..71a6a2869a4540abddce72cecf99565e18a2d0fd --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/ExampleJsunit.test.js @@ -0,0 +1,1871 @@ +/* + * Copyright (c) 2021 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 notification from '@ohos.notification' +import Subscriber from '@ohos.commonevent' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 5000 +var multiLineDataOne +var multiLineDataTwo +var LongContentDataOne +var LongContentDataTwo +var SlotTypeDataOne +var SlotTypeDataTwo +var SlotTypeDataThree +var SlotTypeDataFour +var SlotTypeDataFive +var SlotTypeDataSix +var OtherDataOne +var OtherDataTwo +var OtherDataThree +var OtherDataFour +var OtherDataFive +var OtherDataSix +var ServiceDataOne +var ServiceDataTwo +var ServiceDataThree +var ServiceDataFour +var ServiceDataFive +var ServiceDataSix +var SocialDataOne +var SocialDataTwo +var SocialDataThree +var SocialDataFour +var SocialDataFive +var SocialDataSix +describe('ActsAnsNotificationTest', function () { + function publishMULTILINEContentCallback001(error){ + console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0100 asyncCallback'+JSON.stringify(error.code)) + } + function publishMULTILINEContentCallback002(error){ + console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0200 asyncCallback'+JSON.stringify(error.code)) + } + function publishMULTILINEContentCallback003(error){ + console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code)) + } + function publishLONGContentCallback001(error){ + console.log('ActsNotificationTest ACTS_PublishLONGContent_0100 asyncCallback'+JSON.stringify(error.code)) + } + function publishLONGContentCallback002(error){ + console.log('ActsNotificationTest ACTS_PublishLONGContent_0200 asyncCallback'+JSON.stringify(error.code)) + } + function publishLONGContentCallback003(error){ + console.log('ActsNotificationTest ACTS_PublishLONGContent_0300 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotTypeContentCallback001(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0100 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotTypeContentCallback002(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0200 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotTypeContentCallback003(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0300 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotTypeContentCallback004(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0400 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotOtherCallback001(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0100 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotOtherCallback002(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0200 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotOtherCallback003(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0300 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotOtherCallback004(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0400 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotServiceCallback001(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0100 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotServiceCallback002(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0200 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotServiceCallback003(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0300 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotServiceCallback004(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotSocialCallback001(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotSocialCallback002(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotSocialCallback003(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) + } + function publishSlotSocialCallback004(error){ + console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) + } + function UnSubscribeCallBacka(err){ + console.log('===UnSubscribeCallBacka==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackb(err){ + console.log('===UnSubscribeCallBackb==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackc(err){ + console.log('===UnSubscribeCallBackc==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackd(err){ + console.log('===UnSubscribeCallBackd==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBacke(err){ + console.log('===UnSubscribeCallBacke==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackf(err){ + console.log('===UnSubscribeCallBackf==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackg(err){ + console.log('===UnSubscribeCallBackg==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackh(err){ + console.log('===UnSubscribeCallBackh==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBacki(err){ + console.log('===UnSubscribeCallBacki==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackj(err){ + console.log('===UnSubscribeCallBackj==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackl(err){ + console.log('===UnSubscribeCallBackl==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackm(err){ + console.log('===UnSubscribeCallBackm==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackn(err){ + console.log('===UnSubscribeCallBackn==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBacko(err){ + console.log('===UnSubscribeCallBacko==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackp(err){ + console.log('===UnSubscribeCallBackp==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackq(err){ + console.log('===UnSubscribeCallBackq==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackr(err){ + console.log('===UnSubscribeCallBackr==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBacks(err){ + console.log('===UnSubscribeCallBacks==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackt(err){ + console.log('===UnSubscribeCallBackt==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBacku(err){ + console.log('===UnSubscribeCallBacku==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackv(err){ + console.log('===UnSubscribeCallBackv==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackw(err){ + console.log('===UnSubscribeCallBackw==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackx(err){ + console.log('===UnSubscribeCallBackx==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBacky(err){ + console.log('===UnSubscribeCallBacky==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackz(err){ + console.log('===UnSubscribeCallBackz==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackA(err){ + console.log('===UnSubscribeCallBackA==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackB(err){ + console.log('===UnSubscribeCallBackB==='+err.code) + expect(err.code).assertEqual(0) + } + function UnSubscribeCallBackC(err){ + console.log('===UnSubscribeCallBackC==='+err.code) + expect(err.code).assertEqual(0) + } + /* + * @tc.number: ACTS_PublishMULTILINEContent_0100 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) + */ + it('ACTS_PublishMULTILINEContent_0100', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishMULTILINEContent_0100"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo + , async (err,data) =>{ + console.info("===ACTS_PublishMULTILINEContent_0100===createSubscriber"+JSON.stringify(data)); + multiLineDataOne = data + await Subscriber.subscribe(data, subMultilineOneCallBack) + }) + function subMultilineOneCallBack(err,data){ + console.log('===subMultilineOneCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(multiLineDataOne,UnSubscribeCallBacka) + if(data.code == 1) { + expect(data.code).assertEqual(1); + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 1, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, + multiLine: { + title: "test1_title", + text: "test1_text", + additionalText: "test1_additionalText", + briefText: "briefText1", + longTitle: "longTitle1", + lines: ["thrive", "democracy", "civilization", "harmonious"] + }, + } + }, async (err)=>{ + console.debug("====ACTS_PublishMULTILINEContent_0100===Callback==>") + }); + + }) + + /* + * @tc.number: ACTS_PublishMULTILINEContent_0200 + * @tc.name: publish() + * @tc.desc: verify the function of publish() + */ + it('ACTS_PublishMULTILINEContent_0200', 0,async function (done) { + var notificationInfo = { + id: 2, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, + multiLine: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + briefText: "briefText", + longTitle: "longTitle", + lines: ["thrive", "democracy", "civilization", "harmonious"] + }, + } + } + await notification.publish(notificationInfo,publishMULTILINEContentCallback002) + done(); + }) + /* + * @tc.number: ACTS_PublishMULTILINEContent_0300 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_PICTURE) + */ + it('ACTS_PublishMULTILINEContent_0300', 0,async function (done) { + try { + await notification.publish({ + id: 3, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, + multiLine: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + briefText: "briefText", + longTitle: "longTitle", + lines: ["thrive", "democracy", "civilization", "harmonious"] + }, + } + }, publishMULTILINEContentCallback003); + }catch(error){ + console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code)) + } + done(); + }) + + /* + * @tc.number: ACTS_PublishMULTILINEContent_0400 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) promise + */ + it('ACTS_PublishMULTILINEContent_0400', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishMULTILINEContent_0400"] + }; + await Subscriber.createSubscriber(commonEventSubscribeInfo).then(async(data)=> { + console.info("===ACTS_PublishMULTILINEContent_0400===createSubscriber" + JSON.stringify(data)); + multiLineDataTwo = data + await Subscriber.subscribe(data, subMultilineTwoCallBack) + }) + console.info("===ACTS_PublishMULTILINEContent_0400===subMultilineTwoCallBack"); + async function subMultilineTwoCallBack(err,data){ + console.log('===subMultilineTwoCallBack==='+err.code+JSON.stringify(data)) + await Subscriber.unsubscribe(multiLineDataTwo,UnSubscribeCallBackb) + if(data.code == 4) { + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 4, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, + multiLine: { + title: "test4_title", + text: "test4_text", + additionalText: "test4_additionalText", + briefText:"briefText4", + longTitle:"longTitle4", + lines: ["thrive", "democracy", "civilization", "harmonious"] + }, + } + }).then(console.debug("===ACTS_PublishMULTILINEContent_0400===Promise===>")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishMULTILINEContent_0400====>"); + }, time); + }) + /* + * @tc.number: ACTS_PublishMULTILINEContent_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish() promise + */ + it('ACTS_PublishMULTILINEContent_0500', 0,async function (done) { + var promise = notification.publish({ + id: 5, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, + multiLine: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + briefText:"briefText", + longTitle:"longTitle", + lines: ["thrive", "democracy", "civilization", "harmonious"] + }, + } + }) + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishMULTILINEContent_0500====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishMULTILINEContent_0600 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_PICTURE) promise + */ + it('ACTS_PublishMULTILINEContent_0600', 0,async function (done) { + var promise = notification.publish({ + id: 6, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, + multiLine: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + briefText:"briefText", + longTitle:"longTitle", + lines: ["thrive", "democracy", "civilization", "harmonious"] + }, + } + }) + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishMULTILINEContent_0600====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishLONGContent_0100 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) + */ + it('ACTS_PublishLONGContent_0100', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishLONGContent_0100"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_PublishLONGContent_0100===createSubscriber"+JSON.stringify(data)); + LongContentDataOne = data + await Subscriber.subscribe(data, subLoneOneCallBack) + }) + function subLoneOneCallBack(err,data){ + console.log('===subLoneOneCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(LongContentDataOne,UnSubscribeCallBackc) + if(data.code == 7) { + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 7, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, + longText: { + title: "test7_title", + text: "test7_text", + additionalText: "test7_additionalText", + longText:"longText7", + briefText:"briefText7", + expandedTitle:"expandedTitle7" + }} + },(err)=>{ + console.debug("===ACTS_PublishLONGContent_0100===Callback===>"); + }); + }) + + /* + * @tc.number: ACTS_PublishLONGContent_0200 + * @tc.name: publish() + * @tc.desc: verify the function of publish() + */ + it('ACTS_PublishLONGContent_0200', 0,async function (done) { + await notification.publish({ + id: 8, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, + longText: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + longText:"longText", + briefText:"briefText", + expandedTitle:"expandedTitle" + }} + },publishLONGContentCallback002); + console.log("===ACTS_PublishLONGContent_0200 finished===") + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishLONGContent_0200====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishLONGContent_0300 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MEDIA) + */ + it('ACTS_PublishLONGContent_0300', 0,async function (done) { + await notification.publish({ + id: 9, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA, + longText: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + longText:"longText", + briefText:"briefText", + expandedTitle:"expandedTitle" + }} + },publishLONGContentCallback003); + console.log("===ACTS_PublishLONGContent_0300 finished===") + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishLONGContent_0300====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishLONGContent_0400 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) promise + */ + it('ACTS_PublishLONGContent_0400', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishLONGContent_0400"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishLONGContent_0400===createSubscriber"+JSON.stringify(data)); + LongContentDataTwo = data + await Subscriber.subscribe(data, subLoneTwoCallBack) + }) + function subLoneTwoCallBack(err,data){ + console.log('===subLoneTwoCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(LongContentDataTwo,UnSubscribeCallBackd) + if(data.code == 10) { + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 10, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, + longText: { + title: "test10_title", + text: "test10_text", + additionalText: "test10_additionalText", + longText:"longText10", + briefText:"briefText10", + expandedTitle:"expandedTitle10" + }} + }).then(console.log("===ACTS_PublishLONGContent_0400 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishLONGContent_0400====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishLONGContent_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish() promise + */ + it('ACTS_PublishLONGContent_0500', 0,async function (done) { + var promise = await notification.publish({ + id: 11, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, + longText: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + longText:"longText", + briefText:"briefText", + expandedTitle:"expandedTitle" + }} + }) + expect(promise).assertEqual(undefined) + done(); + }) + + /* + * @tc.number: ACTS_PublishLONGContent_0600 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MEDIA) promise + */ + it('ACTS_PublishLONGContent_0600', 0,async function (done) { + var promise = notification.publish({ + id: 12, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_MEDIA, + longText: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText", + longText:"longText", + briefText:"briefText", + expandedTitle:"expandedTitle" + }} + }) + expect(promise).assertEqual(undefined) + done(); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0100 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) + */ + it('ACTS_Publish_SlotTypeContent_0100', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_Publish_SlotTypeContent_0100"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_Publish_SlotTypeContent_0100===createSubscriber"+JSON.stringify(data)); + SlotTypeDataOne = data + await Subscriber.subscribe(data, subSlotTypeOneCallBack) + }) + function subSlotTypeOneCallBack(err,data){ + console.log('===subSlotTypeOneCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SlotTypeDataOne,UnSubscribeCallBacke) + if(data.code == 13) { + expect(data.code).assertEqual(13) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 13, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test13_title", + text: "test13_text", + additionalText: "test13_additionalText" + } + }, + slotType:notification.SlotType.CONTENT_INFORMATION + },publishSlotTypeContentCallback001); + console.log("===ACTS_Publish_SlotTypeContent_0100 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0100====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0200 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:CONTENT_INFORMATION) + */ + it('ACTS_Publish_SlotTypeContent_0200', 0,async function (done) { + await notification.publish({ + id: 14, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + } + }, + slotType:notification.SlotType.CONTENT_INFORMATION + },publishSlotTypeContentCallback002); + console.log("===ACTS_Publish_SlotTypeContent_0200 finished===") + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0200====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0300 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) + */ + it('ACTS_Publish_SlotTypeContent_0300', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_Publish_SlotTypeContent_0300"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_Publish_SlotTypeContent_0300===createSubscriber"+JSON.stringify(data)); + SlotTypeDataTwo = data + await Subscriber.subscribe(data, subSlotTypeTwoCallBack) + }) + function subSlotTypeTwoCallBack(err,data){ + console.log('===subSlotTypeTwoCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SlotTypeDataTwo,UnSubscribeCallBackf) + if(data.code == 15) { + expect(data.code).assertEqual(15) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 15, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test15_title", + text: "test15_text", + additionalText: "test_additionalText" + } + }, + //slotType:notification.SlotType.CONTENT_INFORMATION + },publishSlotTypeContentCallback003); + console.log("===ACTS_Publish_SlotTypeContent_0300 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0300====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0400 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) + */ + it('ACTS_Publish_SlotTypeContent_0400', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_Publish_SlotTypeContent_0400"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_Publish_SlotTypeContent_0400===createSubscriber"+JSON.stringify(data)); + SlotTypeDataThree = data + await Subscriber.subscribe(data, subSlotTypeThreeCallBack) + }) + function subSlotTypeThreeCallBack(err,data){ + console.log('===subSlotTypeThreeCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SlotTypeDataThree,UnSubscribeCallBackg) + if(data.code == 16) { + expect(data.code).assertEqual(16) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 16, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test16_title", + text: "test16_text", + additionalText: "test16_additionalText" + } + }, + slotType:notification.SlotType.SERVICE_INFORMATION + },publishSlotTypeContentCallback004); + console.log("===ACTS_Publish_SlotTypeContent_0400 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0400====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise + */ + it('ACTS_Publish_SlotTypeContent_0500', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_Publish_SlotTypeContent_0500"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_Publish_SlotTypeContent_0500===createSubscriber"+JSON.stringify(data)); + SlotTypeDataFour = data + await Subscriber.subscribe(data, subSlotTypeFourCallBack) + }) + function subSlotTypeFourCallBack(err,data){ + console.log('===subSlotTypeFourCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SlotTypeDataFour,UnSubscribeCallBackh) + if(data.code == 17) { + expect(data.code).assertEqual(17) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 17, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test17_title", + text: "test17_text", + additionalText: "test17_additionalText" + } + }, + slotType:notification.SlotType.CONTENT_INFORMATION + }).then( console.log("===ACTS_Publish_SlotTypeContent_0500 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0500====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0600 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:CONTENT_INFORMATION) promise + */ + it('ACTS_Publish_SlotTypeContent_0600', 0,async function (done) { + var promise = notification.publish({ + id: 18, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + } + }, + slotType:notification.SlotType.CONTENT_INFORMATION + }) + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0600====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0700 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise + */ + it('ACTS_Publish_SlotTypeContent_0700', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_Publish_SlotTypeContent_0700"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_Publish_SlotTypeContent_0700===createSubscriber"+JSON.stringify(data)); + SlotTypeDataFive = data + await Subscriber.subscribe(data, subSlotTypeFiveCallBack) + }) + function subSlotTypeFiveCallBack(err,data){ + console.log('===subSlotTypeFiveCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SlotTypeDataFive,UnSubscribeCallBacki) + if(data.code == 19) { + expect(data.code).assertEqual(19) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 19, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test19_title", + text: "test19_text", + additionalText: "test19_additionalText" + } + }, + //slotType:notification.SlotType.CONTENT_INFORMATION + }).then(console.log("===ACTS_Publish_SlotTypeContent_0700 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0700====>"); + }, time); + }) + + /* + * @tc.number: ACTS_Publish_SlotTypeContent_0800 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise + */ + it('ACTS_Publish_SlotTypeContent_0800', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_Publish_SlotTypeContent_0800"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_Publish_SlotTypeContent_0800===createSubscriber"+JSON.stringify(data)); + SlotTypeDataSix = data + await Subscriber.subscribe(data, subSlotTypeSixCallBack) + }) + function subSlotTypeSixCallBack(err,data){ + console.log('===subSlotTypeSixCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SlotTypeDataSix,UnSubscribeCallBackj) + if(data.code == 20) { + expect(data.code).assertEqual(20) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 20, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test20_title", + text: "test20_text", + additionalText: "test20_additionalText" + } + }, + slotType:notification.SlotType.SERVICE_INFORMATION + }).then(console.log("===ACTS_Publish_SlotTypeContent_0800 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_Publish_SlotTypeContent_0800====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0100 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:OTHER_TYPES) + */ + it('ACTS_PublishSlotTypeOther_0100', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeOther_0100"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeOther_0100===createSubscriber"+JSON.stringify(data)); + OtherDataOne = data + await Subscriber.subscribe(data, subOtherOneCallBack) + }) + function subOtherOneCallBack(err,data){ + console.log('===subOtherOneCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(OtherDataOne,UnSubscribeCallBackl) + if(data.code == 21) { + expect(data.code).assertEqual(21) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id:21, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test21_title", + text: "test21_text", + additionalText: "test21_additionalText" + }, + slotType:notification.SlotType.OTHER_TYPES + } + },publishSlotOtherCallback001); + console.log("===ACTS_PublishSlotTypeOther_0100 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0100====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0200 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:OTHER_TYPES) + */ + it('ACTS_PublishSlotTypeOther_0200', 0,async function (done) { + await notification.publish({ + id:22, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + slotType:notification.SlotType.OTHER_TYPES + } + },publishSlotOtherCallback002); + console.log("===ACTS_PublishSlotTypeOther_0200 finished===") + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0200====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0300 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) + */ + it('ACTS_PublishSlotTypeOther_0300', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeOther_0300"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeOther_0300===createSubscriber"+JSON.stringify(data)); + OtherDataTwo = data + await Subscriber.subscribe(data, subOtherTwoCallBack) + }) + function subOtherTwoCallBack(err,data){ + console.log('===subOtherTwoCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(OtherDataTwo,UnSubscribeCallBackm) + if(data.code == 23) { + expect(data.code).assertEqual(23) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id:23, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test23_title", + text: "test23_text", + additionalText: "test23_additionalText" + }, + //slotType:notification.SlotType.OTHER_TYPES + } + },publishSlotOtherCallback003); + console.log("===ACTS_PublishSlotTypeOther_0300 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0300====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0400 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) + */ + it('ACTS_PublishSlotTypeOther_0400', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeOther_0400"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeOther_0400===createSubscriber"+JSON.stringify(data)); + OtherDataThree = data + await Subscriber.subscribe(data, subOtherThreeCallBack) + }) + function subOtherThreeCallBack(err,data){ + console.log('===subOtherThreeCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(OtherDataThree,UnSubscribeCallBackn) + if(data.code == 24) { + expect(data.code).assertEqual(24) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id:24, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test24_title", + text: "test24_text", + additionalText: "test24_additionalText" + }, + slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + },publishSlotOtherCallback004); + console.log("===ACTS_PublishSlotTypeOther_0400 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0400====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:OTHER_TYPES) promise + */ + it('ACTS_PublishSlotTypeOther_0500', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeOther_0500"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeOther_0500===createSubscriber"+JSON.stringify(data)); + OtherDataFour = data + await Subscriber.subscribe(data, subOtherFourCallBack) + }) + function subOtherFourCallBack(err,data){ + console.log('===subOtherFourCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(OtherDataFour,UnSubscribeCallBacko) + if(data.code == 25) { + expect(data.code).assertEqual(25) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id:25, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test25_title", + text: "test25_text", + additionalText: "test25_additionalText" + }, + slotType:notification.SlotType.OTHER_TYPES + } + }).then(console.log("===ACTS_PublishSlotTypeOther_0500 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0500====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0600 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:OTHER_TYPES) promise + */ + it('ACTS_PublishSlotTypeOther_0600', 0,async function (done) { + var promise = notification.publish({ + id:26, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + slotType:notification.SlotType.OTHER_TYPES + } + }) + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0600====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0700 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise + */ + it('ACTS_PublishSlotTypeOther_0700', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeOther_0700"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_PublishSlotTypeOther_0700===createSubscriber"+JSON.stringify(data)); + OtherDataFive = data + await Subscriber.subscribe(data, subOtherFiveCallBack) + }) + function subOtherFiveCallBack(err,data){ + console.log('===subOtherFiveCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(OtherDataFive,UnSubscribeCallBackp) + if(data.code == 27) { + expect(data.code).assertEqual(27) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id:27, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test27_title", + text: "test27_text", + additionalText: "test27_additionalText" + }, + //slotType:notification.SlotType.OTHER_TYPES + } + }).then(console.log("===ACTS_PublishSlotTypeOther_0700 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0700====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeOther_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise + */ + it('ACTS_PublishSlotTypeOther_0800', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeOther_0800"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_PublishSlotTypeOther_0800===createSubscriber"+JSON.stringify(data)); + OtherDataSix = data + await Subscriber.subscribe(data, subOtherSixCallBack) + }) + function subOtherSixCallBack(err,data){ + console.log('===subOtherSixCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(OtherDataSix,UnSubscribeCallBackq) + if(data.code == 28) { + expect(data.code).assertEqual(28) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id:28, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test28_title", + text: "test28_text", + additionalText: "test28_additionalText" + }, + slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + }).then(console.log("===ACTS_PublishSlotTypeOther_0800 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeOther_0800====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0100 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) + */ + it('ACTS_PublishSlotTypeService_0100', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeService_0100"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeService_0100===createSubscriber"+JSON.stringify(data)); + ServiceDataOne = data + await Subscriber.subscribe(data, subServiceOneCallBack) + }) + function subServiceOneCallBack(err,data){ + console.log('===subServiceOneCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(ServiceDataOne,UnSubscribeCallBackr) + if(data.code == 29) { + expect(data.code).assertEqual(29) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id:29, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test29_title", + text: "test29_text", + additionalText: "test29_additionalText" + }, + }, + slotType:notification.SlotType.SERVICE_INFORMATION + },publishSlotServiceCallback001); + console.log("===ACTS_PublishSlotTypeService_0100 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0100====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0200 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) + */ + it('ACTS_PublishSlotTypeService_0200', 0,async function (done) { + await notification.publish({ + id: 30, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + slotType:notification.SlotType.SERVICE_INFORMATION + },publishSlotServiceCallback002); + console.log("===ACTS_PublishSlotTypeService_0200 finished===") + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0200====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0300 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) + */ + it('ACTS_PublishSlotTypeService_0300', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeService_0300"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_PublishSlotTypeService_0300===createSubscriber"+JSON.stringify(data)); + ServiceDataTwo = data + await Subscriber.subscribe(data, subServiceTwoCallBack) + }) + function subServiceTwoCallBack(err,data){ + console.log('===subServiceTwoCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(ServiceDataTwo,UnSubscribeCallBacks) + if(data.code == 31) { + expect(data.code).assertEqual(31) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 31, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test31_title", + text: "test31_text", + additionalText: "test31_additionalText" + }, + }, + // slotType:notification.SlotType.SERVICE_INFORMATION + },publishSlotServiceCallback003); + console.log("===ACTS_PublishSlotTypeService_0300 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0300====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0400 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) + */ + it('ACTS_PublishSlotTypeService_0400', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeService_0400"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async(data) =>{ + console.info("===ACTS_PublishSlotTypeService_0400===createSubscriber"+JSON.stringify(data)); + ServiceDataThree = data + await Subscriber.subscribe(data, subServiceThreeCallBack) + }) + function subServiceThreeCallBack(err,data){ + console.log('===subServiceThreeCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(ServiceDataThree,UnSubscribeCallBackt) + if(data.code == 32) { + expect(data.code).assertEqual(32) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 32, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test32_title", + text: "test32_text", + additionalText: "test32_additionalText" + }, + }, + slotType:notification.SlotType.UNKNOWN_TYPE + },publishSlotServiceCallback004); + console.log("===ACTS_PublishSlotTypeService_0400 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0400====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise + */ + it('ACTS_PublishSlotTypeService_0500', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeService_0500"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeService_0500===createSubscriber"+JSON.stringify(data)); + ServiceDataFour = data + await Subscriber.subscribe(data, subServiceFourCallBack) + }) + function subServiceFourCallBack(err,data){ + console.log('===subServiceFourCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(ServiceDataFour,UnSubscribeCallBacku) + if(data.code == 33) { + expect(data.code).assertEqual(33) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 33, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test33_title", + text: "test33_text", + additionalText: "test33_additionalText" + }, + }, + slotType:notification.SlotType.SERVICE_INFORMATION + }).then(console.log("===ACTS_PublishSlotTypeService_0500 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0500====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0600 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) promise + */ + it('ACTS_PublishSlotTypeService_0600', 0,async function (done) { + var promise = notification.publish({ + id: 34, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + }, + slotType:notification.SlotType.SERVICE_INFORMATION + }) + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0600====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0700 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise + */ + it('ACTS_PublishSlotTypeService_0700', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeService_0700"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeService_0700===createSubscriber"+JSON.stringify(data)); + ServiceDataFive = data + await Subscriber.subscribe(data, subServiceFiveCallBack) + }) + function subServiceFiveCallBack(err,data){ + console.log('===subServiceFourCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(ServiceDataFive,UnSubscribeCallBackv) + if(data.code == 35) { + expect(data.code).assertEqual(35) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 35, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test35_title", + text: "test35_text", + additionalText: "test35_additionalText" + }, + }, + // slotType:notification.SlotType.SERVICE_INFORMATION + }).then(console.log("===ACTS_PublishSlotTypeService_0700 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0700====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeService_0800 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) promise + */ + it('ACTS_PublishSlotTypeService_0800', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeService_0800"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeService_0800===createSubscriber"+JSON.stringify(data)); + ServiceDataSix = data + await Subscriber.subscribe(data, subServiceSixCallBack) + }) + function subServiceSixCallBack(err,data){ + console.log('===subServiceSixCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(ServiceDataSix,UnSubscribeCallBackw) + if(data.code == 36) { + expect(data.code).assertEqual(36) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 36, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test36_title", + text: "test36_text", + additionalText: "test36_additionalText" + }, + }, + slotType:notification.SlotType.UNKNOWN_TYPE + }).then(console.log("===ACTS_PublishSlotTypeService_0800 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeService_0800====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0100 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) + */ + it('ACTS_PublishSlotTypeSocial_0100', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeSocial_0100"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeSocial_0100===createSubscriber"+JSON.stringify(data)); + SocialDataOne = data + await Subscriber.subscribe(data, subSocialOneCallBack) + }) + function subSocialOneCallBack(err,data){ + console.log('===subSocialOneCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SocialDataOne,UnSubscribeCallBackx) + if(data.code == 37) { + expect(data.code).assertEqual(37) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 37, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test37_title", + text: "test37_text", + additionalText: "test37_additionalText" + }, + slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + },publishSlotSocialCallback001); + console.log("===ACTS_PublishSlotTypeSocial_0600 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0100====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0200 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) + */ + it('ACTS_PublishSlotTypeSocial_0200', 0,async function (done) { + await notification.publish({ + id: 38, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + },publishSlotSocialCallback002); + console.log("===ACTS_PublishSlotTypeSocial_0600 finished===") + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0200====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0300 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) + */ + it('ACTS_PublishSlotTypeSocial_0300', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeSocial_0300"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeSocial_0300===createSubscriber"+JSON.stringify(data)); + SocialDataTwo = data + await Subscriber.subscribe(data, subSocialTwoCallBack) + }) + function subSocialTwoCallBack(err,data){ + console.log('===subSocialTwoCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SocialDataTwo,UnSubscribeCallBacky) + if(data.code == 39) { + expect(data.code).assertEqual(39) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 39, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test39_title", + text: "test39_text", + additionalText: "test39_additionalText" + }, + // slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + },publishSlotSocialCallback003); + console.log("===ACTS_PublishSlotTypeSocial_0300 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0300====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0400 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) + */ + it('ACTS_PublishSlotTypeSocial_0400', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeSocial_0400"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeSocial_0400===createSubscriber"+JSON.stringify(data)); + SocialDataThree = data + await Subscriber.subscribe(data, subSocialThreeCallBack) + }) + function subSocialThreeCallBack(err,data){ + console.log('===subSocialThreeCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SocialDataThree,UnSubscribeCallBackz) + if(data.code == 40) { + expect(data.code).assertEqual(40) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + await notification.publish({ + id: 40, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test40_title", + text: "test40_text", + additionalText: "test40_additionalText" + }, + slotType:notification.SlotType.CONTENT_INFORMATION + } + },publishSlotSocialCallback004); + console.log("===ACTS_PublishSlotTypeSocial_0400 finished===") + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0400====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0500 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise + */ + it('ACTS_PublishSlotTypeSocial_0500', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeSocial_0500"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeSocial_0500===createSubscriber"+JSON.stringify(data)); + SocialDataFour = data + await Subscriber.subscribe(data, subSocialFourCallBack) + }) + function subSocialFourCallBack(err,data){ + console.log('===subSocialFourCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SocialDataFour,UnSubscribeCallBackA) + if(data.code == 41) { + expect(data.code).assertEqual(41) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 41, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test41_title", + text: "test41_text", + additionalText: "test41_additionalText" + }, + slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + }).then(console.log("===ACTS_PublishSlotTypeSocial_0500 finished===")) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0500====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0600 + * @tc.name: publish() + * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) promise + */ + it('ACTS_PublishSlotTypeSocial_0600', 0,async function (done) { + var promise = notification.publish({ + id: 42, + content: { + // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test_title", + text: "test_text", + additionalText: "test_additionalText" + }, + slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + }) + expect(promise).assertEqual(undefined) + done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0600====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0700 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise + */ + it('ACTS_PublishSlotTypeSocial_0700', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeSocial_0700"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeSocial_0700===createSubscriber"+JSON.stringify(data)); + SocialDataFive = data + await Subscriber.subscribe(data, subSocialFiveCallBack) + }) + function subSocialFiveCallBack(err,data){ + console.log('===subSocialFiveCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SocialDataFive,UnSubscribeCallBackB) + if(data.code == 43) { + expect(data.code).assertEqual(43) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 43, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test43_title", + text: "test43_text", + additionalText: "test43_additionalText" + }, + //slotType:notification.SlotType.SOCIAL_COMMUNICATION + } + }).then(console.log("===ACTS_PublishSlotTypeSocial_0700 finished==="), + ) + setTimeout(function(){ + console.debug("====>time out ACTS_PublishSlotTypeSocial_0700====>"); + }, time); + }) + + /* + * @tc.number: ACTS_PublishSlotTypeSocial_0800 + * @tc.name: publish() + * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise + */ + it('ACTS_PublishSlotTypeSocial_0800', 0,async function (done) { + var commonEventSubscribeInfo = { + events: ["ACTS_PublishSlotTypeSocial_0800"] + }; + await Subscriber.createSubscriber( + commonEventSubscribeInfo).then(async (data) =>{ + console.info("===ACTS_PublishSlotTypeSocial_0800===createSubscriber"+JSON.stringify(data)); + SocialDataSix = data + await Subscriber.subscribe(data, subSocialSixCallBack) + }) + function subSocialSixCallBack(err,data){ + console.log('===subSocialSixCallBack==='+err.code+JSON.stringify(data)) + Subscriber.unsubscribe(SocialDataSix,UnSubscribeCallBackC) + if(data.code == 44) { + expect(data.code).assertEqual(44) + done(); + } + else{ + expect().assertFail(); + done(); + } + } + notification.publish({ + id: 44, + content: { + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: "test44_title", + text: "test44_text", + additionalText: "test44_additionalText" + }, + slotType:notification.SlotType.CONTENT_INFORMATION + } + }).then(console.log("===ACTS_PublishSlotTypeSocial_0800 finished===")) + }) +}) \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..f64df115c59a50235b81d92385e4d73e954dc3db --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/publishtype/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./ExampleJsunit.test.js') diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishcontentype/publishtype/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/publishcontentype/publishtype/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/publishcontentype/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishcontentype/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishcontentype/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/.gitignore b/notification/ans_standard/publish_test/publishcontentype/sub/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/.idea/.gitignore b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/.idea/compiler.xml b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/.idea/gradle.xml b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/.idea/misc.xml b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/BUILD.gn b/notification/ans_standard/publish_test/publishcontentype/sub/BUILD.gn similarity index 92% rename from notification/ans_standard/publish_test/publishimage/BUILD.gn rename to notification/ans_standard/publish_test/publishcontentype/sub/BUILD.gn index 8d55835e893f704b257b9dbd8b905fa01ee099db..40c0b759c934562736f64da69c094c392754f182 100644 --- a/notification/ans_standard/publish_test/publishimage/BUILD.gn +++ b/notification/ans_standard/publish_test/publishcontentype/sub/BUILD.gn @@ -12,14 +12,14 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsPublishImageTest") { +ohos_js_hap_suite("ActsAnsCommonEventTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsPublishImageTest" + hap_name = "ActsAnsCommonEventTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/publishimage/Test.json b/notification/ans_standard/publish_test/publishcontentype/sub/Test.json similarity index 77% rename from notification/ans_standard/publish_test/publishimage/Test.json rename to notification/ans_standard/publish_test/publishcontentype/sub/Test.json index 5fc73d5ee0b202555678c3e333cf6c8025e32ef0..8fd5a7192169bdf2942a03d04b9e1ff1e96912a2 100644 --- a/notification/ans_standard/publish_test/publishimage/Test.json +++ b/notification/ans_standard/publish_test/publishcontentype/sub/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.actsanspublishimagetest", + "package": "com.example.actsanscommoneventtest", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "ActsAnsPublishImageTest" + "ActsAnsCommonEventTest" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/.gitignore b/notification/ans_standard/publish_test/publishcontentype/sub/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/config.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..3b25d7e235da20fbcf5317239ce6e1e21466fc52 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.example.actsanscommoneventtest", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsanscommoneventtest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.actsanscommoneventtest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.hml similarity index 71% rename from notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.hml index 14dace840b438719d5f6ad3bce9883b2f9d1009c..223f355bd902b758644a01a45069bff99ba2fe30 100644 --- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoone/entry/src/main/js/default/pages/index/index.hml +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
- 获取AgentInfo + 发布公共事件
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfive/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/element/string.json similarity index 93% rename from notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/element/string.json index 973bba2db054aa92214d337a6b3d0938aa293398..6d530caefcdbe79f49db0b49fb864ed4daaeaac0 100644 --- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Sub1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Sub1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/List.test.js similarity index 93% rename from notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js rename to notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/List.test.js index 003594972e3abe8d932ea22392c054875348bfc4..41999288d49304127387014dc88894130a148ab4 100644 --- a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ -require('./ActiveButton.js') +/* + * Copyright (c) 2021 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. + */ +require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/Subscriber.js new file mode 100644 index 0000000000000000000000000000000000000000..0fcb7ff1a46da82a1da08b8bdc2b22fc8525fc5d --- /dev/null +++ b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/Subscriber.js @@ -0,0 +1,578 @@ +/* + * Copyright (c) 2021 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 Subscriber from '@ohos.commonevent' +import notification from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var multiLineDataOne +var multiLineDataTwo +var LongContentDataOne +var LongContentDataTwo +var SlotTypeDataOne +var SlotTypeDataTwo +var SlotTypeDataThree +var SlotTypeDataFour +var SlotTypeDataFive +var SlotTypeDataSix +var OtherDataOne +var OtherDataTwo +var OtherDataThree +var OtherDataFour +var OtherDataFive +var OtherDataSix +var ServiceDataOne +var ServiceDataTwo +var ServiceDataThree +var ServiceDataFour +var ServiceDataFive +var ServiceDataSix +var SocialDataOne +var SocialDataTwo +var SocialDataThree +var SocialDataFour +var SocialDataFive +var SocialDataSix +var time = 1000 +function publishCallbacka(err) { + console.info("===>publishCallbacka"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackb(err) { + console.info("===>publishCallbackb"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackc(err) { + console.info("===>publishCallbackc"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackd(err) { + console.info("===>publishCallbackd"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbacke(err) { + console.info("===>publishCallbacke"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackf(err) { + console.info("===>publishCallbackf"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackg(err) { + console.info("===>publishCallbackg"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackh(err) { + console.info("===>publishCallbackh"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbacki(err) { + console.info("===>publishCallbacki"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackj(err) { + console.info("===>publishCallbackj"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackl(err) { + console.info("===>publishCallbackl"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackm(err) { + console.info("===>publishCallbackm"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackn(err) { + console.info("===>publishCallbackn"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbacko(err) { + console.info("===>publishCallbacko"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackp(err) { + console.info("===>publishCallbackp"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackq(err) { + console.info("===>publishCallbackq"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackr(err) { + console.info("===>publishCallbackr"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbacks(err) { + console.info("===>publishCallbacks"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackt(err) { + console.info("===>publishCallbackt"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbacku(err) { + console.info("===>publishCallbacku"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackv(err) { + console.info("===>publishCallbackv"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackw(err) { + console.info("===>publishCallbackw"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackx(err) { + console.info("===>publishCallbackx"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbacky(err) { + console.info("===>publishCallbacky"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackz(err) { + console.info("===>publishCallbackz"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackA(err) { + console.info("===>publishCallbackA"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackB(err) { + console.info("===>publishCallbackB"+err.code); + expect(err.code).assertEqual(0); +} +function publishCallbackC(err) { + console.info("===>publishCallbackC"+err.code); + expect(err.code).assertEqual(0); +} +describe('ActsAnsCommonEventTest', function () { + console.info("==ActsAnsCommonEventTest start==>"); + //consume + function consumeCallback(data) { + console.debug("===>consumeCallback data===>" + JSON.stringify(data)); + if(data.request.id == 1) { + if(data.request.content.multiLine.title === "test1_title") + { + multiLineDataOne = { + code: 1 + } + } + else{ + multiLineDataOne = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishMULTILINEContent_0100", multiLineDataOne, publishCallbacka); + } + else if(data.request.id == 4){ + if(data.request.content.multiLine.title == "test4_title") + { + multiLineDataTwo = { + code: 4 + } + } + else{ + multiLineDataTwo = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishMULTILINEContent_0400", multiLineDataTwo, publishCallbackb); + }else if(data.request.id == 7){ + if(data.request.content.longText.title == "test7_title") + { + LongContentDataOne = { + code: 7 + } + } + else{ + LongContentDataOne = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishLONGContent_0100", LongContentDataOne, publishCallbackc); + } + else if(data.request.id == 10){ + if(data.request.content.longText.title == "test10_title") + { + LongContentDataTwo = { + code: 10 + } + } + else{ + LongContentDataTwo = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishLONGContent_0400", LongContentDataTwo, publishCallbackd); + } + else if(data.request.id == 13){ + if(data.request.content.normal.title == "test13_title") + { + SlotTypeDataOne = { + code: 13 + } + } + else{ + SlotTypeDataOne = { + code: 0 + } + } + Subscriber.publish("ACTS_Publish_SlotTypeContent_0100", SlotTypeDataOne, publishCallbacke); + } + else if(data.request.id == 15){ + if(data.request.content.normal.title == "test15_title") + { + SlotTypeDataTwo = { + code: 15 + } + } + else{ + SlotTypeDataTwo = { + code: 0 + } + } + Subscriber.publish("ACTS_Publish_SlotTypeContent_0300", SlotTypeDataTwo, publishCallbackf); + } + else if(data.request.id == 16){ + if(data.request.content.normal.title == "test16_title") + { + SlotTypeDataThree = { + code: 16 + } + } + else{ + SlotTypeDataThree = { + code: 0 + } + } + Subscriber.publish("ACTS_Publish_SlotTypeContent_0400", SlotTypeDataThree, publishCallbackg); + } + else if(data.request.id == 17){ + if(data.request.content.normal.title == "test17_title") + { + SlotTypeDataFour = { + code: 17 + } + } + else{ + SlotTypeDataFour = { + code: 0 + } + } + Subscriber.publish("ACTS_Publish_SlotTypeContent_0500", SlotTypeDataFour, publishCallbackh); + } + else if(data.request.id == 19){ + if(data.request.content.normal.title == "test19_title") + { + SlotTypeDataFive = { + code: 19 + } + } + else{ + SlotTypeDataFive = { + code: 0 + } + } + Subscriber.publish("ACTS_Publish_SlotTypeContent_0700", SlotTypeDataFive, publishCallbacki); + } + else if(data.request.id == 20){ + if(data.request.content.normal.title == "test20_title") + { + SlotTypeDataSix = { + code: 20 + } + } + else{ + SlotTypeDataSix = { + code: 0 + } + } + Subscriber.publish("ACTS_Publish_SlotTypeContent_0800", SlotTypeDataSix, publishCallbackj); + } + else if(data.request.id == 21){ + if(data.request.content.normal.title == "test21_title") + { + OtherDataOne = { + code: 21 + } + } + else{ + OtherDataOne = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeOther_0100", OtherDataOne, publishCallbackl); + } + else if(data.request.id == 23){ + if(data.request.content.normal.title == "test23_title") + { + OtherDataTwo = { + code: 23 + } + } + else{ + OtherDataTwo = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeOther_0300", OtherDataTwo, publishCallbackm); + } + else if(data.request.id == 24){ + if(data.request.content.normal.title == "test24_title") + { + OtherDataThree = { + code: 24 + } + } + else{ + OtherDataThree = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeOther_0400", OtherDataThree, publishCallbackn); + } + else if(data.request.id == 25){ + if(data.request.content.normal.title == "test25_title") + { + OtherDataFour = { + code: 25 + } + } + else{ + OtherDataFour = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeOther_0500", OtherDataFour, publishCallbacko); + } + else if(data.request.id == 27){ + if(data.request.content.normal.title == "test27_title") + { + OtherDataFive = { + code: 27 + } + } + else{ + OtherDataFive= { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeOther_0700", OtherDataFive, publishCallbackp); + } + else if(data.request.id == 28){ + if(data.request.content.normal.title == "test28_title") + { + OtherDataSix = { + code: 28 + } + } + else{ + OtherDataSix = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeOther_0800", OtherDataSix, publishCallbackq); + } + else if(data.request.id == 29){ + if(data.request.content.normal.title == "test29_title") + { + ServiceDataOne = { + code: 29 + } + } + else{ + ServiceDataOne = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeService_0100", ServiceDataOne, publishCallbackr); + } + else if(data.request.id == 31){ + if(data.request.content.normal.title == "test31_title") + { + ServiceDataTwo = { + code: 31 + } + } + else{ + ServiceDataTwo = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeService_0300", ServiceDataTwo, publishCallbacks); + } + else if(data.request.id == 32){ + if(data.request.content.normal.title == "test32_title") + { + ServiceDataThree = { + code: 32 + } + } + else{ + ServiceDataThree = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeService_0400", ServiceDataThree, publishCallbackt); + } + else if(data.request.id == 33){ + if(data.request.content.normal.title == "test33_title") + { + ServiceDataFour = { + code: 33 + } + } + else{ + ServiceDataFour = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeService_0500", ServiceDataFour, publishCallbacku); + } + else if(data.request.id == 35){ + if(data.request.content.normal.title == "test35_title") + { + ServiceDataFive = { + code: 35 + } + } + else{ + ServiceDataFive = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeService_0700", ServiceDataFive, publishCallbackv); + } + else if(data.request.id == 36){ + if(data.request.content.normal.title == "test36_title") + { + ServiceDataSix = { + code: 36 + } + } + else{ + ServiceDataSix = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeService_0800", ServiceDataSix, publishCallbackw); + } + else if(data.request.id == 37){ + if(data.request.content.normal.title == "test37_title") + { + SocialDataOne = { + code: 37 + } + } + else{ + SocialDataOne = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeSocial_0100", SocialDataOne, publishCallbackx); + } + else if(data.request.id == 39){ + if(data.request.content.normal.title == "test39_title") + { + SocialDataTwo= { + code: 39 + } + } + else{ + SocialDataTwo = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeSocial_0300", SocialDataTwo, publishCallbacky); + } + else if(data.request.id == 40){ + if(data.request.content.normal.title == "test40_title") + { + SocialDataThree = { + code: 40 + } + } + else{ + SocialDataThree = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeSocial_0400", SocialDataThree, publishCallbackz); + } + else if(data.request.id == 41){ + if(data.request.content.normal.title == "test41_title") + { + SocialDataFour = { + code: 41 + } + } + else{ + SocialDataFour = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeSocial_0500", SocialDataFour, publishCallbackA); + } + else if(data.request.id == 43){ + if(data.request.content.normal.title == "test43_title") + { + SocialDataFive = { + code: 43 + } + } + else{ + SocialDataFive = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeSocial_0700", SocialDataFive, publishCallbackB); + } + else if(data.request.id == 44){ + if(data.request.content.normal.title == "test44_title") + { + SocialDataSix = { + code: 44 + } + } + else{ + SocialDataSix = { + code: 0 + } + } + Subscriber.publish("ACTS_PublishSlotTypeSocial_0800", SocialDataSix, publishCallbackC); + } + } + //subscribeOn + function subscribeOnCallback() { + console.debug("===>onConnectCallback===>"); + } + /* + * @tc.number: ActsDoNotSubscriber_test_0100 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsCommonSubscriber_test_0100', 0, async function (done) { + console.debug("===ActsCommonSubscriber_test_0100====begin===>"); + var subInfo ={ + onConsume:consumeCallback, + onConnect:subscribeOnCallback, + } + await notification.subscribe(subInfo,(err) => { + console.debug("===>subscribeCallback===>"+err.code) + expect(err.code).assertEqual(0); + done() + }); + }) +}) + diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishcontentype/sub/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetsix/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/publishcontentype/sub/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/publishicontest/Test.json b/notification/ans_standard/publish_test/publishicontest/Test.json deleted file mode 100644 index de9530dee6f0ff172f7b99fb6f50e7f811be11fe..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsansicontest", - "shell-timeout": "120000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsIconTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} - diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js deleted file mode 100644 index a27f0ff9508597385b0e18130f502c240083d030..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import image from '@ohos.multimedia.image' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -var largeBuffer -var smallBuffer -var opts -var subInfo -var largeIcon -var smallIcon -var time = 1000 - -describe('ActsAnsIconTest', function () { - console.info("===========ActsAnsIconTest start====================>"); - - //consume - function consumeCallback(err,data) { - console.debug("==========================consumeCallback data : =======================>" +err+ JSON.stringify(data)); - console.log("==========================consumeCallback smallIcon : =======================>"+JSON.stringify(data.request.smallIcon)) - console.log("==========================consumeCallback largeIcon : =======================>"+JSON.stringify(data.request.largeIcon)) - } - - function subscribeCallback(err) { - console.info("==========================subscribeCallback start=======================>"); - console.info("================subscribeCallback err : =======================>" + JSON.stringify(err)); - console.info("==========================subscribeCallback end=======================>"); - } - - function publishCallback(err){ - console.info("==========================publishCallback start=======================>"); - console.info("================publishCallback err : =======================>" + JSON.stringify(err)); - console.info("==========================publishCallback end=======================>"); - } - /* - * @tc.number: ActsAnsIconTest_0100 - * @tc.name: createPixelMap() - * @tc.desc: verify the function of subscribe - */ - it('ActsAnsIconTest_0100', 0, async function (done) { - console.debug("===============ActsAnsIconTest_0100 start====================>"); - subInfo ={ - onConsume:consumeCallback, - } - await notify.subscribe(subInfo,subscribeCallback); - - largeBuffer = new ArrayBuffer(64); - smallBuffer = new ArrayBuffer(32); - opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}} - const promise_Large = image.createPixelMap(largeBuffer, opts); - promise_Large.then((data) => { - console.debug("==========================createPixelMap_promise_Large=======================>"); - largeIcon = data; - console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+largeIcon); - - const promise_Small = image.createPixelMap(smallBuffer, opts); - promise_Small.then((data) => { - console.debug("==========================createPixelMap_promise_Small=======================>"); - smallIcon = data; - console.debug("==========================createPixelMap_promise_Small smallIcon=======================>"+smallIcon); - notify.publish({ - id: 1, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", - smallIcon:smallIcon, - largeIcon:largeIcon, - },publishCallback); - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsIconTest_0100====>"); - }, time); - }); - }) - }) -}); - - diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js deleted file mode 100644 index f5ea7e09119f003185485461680f8399a5d00b42..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./Icon.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 2a6ecfe5b683148ed02ca6c2641962f5fc4b6343..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 发布图片通知 - -
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index aec0fde23d7cfea36d7c4f0a4ca6bd3d9a2e9ae8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Pubimage" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js deleted file mode 100644 index 59fb3987808416ca71283ab2384b0c1a8fd55f0c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./publishImage.js') diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js deleted file mode 100644 index 9ec36bd65f7abaf35c9f8f51deabb8d8c4957fb6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import image from '@ohos.multimedia.image' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var imageBuffer -var opts -var pubimage -var time = 1000 -describe('ActsAnsPublishImageTest', function () { - console.info("===========ActsDoNotSubscriberTest start====================>"); - - //consume - function consumeCallbackOne(err,data) { - console.debug("==========================>consumeDoNotCallback1 data : =======================>" +err+ JSON.stringify(data)); - checkConsumeData(data) - } - function consumeCallbackTwo(err,data) { - console.debug("==========================>consumeDoNotCallback2 data : =======================>" +err+ JSON.stringify(data)); - checkConsumeData(data) - } - function checkConsumeData(data){ - expect(typeof(data)).assertEqual("object"); - expect(data.id).assertEqual(1); - expect(data.content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_PICTURE); - expect(data.content.picture.title).assertEqual("image_title"); - expect(data.content.picture.text).assertEqual("image_text"); - expect(data.content.picture.additionalText).assertEqual("image_additionalText"); - expect(data.content.picture.briefText).assertEqual("image_briefText"); - expect(data.content.picture.expandedTitle).assertEqual("expandedTitle"); -// expect(typeof(data.content.picture.picture)).assertEqual(); - expect(data.slotType).assertEqual(notify.SlotType.SOCIAL_COMMUNICATION); - expect(data.classification).assertEqual("classification1"); - expect(data.sortingKey).assertEqual("sortingKey1"); - } - //subscribeOn - function subscribeOnCallback(err) { - console.debug("==========================>subscribeDoNotOnCallback=======================>"); - } - //subscribe - function subscribeCallback(err) { - console.debug("==========================>subscribeDoNotCallback=======================>"); - } - function publishCallback001(){ - console.log('ActsAnsPublishImageTest ACTS_Publish_0100 asyncCallback') - } - /* - * @tc.number: ActsPublishImage_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsPublishImage_test_0100', 0, async function (done) { - console.debug("===============ActsDoNotSubscriber_test_0100======begin====================>"); - - var subInfo ={ - onConsume:consumeCallbackOne, - onConnecte:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, subscribeCallback); - } - catch(err) { - console.error('=ActsDoNotSubscriber_test_0100 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("===============ActsSubscriber_test_0100=======end3===================>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsPublishImage_test_0100====>"); - }, time); - }) - /* - * @tc.number: ACTS_publishTest_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ActsPublishImage_test_0200', 0,async function (done) { - imageBuffer = new ArrayBuffer(32); - opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}} - const promise_Large = image.createPixelMap(imageBuffer, opts); - promise_Large.then((data) => { - console.debug("==========================createPixelMap_promise_Large=======================>"); - pubimage = data; - console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+pubimage); - notify.publish({ - id: 1, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_PICTURE, - picture: { - title: "image_title", - text: "image_text", - additionalText: "image_additionalText", - briefText:"image_brief", - expandedTitle:"expandedTitle", - picture:pubimage - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", - },publishCallback001); - done() - setTimeout(function(){ - console.debug("====>time out ACTS_publishTest_0100====>"); - }, time); - }) - }) -}) - diff --git a/notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/BUILD.gn b/notification/ans_standard/publish_test/subscribe/BUILD.gn index a2b04dc63be55da8145a4f9c33205b8f037d333c..9a9a8f8d2a8be0046dae20d35f890ae1f7517d04 100644 --- a/notification/ans_standard/publish_test/subscribe/BUILD.gn +++ b/notification/ans_standard/publish_test/subscribe/BUILD.gn @@ -17,9 +17,9 @@ group("subscribe") { testonly = true if (is_standard_system) { deps = [ - "publishfirst:ActsAnsPublishOneTest", - "publishsecond:ActsAnsPublishTwoTest", + "publish:ActsAnsPublishTest", "subscribe:ActsAnsSubscriberTest", + "subsystem:ActsAnsSubSystemTest", ] } } diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn b/notification/ans_standard/publish_test/subscribe/publish/BUILD.gn similarity index 94% rename from notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn rename to notification/ans_standard/publish_test/subscribe/publish/BUILD.gn index ed28c5922930e1dbcd73689afea11af69203d35f..760165ac854049d60e51f95d4c22f26c43c09363 100644 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn +++ b/notification/ans_standard/publish_test/subscribe/publish/BUILD.gn @@ -12,9 +12,9 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_hap("ActsAnsPublishOneTest") { +ohos_hap("ActsAnsPublishTest") { hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsPublishOneTest" + hap_name = "ActsAnsPublishTest" subsystem_name = XTS_SUITENAME final_hap_path = "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/Test.json b/notification/ans_standard/publish_test/subscribe/publish/Test.json similarity index 75% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/Test.json rename to notification/ans_standard/publish_test/subscribe/publish/Test.json index b8fce8c48042667a4036922110b478511ce634d8..f7a2623f05c045447fd01c3aa9227bc487bdd122 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayfive/Test.json +++ b/notification/ans_standard/publish_test/subscribe/publish/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplayfivetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplayFiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsanspublishtest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsPublishTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/config.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/config.json similarity index 86% rename from notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/config.json rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/config.json index 8fbeef9ca0777e542da828caa263db598f5150a5..afe023398aa275767538102192abb64d9acec11d 100644 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsanspublishonetest", + "bundleName": "com.example.actsanspublishtest", "vendor": "example", "version": { "code": 1, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.actsanspublishonetest", + "package": "com.example.actsanspublishtest", "name": ".MyApplication", "deviceType": [ "phone" @@ -36,7 +36,7 @@ ] } ], - "name": "com.example.actsanspublishonetest.MainAbility", + "name": "com.example.actsanspublishtest.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from notification/ans_standard/publish_test/getactive/getactivenormal/publish/entry/src/main/js/default/pages/index/index.hml rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.hml diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetfour/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/element/string.json similarity index 93% rename from notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/element/string.json index 3844ef37fb2dacbbae7444dd531e5acd0461a0c9..1e896cb97197887cb4e2ffe9fa7acf74be61160f 100644 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "publish" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "publish" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/ExampleJsunit.test.js similarity index 62% rename from notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/test/ExampleJsunit.test.js rename to notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/ExampleJsunit.test.js index 2907d31f53f87061a1a9d4d59ad367e6d261a0d3..9bca8fa0a792838a27cfcf2b106aa277ab9130ef 100644 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/test/ExampleJsunit.test.js +++ b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/ExampleJsunit.test.js @@ -15,8 +15,8 @@ import notification from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('ActsAnsPublishOneTest', function () { +var time = 1000 +describe('ActsAnsPublishTest', function () { function publishCallback001(){ console.log('ActsAnsPublishTest ACTS_PublishTest_0100 asyncCallback') } @@ -28,8 +28,7 @@ describe('ActsAnsPublishOneTest', function () { */ it('ACTS_PublishTest_0100', 0,async function (done) { await notification.publish({ - id: 1, - content: { + content:{ contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { title: "test1_title", @@ -37,10 +36,30 @@ describe('ActsAnsPublishOneTest', function () { additionalText: "test1_additionalText" }, }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", + id: 1, + slotType : notification.SlotType.OTHER_TYPES, + isOngoing : true, + isUnremovable : false, + deliveryTime : 1624950453, + tapDismissed : true, + autoDeletedTime: 1625036817, + color: 2, + colorEnabled: true, + isAlertOnce: true, + isStopwatch: true, + isCountDown: true, + progressValue: 12, + progressMaxValue: 100, + isIndeterminate: true, + statusBarText: "statusBarText", + isFloatingIcon : true, + label: "0100_1", + badgeIconStyle: 1, + showDeliveryTime: true, },publishCallback001); done(); + setTimeout(function(){ + console.debug("====>time out ACTS_PublishTest_0100====>"); + }, time); }) }) \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..c0b876e81cf0a75db974ee932d8fc06a1d5a6e66 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 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. + */ +require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/subscribe/publish/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettree/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/subscribe/publish/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/Test.json b/notification/ans_standard/publish_test/subscribe/publishfirst/Test.json deleted file mode 100644 index 03fbf05ed6566e94ec2e1840f46fc1d0ad69c19c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsanspublishonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsPublishOneTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index fc2437b2b0af5bd75dfc14e0ea743d011159ede3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 发布接口调用 - -
diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/test/List.test.js deleted file mode 100644 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishfirst/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/subscribe/publishfirst/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/publishfirst/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn b/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn deleted file mode 100644 index f198bf413cda40508c77d6f56255e649f00885bb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_hap("ActsAnsPublishTwoTest") { - hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsPublishTwoTest" - subsystem_name = XTS_SUITENAME - final_hap_path = - "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/Test.json b/notification/ans_standard/publish_test/subscribe/publishsecond/Test.json deleted file mode 100644 index 5be33f3ee04fdfb95ee4d133b7d1ff05d577f6f5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsanspublishtwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsPublishTwoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index b235e58c10080925fdcea67bc3da34a5cb097f9b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 第二个发布接口 - -
diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 02690ec2da38a26a17dcdcbedbd44d44590b3723..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "publish2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index c2be5ce06737ea7c5c2d902be01f8a2a704c8a0c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 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 notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('ActsAnsPublishTwoTest', function () { - function publishCallback002(){ - console.log('ActsAnsPublishTest ACTS_PublishTest_0200 asyncCallback') - } - - /* - * @tc.number: ACTS_PublishTwoTest_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ACTS_PublishTwoTest_0200', 0,async function (done) { - await notification.publish({ - id: 2, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test2_title", - text: "test2_text", - additionalText: "test2_additionalText" - }, - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION, - classification:"classification2", - sortingKey:"sortingKey2", - },publishCallback002); - done(); - }) -}) \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/test/List.test.js deleted file mode 100644 index 8b0d59ef5d7dd08816ab517e7f4d03a80e797951..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/subscribe/publishsecond/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/publishsecond/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/Test.json b/notification/ans_standard/publish_test/subscribe/subscribe/Test.json index 9f5d14a576536211adf09764bbb468d766a3e2da..40fa4640de566352afd604e687ad2f1888cd3171 100644 --- a/notification/ans_standard/publish_test/subscribe/subscribe/Test.json +++ b/notification/ans_standard/publish_test/subscribe/subscribe/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsanssubscribertest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSubscriberTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsanssubscribertest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsSubscriberTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/resources/base/element/string.json index 54d2d87ff6caa4a4ad4131e135e181723f18cd79..30895093f1f793272b0638cbde300dd08dfcf1c0 100644 --- a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Subscriber" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Subscriber" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/List.test.js index 0ce6d94a15c59e53ae647cc1afbffc13094a5a96..41999288d49304127387014dc88894130a148ab4 100644 --- a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js index b284ee2aea778c3538ed1408f5630692bc24e72c..0566b0c01291743ae03c23c04b452502b8bf40ef 100644 --- a/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js +++ b/notification/ans_standard/publish_test/subscribe/subscribe/entry/src/main/js/test/Subscriber.js @@ -1,407 +1,489 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsSubscriberTest', function () { - console.info("==ActsDoNotSubscriberTest start==>"); - - //consume - function consumeCallbackOne(err,data) { - console.debug("==>consumeDoNotCallback1 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackTwo(err,data) { - console.debug("==>consumeDoNotCallback2 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackTree(err,data) { - console.debug("==>consumeDoNotCallback3 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackFour(err,data) { - console.debug("==>consumeDoNotCallback4 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackFive(err,data) { - console.debug("==>consumeDoNotCallback5 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackSix(err,data) { - console.debug("==>consumeDoNotCallback6 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackSeven(err,data) { - console.debug("==>consumeDoNotCallback7 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackEight(err,data) { - console.debug("==>consumeDoNotCallback8 data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbacka(err,data) { - console.debug("==>consumeCallbacka data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackb(err,data) { - console.debug("==>consumeCallbackb data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackc(err,data) { - console.debug("==>consumeCallbackc data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackd(err,data) { - console.debug("==>consumeCallbackd data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbacke(err,data) { - console.debug("==>consumeCallbacke data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - function consumeCallbackf(err,data) { - console.debug("==>consumeCallbackf data : ==>" +err+ JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - } - //subscribeOn - function subscribeOnCallback(err) { - console.debug("==>subscribeDoNotOnCallback==>"); - } - //subscribe - function subscribeCallback(err) { - console.debug("==>subscribeDoNotCallback==>"); - - } - function publishCallback001(){ - console.log('ActsAnsSubscriberTest ACTS_Publish_0100 asyncCallback') - } - - /* - * @tc.number: ActsDoNotSubscriber_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0100', 0, async function (done) { - console.debug("==ActsDoNotSubscriber_test_0100==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackOne, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, subscribeCallback); - } - catch(err) { - console.error('=ActsDoNotSubscriber_test_0100 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0100==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0200', 0, async function (done) { - console.debug("==ActsSubscriber_test_0200==begin==>"); - var subInfo ={ - onConsumed:consumeCallbackTwo, - onConnected:subscribeOnCallback, - } - try{ - await notify.subscribe(subInfo,subscribeCallback); - await notify.subscribe(subInfo,subscribeCallback); - }catch(err) { - console.error('=ActsDoNotSubscriber_test_0200 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0200==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0200====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0300 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0300', 0, async function (done) { - console.debug("==ActsSubscriber_test_0300==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackTree, - onConnected:subscribeOnCallback, - } - var subInfo2 ={ - onConsumed:consumeCallbackFour, - onConnected:subscribeOnCallback, - } - try{ - await notify.subscribe(subInfo,subscribeCallback); - await notify.subscribe(subInfo2,subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0300 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0300==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0400 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0400', 0, async function (done) { - console.debug("==ActsSubscriber_test_0400==begin==>"); - try{ - await notify.subscribe({ - onConsumed:consumeCallbackFive, - onConnected:subscribeOnCallback, - },subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0400 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0400==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0400====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0500 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0500', 0, async function (done) { - console.debug("==ActsSubscriber_test_0500==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackSix, - onConnected:subscribeOnCallback, - } - var subInfo2 ={ - onConsumed:consumeCallbackSeven, - onConnected:subscribeOnCallback, - } - try{ - await notify.subscribe(subInfo,subscribeCallback); - await notify.subscribe(subInfo,subscribeCallback); - await notify.subscribe(subInfo2,subscribeCallback); - await notify.subscribe({ - onConsumed:consumeCallbackEight, - onConnected:subscribeOnCallback, - },subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0500 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0500==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0600 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0600', 0, async function (done) { - console.debug("==ActsSubscriber_test_0600==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbacka, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, {bundleNames:["com.neu.actsanspublishonetest"]},subscribeCallback); - } - catch(err) { - console.error('=ActsSubscriber_test_0600 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0600==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0600====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0700 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0700', 0, async function (done) { - console.debug("==ActsSubscriber_test_0700==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackb, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, {bundleNames:["com.neu.actsanspublishonetest"]}).then( - console.log("ActsSubscriber_test_0700=======promise") - ); - } - catch(err) { - console.error('=ActsSubscriber_test_0700 订阅 promise err:'+err); - } - console.debug("==ActsSubscriber_test_0700==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0800 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0800', 0, async function (done) { - console.debug("==ActsDoNotSubscriber_test_0100==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackc, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, {bundleNames:["com.neu.actsanspublishonetest","com.neu.actsanspublishtwotest"]},subscribeCallback); - } - catch(err) { - console.error('=ActsSubscriber_test_0800 订阅 subscribeCallback err:'+err); - } - console.debug("==ActsSubscriber_test_0800==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0800====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0900 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0900', 0, async function (done) { - console.debug("==ActsSubscriber_test_0800==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackd, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, {bundleNames:["com.neu.actsanspublishonetest","com.neu.actsanspublishtwotest"],}).then( - console.log("ActsSubscriber_test_0900=======promise") - ); - } - catch(err) { - console.error('=ActsSubscriber_test_0900 订阅 promise err:'+err); - } - console.debug("==ActsSubscriber_test_0900==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0900====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_1000 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1000', 0, async function (done) { - console.debug("==ActsSubscriber_test_1000==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbacke, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, {bundleNames:["com.neu.actsanspublishonetest","com.neu.actsanspublishonetest"]},subscribeCallback); - } - catch(err) { - console.error('=ActsSubscriber_test_1000 订阅 subscribeCallback err:'+err); - } - console.debug("==ActsSubscriber_test_1000==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_1000====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_1100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1100', 0, async function (done) { - console.debug("==ActsSubscriber_test_1100==begin==>"); - - var subInfo ={ - onConsumed:consumeCallbackf, - onConnected:subscribeOnCallback, - } - try { - await notify.subscribe(subInfo, {bundleNames:["com.neu.actsanspublishonetest","com.neu.actsanspublishonetest"]}).then( - console.log("ActsSubscriber_test_1100=======promise") - ); - } - catch(err) { - console.error('=ActsSubscriber_test_1100 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("==ActsSubscriber_test_1100==end3==>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_1100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_publishTest_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ACTS_publishTest_0100', 0,async function (done) { - await notify.publish({ - id: 1, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", - },publishCallback001); - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_publishTest_0100====>"); - }, time); - }) -}) - +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +describe('ActsAnsSubscriberTest', function () { + console.info("==ActsAnsSubscriberTest start==>"); + //ActsSubscriber_test_0100 + var subInfoa ={ + onConsume:consumeCallbackc, + onConnect:connectCallbacka, + onDisconnect:disconnectCallbacka, + } + function consumeCallbackc(data) { + console.debug("==>consumeCallbackc data : ==>" + JSON.stringify(data)); + checkConsumeData(data) + notify.unsubscribe(subInfoa, unSubscribeCallbacka); + } + function connectCallbacka() { + console.debug("==>connectCallbacka code==>"); + } + function subscribeCallbacka(err) { + console.debug("==>subscribeCallbacka code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbacka(err){ + console.debug("==>unSubscribeCallbacka code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbacka(){ + console.debug("==>disconnectCallbacka code==>"); + } + //ActsSubscriber_test_0200 + function connectCallbackb() { + console.debug("==>connectCallbackb code==>"); + } + function subscribeCallbackb(err) { + console.debug("==>subscribeCallbackb code==>" +err.code); + expect(err.code).assertEqual(0); + } + function subscribeCallbackc(err) { + console.debug("==>subscribeCallbackc code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackb(err){ + console.debug("==>unSubscribeCallbackb code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackb(){ + console.debug("==>disconnectCallbackb code==>"); + } + //ActsSubscriber_test_0300 + function connectCallbackc() { + console.debug("==>connectCallbackc code==>"); + } + function connectCallbackd() { + console.debug("==>connectCallbackd code==>"); + } + function subscribeCallbackd(err) { + console.debug("==>subscribeCallbackd code==>" +err.code); + expect(err.code).assertEqual(0); + } + function subscribeCallbacke(err) { + console.debug("==>subscribeCallbacke code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackc(err){ + console.debug("==>unSubscribeCallbackc code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackd(err){ + console.debug("==>unSubscribeCallbackd code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackc(){ + console.debug("==>disconnectCallbackc code==>"); + } + function disconnectCallbackd(){ + console.debug("==>disconnectCallbackd code==>"); + } + //ActsSubscriber_test_0500 + function connectCallbackf() { + console.debug("==>connectCallbackf code==>"); + } + function connectCallbackg() { + console.debug("==>connectCallbackg code==>"); + } + function subscribeCallbackg(err) { + console.debug("==>subscribeCallbackg code==>" +err.code); + expect(err.code).assertEqual(0); + } + function subscribeCallbackh(err) { + console.debug("==>subscribeCallbackh code==>" +err.code); + expect(err.code).assertEqual(0); + } + function subscribeCallbacki(err) { + console.debug("==>subscribeCallbacki code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackf(err){ + console.debug("==>unSubscribeCallbackf code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackg(err){ + console.debug("==>unSubscribeCallbackg code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackf(){ + console.debug("==>disconnectCallbackf code==>"); + } + function disconnectCallbackg(){ + console.debug("==>disconnectCallbackg code==>"); + } + //ActsSubscriber_test_0600 + var subInfob = { + onConsume:consumeCallbacka, + onConnect:connectCallbacki, + onDisconnect:disconnectCallbacki, + } + function consumeCallbacka(data) { + console.debug("==>consumeCallbacka data : ==>" + JSON.stringify(data)); + checkConsumeData(data) + notify.unsubscribe(subInfob, unSubscribeCallbacki); + } + function connectCallbacki() { + console.debug("==>connectCallbacki code==>"); + } + function subscribeCallbackl(err) { + console.debug("==>subscribeCallbackl code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbacki(err){ + console.debug("==>unSubscribeCallbacki code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbacki(){ + console.debug("==>disconnectCallbacki code==>"); + } + //ActsSubscriber_test_0700 + var subInfoc ={ + onConsume:consumeCallbackb, + onConnecte:connectCallbackj, + onDisconnect:disconnectCallbackj, + } + function consumeCallbackb(data) { + console.debug("==>consumeCallbackb data : ==>" + JSON.stringify(data)); + checkConsumeData(data) + notify.unsubscribe(subInfoc, unSubscribeCallbackj); + } + function connectCallbackj() { + console.debug("==>connectCallbackj code==>"); + } + function unSubscribeCallbackj(err){ + console.debug("==>unSubscribeCallbackj code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackj(){ + console.debug("==>disconnectCallbackj code==>"); + } + //ActsSubscriber_test_0800 + var subInfod ={ + onConsume:consumeCallbackd, + onConnect:connectCallbackm, + onDisconnect:disconnectCallbackl, + } + function consumeCallbackd(data) { + console.debug("==>consumeCallbackd data : ==>" + JSON.stringify(data)); + checkConsumeData(data) + notify.unsubscribe(subInfod, unSubscribeCallbackl); + } + function connectCallbackm() { + console.debug("==>connectCallbackm code==>"); + } + function subscribeCallbackn(err) { + console.debug("==>subscribeCallbackn code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackl(err){ + console.debug("==>unSubscribeCallbackl code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackl(){ + console.debug("==>disconnectCallbackl code==>"); + } + //ActsSubscriber_test_0900 + var subInfoe ={ + onConsume:consumeCallbacke, + onConnect:connectCallbackn, + onDisconnect:disconnectCallbackm, + } + function consumeCallbacke(data) { + console.debug("==>consumeCallbacke data : ==>" + JSON.stringify(data)); + checkConsumeData(data) + notify.unsubscribe(subInfoe, unSubscribeCallbackm); + } + function connectCallbackn() { + console.debug("==>connectCallbackn code==>"); + } + function unSubscribeCallbackm(err){ + console.debug("==>unSubscribeCallbackm code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackm(){ + console.debug("==>disconnectCallbackm code==>"); + } + //ActsSubscriber_test_1400 + function connectCallbackl(){ + console.debug("==>connectCallbackl code==>"); + } + function subscribeCallbacko(err){ + console.debug("==>subscribeCallbacko code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbackn(err){ + console.debug("==>unSubscribeCallbackn code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbackn(){ + console.debug("==>disconnectCallbackn code==>"); + } + //ActsSubscriber_test_1500 + function connectCallbacko(){ + console.debug("==>connectCallbacko code==>"); + } + function subscribeCallbackp(err){ + console.debug("==>subscribeCallbackp code==>" +err.code); + expect(err.code).assertEqual(0); + } + function unSubscribeCallbacko(err){ + console.debug("==>unSubscribeCallbacko code==>" +err.code); + expect(err.code).assertEqual(0); + } + function disconnectCallbacko(){ + console.debug("==>disconnectCallbacko code==>"); + } + function checkConsumeData(data){ + expect(data.request.id).assertEqual(1); + expect(data.request.content.contentType).assertEqual(0); + expect(data.request.content.normal.title).assertEqual("test1_title"); + expect(data.request.content.normal.text).assertEqual("test1_text"); + expect(data.request.content.normal.additionalText).assertEqual("test1_additionalText"); + expect(data.request.slotType).assertEqual(65535); + expect(data.request.isOngoing).assertEqual(true); + expect(data.request.isUnremovable).assertEqual(false); + expect(data.request.deliveryTime).assertEqual(1624950453); + expect(data.request.tapDismissed).assertEqual(true); + expect(data.request.autoDeletedTime).assertEqual(1625036817); + expect(data.request.color).assertEqual(2); + expect(data.request.colorEnabled).assertEqual(true); + expect(data.request.isAlertOnce).assertEqual(true); + expect(data.request.isStopwatch).assertEqual(true); + expect(data.request.isCountDown).assertEqual(true); + expect(data.request.progressValue).assertEqual(12); + expect(data.request.progressMaxValue).assertEqual(100); + expect(data.request.isIndeterminate).assertEqual(true); + expect(data.request.statusBarText).assertEqual("statusBarText"); + expect(data.request.isFloatingIcon).assertEqual(true); + expect(data.request.label).assertEqual("0100_1"); + expect(data.request.badgeIconStyle).assertEqual(1); + expect(data.request.showDeliveryTime).assertEqual(true); + } + + /* + * @tc.number: ActsSubscriber_test_0100 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0100', 0, async function (done) { + console.debug("==ActsSubscriber_test_0100==begin==>"); + await notify.subscribe(subInfoa, subscribeCallbacka); + console.debug("==ActsSubscriber_test_0100==end==>"); + done(); + }) + + /* + * @tc.number: ActsSubscriber_test_0200 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0200', 0, async function (done) { + console.debug("==ActsSubscriber_test_0200==begin==>"); + var subInfo ={ + onConnect:connectCallbackb, + onDisconnect:disconnectCallbackb, + } + await notify.subscribe(subInfo,subscribeCallbackb); + await notify.subscribe(subInfo,subscribeCallbackc); + await notify.unsubscribe(subInfo, unSubscribeCallbackb); + console.debug("==ActsSubscriber_test_0200==end==>"); + done(); + }) + + /* + * @tc.number: ActsSubscriber_test_0300 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0300', 0, async function (done) { + console.debug("==ActsSubscriber_test_0300==begin==>"); + + var subInfo ={ + onConnect:connectCallbackc, + onDisconnect:disconnectCallbackc, + } + var subInfo2 ={ + onConnect:connectCallbackd, + onDisconnect:disconnectCallbackd, + } + await notify.subscribe(subInfo,subscribeCallbackd); + await notify.subscribe(subInfo2,subscribeCallbacke); + await notify.unsubscribe(subInfo, unSubscribeCallbackc); + await notify.unsubscribe(subInfo2, unSubscribeCallbackd); + console.debug("==ActsSubscriber_test_0300==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_0400 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0400', 0, async function (done) { + console.debug("==ActsSubscriber_test_0500==begin==>"); + + var subInfo ={ + onConnect:connectCallbackf, + onDisconnect:disconnectCallbackf, + } + var subInfo2 ={ + onConnect:connectCallbackg, + onDisconnect:disconnectCallbackg, + } + await notify.subscribe(subInfo,subscribeCallbackg); + await notify.subscribe(subInfo,subscribeCallbackh); + await notify.subscribe(subInfo2,subscribeCallbacki); + + await notify.unsubscribe(subInfo, unSubscribeCallbackf); + await notify.unsubscribe(subInfo2, unSubscribeCallbackg); + console.debug("==ActsSubscriber_test_0500==end==>"); + done(); + }) + + /* + * @tc.number: ActsSubscriber_test_0500 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0500', 0, async function (done) { + console.debug("==ActsSubscriber_test_0500==begin==>"); + await notify.subscribe(subInfob, {bundleNames:["com.example.actsanspublishtest"]},subscribeCallbackl); + console.debug("==ActsSubscriber_test_0500==end3==>"); + done(); + }) + + /* + * @tc.number: ActsSubscriber_test_0700 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0600', 0, async function (done) { + console.debug("==ActsSubscriber_test_0600==begin==>"); + await notify.subscribe(subInfoc, {bundleNames:["com.example.actsanspublishtest"]}).then( + console.log("ActsSubscriber_test_0600=======promise") + ); + console.debug("==ActsSubscriber_test_0600==end==>"); + done(); + }) + + /* + * @tc.number: ActsSubscriber_test_0700 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0700', 0, async function (done) { + console.debug("==ActsSubscriber_test_0700==begin==>"); + await notify.subscribe(subInfod, {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]},subscribeCallbackn); + console.debug("==ActsSubscriber_test_0700==end==>"); + done(); + }) + + /* + * @tc.number: ActsSubscriber_test_0800 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0800', 0, async function (done) { + console.debug("==ActsSubscriber_test_0900==begin==>"); + await notify.subscribe(subInfoe, {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]}).then( + console.log("ActsSubscriber_test_0900=======promise") + ); + console.debug("==ActsSubscriber_test_0900==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_0900 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_0900', 0, async function (done) { + console.debug("==ActsSubscriber_test_1000==begin==>"); + var promise = notify.subscribe(100,{bundleNames:["com.example.actsanspublishtest"]}); + expect(promise).assertEqual(undefined); + console.debug("==ActsSubscriber_test_1000==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_1000 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_1000', 0, async function (done) { + console.debug("==ActsSubscriber_test_1000==begin==>"); + var subInfo = null + var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); + expect(promise).assertEqual(undefined); + console.debug("==ActsSubscriber_test_1000==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_1200 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_1100', 0, async function (done) { + console.debug("==ActsSubscriber_test_1200==begin==>"); + var subInfo = "#$#%$%$^&%^%" + var promise = notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); + expect(promise).assertEqual(undefined); + console.debug("==ActsSubscriber_test_1200==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_1200 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_1200', 0, async function (done) { + console.debug("==ActsSubscriber_test_1200==begin==>"); + var subInfo = "" + var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); + expect(promise).assertEqual(undefined); + console.debug("==ActsSubscriber_test_1200==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_1300 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_1300', 0, async function (done) { + console.debug("==ActsSubscriber_test_1300==begin==>"); + var subInfo ={ + onConnect:connectCallbackl, + onDisconnect:disconnectCallbackn, + } + await notify.subscribe(subInfo,{bundleNames:["wrongBudleName"]},subscribeCallbacko); + await notify.unsubscribe(subInfo, unSubscribeCallbackn); + console.debug("==ActsSubscriber_test_1300==end==>"); + done(); + }) + /* + * @tc.number: ActsSubscriber_test_1500 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_1400', 0, async function (done) { + console.debug("==ActsSubscriber_test_1400==begin==>"); + var subInfo ={ + onConnect:connectCallbacko, + onDisconnect:disconnectCallbacko, + } + await notify.subscribe(subInfo,{bundleNames:[]},subscribeCallbackp); + await notify.unsubscribe(subInfo, unSubscribeCallbacko); + console.debug("==ActsSubscriber_test_1400==end==>"); + done(); + }) +}) + diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/.gitignore b/notification/ans_standard/publish_test/subscribe/subsystem/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/.idea/.gitignore b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/.idea/compiler.xml b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/.idea/gradle.xml b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/.idea/misc.xml b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishicontest/BUILD.gn b/notification/ans_standard/publish_test/subscribe/subsystem/BUILD.gn similarity index 92% rename from notification/ans_standard/publish_test/publishicontest/BUILD.gn rename to notification/ans_standard/publish_test/subscribe/subsystem/BUILD.gn index d0933e80ac6cb59c8d41ed41584e8952118c31be..dd614deba9822d1b6cdc66b7432c7a8c84f7ac1b 100644 --- a/notification/ans_standard/publish_test/publishicontest/BUILD.gn +++ b/notification/ans_standard/publish_test/subscribe/subsystem/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAnsIconTest") { +ohos_js_hap_suite("ActsAnsSubSystemTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsIconTest" + hap_name = "ActsAnsSubSystemTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/Test.json b/notification/ans_standard/publish_test/subscribe/subsystem/Test.json similarity index 74% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/Test.json rename to notification/ans_standard/publish_test/subscribe/subsystem/Test.json index 0dbd16ff7bb51eada0a5d6c4ead31afd9a6a2390..a071fd38bdcd14359a9935ef50d98d056ef5ac4f 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/Test.json +++ b/notification/ans_standard/publish_test/subscribe/subsystem/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansbadgedisplayonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplayOneTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsanssubsystemtest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsSubSystemTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/entry/.gitignore b/notification/ans_standard/publish_test/subscribe/subsystem/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/.gitignore @@ -0,0 +1 @@ +/build diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/config.json b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/config.json similarity index 86% rename from notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/config.json rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/config.json index 9bf183d7a4a4eb2ec516cff973502446efe42fd9..ba837a9f0b2e58ed06acbb7a1a2d1c363f90e328 100644 --- a/notification/ans_standard/publish_test/subscribe/publishsecond/entry/src/main/config.json +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.actsanspublishtwotest", + "bundleName": "com.example.actsanssubsystemtest", "vendor": "example", "version": { "code": 1, @@ -14,7 +14,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.actsanspublishtwotest", + "package": "com.example.actsanssubsystemtest", "name": ".MyApplication", "deviceType": [ "phone" @@ -36,7 +36,7 @@ ] } ], - "name": "com.example.actsanspublishtwotest.MainAbility", + "name": "com.example.actsanssubsystemtest.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/i18n/en-US.json rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/i18n/en-US.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/i18n/zh-CN.json rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/i18n/zh-CN.json diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/default/pages/index/index.css rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.css diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..e42bdfdd29c1e18681d7f2924d1b98191d47fa4a --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + 订阅发布 + +
diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysetone/entry/src/main/js/default/pages/index/index.js rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/default/pages/index/index.js diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/resources/base/element/string.json similarity index 94% rename from notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/element/string.json rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/resources/base/element/string.json index 54d2d87ff6caa4a4ad4131e135e181723f18cd79..30895093f1f793272b0638cbde300dd08dfcf1c0 100644 --- a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Subscriber" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Subscriber" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/entry/src/main/js/resources/base/media/icon.png rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/resources/base/media/icon.png diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/test/List.test.js similarity index 93% rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/test/List.test.js rename to notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/test/List.test.js index 630d30d02fe26d4c0b1941e035cc82103658afb2..41999288d49304127387014dc88894130a148ab4 100644 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplayone/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ -require('./BadgeDisplay.js') \ No newline at end of file +/* + * Copyright (c) 2021 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. + */ +require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/test/Subscriber.js new file mode 100644 index 0000000000000000000000000000000000000000..5228d93195c78f474547c7c1c70725b3e07caaa5 --- /dev/null +++ b/notification/ans_standard/publish_test/subscribe/subsystem/entry/src/main/js/test/Subscriber.js @@ -0,0 +1,48 @@ + /* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 1000 +var ERR_ANS_NON_SYSTEM_APP = 67108877 +describe('ActsAnsSubSystemTest', function () { + console.info("===========ActsAnsSubSystemTest start====================>"); + //subscribeOn + function subscribeOnCallback(err) { + console.debug("===>subscribeOnCallback===>"); + expect(err.code).assertEqual(0); + } + /* + * @tc.number: ActsSubscriber_test_1400 + * @tc.name: subscribe() + * @tc.desc: verify the function of subscribe + */ + it('ActsSubscriber_test_1500', 0, async function (done) { + console.debug("===ActsSubscriber_test_1400===begin===>"); + + var subInfo ={ + onConnect:subscribeOnCallback, + } + await notify.subscribe(subInfo, (err)=>{ + console.debug("=====subErrorCode====="+err.code) + expect(err.code).assertEqual(ERR_ANS_NON_SYSTEM_APP); + done(); + }) + console.debug("===ActsSubscriber_test_1500===end==>"); + setTimeout(function(){ + console.debug("====>time out ActsSubscriber_test_1500====>"); + }, time); + }) +}) + diff --git a/notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/subscribe/subsystem/signature/openharmony_sx.p7b similarity index 100% rename from notification/ans_standard/publish_test/badgedisplayedset/badgedisplaysettwo/signature/openharmony_sx.p7b rename to notification/ans_standard/publish_test/subscribe/subsystem/signature/openharmony_sx.p7b diff --git a/notification/ans_standard/publish_test/unsubscribe/Test.json b/notification/ans_standard/publish_test/unsubscribe/Test.json index a8c29ea347f07548f68d121c462a78636654efc6..e5161e007ca60dc0b83c09f9083920ad18af8b06 100644 --- a/notification/ans_standard/publish_test/unsubscribe/Test.json +++ b/notification/ans_standard/publish_test/unsubscribe/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsansunsubscribertest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsUnSubscriberTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsansunsubscribertest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsUnSubscriberTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/resources/base/element/string.json index 9ac331b5b6c31169b03b8368116da00d35497c35..7453b6262767e385b9dc8971ef65c02c69cfc790 100644 --- a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "UnSub" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} +{ + "string": [ + { + "name": "app_name", + "value": "UnSub" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} diff --git a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/List.test.js index 0ce6d94a15c59e53ae647cc1afbffc13094a5a96..1e69dcaaaa2ef4a8815f61589597a2ae4273951d 100644 --- a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ -require('./Subscriber.js') \ No newline at end of file +/* + * Copyright (c) 2021 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. + */ +require('./UnSubscriber.js') diff --git a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/Subscriber.js deleted file mode 100644 index 5898c8830d1f95bcb08ca1003eca04f714070550..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/Subscriber.js +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsUnSubscriberTest', function () { - console.info("==ActsDoNotSubscriberTest start==>"); - //subscribeOn - function subscribeOnCallback(err) { - console.debug("===>subscribeDoNotOnCallback===>"); - } - //subscribe - function subscribeCallback(err) { - console.debug("===>subscribeDoNotCallback===>"); - - } - function unSubscribeCallbackOne(err) { - console.debug("===>unSubscribeCallbackOne===>"); - } - function unSubscribeCallbackTwo(err) { - console.debug("===>unSubscribeCallbackTwo===>"); - } - function unSubscribeCallbackThree(err) { - console.debug("===>unSubscribeCallbackThree===>"); - } - function unSubscribeCallbackFour(err) { - console.debug("===>unSubscribeCallbackFour===>"); - } - function unSubscribeCallbackFive(err) { - console.debug("===>unSubscribeCallbackFive===>"); - } - function unSubscribeCallbackSix(err) { - console.debug("===>unSubscribeCallbackSix===>"); - } - function unSubscribeCallbackSeven(err) { - console.debug("===>unSubscribeCallbackSeven===>"); - } - function unSubscribeCallbackEight(err) { - console.debug("===>unSubscribeCallbackEight===>"); - } - - function publishCallback001(){ - console.log('ActsAnsSubscriberTest ACTS_Publish_0100 asyncCallback') - } - - /* - * @tc.number: ActsDoNotSubscriber_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0100', 0, async function (done) { - console.debug("===ActsDoNotSubscriber_test_0100===begin===>"); - - var subInfoOne ={ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackOne - } - try { - await notify.subscribe(subInfoOne, subscribeCallback); - } - catch(err) { - console.error('=ActsDoNotSubscriber_test_0100 订阅 subscribeDoNotCallback err:'+err); - } - try{ - await notify.unsubscribe(subInfoOne, unSubscribeCallbackOne); - } - catch(err) { - console.error('=ActsSubscriber_test_0100 取消订阅 unSubscribeCallbackOne err:'+err); - } - console.debug("===ActsSubscriber_test_0100===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0100====>"); - }, time); - }) - - /* - * @tc.number: ActsDoNotSubscriber_test_0200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0200', 0, async function (done) { - console.debug("===ActsSubscriber_test_0200===begin===>"); - - var subInfoOne ={ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackOne - } - try { - await notify.subscribe(subInfoOne, subscribeCallback); - } - catch(err) { - console.error('=ActsSubscriber_test_0200 订阅 subscribeDoNotCallback err:'+err); - } - try{ - notify.unsubscribe(subInfoOne).then(()=> - console.log("====promise====") - ) - } - catch(err) { - console.error('=ActsSubscriber_test_0200 取消订阅 unSubscribeCallbackOne err:'+err); - } - console.debug("===ActsSubscriber_test_0200===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0200====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0300 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0300', 0, async function (done) { - console.debug("===ActsSubscriber_test_0300===begin===>"); - var subInfoTwo ={ - // onConsumed:consumeCallbackTwo, - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackTwo - } - try{ - await notify.subscribe(subInfoTwo,subscribeCallback); - await notify.subscribe(subInfoTwo,subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0300 订阅 subscribeDoNotCallback err:'+err); - } - try{ - await notify.unsubscribe(subInfoTwo, unSubscribeCallbackTwo); - await notify.unsubscribe(subInfoTwo, unSubscribeCallbackTwo); - } - catch(err) { - console.error('=ActsSubscriber_test_0300 取消订阅 unSubscribeCallbackOne err:'+err); - } - console.debug("===ActsSubscriber_test_0300===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0300====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0400 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0400', 0, async function (done) { - console.debug("====ActsSubscriber_test_0400===begin====>"); - var subInfoTwo ={ - // onConsumed:consumeCallbackTwo, - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackTwo - } - try{ - await notify.subscribe(subInfoTwo,subscribeCallback); - await notify.subscribe(subInfoTwo,subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0400 订阅 subscribeDoNotCallback err:'+err); - } - try{ - notify.unsubscribe(subInfoTwo).then( - console.log("===unsubscribeTwo Promise===") - ) - notify.unsubscribe(subInfoTwo).then( - console.log("===unsubscribeTwo Promise===") - ) - } - catch(err) { - console.error('=ActsSubscriber_test_0400 取消订阅 unSubscribeCallbackOne err:'+err); - } - console.debug("===ActsSubscriber_test_0400===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0400====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0500 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0500', 0, async function (done) { - console.debug("===============ActsSubscriber_test_0500======begin====================>"); - - var subInfo1 ={ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackThree, - } - var subInfo2 ={ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackFour, - } - try{ - await notify.subscribe(subInfo1,subscribeCallback); - await notify.subscribe(subInfo2,subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0500 订阅 subscribeDoNotCallback err:'+err); - } - try{ - await notify.unsubscribe(subInfo1, unSubscribeCallbackThree); - await notify.unsubscribe(subInfo2, unSubscribeCallbackFour); - } - catch(err) { - console.error('=ActsSubscriber_test_0500 取消订阅 unSubscribeCallback err:'+err); - } - console.debug("===ActsSubscriber_test_0500===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0500====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0600 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0600', 0, async function (done) { - console.debug("===ActsSubscriber_test_0600===begin====>"); - - var subInfo1 ={ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackThree, - } - var subInfo2 ={ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackFour, - } - try{ - await notify.subscribe(subInfo1,subscribeCallback); - await notify.subscribe(subInfo2,subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0600 订阅 subscribeDoNotCallback err:'+err); - } - try{ - notify.unsubscribe(subInfo1).then( - console.log("==unsubscribeTree Promise==") - ) - notify.unsubscribe(subInfo2).then( - console.log("===unsubscribeTree Promise===") - ) - } - catch(err) { - console.error('=ActsSubscriber_test_0600 取消订阅 unSubscribeCallback err:'+err); - } - console.debug("===ActsSubscriber_test_0600===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0600====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0700 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0700', 0, async function (done) { - console.debug("===ActsSubscriber_test_0700===begin===>"); - try{ - await notify.subscribe({ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackFive - },subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0700 订阅 subscribeDoNotCallback err:'+err); - } - try{ - await notify.unsubscribe({ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackFive - },unSubscribeCallbackFive); - }catch(err) { - console.error('=ActsSubscriber_test_0700 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("===ActsSubscriber_test_0700===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0700====>"); - }, time); - }) - - /* - * @tc.number: ActsSubscriber_test_0800 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsUnSubscriber_test_0800', 0, async function (done) { - console.debug("===ActsSubscriber_test_0800===begin===>"); - try{ - await notify.subscribe({ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackFive - },subscribeCallback); - }catch(err) { - console.error('=ActsSubscriber_test_0800 订阅 subscribeDoNotCallback err:'+err); - } - try{ - notify.unsubscribe({ - onConnecte:subscribeOnCallback, - onDestroy:unSubscribeCallbackFive - }).then( - console.log("====unsubscribeFour Promise====") - ) - }catch(err) { - console.error('=ActsSubscriber_test_0800 订阅 subscribeDoNotCallback err:'+err); - } - console.debug("===ActsSubscriber_test_0800===end3===>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriber_test_0800====>"); - }, time); - }) -}) - diff --git a/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/UnSubscriber.js b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/UnSubscriber.js new file mode 100644 index 0000000000000000000000000000000000000000..1c8987c11e75adcdda3563fb9c63d7a3b8d8a99e --- /dev/null +++ b/notification/ans_standard/publish_test/unsubscribe/entry/src/main/js/test/UnSubscriber.js @@ -0,0 +1,452 @@ +/* + * Copyright (c) 2021 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 notify from '@ohos.notification' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var time = 500 +describe('ActsAnsUnSubscriberTest', function () { + console.debug("===============ActsAnsUnSubscriberTest start=================>"); + function onConnecteOne() { + console.debug("===============Ans_UnSubscriber_0100 onConnecte=================>"); + } + function onDisconnectOne() { + console.debug("===============Ans_UnSubscriber_0100 onDisconnect=================>"); + } + + /* + * @tc.number: Ans_UnSubscriber_0100 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + * @tc.desc: Verify that the subscription can be successfully unsubscribed(callback) + */ + it('Ans_UnSubscriber_0100', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0100 start=============>"); + var subscriber ={ + onConnect:onConnecteOne, + onDisconnect:onDisconnectOne + } + notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0100 subscribe=============>"); + notify.unsubscribe(subscriber, (err)=>{ + console.debug("===========Ans_UnSubscriber_0100 unsubscribe err.code=================>"+err.code); + expect(err.code).assertEqual(0); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0100 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteTwo() { + console.debug("============Ans_UnSubscriber_0200 onConnecteTwo=================>"); + } + function onDisconnectTwo() { + console.debug("============Ans_UnSubscriber_0200 onDisconnectTwo=================>"); + } + + /* + * @tc.number: Ans_UnSubscriber_0200 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; + * @tc.desc: Verify that the subscription can be successfully unsubscribed(promise) + */ + it('Ans_UnSubscriber_0200', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0200 start=============>"); + var subscriber ={ + onConnect:onConnecteTwo, + onDisconnect:onDisconnectTwo + } + notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0200 subscribe=============>"); + notify.unsubscribe(subscriber).then(()=>{ + console.debug("=======Ans_UnSubscriber_0200 subscribe then==========>"); + }).catch((err)=>{ + console.debug("=======Ans_UnSubscriber_0200 subscribe catch err==========>"+err.code); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0200 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteThree() { + console.debug("=======Ans_UnSubscriber_0300 onConnecteThree=================>"); + } + function onDisconnectThree() { + console.debug("=======Ans_UnSubscriber_0300 onDisconnectThree=================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_0300 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + * @tc.desc: Verify the use of the wrong subscriber to unsubscribe(callback) + */ + it('Ans_UnSubscriber_0300', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0300 start=============>"); + var subscriber ={ + onConnect:onConnecteThree, + onDisconnect:onDisconnectThree + } + var subscriberErr ={ + onConnect:"", + onDisconnect:"" + } + await notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0300 subscribe=============>"); + notify.unsubscribe(subscriberErr,(err)=>{ + console.debug("Ans_UnSubscriber_0300 unsubscribe callback err=========>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0300 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteFour() { + console.debug("=======Ans_UnSubscriber_0400 onConnecteFour=================>"); + } + function onDisconnectFour() { + console.debug("=======Ans_UnSubscriber_0400 onDisconnectFour=================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_0400 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; + * @tc.desc: Verify the use of the wrong subscriber to unsubscribe(promise) + */ + it('Ans_UnSubscriber_0400', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0400 start=============>"); + var subscriber ={ + onConnect:onConnecteFour, + onDisconnect:onDisconnectFour + } + var subscriberErr ={ + onConnect:"", + onDisconnect:"" + } + await notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0400 subscribe=============>"); + notify.unsubscribe(subscriberErr).then().catch((err)=>{ + console.debug("=======Ans_UnSubscriber_0400 subscribe catch err==========>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0400 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteFive() { + console.debug("=======Ans_UnSubscriber_0500 onConnecteFive=================>"); + } + function onDisconnectFive() { + console.debug("=======Ans_UnSubscriber_0500 onDisconnectFive=================>"); + expect().assertFail(); + } + function onConnecteTest() { + console.debug("=======Ans_UnSubscriber_0500 onConnecteTest=================>"); + expect().assertFail(); + } + function onDisconnectTest() { + console.debug("=======Ans_UnSubscriber_0500 onDisconnectTest=================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_0500 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + * @tc.desc: Verify that inconsistent subscriber is used to unsubscribe(callback) + */ + it('Ans_UnSubscriber_0500', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0500 start=============>"); + var subscriber ={ + onConnect:onConnecteFive, + onDisconnect:onDisconnectFive + } + var subscriberTest ={ + onConnect:onConnecteTest, + onDisconnect:onDisconnectTest + } + notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0500 subscribe=============>"); + notify.unsubscribe(subscriberTest,(err)=>{ + console.debug("Ans_UnSubscriber_0500 unsubscribe err.code=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + console.info("===========Ans_UnSubscriber_0500 unsubscribe=============>"); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0500 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteSix() { + console.debug("=======Ans_UnSubscriber_0600 onConnecteSix =================>"); + } + function onDisconnectSix() { + console.debug("=======Ans_UnSubscriber_0600 onDisconnectSix=================>"); + expect().assertFail(); + } + function onConnecteTestTwo() { + console.debug("=======Ans_UnSubscriber_0600 onConnecteTestTwo=================>"); + expect().assertFail(); + } + function onDisconnectTestTwo() { + console.debug("=======Ans_UnSubscriber_0600 onDisconnectTestTwo=================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_0600 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; + * @tc.desc: Verify that inconsistent subscriber is used to unsubscribe(promise) + */ + it('Ans_UnSubscriber_0600', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0600 start=============>"); + var subscriber ={ + onConnect:onConnecteSix, + onDisconnect:onDisconnectSix + } + var subscriberTest ={ + onConnect:onConnecteTestTwo, + onDisconnect:onDisconnectTestTwo + } + notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0600 subscribe=============>"); + notify.unsubscribe(subscriberTest).then().catch((err)=>{ + console.debug("=======Ans_UnSubscriber_0600 unsubscribe catch err=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0600 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteSeven() { + console.debug("=======Ans_UnSubscriber_0700 onConnecteSeven=================>"); + } + var timesOfOnDis + function onDisconnectSeven() { + console.debug("=======Ans_UnSubscriber_0700 onDisconnectSeven=================>"); + timesOfOnDis ++; + if(timesOfOnDis == 2){ + expect().assertFail(); + } + } + + /* + * @tc.number: Ans_UnSubscriber_0700 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + * @tc.desc:Verification: After the subscription is successful, unsubscribe twice in a row.(callback) + */ + it('Ans_UnSubscriber_0700', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0700 start=============>"); + timesOfOnDis = 0 + var subscriber ={ + onConnect:onConnecteSeven, + onDisconnect:onDisconnectSeven + } + notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0700 subscribe=============>"); + notify.unsubscribe(subscriber, (err)=>{ + console.debug("Ans_UnSubscriber_0700 unsubscribe first err.code=================>"+err.code); + expect(err.code).assertEqual(0); + notify.unsubscribe(subscriber, (err)=>{ + console.debug("Ans_UnSubscriber_0700 unsubscribe Second err.code=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0700 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteEight() { + console.debug("=======Ans_UnSubscriber_0800 onConnecteEight=================>"); + } + var timesOfOnDisTwo + function onDisconnectEight() { + console.debug("=======Ans_UnSubscriber_0800 onDisconnectEight err.code=================>"); + timesOfOnDisTwo ++; + if(timesOfOnDisTwo == 2){ + expect().assertFail(); + } + } + + /* + * @tc.number: Ans_UnSubscriber_0800 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; + * @tc.desc: Verification: After the subscription is successful, unsubscribe twice in a row.(promise) + */ + it('Ans_UnSubscriber_0800', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0800 start=============>"); + timesOfOnDisTwo = 0 + var subscriber ={ + onConnect:onConnecteEight, + onDisconnect:onDisconnectEight + } + notify.subscribe(subscriber); + console.info("===========Ans_UnSubscriber_0800 subscribe=============>"); + notify.unsubscribe(subscriber).then((err)=>{ + console.debug("=======Ans_UnSubscriber_0800 subscribe first then err=================>"+err.code); + notify.unsubscribe(subscriber).then((err)=>{ + console.debug("=======Ans_UnSubscriber_0800 subscribe second then err=================>"+err.code); + }).catch((err)=>{ + console.debug("=======Ans_UnSubscriber_0800 subscribe second catch err=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + }).catch((err)=>{ + console.debug("=======Ans_UnSubscriber_0800 subscribe first catch err=================>"+err.code); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0800 setTimeout=============>"); + done(); + }, time); + }) + + function onDisconnectTestNine() { + console.debug("=======Ans_UnSubscriber_0900 onDisconnectTestNine =================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_0900 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + * @tc.desc: Verify that after the subscribe fails, the unsubscribe fails(callback) + */ + it('Ans_UnSubscriber_0900', 0, async function (done) { + console.info("===========Ans_UnSubscriber_0900 start=============>"); + var subscriber ={ + onConnect:"", + onDisconnect:onDisconnectTestNine + } + notify.subscribe(subscriber, (err)=>{ + console.debug("Ans_UnSubscriber_0900 subscribeCallbackNine err.code=================>"+err.code); + expect(err.code != 0).assertEqual(true); + notify.unsubscribe(subscriber, (err)=>{ + console.debug("Ans_UnSubscriber_0900 unsubscribe err.code=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_0900 setTimeout=============>"); + done(); + }, time); + }) + + function onDisconnectTestTen() { + console.debug("=======Ans_UnSubscriber_1000 onDisconnectTestTen =================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_1000 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; + * @tc.desc: Verify that after the subscribe fails, the unsubscribe fails(promise) + */ + it('Ans_UnSubscriber_1000', 0, async function (done) { + console.info("===========Ans_UnSubscriber_1000 start=============>"); + var subscriber = { + onConnect:"", + onDisconnect:onDisconnectTestTen + } + notify.subscribe(subscriber, (err)=>{ + notify.unsubscribe(subscriber).then((err)=>{ + console.debug("=======Ans_UnSubscriber_1000 subscribe then err=================>"+err.code); + }).catch((err)=>{ + console.debug("=======Ans_UnSubscriber_1000 subscribe catch err=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_1000 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteEleven() { + console.debug("============Ans_UnSubscriber_1100 onConnecteEleven=================>"); + } + function onDisconnectEleven() { + console.debug("============Ans_UnSubscriber_1100 onDisconnectEleven=================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_1100 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + * @tc.desc: Verify: After the subscription with anonymous Subscribers is successful, + unsubscribing with anonymous subscribers will fail(callback) + */ + it('Ans_UnSubscriber_1100', 0, async function (done) { + console.info("===========Ans_UnSubscriber_1100 start=============>"); + notify.subscribe({ + onConnect:onConnecteEleven, + onDisconnect:onDisconnectEleven + }); + notify.unsubscribe( + { + onConnect:onConnecteOne, + onDisconnect:onDisconnectOne + }, + (err)=>{ + console.debug("Ans_UnSubscriber_1100 unSubscribeCallbackEleven err.code=================>"+err.code); + expect(err.code != 0).assertEqual(true); + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_1100 setTimeout=============>"); + done(); + }, time); + }) + + function onConnecteTwelve() { + console.debug("============Ans_UnSubscriber_1200 onConnecteTwelve=================>"); + } + function onDisconnectTwelve() { + console.debug("============Ans_UnSubscriber_1200 onDisconnectTwelve=================>"); + expect().assertFail(); + } + + /* + * @tc.number: Ans_UnSubscriber_1200 + * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; + * @tc.desc: Verify: After the subscription with anonymous Subscribers is successful, + unsubscribing with anonymous subscribers will fail(promise) + */ + it('Ans_UnSubscriber_1200', 0, async function (done) { + console.info("===========Ans_UnSubscriber_1200 start=============>"); + notify.subscribe({ + onConnect:onConnecteTwelve, + onDisconnect:onConnecteTwelve + }); + notify.unsubscribe({ + onConnect:onConnecteTwelve, + onDisconnect:onDisconnectTwelve + }).then((err)=>{ + console.info("===========Ans_UnSubscriber_1200 unsubscribe then err=============>"+err.code); + }).catch((err)=>{ + console.info("===========Ans_UnSubscriber_1200 unsubscribe catch err=============>"+err.code); + expect(err.code != 0).assertEqual(true); + + }); + setTimeout(function(){ + console.debug("===========Ans_UnSubscriber_1200 setTimeout=============>"); + done(); + }, time); + }); +}) + diff --git a/notification/ans_standard/publish_test/wantagent/BUILD.gn b/notification/ans_standard/publish_test/wantagent/BUILD.gn index c092a70495d8b6e7f51da99c2494434b3c7138fb..8c7eecdf629dfc6b09c1f6e299e5ea3e0f8a9e9e 100644 --- a/notification/ans_standard/publish_test/wantagent/BUILD.gn +++ b/notification/ans_standard/publish_test/wantagent/BUILD.gn @@ -17,7 +17,7 @@ group("wantagent") { testonly = true if (is_standard_system) { deps = [ - #"sub:ActsAnsCommonSubscriberTest", + "sub:ActsAnsCommonSubscriberTest", "test1:test1", "test2:test2", "wantagent1:ActsAnsWantAgentOneTest", diff --git a/notification/ans_standard/publish_test/wantagent/sub/Test.json b/notification/ans_standard/publish_test/wantagent/sub/Test.json index f5c3befdb7f4dfc76401cb46d079f87bfab4e438..c10a3732c1cf63089923d6d241019f31dede3e56 100644 --- a/notification/ans_standard/publish_test/wantagent/sub/Test.json +++ b/notification/ans_standard/publish_test/wantagent/sub/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsanscommonsubscribertest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsCommonSubscriberTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsanscommonsubscribertest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsCommonSubscriberTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json index 973bba2db054aa92214d337a6b3d0938aa293398..6d530caefcdbe79f49db0b49fb864ed4daaeaac0 100644 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Sub1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Sub1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js index 0ce6d94a15c59e53ae647cc1afbffc13094a5a96..41999288d49304127387014dc88894130a148ab4 100644 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js index caa3485cef08858d8130edaf4ff6b5d9215952a2..e944e0caa2258ea7dce3708ad974ed8b7360ba72 100644 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js +++ b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js @@ -1,73 +1,73 @@ -/* - * Copyright (c) 2021 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 Subscriber from '@ohos.commonevent' -import wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var commonEventSubscribeInfo; -var commonEventSubscriber; -var WantAgent; -var time = 1000 -describe('ActsAnsCommonSubscriberTest', function () { - console.info("===========ActsSubscriberTest start====================>"); - - //consume - async function getSubscribeInfoCallBack(err, data) { - console.log("============data=========="+JSON.stringify(data)) -// expect(data.events[0]).assertEqual("action1"); - await Subscriber.subscribe(commonEventSubscriber, subscriberCallBack001); - } - function subscriberCallBack001(err, data) { - console.info("==========================>subscriberCallBack001"); - expect(data.event).assertEqual("action1"); - expect(data.bundleName).assertEqual(""); - expect(data.code).assertEqual(0); - expect(data.data).assertEqual(""); - } - //subscribe - function subscribeCallback(err) { - console.debug("==========================>subscribeCallback=======================>"); - } - - /* - * @tc.number : ActsSubscriberTestUnorder_0100 - * @tc.name : verify subscribe and publish : Check subscribe and publish common event data - * @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise) - */ - it('ActsSubscriberTestUnorder_0100', 0, async function (done) { - console.info("===============ActsSubscriberTestUnorder_0100=============================>"); - commonEventSubscribeInfo = { - events: ["action1"], - }; - - await Subscriber.createSubscriber( - commonEventSubscribeInfo - ).then(async (data) =>{ - console.info("===============ActsSubscriberTestUnorder_0100=========createSubscriber promise"+JSON.stringify(data)); - commonEventSubscriber = data; - await data.getSubscribeInfo().then(async (data)=>{ - console.info("===============ActsSubscriberTestUnorder_0100=========getSubscribeInfo promise"); - await getSubscribeInfoCallBack(data); - }); - }) - console.info("===============ActsSubscriberTestUnorder_0100==============================>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriberTestUnorder_0100====>"); - }, time) - }) -}) - +/* + * Copyright (c) 2021 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 Subscriber from '@ohos.commonevent' +import wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +var commonEventSubscribeInfo; +var commonEventSubscriber; +var WantAgent; +var time = 1000 +describe('ActsAnsCommonSubscriberTest', function () { + console.info("===========ActsSubscriberTest start====================>"); + + //consume + async function getSubscribeInfoCallBack(err, data) { + console.log("============data=========="+JSON.stringify(data)) +// expect(data.events[0]).assertEqual("action1"); + await Subscriber.subscribe(commonEventSubscriber, subscriberCallBack001); + } + function subscriberCallBack001(err, data) { + console.info("==========================>subscriberCallBack001"); + expect(data.event).assertEqual("action1"); + expect(data.bundleName).assertEqual(""); + expect(data.code).assertEqual(0); + expect(data.data).assertEqual(""); + } + //subscribe + function subscribeCallback(err) { + console.debug("==========================>subscribeCallback=======================>"); + } + + /* + * @tc.number : ActsSubscriberTestUnorder_0100 + * @tc.name : verify subscribe and publish : Check subscribe and publish common event data + * @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise) + */ + it('ActsSubscriberTestUnorder_0100', 0, async function (done) { + console.info("===============ActsSubscriberTestUnorder_0100=============================>"); + commonEventSubscribeInfo = { + events: ["action1"], + }; + + await Subscriber.createSubscriber( + commonEventSubscribeInfo + ).then(async (data) =>{ + console.info("===============ActsSubscriberTestUnorder_0100=========createSubscriber promise"+JSON.stringify(data)); + commonEventSubscriber = data; + await data.getSubscribeInfo().then(async (data)=>{ + console.info("===============ActsSubscriberTestUnorder_0100=========getSubscribeInfo promise"); + await getSubscribeInfoCallBack(data); + }); + }) + console.info("===============ActsSubscriberTestUnorder_0100==============================>"); + done(); + setTimeout(function(){ + console.debug("====>time out ActsSubscriberTestUnorder_0100====>"); + }, time) + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/test1/Test.json b/notification/ans_standard/publish_test/wantagent/test1/Test.json index 7a88763ed8d2ac31dd30211b9574f47273e84549..fd2b84059ded89eccdaa96c479873e0c1bc5d090 100644 --- a/notification/ans_standard/publish_test/wantagent/test1/Test.json +++ b/notification/ans_standard/publish_test/wantagent/test1/Test.json @@ -1,3 +1,3 @@ -{ - "description": "Configuration for hjunit demo Tests", -} +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json index c5b09c26e94885094828a061e60a1c3355194bed..f65b394eb7a98a4058d726bacda53fe1221d909d 100644 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "test1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "test1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test2/Test.json b/notification/ans_standard/publish_test/wantagent/test2/Test.json index 7a88763ed8d2ac31dd30211b9574f47273e84549..fd2b84059ded89eccdaa96c479873e0c1bc5d090 100644 --- a/notification/ans_standard/publish_test/wantagent/test2/Test.json +++ b/notification/ans_standard/publish_test/wantagent/test2/Test.json @@ -1,3 +1,3 @@ -{ - "description": "Configuration for hjunit demo Tests", -} +{ + "description": "Configuration for hjunit demo Tests", +} diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json index cdf4ae5fc375e6b97774e8b6132fce32050a0f45..dd75de46505148f70190b878f16fe858628fcfda 100644 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Test2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Test2" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json index a0e36e1fd3517042ed1b58deef18d297cc5dfeb0..5ed50d2c70bb2642fde6f2c4bb9c7055314b190f 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json @@ -1,19 +1,19 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagentonetest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentOneTest.hap", - "test1.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagentonetest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentOneTest.hap", + "test1.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/resources/base/element/string.json index 38e35aa2ddcdba7bafaf5c85dae29ab3cb50eaae..4cb2fd2d040dea924eb7cdd7c990178eb003edf1 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Want1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Want1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/WantAgent.test.js index 76f8b51d89e9110e1fd06ba36ea5743d5a3d0f20..2dcddcdb8ec1dfaf5958a46b9a483896de85f171 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent1/entry/src/main/js/test/WantAgent.test.js @@ -1,96 +1,96 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentOneTest', function () { - console.info('----ActsWantAgentTest----'); - - /* - * @tc.number: ACTS_SetWant_0100 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) - */ - it('ACTS_SetWant_0100', 0, async function (done) { - console.info('----scene_test_callback_1----'); - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0100====>"); - }, time); - - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentOneTest', function () { + console.info('----ActsWantAgentTest----'); + + /* + * @tc.number: ACTS_SetWant_0100 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) + */ + it('ACTS_SetWant_0100', 0, async function (done) { + console.info('----scene_test_callback_1----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + await wantAgent.getWantAgent(agentInfo, + (err, data) => { + if (err.code == 0) { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0100====>"); + }, time); + + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json index 8ecb845b54440a2d6b62f59b945e4f680a37d50b..d8d60316c012540617261b393bda3b89d8c0d26d 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json @@ -1,19 +1,19 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagentoneprotest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentOneProTest.hap", - "test1.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagentoneprotest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentOneProTest.hap", + "test1.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/resources/base/element/string.json index bad08f158ec4c12de97ea2087ac5a762ba503e9d..fe776705f6141a63b37dd9c523bcd56bb2814678 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantPro1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantPro1" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/WantAgent.test.js index 7c00a5acfe09f6aaf0836af6abcc3d65df2da0bb..1fca21ac017a2e1f6eadde6884c1bf43bd5aa9b7 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent1promise/entry/src/main/js/test/WantAgent.test.js @@ -1,88 +1,88 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentOneProTest', function () { - console.info('----ActsWantAgentTest----'); - - /* - * @tc.number: ACTS_SetWant_0100 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) - */ - it('ACTS_SetWant_0200', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(JSON.stringify(data)); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0200====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentOneProTest', function () { + console.info('----ActsWantAgentTest----'); + + /* + * @tc.number: ACTS_SetWant_0100 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) + */ + it('ACTS_SetWant_0200', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo).then( + (data) => { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(JSON.stringify(data)); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + done(); + + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0200====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json index eed53d849459f8dc8498cff52fb52d77a1f0ae30..63e821202937e9f3da19738100f7e8dc3b4868dd 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json @@ -1,20 +1,20 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "60000", - "package": "com.example.actsanswantagenttwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTwoTest.hap", - "test1.hap", - "test2.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "60000", + "package": "com.example.actsanswantagenttwotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentTwoTest.hap", + "test1.hap", + "test2.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/resources/base/element/string.json index 5b47bcb1abd20c5f5f3f307c14b9ae482b6ba9ac..0b303ceac98dc7fa565519fdf52ab91333023303 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Want2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "Want2" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/WantAgent.test.js index b10afe21f8a49fabfff2758af17b22daaf86cf95..e94112b9a27f447a00aa2162b4b24cc4a69cdd6b 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent2/entry/src/main/js/test/WantAgent.test.js @@ -1,112 +1,112 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentTwoTest', function () { - - /* - * @tc.number: ACTS_SetWant_0300 - * @tc.name: getWantAgent(OperationType.START_ABILITIES) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) - */ - it('ACTS_SetWant_0300', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgenTest2", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: OperationType.START_ABILITIES, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0300====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentTwoTest', function () { + + /* + * @tc.number: ACTS_SetWant_0300 + * @tc.name: getWantAgent(OperationType.START_ABILITIES) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) + */ + it('ACTS_SetWant_0300', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + { + deviceId: "", + bundleName: "com.neu.WantAgenTest2", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + } + ], + operationType: OperationType.START_ABILITIES, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo, + (err, data) => { + if (err.code == 0) { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0300====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json index 8af2ee2c59590553aec2fb4cc44cf5094f9b33e6..0a87c1c884a85fcb76ca69060248aad651f2461a 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json @@ -1,20 +1,20 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "260000", - "package": "com.example.actsanswantagenttwoprotest", - "shell-timeout": "260000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTwoProTest.hap", - "test1.hap", - "test2.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "260000", + "package": "com.example.actsanswantagenttwoprotest", + "shell-timeout": "260000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentTwoProTest.hap", + "test1.hap", + "test2.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/resources/base/element/string.json index 8f9fb3f34ccca8821b3300445dab57a0e0b0a182..a5e3f02e7d06698d62914f94b70c95daaad93fba 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantPro2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantPro2" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/WantAgent.test.js index 89f09b1a142dddd35b097f2d7d23fdfe16aab634..2bf5e10da8fb2cf754756a4f27fcc871f7a77b4f 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent2promise/entry/src/main/js/test/WantAgent.test.js @@ -1,106 +1,106 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentTwoProTest', function () { - - /* - * @tc.number: ACTS_SetWant_0400 - * @tc.name: getWantAgent(OperationType.START_ABILITIES) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) - */ - it('ACTS_SetWant_0400', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgenTest2", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: OperationType.START_ABILITIES, - requestCode: 0, -// wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0400====>"); - }, time); - console.info('----getWantAgent after----'); - }) - -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentTwoProTest', function () { + + /* + * @tc.number: ACTS_SetWant_0400 + * @tc.name: getWantAgent(OperationType.START_ABILITIES) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) + */ + it('ACTS_SetWant_0400', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + { + deviceId: "", + bundleName: "com.neu.WantAgenTest2", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + } + ], + operationType: OperationType.START_ABILITIES, + requestCode: 0, +// wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo).then( + (data) => { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + done(); + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0400====>"); + }, time); + console.info('----getWantAgent after----'); + }) + +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json index a1be03ea6c7d3342245e17734babcae2edf4ea6c..31b30590370307a4cc36d1e4044450e87ac0ca56 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagenttreetest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTreeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagenttreetest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentTreeTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/resources/base/element/string.json index 53f2bb4d89814e1b41c3cf0a8611419d812eee45..421f8222ad3ff2d1b5c18a4aab04875c1399c5ca 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgent3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantAgent3" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/WantAgent.test.js index 4a90ba1ded70d271d1128e6f8d0ab0f532e75c06..b79054bfa22a41f6edbcbc367e874b2094175752 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent3/entry/src/main/js/test/WantAgent.test.js @@ -1,93 +1,93 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentTreeTest', function () { - - /* - * @tc.number: ACTS_SetWant_0500 - * @tc.name: getWantAgent(OperationType.SEND_COMMON_EVENT) - * @tc.desc: verify the function of getWantAgent(OperationType.SEND_COMMON_EVENT) - */ - it('ACTS_SetWant_0500', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.SEND_COMMON_EVENT, - requestCode: 0, -// wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0500====>"); - }, time) - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentTreeTest', function () { + + /* + * @tc.number: ACTS_SetWant_0500 + * @tc.name: getWantAgent(OperationType.SEND_COMMON_EVENT) + * @tc.desc: verify the function of getWantAgent(OperationType.SEND_COMMON_EVENT) + */ + it('ACTS_SetWant_0500', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.SEND_COMMON_EVENT, + requestCode: 0, +// wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo, + (err, data) => { + if (err.code == 0) { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0500====>"); + }, time) + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json index c083bbe0d887e84e4e73b3c31bc735806fb83cf1..95dbe80c3fb7c6011440b55d0f92f63f197e0941 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagenttreeprotest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTreeProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagenttreeprotest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentTreeProTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/resources/base/element/string.json index 95f159c8ccb78a06842cf2429920ea7f75e2ea7a..04448e8534bfc51b9c164aead03524df85b67fd2 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgentPromise3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantAgentPromise3" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/WantAgent.test.js index fefff412e985a9651af86815b0f92e7f80ec479f..8e1dfbcc649bcf8b214383de5259d073a4330288 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent3promise/entry/src/main/js/test/WantAgent.test.js @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentTreeProTest', function () { - - /* - * @tc.number: ACTS_SetWant_0600 - * @tc.name: getWantAgent(OperationType.SEND_COMMON_EVENT) - * @tc.desc: verify the function of getWantAgent(OperationType.SEND_COMMON_EVENT) - */ - it('ACTS_SetWant_0600', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.SEND_COMMON_EVENT, - requestCode: 0, -// wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('==================== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('==================== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - - } - ); -setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0600====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentTreeProTest', function () { + + /* + * @tc.number: ACTS_SetWant_0600 + * @tc.name: getWantAgent(OperationType.SEND_COMMON_EVENT) + * @tc.desc: verify the function of getWantAgent(OperationType.SEND_COMMON_EVENT) + */ + it('ACTS_SetWant_0600', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.SEND_COMMON_EVENT, + requestCode: 0, +// wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo).then( + (data) => { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('==================== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('==================== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + done(); + + } + ); +setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0600====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json index b7456ef2e3c9a9e5ccf35f4566e35693e6e201e0..1c4a27fbb4624e7a8bae22c47431ddbf8d65702a 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagentfourtest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFourTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagentfourtest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentFourTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/resources/base/element/string.json index 1514abe5a9eef098f4ffd89668bee49178ba8bd9..3efaac030d687b65f3e62bb665664627d9e3d9ea 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgent4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantAgent4" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/WantAgent.test.js index 3d413c88e2056f97368ade45d696139f2937c29b..78cd0caf35263b0be34fea0013b7ed376f07ade5 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent4/entry/src/main/js/test/WantAgent.test.js @@ -1,93 +1,93 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentFourTest', function () { - - /* - * @tc.number: ACTS_SetWant_0700 - * @tc.name: getWantAgent(OperationType.UNKNOWN_TYPE) - * @tc.desc: verify the function of getWantAgent(OperationType.UNKNOWN_TYPE) - */ - it('ACTS_SetWant_0700', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.UNKNOWN_TYPE, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0700====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentFourTest', function () { + + /* + * @tc.number: ACTS_SetWant_0700 + * @tc.name: getWantAgent(OperationType.UNKNOWN_TYPE) + * @tc.desc: verify the function of getWantAgent(OperationType.UNKNOWN_TYPE) + */ + it('ACTS_SetWant_0700', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.UNKNOWN_TYPE, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo, + (err, data) => { + if (err.code == 0) { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + expect(typeof(data)).assertEqual("object"); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0700====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json index c14c4adf599456ef8291a8a4090a484c2423dca4..e6175508c0363aedb56b85588187118a9b36035b 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json @@ -1,18 +1,18 @@ - { - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagentfourprotest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFourProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} + { + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagentfourprotest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentFourProTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/resources/base/element/string.json index 2abae18b75a25e7aa53c7c96e9498f5c4c5d4ab8..0541bffdddc8bf76ef8097927938cb5dd4df5fa7 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgentPromise4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantAgentPromise4" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/WantAgent.test.js index 81b3f4ebc1b137123bdd4cfa2f2ea736712a22dd..a7ce02d0af1e117a40ad301e253f78a39428a4d1 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent4promise/entry/src/main/js/test/WantAgent.test.js @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentFourProTest', function () { - - /* - * @tc.number: ACTS_SetWant_0800 - * @tc.name: getWantAgent(OperationType.UNKNOWN_TYPE) - * @tc.desc: verify the function of getWantAgent(OperationType.UNKNOWN_TYPE) - */ - it('ACTS_SetWant_0800', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: OperationType.UNKNOWN_TYPE, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0800====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentFourProTest', function () { + + /* + * @tc.number: ACTS_SetWant_0800 + * @tc.name: getWantAgent(OperationType.UNKNOWN_TYPE) + * @tc.desc: verify the function of getWantAgent(OperationType.UNKNOWN_TYPE) + */ + it('ACTS_SetWant_0800', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], + operationType: OperationType.UNKNOWN_TYPE, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo).then( + (data) => { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + done(); + + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0800====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json index 26e03b41673330e16ba8b133950d9244804d2227..214f1e26b09d295d7cbddfbc206ae8963566be2e 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagentfivetest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagentfivetest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentFiveTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/resources/base/element/string.json index bf1ef24380187b17f173957c42788ce836164fe5..0855c09c5974a6a2f2d40fa7391da4dff5840b28 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgent5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantAgent5" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/WantAgent.test.js index b00f346104162919ad6b1d1b18beb1702327271a..eb801bc7b9e048e8cd46fff09820c77530758554 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent5/entry/src/main/js/test/WantAgent.test.js @@ -1,93 +1,93 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentFiveTest', function () { - - /* - * @tc.number: ACTS_SetWant_0900 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent() - */ - it('ACTS_SetWant_0900', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], -// operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0900====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentFiveTest', function () { + + /* + * @tc.number: ACTS_SetWant_0900 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent() + */ + it('ACTS_SetWant_0900', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], +// operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo, + (err, data) => { + if (err.code == 0) { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_0900====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json index 40e57acd64af69328e2aa6fe269e8355ffae39d1..09eaf0be3cf5f2301bb19713664eac567b056fe0 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json @@ -1,18 +1,18 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "160000", - "package": "com.example.actsanswantagentfiveprotest", - "shell-timeout": "160000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFiveProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "160000", + "package": "com.example.actsanswantagentfiveprotest", + "shell-timeout": "160000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAnsWantAgentFiveProTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/default/app.js index c158442201abb1888ae8fb1d57f150c5ec26c36b..2a68c1992145a976957d7dcdd69a7e9c2e8e9877 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/default/app.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/resources/base/element/string.json index 3dfcf44ad69d1ed7fb18d42c5a733219740d8819..b739d36d595d58a637f81f8e4aad498fb369e530 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/resources/base/element/string.json +++ b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgentPromise5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "WantAgentPromise5" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/List.test.js index b9556322bf41111d632585be3c2648966cae85d8..680626aa64dc7a7d91516062ca239fdf5540d142 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/List.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 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. - */ +/* + * Copyright (c) 2021 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. + */ require('./WantAgent.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/WantAgent.test.js index 7486ffc0ff9ff6dd0aa4b27dba653b3017ba1e26..c976e862b2f2bf8ec33e9cf6110dc7c49984af6e 100644 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/wantagent/wantagent5promise/entry/src/main/js/test/WantAgent.test.js @@ -1,86 +1,86 @@ -/* - * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -var time = 1000 -var WantAgent; -describe('ActsAnsWantAgentFiveProTest', function () { - - /* - * @tc.number: ACTS_SetWant_1000 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent() - */ - it('ACTS_SetWant_1000', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "deviceId", - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], -// operationType: OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_1000====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - +/* + * Copyright (c) 2021 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 wantAgent from '@ohos.wantAgent'; +import { OperationType, Flags } from '@ohos.wantagent'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; +var time = 1000 +var WantAgent; +describe('ActsAnsWantAgentFiveProTest', function () { + + /* + * @tc.number: ACTS_SetWant_1000 + * @tc.name: getWantAgent() + * @tc.desc: verify the function of getWantAgent() + */ + it('ACTS_SetWant_1000', 0, async function (done) { + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.neu.WantAgentTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + }, + ], +// operationType: OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG] + } + console.info('----getWantAgent before----'); + wantAgent.getWantAgent(agentInfo).then( + (data) => { + WantAgent = data; + console.info('----getWantAgent success!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + var triggerInfo = { + code:0 + } + wantAgent.trigger(WantAgent, triggerInfo, + (err, data) => { + if (err.code == 0) { + console.info('----trigger success!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } else { + console.info('----trigger failed!----'); + console.info('== trigger data ' + JSON.stringify(data) ); + } + done(); + } + ); + done(); + } + ); + setTimeout(function(){ + console.debug("====>time out ACTS_SetWant_1000====>"); + }, time); + console.info('----getWantAgent after----'); + }) +}) + diff --git a/notification/ans_standard/publishicontest/Test.json b/notification/ans_standard/publishicontest/Test.json deleted file mode 100644 index de9530dee6f0ff172f7b99fb6f50e7f811be11fe..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsansicontest", - "shell-timeout": "120000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsIconTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} - diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/default/app.js b/notification/ans_standard/publishicontest/entry/src/main/js/default/app.js deleted file mode 100644 index c158442201abb1888ae8fb1d57f150c5ec26c36b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publishicontest/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publishicontest/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 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 file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publishicontest/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 54d2d87ff6caa4a4ad4131e135e181723f18cd79..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Subscriber" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publishicontest/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publishicontest/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/test/Icon.js b/notification/ans_standard/publishicontest/entry/src/main/js/test/Icon.js deleted file mode 100644 index 426a7dd0226c86e1c341f8240ed3b5f5c4126396..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/test/Icon.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2021 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 notify from '@ohos.notification' -import image from '@ohos.multimedia.image' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -var largeBuffer -var smallBuffer -var opts -var subInfo -var largeIcon -var smallIcon - -describe('ActsAnsIconTest', function () { - console.info("===========ActsAnsIconTest start====================>"); - - //consume - function consumeCallback(err,data) { - console.debug("==========================consumeCallback data : =======================>" +err+ JSON.stringify(data)); - data.largeIcon.getPixelBytesNumber().then((dataLarge)=>{ - console.info("==================getPixelBytesNumber_largeIcon dataLarge==================>"+ dataLarge); - console.info("==================getPixelBytesNumber_largeIcon largeBuffer==================>"+ largeBuffer); - expect(dataLarge).assertequal(largeBuffer); - }) - - data.smallIcon.getPixelBytesNumber().then((dataSmall)=>{ - console.info("==================getPixelBytesNumber_smallIcon dataSmall==================>"+ dataSmall); - console.info("==================getPixelBytesNumber_smallIcon smallBuffer==================>"+ smallBuffer); - expect(dataSmall).assertequal(smallBuffer); - }) - } - - function subscribeCallback(err) { - console.info("==========================subscribeCallback start=======================>"); - console.info("================subscribeCallback err : =======================>" + JSON.stringify(err)); - console.info("==========================subscribeCallback end=======================>"); - } - - function publishCallback(err){ - console.info("==========================publishCallback start=======================>"); - console.info("================publishCallback err : =======================>" + JSON.stringify(err)); - console.info("==========================publishCallback end=======================>"); - } - /* - * @tc.number: ActsAnsIconTest_0100 - * @tc.name: createPixelMap() - * @tc.desc: publish icon test - */ - it('ActsAnsIconTest_0100', 0, async function (done) { - console.debug("===============ActsAnsIconTest_0100 start====================>"); - subInfo ={ - onConsume:consumeCallback, - } - await notify.subscribe(subInfo,subscribeCallback); - - largeBuffer = new ArrayBuffer(64); - smallBuffer = new ArrayBuffer(32); - opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}} - const promise_Large = image.createPixelMap(largeBuffer, opts); - promise_Large.then((data) => { - console.debug("==========================createPixelMap_promise_Large=======================>"); - largeIcon = data; - console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+largeIcon); - - const promise_Small = image.createPixelMap(smallBuffer, opts); - promise_Small.then((data) => { - console.debug("==========================createPixelMap_promise_Small=======================>"); - smallIcon = data; - console.debug("==========================createPixelMap_promise_Small smallIcon=======================>"+smallIcon); - - notify.publish({ - id: 1, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", - smallIcon:smallIcon, - largeIcon:largeIcon, - },publishCallback); - done(); - }); - - }); - - }) - - /* - * @tc.number: ActsAnsIconTest_0200 - * @tc.name: createPixelMap() - * @tc.desc: publish icon test - */ - it('ActsAnsIconTest_0200', 0, async function (done) { - console.debug("===============ActsAnsIconTest_0200 start====================>"); - subInfo ={ - onConsume:consumeCallback, - } - await notify.subscribe(subInfo,subscribeCallback); - - largeBuffer = new ArrayBuffer(0); - smallBuffer = new ArrayBuffer(0); - opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}} - const promise_Large = image.createPixelMap(largeBuffer, opts); - promise_Large.then((data) => { - console.debug("==========================createPixelMap_promise_Large=======================>"); - largeIcon = data; - console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+largeIcon); - - const promise_Small = image.createPixelMap(smallBuffer, opts); - promise_Small.then((data) => { - console.debug("==========================createPixelMap_promise_Small=======================>"); - smallIcon = data; - console.debug("==========================createPixelMap_promise_Small smallIcon=======================>"+smallIcon); - - notify.publish({ - id: 1, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classification1", - sortingKey:"sortingKey1", - smallIcon:smallIcon, - largeIcon:largeIcon, - },publishCallback); - done(); - }); - - }); - - }) -}) - diff --git a/notification/ans_standard/publishicontest/entry/src/main/js/test/List.test.js b/notification/ans_standard/publishicontest/entry/src/main/js/test/List.test.js deleted file mode 100644 index f5ea7e09119f003185485461680f8399a5d00b42..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publishicontest/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ -require('./Icon.js') \ No newline at end of file diff --git a/notification/ans_standard/publishicontest/signature/openharmony_sx.p7b b/notification/ans_standard/publishicontest/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publishicontest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ces_standard/subscribeandpublish/BUILD.gn b/notification/ces_standard/subscribeandpublish/BUILD.gn index 91743d14ffcd77830c66ab804fe90563f7c4acd5..6a46f5483d7f124b366dc3e9daf214efcc242254 100644 --- a/notification/ces_standard/subscribeandpublish/BUILD.gn +++ b/notification/ces_standard/subscribeandpublish/BUILD.gn @@ -17,9 +17,8 @@ group("SubscribeAndPublish") { testonly = true if (is_standard_system) { deps = [ - "actssubscriberorderedtest:ActsSubscriberOrderTest", + #"actssubscriberorderedtest:ActsSubscriberOrderTest", "actssubscriberunordertest:ActsSubscriberUnorderTest", - #"actssubscriberunordersystemtest:ActsSubscriberTestUnorderSystem" ] } diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/resources/base/element/string.json b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 76e501f214f84c96a44d08973dbbdeab8515e1de..f94ce7e64e455e1ebf22a4b2792c5b52c791d037 --- a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/resources/base/element/string.json +++ b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] } \ No newline at end of file diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/test/ActsSubscriber_test_ordered.js b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/test/ActsSubscriber_test_ordered.js index 69c9c11750646fe9de642430daa68467b1dbc55e..ac3dcfee99deb05c047f7ec582811abf054bf481 100644 --- a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/test/ActsSubscriber_test_ordered.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/test/ActsSubscriber_test_ordered.js @@ -30,13 +30,6 @@ describe('ActsSubscriberTestOrder', function () { var commonEventSubscriber0500_1; var commonEventSubscriber0500_2; - function sleep(delay) { - var start = (new Date()).getTime(); - while((new Date()).getTime() - start < delay) { - continue; - } - } - function publishCallback(err) { console.info("===============>publishCallback"); } @@ -45,202 +38,6 @@ describe('ActsSubscriberTestOrder', function () { console.info("===============>unsubscribeCallback"); } - async function subscriberCallBack0100(err, data) { - console.info("===============>subscriberCallBack0100========event: " + data.event); - console.info("===============>subscriberCallBack0100========bundleName: " + data.bundleName); - console.info("===============>subscriberCallBack0100=========code: " + data.code); - console.info("===============>subscriberCallBack0100=========data: " + data.data); - expect(data.event).assertEqual("publish_event0100"); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event1001_init"); - expect(data.bundleName).assertEqual("publish_event0100_bundleName"); - - commonEventSubscriber0100.setCode(2).then(()=>{ - console.info("===============>subscriberCallBack0100 setCodeCallBack promise"); - }) - - commonEventSubscriber0100.setData("publish_event1001_change").then(()=>{ - console.info("===============>subscriberCallBack0100 setDataCallBack promise"); - }) - - commonEventSubscriber0100.setCodeAndData(2, "publish_event1001_change").then(()=>{ - console.info("===============>subscriberCallBack0100 setCodeAndDataCallback promise"); - }) - - commonEventSubscriber0100.getAbortCommonEvent().then(function(data) { - console.info("===============>subscriberCallBack0100 getAbortCommonEventCallback1 promise abort: " + data); - }) - - commonEventSubscriber0100.clearAbortCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0100 clearAbortCommonEventCallback promise"); - }) - - commonEventSubscriber0100.getAbortCommonEvent().then(function(data) { - console.info("===============>subscriberCallBack0100 getAbortCommonEventCallback2 promise abort: " + data); - }) - - commonEventSubscriber0100.finishCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0100 finishCommonEvent promise"); - }) - } - - async function subscriberCallBack0101(err, data) { - console.info("===============>subscriberCallBack0101========code: " + err.code); - console.info("===============>subscriberCallBack0101========event: " + data.event); - console.info("===============>subscriberCallBack0101========bundleName: " + data.bundleName); - console.info("===============>subscriberCallBack0101=========code: " + data.code); - console.info("===============>subscriberCallBack0101=========data: " + data.data); - expect(data.event).assertEqual("publish_event0100"); - console.info("===============>subscriberCallBack0101=========1 code "+ data.code); - expect(data.code).assertEqual(2); - commonEventSubscriber0101.getCode().then(function(data) { - console.info("===============>subscriberCallBack0101 getCodeCallBack promise code: "+ data); - }) - expect(data.data).assertEqual("publish_event1001_change"); - commonEventSubscriber0100.getData().then(function(data) { - console.info("===============>subscriberCallBack0100 getDataCallBack promise data: "+ data); - }) - expect(data.bundleName).assertEqual("publish_event0100_bundleName"); - commonEventSubscriber0101.finishCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0101 finishCommonEvent promise"); - }) - } - - async function subscriberCallBack0200_1(err, data) { - console.info("===============>subscriberCallBack0200_1========event: " + data.event); - console.info("===============>subscriberCallBack0200_1========bundleName: " + data.bundleName); - console.info("===============>subscriberCallBack0200_1=========code: " + data.code); - console.info("===============>subscriberCallBack0200_1=========data: " + data.data); - console.info("===============>subscriberCallBack0200_1=========num2: " + num2); - if (num2 == 0) { - num2++; - expect(data.event).assertEqual("publish_event0200"); - console.info("===============>subscriberCallBack0200_1=====num2:0====code: " + data.code); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event0200_init"); - expect(data.bundleName).assertEqual("publish_event0200_bundleName"); - }else { - num2 = 0; - expect(data.event).assertEqual("publish_event0201"); - console.info("===============>subscriberCallBack0200_1=====num2:1====code: " + data.code); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event0201_init"); - expect(data.bundleName).assertEqual("publish_event0201_bundleName"); - commonEventSubscriber0200_1.finishCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0200_1:num:1:finishCommonEventCallBack"); - }) - } - } - - async function subscriberCallBack0200_2(err, data) { - console.info("===============>subscriberCallBack0200_2========event: " + data.event); - console.info("===============>subscriberCallBack0200_2========bundleName: " + data.bundleName); - console.info("===============>subscriberCallBack0200_2=========code=: " + data.code); - console.info("===============>subscriberCallBack0200_2=========data: " + data.data); - - expect(data.event).assertEqual("publish_event0201"); - console.info("===============>subscriberCallBack0200_2=========code: " + data.code); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event0201_init"); - expect(data.bundleName).assertEqual("publish_event0201_bundleName"); - commonEventSubscriber0200_2.finishCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0200_2:finishCommonEventCallBack"); - }) - } - - async function subscriberCallBack0300_1(err, data) { - console.info("===============>subscriberCallBack0300_1========event: " + data.event); - console.info("===============>subscriberCallBack0300_1========bundleName: " + data.bundleName); - console.info("===============>subscriberCallBack0300_1=========code: " + data.code); - console.info("===============>subscriberCallBack0300_1=========dat: " + data.data); - console.info("===============>subscriberCallBack0300_1=========order: " + order); - - expect(data.event).assertEqual("publish_event0301"); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event0301_init"); - expect(data.bundleName).assertEqual("publish_event0301_bundleName"); - expect(order).assertEqual(1); - - if (order == true) { - order = false; - } - - commonEventSubscriber0300_1.isOrderedCommonEvent().then(function(data) { - console.info("========>subscriberCallBack0300_1 publish_event0301 isOrderedCommonEvent promise " + data); - expect(data).assertEqual(1); - }) - commonEventSubscriber0300_1.finishCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0300_1 publish_event0301 finishCommonEventCallBack"); - }) - } - - async function subscriberCallBack0300_2(err, data) { - console.info("===============>subscriberCallBack0300_2========event: " + data.event); - console.info("===============>subscriberCallBack0300_2========bundleName: " + data.bundleName); - console.info("===============>subscriberCallBack0300_2=========code: " + data.code); - console.info("===============>subscriberCallBack0300_2=========data: " + data.data); - console.info("===============>subscriberCallBack0300_2=========order: " + order); - - expect(data.event).assertEqual("publish_event0301"); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event0301_init"); - expect(data.bundleName).assertEqual("publish_event0301_bundleName"); - - if (order == false) { - order = true; - } - - commonEventSubscriber0300_2.isOrderedCommonEvent().then(function(data) { - console.info("===============>subscriberCallBack0300_2 isOrderedCommonEvent promise " + data); - expect(data).assertEqual(1); - }) - commonEventSubscriber0300_2.finishCommonEvent().then(()=>{ - console.info("===============>subscriberCallBack0300_2 publish_event0301 finishCommonEventCallBack"); - }) - } - - async function subscriberCallBack0400_1(err, data) { - console.info("===============>SubscriberPromise0400_1========event: " + data.event); - console.info("===============>SubscriberPromise0400_1========bundleName: " + data.bundleName); - console.info("===============>SubscriberPromise0400_1=========code: " + data.code); - console.info("===============>SubscriberPromise0400_1=========data: " + data.data); - expect(data.event).assertEqual("publish_event0400"); - expect(data.code).assertEqual(1); - expect(data.data).assertEqual("publish_event0400_init"); - expect(data.bundleName).assertEqual("publish_event0400_bundleName"); - commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) { - console.info("====>SubscriberPromise0400_1======>getAbortCommonEventPromise0400_1:1 abort2: " + data); - }); - commonEventSubscriber0400_1.abortCommonEvent().then(() => { - console.info("===============>SubscriberPromise0400_1=========>AbortCommonEventPromise0400_1"); - }); - commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) { - console.info("===>SubscriberPromise0400_1===========>getAbortCommonEventPromise0400_1:2 abort2: " + data); - }); - commonEventSubscriber0400_1.finishCommonEvent().then(()=> { - console.info("===============>SubscriberPromise0400_1==========>finishCommonEventPromise0400_1"); - }); - } - - async function subscriberCallBack0400_2(err, data) { - console.info("===============>SubscriberPromise0400_2========event: " + data.event); - expect().assertFail(); - } - - async function subscriberCallBack0500_1(err, data) { - console.info("===============>SubscriberPromise0500_1========event: " + data.event); - console.info("===============>SubscriberPromise0500_1========bundleName: " + data.bundleName); - console.info("===============>SubscriberPromise0500_1=========code: " + data.code); - console.info("===============>SubscriberPromise0500_1=========data: " + data.data); - expect(data.event).assertEqual("publish_event0500"); - expect(data.code).assertEqual(10); - expect(data.data).assertEqual("publish_event0500_init"); - expect(data.bundleName).assertEqual("publish_event0500_bundleName"); - commonEventSubscriber0500_1.finishCommonEvent().then(() => { - console.info("===============>SubscriberPromise0500_1==========>finishCommonEventPromise0500_1"); - }); - } - /* * @tc.number : ActsSubscriberTestOrder_0100 * @tc.name : verify subscribe and publish : Check subscribe same event and publish common ordered event @@ -267,6 +64,70 @@ describe('ActsSubscriberTestOrder', function () { isSticky: false, } + async function subscriberCallBack0100(err, data) { + console.info("===============>subscriberCallBack0100========event: " + data.event); + console.info("===============>subscriberCallBack0100========bundleName: " + data.bundleName); + console.info("===============>subscriberCallBack0100=========code: " + data.code); + console.info("===============>subscriberCallBack0100=========data: " + data.data); + expect(data.event).assertEqual("publish_event0100"); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event1001_init"); + expect(data.bundleName).assertEqual("publish_event0100_bundleName"); + + commonEventSubscriber0100.setCode(2).then(()=>{ + console.info("===============>subscriberCallBack0100 setCodeCallBack promise"); + }) + + commonEventSubscriber0100.setData("publish_event1001_change").then(()=>{ + console.info("===============>subscriberCallBack0100 setDataCallBack promise"); + }) + + commonEventSubscriber0100.setCodeAndData(2, "publish_event1001_change").then(()=>{ + console.info("===============>subscriberCallBack0100 setCodeAndDataCallback promise"); + }) + + commonEventSubscriber0100.getAbortCommonEvent().then(function(data) { + console.info( + "===============>subscriberCallBack0100 getAbortCommonEventCallback1 promise abort: " + data); + }) + + commonEventSubscriber0100.clearAbortCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0100 clearAbortCommonEventCallback promise"); + }) + + commonEventSubscriber0100.getAbortCommonEvent().then(function(data) { + console.info( + "===============>subscriberCallBack0100 getAbortCommonEventCallback2 promise abort: " + data); + }) + + commonEventSubscriber0100.finishCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0100 finishCommonEvent promise"); + }) + } + + async function subscriberCallBack0101(err, data) { + console.info("===============>subscriberCallBack0101========code: " + err.code); + console.info("===============>subscriberCallBack0101========event: " + data.event); + console.info("===============>subscriberCallBack0101========bundleName: " + data.bundleName); + console.info("===============>subscriberCallBack0101=========code: " + data.code); + console.info("===============>subscriberCallBack0101=========data: " + data.data); + expect(data.event).assertEqual("publish_event0100"); + console.info("===============>subscriberCallBack0101=========1 code "+ data.code); + expect(data.code).assertEqual(2); + commonEventSubscriber0101.getCode().then(function(data) { + console.info("===============>subscriberCallBack0101 getCodeCallBack promise code: "+ data); + }) + expect(data.data).assertEqual("publish_event1001_change"); + commonEventSubscriber0100.getData().then(function(data) { + console.info("===============>subscriberCallBack0100 getDataCallBack promise data: "+ data); + }) + expect(data.bundleName).assertEqual("publish_event0100_bundleName"); + commonEventSubscriber0101.finishCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0101 finishCommonEvent promise"); + }) + done(); + } + Subscriber.createSubscriber( commonEventSubscribeInfo_1 ).then(function (data) { @@ -289,8 +150,9 @@ describe('ActsSubscriberTestOrder', function () { Subscriber.publish("publish_event0100", commonEventPublishData, publishCallback); }); }) - sleep(5); - done(); + setTimeout(function (){ + console.debug("===================ActsSubscriberTestOrder_0100 end=================="); + }, 200000); }) /* @@ -329,6 +191,49 @@ describe('ActsSubscriberTestOrder', function () { isSticky: false, } + async function subscriberCallBack0200_1(err, data) { + console.info("===============>subscriberCallBack0200_1========event: " + data.event); + console.info("===============>subscriberCallBack0200_1========bundleName: " + data.bundleName); + console.info("===============>subscriberCallBack0200_1=========code: " + data.code); + console.info("===============>subscriberCallBack0200_1=========data: " + data.data); + console.info("===============>subscriberCallBack0200_1=========num2: " + num2); + if (num2 == 0) { + num2++; + expect(data.event).assertEqual("publish_event0200"); + console.info("===============>subscriberCallBack0200_1=====num2:0====code: " + data.code); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event0200_init"); + expect(data.bundleName).assertEqual("publish_event0200_bundleName"); + }else { + num2 = 0; + expect(data.event).assertEqual("publish_event0201"); + console.info("===============>subscriberCallBack0200_1=====num2:1====code: " + data.code); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event0201_init"); + expect(data.bundleName).assertEqual("publish_event0201_bundleName"); + commonEventSubscriber0200_1.finishCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0200_1:num:1:finishCommonEventCallBack"); + }) + } + } + + async function subscriberCallBack0200_2(err, data) { + console.info("===============>subscriberCallBack0200_2========event: " + data.event); + console.info("===============>subscriberCallBack0200_2========bundleName: " + data.bundleName); + console.info("===============>subscriberCallBack0200_2=========code=: " + data.code); + console.info("===============>subscriberCallBack0200_2=========data: " + data.data); + + expect(data.event).assertEqual("publish_event0201"); + console.info("===============>subscriberCallBack0200_2=========code: " + data.code); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event0201_init"); + expect(data.bundleName).assertEqual("publish_event0201_bundleName"); + commonEventSubscriber0200_2.finishCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0200_2:finishCommonEventCallBack"); + }) + done(); + } + Subscriber.createSubscriber( commonEventSubscribeInfo_1, ).then(function (data) { @@ -354,8 +259,9 @@ describe('ActsSubscriberTestOrder', function () { }); }) - sleep(5); - done(); + setTimeout(function (){ + console.debug("===================ActsSubscriberTestOrder_0200 end=================="); + }, 200000); }) /* @@ -385,6 +291,59 @@ describe('ActsSubscriberTestOrder', function () { isSticky: false, } + async function subscriberCallBack0300_1(err, data) { + console.info("===============>subscriberCallBack0300_1========event: " + data.event); + console.info("===============>subscriberCallBack0300_1========bundleName: " + data.bundleName); + console.info("===============>subscriberCallBack0300_1=========code: " + data.code); + console.info("===============>subscriberCallBack0300_1=========dat: " + data.data); + console.info("===============>subscriberCallBack0300_1=========order: " + order); + + expect(data.event).assertEqual("publish_event0301"); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event0301_init"); + expect(data.bundleName).assertEqual("publish_event0301_bundleName"); + expect(order).assertEqual(1); + + if (order == true) { + order = false; + } + + commonEventSubscriber0300_1.isOrderedCommonEvent().then(function(data) { + console.info( + "========>subscriberCallBack0300_1 publish_event0301 isOrderedCommonEvent promise " + data); + expect(data).assertEqual(1); + }) + commonEventSubscriber0300_1.finishCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0300_1 publish_event0301 finishCommonEventCallBack"); + }) + done(); + } + + async function subscriberCallBack0300_2(err, data) { + console.info("===============>subscriberCallBack0300_2========event: " + data.event); + console.info("===============>subscriberCallBack0300_2========bundleName: " + data.bundleName); + console.info("===============>subscriberCallBack0300_2=========code: " + data.code); + console.info("===============>subscriberCallBack0300_2=========data: " + data.data); + console.info("===============>subscriberCallBack0300_2=========order: " + order); + + expect(data.event).assertEqual("publish_event0301"); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event0301_init"); + expect(data.bundleName).assertEqual("publish_event0301_bundleName"); + + if (order == false) { + order = true; + } + + commonEventSubscriber0300_2.isOrderedCommonEvent().then(function(data) { + console.info("===============>subscriberCallBack0300_2 isOrderedCommonEvent promise " + data); + expect(data).assertEqual(1); + }) + commonEventSubscriber0300_2.finishCommonEvent().then(()=>{ + console.info("===============>subscriberCallBack0300_2 publish_event0301 finishCommonEventCallBack"); + }) + } + Subscriber.createSubscriber( commonEventSubscribeInfo_1, ).then(function (data) { @@ -411,8 +370,9 @@ describe('ActsSubscriberTestOrder', function () { }); }) - sleep(5); - done(); + setTimeout(function (){ + console.debug("===================ActsSubscriberTestOrder_0300 end=================="); + }, 200000); }) /* @@ -442,6 +402,36 @@ describe('ActsSubscriberTestOrder', function () { isSticky: false, } + async function subscriberCallBack0400_1(err, data) { + console.info("===============>SubscriberPromise0400_1========event: " + data.event); + console.info("===============>SubscriberPromise0400_1========bundleName: " + data.bundleName); + console.info("===============>SubscriberPromise0400_1=========code: " + data.code); + console.info("===============>SubscriberPromise0400_1=========data: " + data.data); + expect(data.event).assertEqual("publish_event0400"); + expect(data.code).assertEqual(1); + expect(data.data).assertEqual("publish_event0400_init"); + expect(data.bundleName).assertEqual("publish_event0400_bundleName"); + commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) { + console.info("====>SubscriberPromise0400_1======>getAbortCommonEventPromise0400_1:1 abort2: " + data); + }); + commonEventSubscriber0400_1.abortCommonEvent().then(() => { + console.info("===============>SubscriberPromise0400_1=========>AbortCommonEventPromise0400_1"); + }); + commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) { + console.info( + "===>SubscriberPromise0400_1===========>getAbortCommonEventPromise0400_1:2 abort2: " + data); + }); + commonEventSubscriber0400_1.finishCommonEvent().then(()=> { + console.info("===============>SubscriberPromise0400_1==========>finishCommonEventPromise0400_1"); + }); + done(); + } + + async function subscriberCallBack0400_2(err, data) { + console.info("===============>SubscriberPromise0400_2========event: " + data.event); + expect().assertFail(); + } + Subscriber.createSubscriber( commonEventSubscribeInfo_1 ).then(function (data) { @@ -467,8 +457,9 @@ describe('ActsSubscriberTestOrder', function () { }) }) - sleep(5); - done(); + setTimeout(function (){ + console.debug("===================ActsSubscriberTestOrder_0400 end=================="); + }, 200000); }) /* @@ -498,6 +489,20 @@ describe('ActsSubscriberTestOrder', function () { isSticky: false, } + async function subscriberCallBack0500_1(err, data) { + console.info("===============>SubscriberPromise0500_1========event: " + data.event); + console.info("===============>SubscriberPromise0500_1========bundleName: " + data.bundleName); + console.info("===============>SubscriberPromise0500_1=========code: " + data.code); + console.info("===============>SubscriberPromise0500_1=========data: " + data.data); + expect(data.event).assertEqual("publish_event0500"); + expect(data.code).assertEqual(10); + expect(data.data).assertEqual("publish_event0500_init"); + expect(data.bundleName).assertEqual("publish_event0500_bundleName"); + commonEventSubscriber0500_1.finishCommonEvent().then(() => { + console.info("===============>SubscriberPromise0500_1==========>finishCommonEventPromise0500_1"); + }); + } + async function subscriberCallBack0500_2(err, data) { console.info("===============>SubscriberPromise0500_2========event: " + data.event); console.info("===============>SubscriberPromise0500_2========bundleName: " + data.bundleName); @@ -536,7 +541,7 @@ describe('ActsSubscriberTestOrder', function () { }) setTimeout(function (){ - console.debug("===================ActsSubscriberTestUnorder_1000 end=================="); - }, 30000); + console.debug("===================ActsSubscriberTestOrder_0500 end=================="); + }, 200000); }) }) diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/signature/openharmony_sx.p7b b/notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/default/app.js b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/default/app.js index b58cf3c570b660c6f6f8cdcb1b317d67687deb29..bdbaaf37cd23be7a759b6d491a6311331d0d17be 100644 --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/default/app.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/default/app.js @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2021 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. - */ -export default { - onCreate() { - console.info("============== AceApplication onCreate =============="); - }, - onDestroy() { - console.info('=============AceApplication onDestroy============='); - } -}; +/* + * Copyright (c) 2021 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. + */ +export default { + onCreate() { + console.info("============== AceApplication onCreate =============="); + }, + onDestroy() { + console.info('=============AceApplication onDestroy============='); + } +}; diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/resources/base/element/string.json b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 76e501f214f84c96a44d08973dbbdeab8515e1de..f94ce7e64e455e1ebf22a4b2792c5b52c791d037 --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/resources/base/element/string.json +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] } \ No newline at end of file diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js old mode 100644 new mode 100755 index b10023c2abed8a622fa0ec700ef41f810326a598..c988d55692704e7449c484d702717c8f4c896c6a --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js @@ -1,78 +1,86 @@ -/* - * Copyright (c) 2021 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 Subscriber from '@ohos.commonevent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -describe('ActsSubscriberTestUnorderSystem', async function (done) { - console.info("===========ActsSubscriberTestUnorderSystem start====================>"); - var commonEventSubscriber; - - function publishCallback(err) { - console.info("==========================>publishCallback"); - } - - /* - * @tc.number : ActsSubscriberTestUnorderSystem_0100 - * @tc.name : verify subscribe and publish : Check subscribe and publish common event data - * with publishInfo data - * @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise) - */ - it('ActsSubscriberTestUnorderSystem_0100', 0, async function (done) { - console.info("===============ActsSubscriberTestUnorderSystem_0100==========================>"); - var commonEventSubscribeInfo = { - events: ["publish_event0100"], - publisherDeviceId: "PublishDeviceId0100", - priority: 10, - }; - - var commonEventPublishData = { - isOrdered: false, - bundleName: "PublishBundleName0100", - code: 55, - data: "PublishData0100", - } - - function isOrderedCommonEventCallback001(err, data) { - console.info("==========================>isOrderedCommonEventCallback001"); - expect(data).assertEqual(false); - done(); - } - - function subscriberCallBack001(err, data) { - console.info("==========================>subscriberCallBack001"); - expect(data.event).assertEqual("publish_event0100"); - expect(data.bundleName).assertEqual("PublishBundleName0100"); - expect(data.code).assertEqual(55); - expect(data.data).assertEqual("PublishData0100"); - commonEventSubscriber.isOrderedCommonEvent(isOrderedCommonEventCallback001); - } - - Subscriber.createSubscriber( - commonEventSubscribeInfo - ).then(function (data) { - console.info("===============ActsSubscriberTestUnorderSystem_0100=========createSubscriber promise"); - commonEventSubscriber = data; - data.getSubscribeInfo().then(function (data) { - console.info("===============ActsSubscriberTestUnorderSystem_0100=========getSubscribeInfo promise"); - Subscriber.subscribe(commonEventSubscriber, subscriberCallBack001); - Subscriber.publish("publish_event0100", commonEventPublishData, publishCallback); - }); - }) - setTimeout(function (){ - console.debug("===================ActsSubscriberTestUnorderSystem_0100 end=================="); - }, 30000); - }) -}) - +/* + * Copyright (c) 2021 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 Subscriber from '@ohos.commonevent' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +describe('ActsSubscriberTestUnorderSystem', async function (done) { + console.info("===========ActsSubscriberTestUnorderSystem start====================>"); + var commonEventSubscriber; + + function publishCallback(err) { + console.info("==========================>publishCallback"); + } + + function sleep(delay) { + var start = (new Date()).getTime(); + while((new Date()).getTime() - start < delay) {} + } + + /* + * @tc.number : ActsSubscriberTestUnorderSystem_0100 + * @tc.name : verify subscribe and publish : Check subscribe and publish common event data + * with publishInfo data + * @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise) + */ + it('ActsSubscriberTestUnorderSystem_0100', 0, async function (done) { + console.info("===============ActsSubscriberTestUnorderSystem_0100==========================>"); + var commonEventSubscribeInfo = { + events: ["Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED"], + publisherDeviceId: "PublishDeviceId0100", + priority: 10, + }; + + var commonEventPublishData = { + isOrdered: false, + bundleName: "PublishBundleName0100", + code: 55, + data: "PublishData0100", + } + + function isOrderedCommonEventCallback001(err, data) { + console.info("==========================>isOrderedCommonEventCallback001"); + expect(data).assertEqual(false); + done(); + } + + function subscriberCallBack001(err, data) { + console.info("==========================>subscriberCallBack001"); + expect(data.event).assertEqual("Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED"); + expect(data.bundleName).assertEqual("PublishBundleName0100"); + expect(data.code).assertEqual(55); + expect(data.data).assertEqual("PublishData0100"); + commonEventSubscriber.isOrderedCommonEvent(isOrderedCommonEventCallback001); + } + + Subscriber.createSubscriber( + commonEventSubscribeInfo + ).then(function (data) { + console.info("===============ActsSubscriberTestUnorderSystem_0100=========createSubscriber promise"); + commonEventSubscriber = data; + data.getSubscribeInfo().then(function (data) { + console.info("===============ActsSubscriberTestUnorderSystem_0100=========getSubscribeInfo promise"); + Subscriber.subscribe(commonEventSubscriber, subscriberCallBack001); + sleep(10); + Subscriber.publish("Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED", + commonEventPublishData, + publishCallback); + }); + }) + setTimeout(function (){ + console.debug("===================ActsSubscriberTestUnorderSystem_0100 end=================="); + }, 30000); + }) +}) + diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/signature/openharmony_sx.p7b b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/resources/base/element/string.json b/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/resources/base/element/string.json old mode 100644 new mode 100755 index 76e501f214f84c96a44d08973dbbdeab8515e1de..f94ce7e64e455e1ebf22a4b2792c5b52c791d037 --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/resources/base/element/string.json +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] } \ No newline at end of file diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/test/ActsSubscriber_test_unorder.js b/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/test/ActsSubscriber_test_unorder.js old mode 100644 new mode 100755 index d13c1c6517e2bf491e76081cebd56b94e58afb1b..f4a7777edac34aeb4bc075951fd56ea8da1cbcb1 --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/test/ActsSubscriber_test_unorder.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/test/ActsSubscriber_test_unorder.js @@ -31,7 +31,6 @@ describe('ActsSubscriberTestUnorder', async function (done) { var commonEventSubscriber010_2; var commonEventSubscriber011; var commonEventSubscriber012; -// var commonEventSubscriber013; function publishCallback(err) { console.info("==========================>publishCallback"); @@ -56,7 +55,6 @@ describe('ActsSubscriberTestUnorder', async function (done) { */ it('ActsSubscriberTestUnorder_0100', 0, async function (done) { console.info("===============ActsSubscriberTestUnorder_0100=============================>"); - function subscriberCallBack001(err, data) { console.info("==========================>subscriberCallBack001"); expect(data.event).assertEqual("publish_event0100"); @@ -78,7 +76,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data){ console.info("===============ActsSubscriberTestUnorder_0100=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber001, subscriberCallBack001); - Subscriber.publish("publish_event0100", publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0100 publish start============"); + Subscriber.publish("publish_event0100", publishCallback); + }, 1000); }); }) @@ -117,7 +118,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data){ console.info("===============ActsSubscriberTestUnorder_0200=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber002, subscriberCallBack002); - Subscriber.publish("@#¥#3243adsafdf_", publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0200 publish start============"); + Subscriber.publish("@#¥#3243adsafdf_", publishCallback); + }, 1000); }); }) @@ -170,7 +174,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorder_0300=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber003, subscriberCallBack003); - Subscriber.publish("publish_event0300", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0300 publish start============"); + Subscriber.publish("publish_event0300", commonEventPublishData, publishCallback); + }, 1000); }); }) setTimeout(function (){ @@ -217,7 +224,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data){ console.info("===============ActsSubscriberTestUnorder_0400=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber004, subscriberCallBack004); - Subscriber.publish("publish_event0400", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0400 publish start============"); + Subscriber.publish("publish_event0400", commonEventPublishData, publishCallback); + }, 1000); }); }) @@ -272,7 +282,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { console.info("===============ActsSubscriberTestUnorder_0500_2=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber005_2, subscriberCallBack005); Subscriber.unsubscribe(commonEventSubscriber005_1, unsubscriberCallBack); - Subscriber.publish("publish_event0500", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0500 publish start============"); + Subscriber.publish("publish_event0500", commonEventPublishData, publishCallback); + }, 1000); }); }) @@ -322,8 +335,11 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorder_0700=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber006, subscriberCallBack006); - Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback); - Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0600 publish start============"); + Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback); + Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback); + }, 1000); }); }) @@ -367,7 +383,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorder_0700=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber007, subscriberCallBack007); - Subscriber.publish("publish_event0700", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0700 publish start============"); + Subscriber.publish("publish_event0700", commonEventPublishData, publishCallback); + }, 1000); }); }); @@ -427,7 +446,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorder_0800=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber008, subscriberCallBack008); - Subscriber.publish("publish_event0800", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.debug("==========ActsSubscriberTestUnorder_0800 publish start============"); + Subscriber.publish("publish_event0800", commonEventPublishData, publishCallback); + }, 1000); }); }); sleep(5); @@ -474,7 +496,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorder_0900=========getSubscribeInfo promise="); Subscriber.subscribe(commonEventSubscriber009, subscriberCallBack009); - Subscriber.publish("publish_event0900", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0900 publish start============"); + Subscriber.publish("publish_event0900", commonEventPublishData, publishCallback); + }, 1000); }); }); @@ -569,8 +594,11 @@ describe('ActsSubscriberTestUnorder', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorder_1000=========getSubscribeInfo promise1000_2"); Subscriber.subscribe(commonEventSubscriber010_2, subscriberCallBack010_2); - Subscriber.publish("publish_event1000_1", commonEventPublishData_1, publishCallback1000_1); - Subscriber.publish("publish_event1000_2", commonEventPublishData_2, publishCallback1000_2); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_1000 publish start============"); + Subscriber.publish("publish_event1000_1", commonEventPublishData_1, publishCallback1000_1); + Subscriber.publish("publish_event1000_2", commonEventPublishData_2, publishCallback1000_2); + }, 1000); }); }); @@ -603,7 +631,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { console.info("==========================>getSubscribeInfo1100CallBack=======================>"); expect(data.events[0]).assertEqual("publish_event1100"); Subscriber.subscribe(commonEventSubscriber011, subscriberCallBack011); - Subscriber.publish("publish_event1100", publishCallback); + setTimeout(function (){ + console.debug("==========ActsSubscriberTestUnorder_1100 publish start============"); + Subscriber.publish("publish_event1100", publishCallback); + }, 1000); } function createSubscriber1100CallBack(err, data) { @@ -658,7 +689,10 @@ describe('ActsSubscriberTestUnorder', async function (done) { console.info("==========================>getSubscribeInfo1200CallBack=======================>"); expect(data.events[0]).assertEqual("publish_event1200"); Subscriber.subscribe(commonEventSubscriber012, subscriberCallBack012); - Subscriber.publish("publish_event1200", commonEventPublishData, publishCallback); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_1200 publish start============"); + Subscriber.publish("publish_event1200", commonEventPublishData, publishCallback); + }, 1000); } function createSubscriber1200CallBack(err, data) { diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/signature/openharmony_sx.p7b b/notification/ces_standard/subscribeandpublish/actssubscriberunordertest/signature/openharmony_sx.p7b old mode 100644 new mode 100755