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 00e12ac95f09a1c054af364d9a281b04bcab7cae..66b23c22330cb8e98b96f1612fffd9c9b10d685d 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 @@ -17,35 +17,35 @@ import notify from '@ohos.notification' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' let timeout = 500; describe('ActsAnsNotificationCancel', function () { - console.info("===========ActsAnsNotificationCancel start====================>"); + console.info('===========ActsAnsNotificationCancel start====================>'); let timesOfOnConsume function onConsumeCancelAll(data) { - console.info("================ANS_Cancel_0100 onConsume start=======================>"); - console.info("================ANS_Cancel_0100 onConsume data:=================>" + JSON.stringify(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("================ANS_Cancel_0100 onConsume cancelAll=======================>"); + console.info('================ANS_Cancel_0100 onConsume cancelAll=======================>'); } - console.info("================ANS_Cancel_0100 onConsume end=======================>"); + console.info('================ANS_Cancel_0100 onConsume end=======================>'); } let timesOfOnCancel function onCancelCancelAll(data) { - console.info("================ANS_Cancel_0100 onCancel start===============>"); - console.info("================ANS_Cancel_0100 onCancel data:===============>" + JSON.stringify(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); } else if (timesOfOnCancel == 2){ expect(data.request.id).assertEqual(2); } - console.info("================ANS_Cancel_0100 onCancel end=======================>"); + console.info('================ANS_Cancel_0100 onCancel end=======================>'); } function cancelAllCallBack(err, data){ - 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================>"); + 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================>'); } /* @@ -55,7 +55,7 @@ describe('ActsAnsNotificationCancel', function () { cancelAll(callback: AsyncCallback) interface */ it('ANS_Cancel_0100', 0, async function (done) { - console.info("==================ANS_Cancel_0100 start==================>"); + console.info('==================ANS_Cancel_0100 start==================>'); timesOfOnConsume = 0 timesOfOnCancel = 0 let subscriber ={ @@ -66,9 +66,9 @@ describe('ActsAnsNotificationCancel', function () { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 1, @@ -86,9 +86,9 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0100_1", + label: '0100_1', badgeIconStyle: 1, showDeliveryTime: true, } @@ -96,9 +96,9 @@ describe('ActsAnsNotificationCancel', function () { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 2, @@ -116,22 +116,22 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0100_2", + label: '0100_2', badgeIconStyle: 1, showDeliveryTime: true, } await notify.subscribe(subscriber); - console.info("===========ANS_Cancel_0100 subscribe promise=======>"); + console.info('===========ANS_Cancel_0100 subscribe promise=======>'); await notify.publish(notificationRequest); - console.info("===========ANS_Cancel_0100 publish1 promise=======>"); + console.info('===========ANS_Cancel_0100 publish1 promise=======>'); await notify.publish(notificationRequest1); - console.info("===========ANS_Cancel_0100 publish2 promise=======>"); + console.info('===========ANS_Cancel_0100 publish2 promise=======>'); setTimeout((async function(){ - console.info("======ANS_Cancel_0100 setTimeout==================>"); + console.info('======ANS_Cancel_0100 setTimeout==================>'); await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0100 setTimeout unsubscribe==================>"); + console.info('======ANS_Cancel_0100 setTimeout unsubscribe==================>'); done(); }),timeout); }) @@ -139,25 +139,25 @@ describe('ActsAnsNotificationCancel', function () { function onConsumeCancelAllPromise(data) { timesOfOnConsume = timesOfOnConsume + 1 - console.info("================ANS_Cancel_0200 onConsume start===========>"); - console.info("================ANS_Cancel_0200 onConsume data:============>" + JSON.stringify(data)); + console.info('================ANS_Cancel_0200 onConsume start===========>'); + console.info('================ANS_Cancel_0200 onConsume data:============>' + JSON.stringify(data)); if (timesOfOnConsume == 2){ notify.cancelAll(); - console.info("==========ANS_Cancel_0200 onConsume cancelAll promise==========>"); + console.info('==========ANS_Cancel_0200 onConsume cancelAll promise==========>'); } - console.info("================ANS_Cancel_0200 onConsume end===============>"); + console.info('================ANS_Cancel_0200 onConsume end===============>'); } function onCancelCancelAllPromise(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("=========ANS_Cancel_0200 onCancel start==========>"); - console.info("=========ANS_Cancel_0200 onCancel data:==========>" + JSON.stringify(data)); + 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); } else if (timesOfOnCancel == 2){ expect(data.request.id).assertEqual(2); } - console.info("==========ANS_Cancel_0200 onCancel end=======================>"); + console.info('==========ANS_Cancel_0200 onCancel end=======================>'); } /* @@ -167,7 +167,7 @@ describe('ActsAnsNotificationCancel', function () { calling the cancelAll(): Promise interface */ it('ANS_Cancel_0200', 0, async function (done) { - console.info("===============ANS_Cancel_0200 start==========================>"); + console.info('===============ANS_Cancel_0200 start==========================>'); timesOfOnConsume = 0 timesOfOnCancel = 0 let subscriber ={ @@ -175,14 +175,14 @@ describe('ActsAnsNotificationCancel', function () { onCancel:onCancelCancelAllPromise, } await notify.subscribe(subscriber); - console.info("==================ANS_Cancel_0200 subscribe promise==================>"); + console.info('==================ANS_Cancel_0200 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 1, @@ -200,9 +200,9 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0200", + label: '0200', badgeIconStyle: 1, showDeliveryTime: true, } @@ -210,9 +210,9 @@ describe('ActsAnsNotificationCancel', function () { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 2, @@ -230,40 +230,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0200", + label: '0200', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==========ANS_Cancel_0200 publish1 promise==================>"); + console.info('==========ANS_Cancel_0200 publish1 promise==================>'); await notify.publish(notificationRequest1); - console.info("==========ANS_Cancel_0200 publish2 promise==================>"); + console.info('==========ANS_Cancel_0200 publish2 promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0200 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0200 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancelAllNoNotify(data) { - console.info("================ANS_Cancel_0300 onConsume start========>"); - console.info("================ANS_Cancel_0300 onConsume data:========>" + JSON.stringify(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=======================>"); + console.info('================ANS_Cancel_0300 onConsume end=======================>'); } function onCancelCancelAllNoNotify(data) { - console.info("=================ANS_Cancel_0300 onCancel start=============>"); + 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================>"); + console.info('================ANS_Cancel_0300 onCancel data:==============>' + JSON.stringify(data)); + console.info('================ANS_Cancel_0300 onCancel end================>'); } function cancelAllCallBackNoNotify(err, data){ - 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===============>"); + 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===============>'); } /* @@ -276,33 +276,33 @@ describe('ActsAnsNotificationCancel', function () { and there is no OnCancel notification(Callback mode) */ it('ANS_Cancel_0300', 0, async function (done) { - console.info("===============ANS_Cancel_0300 start==========================>"); + console.info('===============ANS_Cancel_0300 start==========================>'); let subscriber ={ onConsume:onConsumeCancelAllNoNotify, onCancel:onCancelCancelAllNoNotify, } await notify.subscribe(subscriber); - console.info("===============ANS_Cancel_0300 subscribe promise===============>"); + console.info('===============ANS_Cancel_0300 subscribe promise===============>'); await notify.cancelAll(cancelAllCallBackNoNotify); - console.info("===============ANS_Cancel_0300 cancelAll promise===============>"); + console.info('===============ANS_Cancel_0300 cancelAll promise===============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0300 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0300 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancelAllNoNotifyPromise(data) { - console.info("================ANS_Cancel_0400 onConsume===============>"); - console.info("================ANS_Cancel_0400 onConsume data:===========>" + JSON.stringify(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===========>"); + 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)); + 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===============>"); + console.info('===============ANS_Cancel_0400 onCancel end===============>'); } /* @@ -315,53 +315,53 @@ describe('ActsAnsNotificationCancel', function () { and there is no OnCancel notification( Callback mode) */ it('ANS_Cancel_0400', 0, async function (done) { - console.info("===============ANS_Cancel_0400 start==========================>"); + console.info('===============ANS_Cancel_0400 start==========================>'); let subscriber ={ onConsume:onConsumeCancelAllNoNotifyPromise, onCancel:onCancelCancelAllNoNotifyPromise, } await notify.subscribe(subscriber); - console.info("================ANS_Cancel_0400 subscribe promise=============>"); + console.info('================ANS_Cancel_0400 subscribe promise=============>'); await notify.cancelAll(); - console.info("================ANS_Cancel_0400 cancelAll promise=============>"); + console.info('================ANS_Cancel_0400 cancelAll promise=============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0400 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0400 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancelAll2Times(data) { - console.info("==========ANS_Cancel_0500 onConsume start==============>"); - console.info("==========ANS_Cancel_0500 onConsume data:==============>" + JSON.stringify(data)); + console.info('==========ANS_Cancel_0500 onConsume start==============>'); + console.info('==========ANS_Cancel_0500 onConsume data:==============>' + JSON.stringify(data)); notify.cancelAll(cancelAllCallBack2Times1); - console.info("==========ANS_Cancel_0500 onConsume cancelAll=================>"); - console.info("==========ANS_Cancel_0500 onConsume end=======================>"); + console.info('==========ANS_Cancel_0500 onConsume cancelAll=================>'); + console.info('==========ANS_Cancel_0500 onConsume end=======================>'); } function onCancelCancelAll2Times(data) { - console.info("=========ANS_Cancel_0500 onCancel start===============>"); - console.info("=========ANS_Cancel_0500 onCancel data:===============>" + JSON.stringify(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); } else if (timesOfOnCancel){ expect(data.request.id).assertEqual(0); } - console.info("==========ANS_Cancel_0500 onCancel end===============>"); + console.info('==========ANS_Cancel_0500 onCancel end===============>'); } function cancelAllCallBack2Times1(err){ - console.info("==========ANS_Cancel_0500 cancelAllCallBack1 start==========>"); - console.info("==========ANS_Cancel_0500 cancelAllCallBack1 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("==========ANS_Cancel_0500 cancelAllCallBack1 cancelAll======>"); - console.info("==========ANS_Cancel_0500 cancelAllCallBack1 end===========>"); + console.info('==========ANS_Cancel_0500 cancelAllCallBack1 cancelAll======>'); + console.info('==========ANS_Cancel_0500 cancelAllCallBack1 end===========>'); } function cancelAllCallBack2Times2(err){ - console.info("==========ANS_Cancel_0500 cancelAllCallBack2 start=============>"); - console.info("==========ANS_Cancel_0500 cancelAllCallBack2 err:==============>" + JSON.stringify(err)); - console.info("==========ANS_Cancel_0500 cancelAllCallBack2 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===============>'); } /* @@ -372,21 +372,21 @@ 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 let subscriber ={ onConsume:onConsumeCancelAll2Times, onCancel:onCancelCancelAll2Times, } await notify.subscribe(subscriber); - console.info("============ANS_Cancel_0500 subscribe promise======>"); + console.info('============ANS_Cancel_0500 subscribe promise======>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 5, @@ -404,40 +404,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0500", + label: '0500', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==============ANS_Cancel_0500 publish promise end==============>"); + console.info('==============ANS_Cancel_0500 publish promise end==============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0500 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0500 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancelAll2TimesPromise(data) { - console.info("==========ANS_Cancel_0600 onConsume start============>"); - console.info("==========ANS_Cancel_0600 onConsume data=============>" + JSON.stringify(data)); + console.info('==========ANS_Cancel_0600 onConsume start============>'); + console.info('==========ANS_Cancel_0600 onConsume data=============>' + JSON.stringify(data)); notify.cancelAll(); - console.info("==========ANS_Cancel_0600 onConsume cancelAll 2times1 end======>"); + console.info('==========ANS_Cancel_0600 onConsume cancelAll 2times1 end======>'); notify.cancelAll(); - console.info("==========ANS_Cancel_0600 onConsume cancelAll 2times2 end======>"); - console.info("==========ANS_Cancel_0600 onConsume end========>"); + console.info('==========ANS_Cancel_0600 onConsume cancelAll 2times2 end======>'); + console.info('==========ANS_Cancel_0600 onConsume end========>'); } function onCancelCancelAll2TimesPromise(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("==========ANS_Cancel_0600 onCancel===================>"); - console.info("==========ANS_Cancel_0600 onCancel data:============>" + JSON.stringify(data)); + 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); } else if (timesOfOnCancel == 2){ expect().assertFail(); } - console.info("==========ANS_Cancel_0600 onCancel end=============>"); + console.info('==========ANS_Cancel_0600 onCancel end=============>'); } /* @@ -447,21 +447,21 @@ describe('ActsAnsNotificationCancel', function () { cancelAll(): Promise interface, and then cancel the notification again */ it('ANS_Cancel_0600', 0, async function (done) { - console.info("===============ANS_Cancel_0600 start==========================>"); + console.info('===============ANS_Cancel_0600 start==========================>'); timesOfOnCancel = 0 let subscriber ={ onConsume:onConsumeCancelAll2TimesPromise, onCancel:onCancelCancelAll2TimesPromise, } await notify.subscribe(subscriber); - console.info("==================ANS_Cancel_0600 subscribe promise==================>"); + console.info('==================ANS_Cancel_0600 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 6, @@ -479,39 +479,39 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0600", + label: '0600', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================ANS_Cancel_0600 publish promise==================>"); + console.info('==================ANS_Cancel_0600 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0600 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0600 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancelAllIsUnremovable(data) { - console.info("========ANS_Cancel_0700 onConsume start===========>"); - console.info("========ANS_Cancel_0700 onConsume data: ===========>" + JSON.stringify(data)); + console.info('========ANS_Cancel_0700 onConsume start===========>'); + console.info('========ANS_Cancel_0700 onConsume data: ===========>' + JSON.stringify(data)); notify.cancelAll(cancelAllCallBackIsUnremovable); - console.info("========ANS_Cancel_0700 onConsume cancelAll===========>"); - console.info("========ANS_Cancel_0700 onConsume end============>"); + console.info('========ANS_Cancel_0700 onConsume cancelAll===========>'); + console.info('========ANS_Cancel_0700 onConsume end============>'); } function onCancelCancelAllIsUnremovable(data) { - console.info("================ANS_Cancel_0700 onCancel start=======================>"); - console.info("================ANS_Cancel_0700 onCancel data:====================>" + JSON.stringify(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=======================>"); + console.info('================ANS_Cancel_0700 onCancel end=======================>'); } function cancelAllCallBackIsUnremovable(err, data){ - 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=======================>"); + 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=======================>'); } /* @@ -522,20 +522,20 @@ describe('ActsAnsNotificationCancel', function () { that isUnremovable is true that it has published */ it('ANS_Cancel_0700', 0, async function (done) { - console.info("===============ANS_Cancel_0700 start==========================>"); + console.info('===============ANS_Cancel_0700 start==========================>'); let subscriber ={ onConsume:onConsumeCancelAllIsUnremovable, onCancel:onCancelCancelAllIsUnremovable, } await notify.subscribe(subscriber); - console.info("========ANS_Cancel_0700 subscribe promise==================>"); + console.info('========ANS_Cancel_0700 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 7, @@ -553,33 +553,33 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0700", + label: '0700', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("===========ANS_Cancel_0700 publish promise==================>"); + console.info('===========ANS_Cancel_0700 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0700 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0700 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancelAllIsUnremovablPromise(data) { - console.info("================ANS_Cancel_0800 onConsume start=============>"); - console.info("================ANS_Cancel_0800 onConsume data:=============>" + JSON.stringify(data)); + console.info('================ANS_Cancel_0800 onConsume start=============>'); + console.info('================ANS_Cancel_0800 onConsume data:=============>' + JSON.stringify(data)); notify.cancelAll(); - console.info("================ANS_Cancel_0800 cancelAll==========>"); - console.info("================ANS_Cancel_0800 onConsume end===============>"); + console.info('================ANS_Cancel_0800 cancelAll==========>'); + console.info('================ANS_Cancel_0800 onConsume end===============>'); } function onCancelCancelAllIsUnremovablePromise(data) { - console.info("================ANS_Cancel_0800 onCancel start================>"); - console.info("================ANS_Cancel_0800 onCancel data :===============>" + JSON.stringify(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================>"); + console.info('================ANS_Cancel_0800 onCancel end================>'); } /* @@ -590,20 +590,20 @@ describe('ActsAnsNotificationCancel', function () { that isUnremovable is true that it has published */ it('ANS_Cancel_0800', 0, async function (done) { - console.info("===============ANS_Cancel_0800 start==========================>"); + console.info('===============ANS_Cancel_0800 start==========================>'); let subscriber ={ onConsume:onConsumeCancelAllIsUnremovablPromise, onCancel:onCancelCancelAllIsUnremovablePromise, } await notify.subscribe(subscriber); - console.info("==================ANS_Cancel_0800 subscribe promsie==================>"); + console.info('==================ANS_Cancel_0800 subscribe promsie==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 8, @@ -621,38 +621,38 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "0800", + label: '0800', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("=========ANS_Cancel_0800 publish promise==================>"); + console.info('=========ANS_Cancel_0800 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0800 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0800 setTimeout unsubscribe end==================>'); done(); }),timeout); }) function onConsumeCancel(data) { - console.info("=========ANS_Cancel_0900 onConsume start================>"); - console.info("=========ANS_Cancel_0900 onConsume data:================>" + JSON.stringify(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("=========ANS_Cancel_0900 onConsume cancel=============>"); - console.info("=========ANS_Cancel_0900 onConsume end================>"); + console.info('=========ANS_Cancel_0900 onConsume cancel=============>'); + console.info('=========ANS_Cancel_0900 onConsume end================>'); } function onCancelCancel(data) { - console.info("=========ANS_Cancel_0900 onCancel start================>"); - console.info("=========ANS_Cancel_0900 onCancel data:================>" + JSON.stringify(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================>"); + console.info('=========ANS_Cancel_0900 onCancel end================>'); } function cancelCallBackCancel(err){ - console.info("===========ANS_Cancel_0900 cancelCallBack start================>"); - console.info("===========ANS_Cancel_0900 cancelCallBack err:=================>" + JSON.stringify(err)); - console.info("===========ANS_Cancel_0900 cancelCallBack 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==================>'); } /* @@ -662,20 +662,20 @@ describe('ActsAnsNotificationCancel', function () { the cancel(id: number, callback: AsyncCallback): void; interface */ it('ANS_Cancel_0900', 0, async function (done) { - console.info("===============ANS_Cancel_0900 start==========================>"); + console.info('===============ANS_Cancel_0900 start==========================>'); let subscriber ={ onConsume:onConsumeCancel, onCancel:onCancelCancel, } await notify.subscribe(subscriber); - console.info("==================ANS_Cancel_0900 subscribe promise==================>"); + console.info('==================ANS_Cancel_0900 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 9, @@ -693,40 +693,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==================ANS_Cancel_0900 publish promise==================>"); + console.info('==================ANS_Cancel_0900 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_0900 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_0900 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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("========ANS_Cancel_1000 onConsume cancel==========>"); - console.info("========ANS_Cancel_1000 onConsume end============>"); + console.info('========ANS_Cancel_1000 onConsume cancel==========>'); + console.info('========ANS_Cancel_1000 onConsume end============>'); } function onCancelCancelWrongId(data) { - console.info("================ANS_Cancel_1000 onCancel start=============>"); - console.info("================ANS_Cancel_1000 onCancel data:=============>" + JSON.stringify(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===============>"); + console.info('================ANS_Cancel_1000 onCancel end===============>'); } function cancelCallBackCancelWrongId(err){ - console.info("==============ANS_Cancel_1000 cancelCallBack start===============>"); - console.info("==============ANS_Cancel_1000 cancelCallBack err:================>" + JSON.stringify(err)); + 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=================>"); + console.info('==============ANS_Cancel_1000 cancelCallBack end=================>'); } /* @@ -736,20 +736,20 @@ describe('ActsAnsNotificationCancel', function () { interface is called, when the id is wrong, no notification information is cancelled at this time */ it('ANS_Cancel_1000', 0, async function (done) { - console.info("===============ANS_Cancel_1000 start==========================>"); + console.info('===============ANS_Cancel_1000 start==========================>'); let subscriber ={ onConsume:onConsumeCancelWrongId, onCancel:onCancelCancelWrongId, } await notify.subscribe(subscriber); - console.info("================ANS_Cancel_1000 subscribe promise==================>"); + console.info('================ANS_Cancel_1000 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 10, @@ -767,41 +767,41 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1000", + label: '1000', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("===========ANS_Cancel_1000 publish promise==================>"); + console.info('===========ANS_Cancel_1000 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1000 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1000 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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("============ANS_Cancel_1100 onConsume cancel=======================>"); - console.info("============ANS_Cancel_1100 onConsume end=======================>"); + console.info('============ANS_Cancel_1100 onConsume cancel=======================>'); + console.info('============ANS_Cancel_1100 onConsume 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); + 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=======================>"); + console.info('============ANS_Cancel_1100 onCancel end=======================>'); } function cancelCallBackCancelIsUnremovable(err){ - console.info("============ANS_Cancel_1100 cancelCallBack start=================>"); - console.info("============ANS_Cancel_1100 cancelCallBack err:==================>" + JSON.stringify(err)); - console.info("============ANS_Cancel_1100 cancelCallBack 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===================>'); } /* @@ -811,20 +811,20 @@ describe('ActsAnsNotificationCancel', function () { being true by calling the cancel(id: number, callback: AsyncCallback): void interface */ it('ANS_Cancel_1100', 0, async function (done) { - console.info("===============ANS_Cancel_1100 start==========================>"); + console.info('===============ANS_Cancel_1100 start==========================>'); let subscriber ={ onConsume:onConsumeCancelIsUnremovable, onCancel:onCancelCancelIsUnremovable, } await notify.subscribe(subscriber); - console.info("===============ANS_Cancel_1100 subscribe promise=============>"); + console.info('===============ANS_Cancel_1100 subscribe promise=============>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 11, @@ -842,57 +842,57 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("============ANS_Cancel_1100 publish promise===========>"); + console.info('============ANS_Cancel_1100 publish promise===========>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1100 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1100 setTimeout unsubscribe end==================>'); done(); }),timeout); }) let id1200 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); + 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("=========ANS_Cancel_1200 onConsume cancel====================>"); - console.info("=========ANS_Cancel_1200 onConsume end=======================>"); + console.info('=========ANS_Cancel_1200 onConsume cancel====================>'); + console.info('=========ANS_Cancel_1200 onConsume end=======================>'); } function onCancelCancel2Times(data) { timesOfOnCancel = timesOfOnCancel + 1 - 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); + 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); - console.info("=========ANS_Cancel_1200 onCancel id:======================>" + data.request.id); + console.info('=========ANS_Cancel_1200 onCancel id:======================>' + data.request.id); notify.cancel(id1200, cancelCallBackCancel2Times2); - console.info("=========ANS_Cancel_1200 onCancel cancelCallBack_cancel 2Times2===========>"); + console.info('=========ANS_Cancel_1200 onCancel cancelCallBack_cancel 2Times2===========>'); }else if(timesOfOnCancel == 2) { expect().assertFail(); } - console.info("=========ANS_Cancel_1200 onCancel end=======================>"); + console.info('=========ANS_Cancel_1200 onCancel end=======================>'); } function cancelCallBackCancel2Times1(err){ - console.info("===========ANS_Cancel_1200 cancelCallBack1 start================>"); - console.info("===========ANS_Cancel_1200 cancelCallBack1 err:=================>" + JSON.stringify(err)); - console.info("===========ANS_Cancel_1200 cancelCallBack1 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("===========ANS_Cancel_1200 cancelCallBack2 start===========>"); - console.info("===========ANS_Cancel_1200 cancelCallBack2 err:============>" + JSON.stringify(err)); + console.info('===========ANS_Cancel_1200 cancelCallBack2 start===========>'); + console.info('===========ANS_Cancel_1200 cancelCallBack2 err:============>' + JSON.stringify(err)); expect(err.code != 0).assertEqual(true); - console.info("===========ANS_Cancel_1200 cancelCallBack2 end============>"); + console.info('===========ANS_Cancel_1200 cancelCallBack2 end============>'); } /* @@ -902,21 +902,21 @@ 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 let subscriber ={ onConsume:onConsumeCancel2Times, onCancel:onCancelCancel2Times, } await notify.subscribe(subscriber); - console.info("=============ANS_Cancel_1200 subscribe promise==================>"); + console.info('=============ANS_Cancel_1200 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 12, @@ -934,42 +934,42 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("========ANS_Cancel_1200 publish promise=================>"); + console.info('========ANS_Cancel_1200 publish promise=================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1200 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1200 setTimeout unsubscribe end==================>'); done(); }),1500); }) 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); + 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("============ANS_Cancel_1300 onConsume cance=============>"); - console.info("============ANS_Cancel_1300 onConsume 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)); + 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==============>"); + 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("=========ANS_Cancel_1300 cancelCallBack start====================>"); - console.info("=========ANS_Cancel_1300 cancelCallBack err:=====================>" + JSON.stringify(err)); - console.info("=========ANS_Cancel_1300 cancelCallBack 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=====================>'); } /* @@ -980,20 +980,20 @@ describe('ActsAnsNotificationCancel', function () { */ let subscriber it('ANS_Cancel_1300', 0, async function (done) { - console.info("===============ANS_Cancel_1300 start==========================>"); + console.info('===============ANS_Cancel_1300 start==========================>'); subscriber ={ onConsume:onConsumeCancelLabel, onCancel:onCancelCancelLabel, } await notify.subscribe(subscriber); - console.info("================ANS_Cancel_1300 subscribe promise==============>"); + console.info('================ANS_Cancel_1300 subscribe promise==============>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 13, @@ -1011,38 +1011,38 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1300", + label: '1300', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("===========ANS_Cancel_1300 publish promise==================>"); + console.info('===========ANS_Cancel_1300 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1300 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1300 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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("==========ANS_Cancel_1400 onConsume cancel==========>"); - console.info("==========ANS_Cancel_1400 onConsume 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)); + 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==============>"); + 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==============>'); } /* @@ -1052,20 +1052,20 @@ describe('ActsAnsNotificationCancel', function () { cancel(id: number, label?: string): Promise interface */ it('ANS_Cancel_1400', 0, async function (done) { - console.info("===============ANS_Cancel_1400 start==========================>"); + console.info('===============ANS_Cancel_1400 start==========================>'); subscriber ={ onConsume:onConsumeCancelLabelPromise, onCancel:onCancelCancelLabelPromise, } await notify.subscribe(subscriber); - console.info("==========ANS_Cancel_1400 subscribe promise==================>"); + console.info('==========ANS_Cancel_1400 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 14, @@ -1083,43 +1083,43 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1400", + label: '1400', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("===============ANS_Cancel_1400 publish promise==============>"); + console.info('===============ANS_Cancel_1400 publish promise==============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1400 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1400 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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("========ANS_Cancel_1500 onConsume cancel====================>"); - console.info("========ANS_Cancel_1500 onConsume 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)); + 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=======================>"); + 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("========ANS_Cancel_1500 cancelCallBack start=========>"); - console.info("========ANS_Cancel_1500 cancelCallBack err:==========>" + JSON.stringify(err)); - console.info("========ANS_Cancel_1500 cancelCallBack 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===========>'); } /* @@ -1129,20 +1129,20 @@ describe('ActsAnsNotificationCancel', function () { successfully by calling the cancel(id: number, label: string, callback: AsyncCallback): void interface */ it('ANS_Cancel_1500', 0, async function (done) { - console.info("===============ANS_Cancel_1500 start==========================>"); + console.info('===============ANS_Cancel_1500 start==========================>'); let subscriber ={ onConsume:onConsumeCancelLabelIsUnremoveable, onCancel:onCancelCancelLabelIsUnremoveable, } await notify.subscribe(subscriber); - console.info("=======ANS_Cancel_1500 subscribe promise==================>"); + console.info('=======ANS_Cancel_1500 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 15, @@ -1160,38 +1160,38 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1500", + label: '1500', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("===========ANS_Cancel_1500 publish promise=============>"); + console.info('===========ANS_Cancel_1500 publish promise=============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1500 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1500 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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("============ANS_Cancel_1600 onConsume cancel end==========>"); - console.info("============ANS_Cancel_1600 onConsume 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)); + 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===================>"); + 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===================>'); } /* @@ -1201,20 +1201,20 @@ describe('ActsAnsNotificationCancel', function () { is canceled successfully by calling the cancel(id: number, label?: string): Promise interface */ it('ANS_Cancel_1600', 0, async function (done) { - console.info("===============ANS_Cancel_1600 start==========================>"); + console.info('===============ANS_Cancel_1600 start==========================>'); let subscriber ={ onConsume:onConsumeCancelLabelIsUnremoveablePromise, onCancel:onCancelCancelLabelIsUnremoveablePromise, } await notify.subscribe(subscriber); - console.info("==============ANS_Cancel_1600 subscribe promise==================>"); + console.info('==============ANS_Cancel_1600 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 16, @@ -1232,40 +1232,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1600", + label: '1600', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==============ANS_Cancel_1600 publish promise==================>"); + console.info('==============ANS_Cancel_1600 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1600 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1600 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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("================ANS_Cancel_1700 onConsume cancel=======================>"); - console.info("================ANS_Cancel_1700 onConsume end=======================>"); + 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('================ANS_Cancel_1700 onConsume cancel=======================>'); + console.info('================ANS_Cancel_1700 onConsume end=======================>'); } function onCancelCancelWrongLabel(data) { - console.info("================ANS_Cancel_1700 onCancel start===============>"); - console.info("================ANS_Cancel_1700 onCancel data:===============>" + JSON.stringify(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=================>"); + console.info('================ANS_Cancel_1700 onCancel end=================>'); } function cancelCallBackCancelWrongLabel(err){ - console.info("================ANS_Cancel_1700 cancelCallBack start=================>"); - console.info("================ANS_Cancel_1700 cancelCallBack err:==================>" + JSON.stringify(err)); + 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===================>"); + console.info('================ANS_Cancel_1700 cancelCallBack end===================>'); } /* @@ -1275,20 +1275,20 @@ describe('ActsAnsNotificationCancel', function () { interface is called, the label is wrong and the ID is correct. */ it('ANS_Cancel_1700', 0, async function (done) { - console.info("===============ANS_Cancel_1700 start==========================>"); + console.info('===============ANS_Cancel_1700 start==========================>'); let subscriber ={ onConsume:onConsumeCancelWrongLabel, onCancel:onCancelCancelWrongLabel, } await notify.subscribe(subscriber); - console.info("==============ANS_Cancel_1700 subscribe promise==================>"); + console.info('==============ANS_Cancel_1700 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 17, @@ -1306,39 +1306,39 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1700", + label: '1700', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==============ANS_Cancel_1700 publish promise==================>"); + console.info('==============ANS_Cancel_1700 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1700 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1700 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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").then(()=>{ - console.info("=========ANS_Cancel_1800 onConsume cancel then======>"); + 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').then(()=>{ + console.info('=========ANS_Cancel_1800 onConsume cancel then======>'); }).catch((err)=>{ - console.info("=========ANS_Cancel_1800 onConsume cancel catch err======>"+JSON.stringify(err)); + console.info('=========ANS_Cancel_1800 onConsume cancel catch err======>'+JSON.stringify(err)); expect(err.code != 0).assertEqual(true); }); - console.info("=========ANS_Cancel_1800 onConsume end=======================>"); + console.info('=========ANS_Cancel_1800 onConsume end=======================>'); } function onCancelCancelWrongLabelPromise(data) { - console.info("=========ANS_Cancel_1800 onCancel start=======================>"); - console.info("=========ANS_Cancel_1800 onCancel data : =======================>" + JSON.stringify(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=======================>"); + console.info('=========ANS_Cancel_1800 onCancel end=======================>'); } /* @@ -1348,20 +1348,20 @@ describe('ActsAnsNotificationCancel', function () { the label is wrong and the ID is correct. */ it('ANS_Cancel_1800', 0, async function (done) { - console.info("===============ANS_Cancel_1800 start==========================>"); + console.info('===============ANS_Cancel_1800 start==========================>'); let subscriber ={ onConsume:onConsumeCancelWrongLabelPromise, onCancel:onCancelCancelWrongLabelPromise, } await notify.subscribe(subscriber); - console.info("==============ANS_Cancel_1800 subscribe promise==================>"); + console.info('==============ANS_Cancel_1800 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 18, @@ -1379,41 +1379,41 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1800", + label: '1800', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==============ANS_Cancel_1800 publish promise==================>"); + console.info('==============ANS_Cancel_1800 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1800 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1800 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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("===========ANS_Cancel_1900 onConsume cancel=======================>"); - console.info("===========ANS_Cancel_1900 onConsume end=======================>"); + 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('===========ANS_Cancel_1900 onConsume cancel=======================>'); + console.info('===========ANS_Cancel_1900 onConsume end=======================>'); } function onCancelCancelLabelNullCharacter(data) { - console.info("===========ANS_Cancel_1900 onCancel start================>"); - console.info("===========ANS_Cancel_1900 onCancel data:================>" + JSON.stringify(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=======================>"); + console.info('===========ANS_Cancel_1900 onCancel end=======================>'); } function cancelCallBackCancelNullCharacter(err){ - console.info("===========ANS_Cancel_1900 cancelCallBack start=================>"); - console.info("===========ANS_Cancel_1900 cancelCallBack err:==================>" + JSON.stringify(err)); + 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===================>"); + console.info('===========ANS_Cancel_1900 cancelCallBack end===================>'); } /* @@ -1423,20 +1423,20 @@ describe('ActsAnsNotificationCancel', function () { interface is called, and the label uses empty characters */ it('ANS_Cancel_1900', 0, async function (done) { - console.info("===============ANS_Cancel_1900 start==========================>"); + console.info('===============ANS_Cancel_1900 start==========================>'); let subscriber ={ onConsume:onConsumeCancelLabelNullCharacter, onCancel:onCancelCancelLabelNullCharacter, } await notify.subscribe(subscriber); - console.info("=============ANS_Cancel_1900 subscribe promise==================>"); + console.info('=============ANS_Cancel_1900 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 19, @@ -1454,40 +1454,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "1900", + label: '1900', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==========ANS_Cancel_1900 publish promise==============>"); + console.info('==========ANS_Cancel_1900 publish promise==============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_1900 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_1900 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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, "").then(()=>{ - console.info("=========ANS_Cancel_2000 onConsume cancel then======>"); + 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, '').then(()=>{ + console.info('=========ANS_Cancel_2000 onConsume cancel then======>'); }).catch((err)=>{ - console.info("=========ANS_Cancel_2000 onConsume cancel catch err======>"+JSON.stringify(err)); + console.info('=========ANS_Cancel_2000 onConsume cancel catch err======>'+JSON.stringify(err)); expect(err.code != 0).assertEqual(true); }); - console.info("==========ANS_Cancel_2000 onConsume cancel end==========>"); - console.info("==========ANS_Cancel_2000 onConsume end=================>"); + console.info('==========ANS_Cancel_2000 onConsume cancel end==========>'); + console.info('==========ANS_Cancel_2000 onConsume end=================>'); } function onCancelCancelNullCharacter(data) { - console.info("==========ANS_Cancel_2000 onCancel start====================>"); - console.info("==========ANS_Cancel_2000 onCancel data:======================>" + JSON.stringify(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=======================>"); + console.info('==========ANS_Cancel_2000 onCancel end=======================>'); } /* @@ -1497,20 +1497,20 @@ describe('ActsAnsNotificationCancel', function () { and the label uses empty characters */ it('ANS_Cancel_2000', 0, async function (done) { - console.info("===============ANS_Cancel_2000 start==========================>"); + console.info('===============ANS_Cancel_2000 start==========================>'); let subscriber ={ onConsume:onConsumeCancelNullCharacter, onCancel:onCancelCancelNullCharacter, } await notify.subscribe(subscriber); - console.info("=========ANS_Cancel_2000 subscribe promise==================>"); + console.info('=========ANS_Cancel_2000 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 20, @@ -1528,17 +1528,17 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2000", + label: '2000', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("============ANS_Cancel_2000 publish promise===============>"); + console.info('============ANS_Cancel_2000 publish promise===============>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2000 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2000 setTimeout unsubscribe end==================>'); done(); }),timeout); }) @@ -1546,41 +1546,41 @@ describe('ActsAnsNotificationCancel', function () { let id2100 let label2100 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); + 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("=========ANS_Cancel_2100 onConsume cancel=======================>"); - console.info("=========ANS_Cancel_2100 onConsume end=======================>"); + console.info('=========ANS_Cancel_2100 onConsume cancel=======================>'); + console.info('=========ANS_Cancel_2100 onConsume end=======================>'); } function onCancelCancelLabel2Times(data) { timesOfOnCancel = timesOfOnCancel + 1 - console.info("=========ANS_Cancel_2100 onCancel start==========>"); - console.info("=========ANS_Cancel_2100 onCancel data===========>" + JSON.stringify(data)); + 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.label).assertEqual('2100'); }else if(timesOfOnCancel == 2){ expect().assertFail(); } - console.info("=========ANS_Cancel_2100 onCancel end==========>"); + console.info('=========ANS_Cancel_2100 onCancel end==========>'); } function cancelCallBackCancelLabel2Times1(err){ - console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 start============>"); - console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 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("=========ANS_Cancel_2100 cancelCallBack 2Times1 cancel =======================>"); - console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 end=======================>"); + console.info('=========ANS_Cancel_2100 cancelCallBack 2Times1 cancel =======================>'); + console.info('=========ANS_Cancel_2100 cancelCallBack 2Times1 end=======================>'); } function cancelCallBackCancelLabel2Times2(err){ - console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 start================>"); - console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 err:=================>" + JSON.stringify(err)); + 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==================>"); + console.info('=========ANS_Cancel_2100 cancelCallBack 2Times2 end==================>'); } /* @@ -1590,21 +1590,21 @@ describe('ActsAnsNotificationCancel', function () { interface is called twice in a row */ it('ANS_Cancel_2100', 0, async function (done) { - console.info("===============ANS_Cancel_2100 start==========================>"); + console.info('===============ANS_Cancel_2100 start==========================>'); timesOfOnCancel = 0 let subscriber ={ onConsume:onConsumeCancelLabel2Times, onCancel:onCancelCancelLabel2Times, } await notify.subscribe(subscriber); - console.info("=============ANS_Cancel_2100 subscribe promise==================>"); + console.info('=============ANS_Cancel_2100 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 21, @@ -1622,17 +1622,17 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2100", + label: '2100', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("=============ANS_Cancel_2100 publish promise================>"); + console.info('=============ANS_Cancel_2100 publish promise================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2100 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2100 setTimeout unsubscribe end==================>'); done(); }),timeout); }) @@ -1640,34 +1640,34 @@ describe('ActsAnsNotificationCancel', function () { let id2200 let label2200 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); + 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("===========ANS_Cancel_2200 onConsume cancel1==========>"); + console.info('===========ANS_Cancel_2200 onConsume cancel1==========>'); notify.cancel(id2200, label2200).then(()=>{ - console.info("=========ANS_Cancel_2200 onConsume cancel2 then======>"); + console.info('=========ANS_Cancel_2200 onConsume cancel2 then======>'); }).catch((err)=>{ - console.info("=========ANS_Cancel_2200 onConsume cancel2 catch err======>"+JSON.stringify(err)); + console.info('=========ANS_Cancel_2200 onConsume cancel2 catch err======>'+JSON.stringify(err)); expect(err.code != 0).assertEqual(true); }); - console.info("===========ANS_Cancel_2200 onConsume cancel2==========>"); - console.info("===========ANS_Cancel_2200 onConsume end==============>"); + console.info('===========ANS_Cancel_2200 onConsume cancel2==========>'); + console.info('===========ANS_Cancel_2200 onConsume end==============>'); } function onCancelCancelLabelPromise2Times(data) { - console.info("===========ANS_Cancel_2200 onCancel start===================>"); - console.info("===========ANS_Cancel_2200 onCancel data:===================>" + JSON.stringify(data)); + console.info('===========ANS_Cancel_2200 onCancel start===================>'); + console.info('===========ANS_Cancel_2200 onCancel data:===================>' + JSON.stringify(data)); timesOfOnCancel = timesOfOnCancel + 1 if (timesOfOnCancel == 1){ expect(data.request.id).assertEqual(22); - expect(data.request.label).assertEqual("2200"); + expect(data.request.label).assertEqual('2200'); }else if (timesOfOnCancel == 2){ expect().assertFail(); } - console.info("===========ANS_Cancel_2200 onCancel end=======================>"); + console.info('===========ANS_Cancel_2200 onCancel end=======================>'); } /* @@ -1677,21 +1677,21 @@ describe('ActsAnsNotificationCancel', function () { interface is called twice in a row */ it('ANS_Cancel_2200', 0, async function (done) { - console.info("===============ANS_Cancel_2200 start==========================>"); + console.info('===============ANS_Cancel_2200 start==========================>'); timesOfOnCancel = 0 let subscriber ={ onConsume:onConsumeCancelLabelPromise2Times, onCancel:onCancelCancelLabelPromise2Times, } await notify.subscribe(subscriber); - console.info("================ANS_Cancel_2200 subscribe_2200_promise=============>"); + console.info('================ANS_Cancel_2200 subscribe_2200_promise=============>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 22, @@ -1709,41 +1709,41 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2200", + label: '2200', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("================ANS_Cancel_2200 publish promise==================>"); + console.info('================ANS_Cancel_2200 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2200 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2200 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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("============ANS_Cancel_2300 onConsume cancel=======================>"); - console.info("============ANS_Cancel_2300 onConsume end=======================>"); + console.info('============ANS_Cancel_2300 onConsume cancel=======================>'); + console.info('============ANS_Cancel_2300 onConsume end=======================>'); } function onCancelCancelRightLabelWrongId(data) { - console.info("============ANS_Cancel_2300 onCancel start=======================>"); - console.info("============ANS_Cancel_2300 onCancel data:=======================>" + JSON.stringify(data)); + console.info('============ANS_Cancel_2300 onCancel start=======================>'); + console.info('============ANS_Cancel_2300 onCancel data:=======================>' + JSON.stringify(data)); expect().assertFail(); - console.info("============ANS_Cancel_2300 onCancel end=======================>"); + console.info('============ANS_Cancel_2300 onCancel end=======================>'); } function cancelCallBackCancelRightLabelWrongId(err){ - console.info("============ANS_Cancel_2300 cancelCallBack start=======================>"); - console.info("============ANS_Cancel_2300 cancelCallBack err:===============>" + JSON.stringify(err)); + 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===================>"); + console.info('============ANS_Cancel_2300 cancelCallBack end===================>'); } /* @@ -1753,20 +1753,20 @@ describe('ActsAnsNotificationCancel', function () { 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==========================>"); + console.info('===============ANS_Cancel_2300 start==========================>'); let subscriber ={ onConsume:onConsumeCancelRightLabelWrongId, onCancel:onCancelCancelRightLabelWrongId, } await notify.subscribe(subscriber); - console.info("================ANS_Cancel_2300 promise==================>"); + console.info('================ANS_Cancel_2300 promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 23, @@ -1784,40 +1784,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2300", + label: '2300', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("============ANS_Cancel_2300 publish promise==================>"); + console.info('============ANS_Cancel_2300 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2300 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2300 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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); + 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).then(()=>{ - console.info("=========ANS_Cancel_2400 onConsume cancel then======>"); + console.info('=========ANS_Cancel_2400 onConsume cancel then======>'); }).catch((err)=>{ - console.info("=========ANS_Cancel_2400 onConsume cancel catch err======>"+JSON.stringify(err)); + console.info('=========ANS_Cancel_2400 onConsume cancel catch err======>'+JSON.stringify(err)); expect(err.code != 0).assertEqual(true); }); - console.info("============ANS_Cancel_2400 onConsume cancel==========>"); - console.info("============ANS_Cancel_2400 onConsume 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)); + 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=======================>"); + console.info('============ANS_Cancel_2400 onCancel end=======================>'); } /* @@ -1827,20 +1827,20 @@ describe('ActsAnsNotificationCancel', function () { interface is called, the label is correct and the ID is correct wrong. */ it('ANS_Cancel_2400', 0, async function (done) { - console.info("===============ANS_Cancel_2400 start==========================>"); + console.info('===============ANS_Cancel_2400 start==========================>'); let subscriber ={ onConsume:onConsumeCancelRightLabelWrongIdPromise, onCancel:onCancelCancelRightLabelWrongIdPromise, } await notify.subscribe(subscriber); - console.info("============ANS_Cancel_2400 subscribe promise========>"); + console.info('============ANS_Cancel_2400 subscribe promise========>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 24, @@ -1858,41 +1858,41 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2400", + label: '2400', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("============ANS_Cancel_2400 publish promise==================>"); + console.info('============ANS_Cancel_2400 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2400 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2400 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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("==========ANS_Cancel_2500 onConsume cancel====================>"); - console.info("==========ANS_Cancel_2500 onConsume end=======================>"); + 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('==========ANS_Cancel_2500 onConsume cancel====================>'); + console.info('==========ANS_Cancel_2500 onConsume end=======================>'); } function onCancelCancelWrongLabelWrongId(data) { - console.info("==========ANS_Cancel_2500 onCancel start====================>"); - console.info("==========ANS_Cancel_2500 onCancel data:====================>" + JSON.stringify(data)); + console.info('==========ANS_Cancel_2500 onCancel start====================>'); + console.info('==========ANS_Cancel_2500 onCancel data:====================>' + JSON.stringify(data)); expect().assertFail(); - console.info("==========ANS_Cancel_2500 onCancel end======================>"); + console.info('==========ANS_Cancel_2500 onCancel end======================>'); } function cancelCallBackCancelWrongLabelWrongId(err){ - console.info("==========ANS_Cancel_2500 cancelCallBack start=======================>"); - console.info("==========ANS_Cancel_2500 cancelCallBack err:================>" + JSON.stringify(err)); + 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=======================>"); + console.info('==========ANS_Cancel_2500 cancelCallBack end=======================>'); } /* @@ -1902,20 +1902,20 @@ describe('ActsAnsNotificationCancel', function () {  interface is called, the label is correct and the ID is correct wrong. */ it('ANS_Cancel_2500', 0, async function (done) { - console.info("===============ANS_Cancel_2500 start==========================>"); + console.info('===============ANS_Cancel_2500 start==========================>'); let subscriber ={ onConsume:onConsumeCancelWrongLabelWrongId, onCancel:onCancelCancelWrongLabelWrongId, } await notify.subscribe(subscriber); - console.info("================ANS_Cancel_2500 subscribe promise==================>"); + console.info('================ANS_Cancel_2500 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 25, @@ -1933,40 +1933,40 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2500", + label: '2500', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("==========ANS_Cancel_2500 publish promise==================>"); + console.info('==========ANS_Cancel_2500 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2500 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2500 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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").then(()=>{ - console.info("=========ANS_Cancel_2600 onConsume cancel then======>"); + 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').then(()=>{ + console.info('=========ANS_Cancel_2600 onConsume cancel then======>'); }).catch((err)=>{ - console.info("=========ANS_Cancel_2600 onConsume cancel catch err======>"+JSON.stringify(err)); + console.info('=========ANS_Cancel_2600 onConsume cancel catch err======>'+JSON.stringify(err)); expect(err.code != 0).assertEqual(true); }); - console.info("========ANS_Cancel_2600 onConsume end================>"); - console.info("========ANS_Cancel_2600 onConsume end================>"); + console.info('========ANS_Cancel_2600 onConsume end================>'); + console.info('========ANS_Cancel_2600 onConsume end================>'); } function onCancelCancelWrongLabelWrongIdPromise(data) { - console.info("========ANS_Cancel_2600 onCancel start=======================>"); - console.info("========ANS_Cancel_2600 onCancel data:=======================>" + JSON.stringify(data)); + console.info('========ANS_Cancel_2600 onCancel start=======================>'); + console.info('========ANS_Cancel_2600 onCancel data:=======================>' + JSON.stringify(data)); expect().assertFail(); - console.info("========ANS_Cancel_2600 onCancel end=======================>"); + console.info('========ANS_Cancel_2600 onCancel end=======================>'); } /* @@ -1976,20 +1976,20 @@ describe('ActsAnsNotificationCancel', function () {  the label is wrong and the ID is wrong. */ it('ANS_Cancel_2600', 0, async function (done) { - console.info("===============ANS_Cancel_2600 start==========================>"); + console.info('===============ANS_Cancel_2600 start==========================>'); let subscriber ={ onConsume:onConsumeCancelWrongLabelWrongIdPromise, onCancel:onCancelCancelWrongLabelWrongIdPromise, } await notify.subscribe(subscriber); - console.info("===============ANS_Cancel_2600 subscribe promise==================>"); + console.info('===============ANS_Cancel_2600 subscribe promise==================>'); let notificationRequest = { content:{ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' }, }, id: 26, @@ -2007,17 +2007,58 @@ describe('ActsAnsNotificationCancel', function () { progressValue: 12, progressMaxValue: 100, isIndeterminate: true, - statusBarText: "statusBarText", + statusBarText: 'statusBarText', isFloatingIcon : true, - label: "2600", + label: '2600', badgeIconStyle: 1, showDeliveryTime: true, } await notify.publish(notificationRequest); - console.info("===============ANS_Cancel_2600 publish promise==================>"); + console.info('===============ANS_Cancel_2600 publish promise==================>'); setTimeout((async function(){ await notify.unsubscribe(subscriber); - console.info("======ANS_Cancel_2600 setTimeout unsubscribe end==================>"); + console.info('======ANS_Cancel_2600 setTimeout unsubscribe end==================>'); + done(); + }),timeout); + }) + + /* + * @tc.number: ANS_Cancel_2700 + * @tc.name: cancel(id: number, label?: string): Promise + * @tc.desc: add + */ + it('ANS_Cancel_2700', 0, async function (done) { + console.info('===============ANS_Cancel_2700 start==========================>'); + let subscriber ={ + onConsume:onConsumeCancelWrongLabelWrongIdPromise, + onCancel:onCancelCancelWrongLabelWrongIdPromise, + } + await notify.subscribe(subscriber); + console.info('===============ANS_Cancel_2700 subscribe promise==================>'); + let notificationRequest = { + content:{ + contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText' + }, + }, + extraInfo:{ + key1: "1231", + key2:"456" + }, + template:{ + name:'/system/etc/notification_template/assets/js/downloadTemplate.js', + data:{key3:"789",key4:"111"} + }, + badgeNumber:1, + } + await notify.publish(notificationRequest); + console.info('===============ANS_Cancel_2700 publish promise==================>'); + setTimeout((async function(){ + await notify.unsubscribe(subscriber); + console.info('======ANS_Cancel_2700 setTimeout unsubscribe end==================>'); done(); }),timeout); }) 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 22e1d5bda1455edbac16e6f80992f137ffe75553..9d3c5fc14d004b5cf73f9c95349e49bc3dd8fbb9 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 @@ -359,6 +359,41 @@ describe('ActsAnsSlotByBundle', function () { }) }) + /* + * @tc.number : ActsAnsGetSlotsByBundle_1100 + * @tc.name : Verify getSlot OTHER_TYPES + * @tc.desc : After adding slottype to OTHER_TYPES's slot, + * call getsbybundle for information.(callback) + */ + it('ActsAnsGetSlotsByBundle_1100', 0, async function (done) { + console.debug("====>ActsAnsGetSlotsByBundle_1100 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_1100====>" + 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].enabled).assertEqual(true) + 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 @@ -1534,8 +1569,8 @@ describe('ActsAnsSlotByBundle', function () { console.debug("====>setSlotsByBundle1====>") console.debug("====>getSlotsByBundle1.1 start====>"); notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_2100.1====>" + JSON.stringify(data)); - expect(data).assertEqual(0) + console.debug("====>ActsAnsSetSlotByBundle_2100====>" + JSON.stringify(data)); + expect(typeof(data)).assertEqual("object") console.debug("====>getSlotsByBundle1.1 finish====>"); done(); }) @@ -1555,15 +1590,16 @@ describe('ActsAnsSlotByBundle', function () { } var notificationslot = { type: notification.SlotType.OTHER_TYPES, - level: 4 + 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).assertEqual(0) + console.debug("====>ActsAnsSetSlotByBundle_2200====>" + JSON.stringify(data)); + expect(typeof(data)).assertEqual("object") console.debug("====>getSlotsByBundle1.1 finish====>"); done(); }) diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/entry/src/main/js/test/actsansdistributedtest.js b/notification/ans_standard/publish_test/actsansdistributedtest/entry/src/main/js/test/actsansdistributedtest.js index c8a36c4cfce408da6a7b9ba9bce99469fb205955..c52b337cb0d9566863e15a0409ca85bad5a8171b 100644 --- a/notification/ans_standard/publish_test/actsansdistributedtest/entry/src/main/js/test/actsansdistributedtest.js +++ b/notification/ans_standard/publish_test/actsansdistributedtest/entry/src/main/js/test/actsansdistributedtest.js @@ -80,10 +80,10 @@ describe('ActsAnsDistributeTest', function () { it('ActsDistribute_test_0400', 0, async function (done) { function onConsume0100(data) { console.info("========ActsDistribute_test_0400 onConsume data:=======>" + JSON.stringify(data)); - if (data.request.distributedOption.remindType != notify.DeviceRemindType.IDLE_DONOT_REMIND - && data.request.distributedOption.remindType != notify.DeviceRemindType.IDLE_REMIND - && data.request.distributedOption.remindType != notify.DeviceRemindType.ACTIVE_DONOT_REMIND - && data.request.distributedOption.remindType != notify.DeviceRemindType.ACTIVE_REMIND ) + if (data.request.distributedOptions.remindType != notify.DeviceRemindType.IDLE_DONOT_REMIND + && data.request.distributedOptions.remindType != notify.DeviceRemindType.IDLE_REMIND + && data.request.distributedOptions.remindType != notify.DeviceRemindType.ACTIVE_DONOT_REMIND + && data.request.distributedOptions.remindType != notify.DeviceRemindType.ACTIVE_REMIND ) { expect().assertFail(); } @@ -110,7 +110,7 @@ describe('ActsAnsDistributeTest', function () { id: 4, label: "ANS_PublishBasicText_0100", slotType : notify.SlotType.CONTENT_INFORMATION, - distributedOption:{isDistributed: true, supportDisplayDevices: ["0"], supportOperateDevices: ["0"]} + distributedOptions:{isDistributed: true, supportDisplayDevices: ["0"], supportOperateDevices: ["0"]} } await notify.publish(notificationRequest); console.info("===========ActsDistribute_test_0400 publish promise========>"); @@ -158,6 +158,46 @@ describe('ActsAnsDistributeTest', function () { done(); }),timeout); }) + + /* + * @tc.number: ActsDistribute_test_0600 + * @tc.name: Query whether the template exists + * @tc.desc: isSupportTemplate(templateName: string, callback: AsyncCallback): void + */ + it('ActsDistribute_test_0600', 0, async function (done) { + console.info("==>ActsDistribute_test_0600 start==>"); + var templateName = '/system/etc/notification_template/assets/js/downloadTemplate.js'; + function isSupportTemplateCallback(err, data) { + if(err) { + console.error("isSupportTemplateCallback" + err.code); + } else { + expect(true).assertTrue(); + console.info("isSupportTemplateCallback" + JSON.stringify(data)); + done(); + } + } + notify.isSupportTemplate(templateName, isSupportTemplateCallback); + done(); + }) + + /* + * @tc.number: ActsDistribute_test_0700 + * @tc.name: Query whether the template exists + * @tc.desc: isSupportTemplate(templateName: string): Promise + */ + it('ActsDistribute_test_0700', 0, async function (done) { + console.info("==>ActsDistribute_test_0700 start==>"); + var templateName = '/system/etc/notification_template/assets/js/downloadTemplate.js'; + notify.isSupportTemplate(templateName).then ((data) => { + expect(data).assertEqual(false); + console.info("isSupportTemplatePromise"); + console.info("==>ActsDistribute_test_0700 success==>" + JSON.stringify(data)); + done(); + }) + done(); + }) + + }) 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 f6aecc6b84117d244050b0567ed7575d49a135ff..5ceba3b2fe13869a2a108f013390928deb474da8 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 @@ -311,5 +311,354 @@ describe('ActsAnsWantAgentOneTest', function () { ); console.info('----getWantAgent after----'); }) + + /* + * @tc.number: ACTS_SetWant_0600 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_ELEMENT] + */ + it('ACTS_SetWant_0600', 0, async function (done) { + console.info('----ACTS_SetWant_0600 start----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.example.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: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_ELEMENT] + } + 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"); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + console.info('----getWantAgent after----'); + }) + + /* + * @tc.number: ACTS_SetWant_0700 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_ACTION] + */ + it('ACTS_SetWant_0700', 0, async function (done) { + console.info('----ACTS_SetWant_0700 start----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.example.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: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_ACTION] + } + 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"); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + console.info('----getWantAgent after----'); + }) + + + /* + * @tc.number: ACTS_SetWant_0800 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_URI] + */ + it('ACTS_SetWant_0800', 0, async function (done) { + console.info('----ACTS_SetWant_0800 start----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.example.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: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_URI] + } + 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"); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + console.info('----getWantAgent after----'); + }) + + /* + * @tc.number: ACTS_SetWant_0900 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_ENTITIES] + */ + it('ACTS_SetWant_0900', 0, async function (done) { + console.info('----ACTS_SetWant_0900 start----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.example.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: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_ENTITIES] + } + 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"); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + console.info('----getWantAgent after----'); + }) + + /* + * @tc.number: ACTS_SetWant_1000 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_BUNDLE] + */ + it('ACTS_SetWant_1000', 0, async function (done) { + console.info('----ACTS_SetWant_1000 start----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.example.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: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_BUNDLE] + } + 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"); + } else { + console.info('----getWantAgent failed!----'); + console.info(data); + expect(typeof(data)).assertEqual("object"); + } + done(); + } + + ); + console.info('----getWantAgent after----'); + }) + + /* + * @tc.number: ACTS_SetWant_1100 + * @tc.name: getWantAgent(OperationType.START_ABILITY) + * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) + */ + it('ACTS_SetWant_1100', 0, async function (done) { + console.info('----ACTS_SetWant_1100 start----'); + var agentInfo = { + wants: [ + { + deviceId: "", + bundleName: "com.example.WantAgentTest1", + abilityName: "com.example.WantAgentTest1.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: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.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) ); + expect(data.info).assertEqual(WantAgent); + expect(data.want).assertEqual(Want); + expect(typeof(data.extraInfo)).assertEqual("object"); + expect(data.finalCode).assertEqual(0); + expect(data.finalData).assertEqual(""); + expect(data.want.deviceId).assertEqual(""); + expect(data.want.bundleName).assertEqual("com.example.WantAgentTest1"); + expect(data.want.abilityName).assertEqual("com.example.WantAgentTest1.MainAbility"); + expect(data.want.uri).assertEqual("key={true,true,false}"); + expect(JSON.stringify(data.want.entities)).assertEqual(JSON.stringify(["entity1"])); + expect(data.want.action).assertEqual("action1"); + } 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_0700====>"); + }, 100); + + console.info('----getWantAgent after----'); + }) }) 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 d4cba6bef641bb5aec003c122846381d4ee1a39a..96e09ae103e74b5af41d94a24c162561687d539c 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 @@ -25,6 +25,7 @@ describe('ActsAnsWantAgentTwoProTest', function () { * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) */ it('ACTS_SetWant_0400', 0, async function (done) { + expect(3).assertEqual(wantAgent.OperationType.START_SERVICE) var agentInfo = { wants: [ { 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 index 2bbf6914b314e29a287a5cffe90ae89f4ba5346b..ab2da5966954c703f20fb71601d63511dd7128f4 100755 --- 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 @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Subscriber from '@ohos.commonevent' +import Subscriber from '@ohos.commonEvent' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' describe('ActsSubscriberTestUnorderSystem', async function (done) { @@ -108,7 +108,14 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { Subscriber.Support.COMMON_EVENT_SMS_RECEIVE_COMPLETED, Subscriber.Support.COMMON_EVENT_SPN_INFO_UPDATED, Subscriber.Support.COMMON_EVENT_BOOT_COMPLETED, - Subscriber.Support.COMMON_EVENT_SPLIT_SCREEN + Subscriber.Support.COMMON_EVENT_SPLIT_SCREEN, + Subscriber.Support.COMMON_EVENT_THERMAL_LEVEL_CHANGED, + Subscriber.Support.COMMON_EVENT_VOLUME_REMOVED, + Subscriber.Support.COMMON_EVENT_VOLUME_UNMOUNTED, + Subscriber.Support.COMMON_EVENT_VOLUME_MOUNTED, + Subscriber.Support.COMMON_EVENT_VOLUME_BAD_REMOVAL, + Subscriber.Support.COMMON_EVENT_VOLUME_EJECT, + Subscriber.Support.COMMON_EVENT_SLOT_CHANGE ]; function publishCallback(err) { @@ -187,6 +194,13 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { Subscriber.Support.COMMON_EVENT_HWID_LOGOFF, Subscriber.Support.COMMON_EVENT_WIFI_POWER_STATE, Subscriber.Support.COMMON_EVENT_WIFI_CONN_STATE, + Subscriber.Support.COMMON_EVENT_THERMAL_LEVEL_CHANGED, + Subscriber.Support.COMMON_EVENT_VOLUME_REMOVED, + Subscriber.Support.COMMON_EVENT_VOLUME_UNMOUNTED, + Subscriber.Support.COMMON_EVENT_VOLUME_MOUNTED, + Subscriber.Support.COMMON_EVENT_VOLUME_BAD_REMOVAL, + Subscriber.Support.COMMON_EVENT_VOLUME_EJECT, + Subscriber.Support.COMMON_EVENT_SLOT_CHANGE ], }; @@ -287,7 +301,15 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { Subscriber.Support.COMMON_EVENT_ABILITY_UPDATED, Subscriber.Support.COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED, Subscriber.Support.COMMON_EVENT_ACCOUNT_DELETED, - Subscriber.Support.COMMON_EVENT_FOUNDATION_READY + Subscriber.Support.COMMON_EVENT_FOUNDATION_READY, + Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED, + Subscriber.Support.COMMON_EVENT_THERMAL_LEVEL_CHANGED, + Subscriber.Support.COMMON_EVENT_VOLUME_REMOVED, + Subscriber.Support.COMMON_EVENT_VOLUME_UNMOUNTED, + Subscriber.Support.COMMON_EVENT_VOLUME_MOUNTED, + Subscriber.Support.COMMON_EVENT_VOLUME_BAD_REMOVAL, + Subscriber.Support.COMMON_EVENT_VOLUME_EJECT, + Subscriber.Support.COMMON_EVENT_SLOT_CHANGE ], }; 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 index b595baedf33bcfe1a159a62d29d851ff6757e998..0dff6039083631a0805c60b6ce8bb459778ea5b0 100755 --- 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 @@ -12,23 +12,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Subscriber from '@ohos.commonevent' +import Subscriber from '@ohos.commonEvent' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' describe('ActsSubscriberTestUnorder', async function (done) { console.info("===========ActsSubscriberTestUnorder start====================>"); - var commonEventSubscriber001; - var commonEventSubscriber002; - var commonEventSubscriber003; - var commonEventSubscriber004; - var commonEventSubscriber0051; - var commonEventSubscriber0052; - var commonEventSubscriber006; - var commonEventSubscriber008; - var commonEventSubscriber0101; - var commonEventSubscriber0102; - var commonEventSubscriber011; - var commonEventSubscriber012; + let commonEventSubscriber001; + let commonEventSubscriber002; + let commonEventSubscriber003; + let commonEventSubscriber004; + let commonEventSubscriber0051; + let commonEventSubscriber0052; + let commonEventSubscriber006; + let commonEventSubscriber008; + let commonEventSubscriber0101; + let commonEventSubscriber0102; + let commonEventSubscriber011; + let commonEventSubscriber012; function publishCallback(err) { console.info("==========================>publishCallback"); @@ -62,7 +62,7 @@ describe('ActsSubscriberTestUnorder', async function (done) { done(); } - var commonEventSubscribeInfo = { + let commonEventSubscribeInfo = { events: ["publish_event0100"], }; @@ -100,7 +100,7 @@ describe('ActsSubscriberTestUnorder', async function (done) { done(); } - var commonEventSubscribeInfo = { + let commonEventSubscribeInfo = { events: ["@#¥#3243adsafdf_"], }; @@ -128,15 +128,14 @@ describe('ActsSubscriberTestUnorder', async function (done) { */ it('ActsSubscriberTestUnorder_0300', 0, async function (done) { console.info("===============ActsSubscriberTestUnorder_0300==========================>"); - var commonEventSubscribeInfo = { + let commonEventSubscribeInfo = { events: ["publish_event0300"], publisherDeviceId: "PublishDeviceId0300", priority: 10, }; - var commonEventPublishData = { + let commonEventPublishData = { isOrdered: false, - bundleName: "PublishBundleName0300", code: 55, data: "PublishData0300", } @@ -150,7 +149,6 @@ describe('ActsSubscriberTestUnorder', async function (done) { function subscriberCallBack003(err, data) { console.info("==========================>subscriberCallBack003"); expect(data.event).assertEqual("publish_event0300"); - expect(data.bundleName).assertEqual("PublishBundleName0300"); expect(data.code).assertEqual(55); expect(data.data).assertEqual("PublishData0300"); commonEventSubscriber003.isOrderedCommonEvent(isOrderedCommonEventCallback003); @@ -172,6 +170,7 @@ describe('ActsSubscriberTestUnorder', async function (done) { }) }) + /* * @tc.number : ActsSubscriberTestUnorder_0500 * @tc.name : verify subscribe and publish : Check the two different subscribe and one publish, @@ -180,11 +179,11 @@ describe('ActsSubscriberTestUnorder', async function (done) { */ it('ActsSubscriberTestUnorder_0500', 0, async function (done) { console.info("===============ActsSubscriberTestUnorder_0500==========================>"); - var commonEventSubscribeInfo = { + let commonEventSubscribeInfo = { events: ["publish_event0500"] }; - var commonEventPublishData = { + let commonEventPublishData = { isOrdered: false, isSticky: false, } @@ -225,5 +224,51 @@ describe('ActsSubscriberTestUnorder', async function (done) { }); }) }) + + + /* + * @tc.number : ActsSubscriberTestUnorder_0600 + * @tc.name : verify subscribe and publish : Check whether the current public event is a sticky event + * @tc.desc : isStickyCommonEvent(callback: AsyncCallback): void + */ + it('ActsSubscriberTestUnorder_0600', 0, async function (done) { + console.info("===============ActsSubscriberTestUnorder_0600==========================>"); + let commonEventSubscribeInfo = { + events: ["publish_event0600"] + }; + + let commonEventPublishData = { + isOrdered: false, + isSticky: false, + } + + function isStickyCallback(err, data) { + console.info("==========================>isStickyCallback"); + expect(data).assertEqual(false); + done(); + } + + function subscriberCallBack006(err, data) { + console.info("==========================>subscriberCallBack006"); + commonEventSubscriber006.isStickyCommonEvent(isStickyCallback); + } + + Subscriber.createSubscriber( + commonEventSubscribeInfo + ).then((data)=>{ + console.info("===============ActsSubscriberTestUnorder_0600=========createSubscriber promise"); + commonEventSubscriber006 = data; + data.getSubscribeInfo().then(()=>{ + console.info("===============ActsSubscriberTestUnorder_0600=========getSubscribeInfo promise"); + Subscriber.subscribe(commonEventSubscriber006, subscriberCallBack006); + Subscriber.unsubscribe(commonEventSubscriber006, unsubscriberCallBack); + setTimeout(function (){ + console.info("==========ActsSubscriberTestUnorder_0600 publish start============"); + Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback); + }, 1000); + }); + }) + }) + }) diff --git a/notification/ces_standard/subscribeandpublish/emittertest/entry/src/main/js/test/EmitterTest.js b/notification/ces_standard/subscribeandpublish/emittertest/entry/src/main/js/test/EmitterTest.js index 62db75821e626bed96e1103f2bc5d553233f1bd9..91c267147eb524faaefbd457f2c11113b4479930 100644 --- a/notification/ces_standard/subscribeandpublish/emittertest/entry/src/main/js/test/EmitterTest.js +++ b/notification/ces_standard/subscribeandpublish/emittertest/entry/src/main/js/test/EmitterTest.js @@ -92,6 +92,18 @@ describe('EmitterTest', function () { done(); }) - + + /* + * @tc.number : EmitterOffTest + * @tc.name : verify off : Check subscribe same off common ordered event + * @tc.desc : Check the subscriber can receive event "EmitterOffTest" type of the interface (by Promise) + */ + it('EmitterOffTest', 0, async function (done){ + console.info("===========EmitterOffTest111====================>"); + emitter.once(InnerEventLow, callback01); + emitter.emit(InnerEventImmediate, eventData); + emitter.off(1); + done(); + }) })