提交 f972d4d5 编写于 作者: Z zhaoyuan17

Update xts code

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 7a5ebac0
......@@ -27,6 +27,8 @@ group("actsabilitymanagertest") {
"actsamstestfourthscene:ActsAmsTestFourthSceneTest",
"actsamstestsecondscene:ActsAmsTestSecondSceneTest",
"actsamstestthirdscene:ActsAmsTestThirdSceneTest",
"sceneProject/clearmissionscallback:ClearMissionsCallBack",
"sceneProject/clearmissionspromise:ClearMissionsPromise",
"sceneProject/simulateEAbility:simulateEAbility",
"sceneProject/simulateFAbilityFir:simulateFAbilityFir",
"sceneProject/simulateFAbilitySed:simulateFAbilitySed",
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -18,6 +18,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +27,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
......@@ -17,7 +17,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
export default {
data: {
title: ""
......@@ -26,20 +26,23 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
if (once) {
once = false
console.info('onShow finish')
require('../../../test/List.test')
core.execute()
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
},
onReady() {
console.info('onReady');
......
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.ohos.launcher",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ClearMissionsCallBack.hap",
"verifyIAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.ohos.launcher",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ClearMissionsPromise.hap",
"verifyIAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
......@@ -12,19 +12,23 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ClearMissionsCallBack") {
hap_profile = "./entry/src/main/config.json"
ohos_hap("ClearMissionsCallBack") {
hap_profile = "./src/main/config.json"
hap_name = "ClearMissionsCallBack"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ClearMissionsCallBack"
certificate_profile = "./signature/systemui.p7b"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "./src/main/js/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
}
......@@ -37,6 +37,7 @@ describe('ActsAmsCallBackSixth Scene', function () {
},
},
);
sleep(5000)
});
/*
* @tc.number : Acts_Ams_test_12200
......@@ -44,14 +45,12 @@ describe('ActsAmsCallBackSixth Scene', function () {
* @tc.desc : Clear Missions(by CallBack)
*/
it('Acts_Ams_test_12200', 0, async function (done) {
setTimeout(function (){
abilitymanager.clearMissions(
(error,info) => {
console.info('Acts_Ams_test_12200 clearMissions error.code ' + error.code + ',data [' + info + ']' );
expect(typeof(info)).assertEqual("number");
expect(info).assertEqual(0);
});
done();
},5000)
abilitymanager.clearMissions(
(error,info) => {
console.info('Acts_Ams_test_12200 clearMissions error.code ' + error.code + ',data [' + info + ']' );
expect(typeof(info)).assertEqual("number");
expect(info).assertEqual(0);
});
done();
})
})
......@@ -12,19 +12,23 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ClearMissionsPromise") {
hap_profile = "./entry/src/main/config.json"
ohos_hap("ClearMissionsPromise") {
hap_profile = "./src/main/config.json"
hap_name = "ClearMissionsPromise"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ClearMissionsPromise"
certificate_profile = "./signature/systemui.p7b"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "./src/main/js/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
}
......@@ -37,19 +37,26 @@ describe('ActsAmsCallBackSixth Scene', function () {
},
},
);
sleep(5000)
});
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
/*
* @tc.number : Acts_Ams_test_12100
* @tc.name : clearMissions : Clear Missions
* @tc.desc : Clear Missions(by Promise)
*/
it('Acts_Ams_test_12100', 0, async function (done) {
setTimeout(async function(){
var info = await abilitymanager.clearMissions();
console.info('Acts_Ams_test_12100 clearMissions data [' + info + ']');
expect(typeof(info)).assertEqual("number");
expect(info).assertEqual(0);
done();
},5000);
var info = await abilitymanager.clearMissions();
console.info('Acts_Ams_test_12100 clearMissions data [' + info + ']');
expect(typeof(info)).assertEqual("number");
expect(info).assertEqual(0);
done();
})
})
......@@ -1432,8 +1432,8 @@ it('FWK_zipFile_3400', 0, async function (done) {
*/
it('FWK_zipFile_3500', 0, async function (done) {
console.log("==================FWK_zipFile_3500 start==================");
var src = "/data/test/fefsef.txt";
var dest = "/data/testA/ceshi.txt";
var src = "/data/teste/fefsef.txt";
var dest = "/data/testA/sfefsfe.zip";
var options = {}
......@@ -1458,6 +1458,7 @@ it('FWK_zipFile_3600', 0, async function (done) {
console.log("==================FWK_zipFile_3600 start==================");
var src = "/data/test/ceshi.txt";
var dest = "";
var options = {}
zlib.zipFile(src, dest, options).then((data) => {
console.log("zipFilePromise_3600 data: " + data);
......
......@@ -22,7 +22,6 @@ const STRESSLEVEL = 20;
const BUNDLE_NAME = 'com.example.actsbmskittest';
const PERMISSION_NAME = 'com.permission.PERMISSION_A';
const START_ABILITY_TIMEOUT = 3000;
const EVENTTIMEOUT = 5000;
var subscriberInfo_0100 = {
events: ['ACTS_Third1_Publish_CommonEvent'],
};
......@@ -167,9 +166,6 @@ describe('ActsBmsKitTest', function () {
}
}
done();
setTimeout(function () {
console.debug('===========ActsBmsKit_getModuleUsageRecordTest_0100===========end');
}, EVENTTIMEOUT)
})
/*
......@@ -207,13 +203,11 @@ describe('ActsBmsKitTest', function () {
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0);
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
if(data[i].bundleName == 'com.example.third1'){
expect(data[i].appLabelId).assertEqual(0);
expect(data[i].labelId).assertEqual(0);
expect(data[i].abilityLabelId).assertEqual(0);
expect(data[i].abilityDescriptionId).assertEqual(0);
expect(data[i].abilityIconId).assertEqual(0);
}
expect(data[i].appLabelId >= 0).assertTrue();
expect(data[i].labelId >= 0).assertTrue();
expect(data[i].abilityLabelId >= 0).assertTrue();
expect(data[i].abilityDescriptionId >= 0).assertTrue();
expect(data[i].abilityIconId >= 0).assertTrue();
console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0);
console.debug('=============labelId==============' + JSON.stringify(data[i].labelId));
......
......@@ -83,6 +83,27 @@ describe('ActsBmsModuleUsageRecordTest', function () {
)
});
})
beforeEach(async (done) => {
bundle.getBundleInfo(BUNDLE_NAME, 1, async (err, data) => {
if (err.code != 0 && data.name.length == 0) {
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
console.debug('========install Finish========' + JSON.stringify(data));
done();
});
} else {
console.info("third1 is exist");
done();
}
});
})
/*
* @tc.number: bms_getModuleUsageRecordTest_0100
* @tc.name: getModuleUsageRecord(maxNum)
......@@ -101,14 +122,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
if (dataMap.has(BUNDLE_NAME)) {
let data = dataMap.get(BUNDLE_NAME);
expect(data.bundleName).assertEqual('com.example.third1');
expect(data.appLabelId).assertEqual(0);
expect(data.appLabelId >= 0).assertTrue();
expect(data.name).assertEqual('entry');
expect(data.labelId).assertEqual(0);
expect(data.labelId >= 0).assertTrue();
expect(data.descriptionId).assertEqual(0);
expect(data.abilityName).assertEqual('com.example.third1.MainAbility');
expect(data.abilityLabelId).assertEqual(0);
expect(data.abilityDescriptionId).assertEqual(0);
expect(data.abilityIconId).assertEqual(0);
expect(data.abilityLabelId >= 0).assertTrue();
expect(data.abilityDescriptionId >= 0).assertTrue();
expect(data.abilityIconId >= 0).assertTrue();
expect(data.launchedCount).assertEqual(START_COUNT);
expect(data.lastLaunchTime).assertLarger(0);
expect(data.isRemoved).assertEqual(false);
......@@ -596,13 +617,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console.debug('=======All Info========' + JSON.stringify(data[i]));
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0);
if (data[i].bundleName == BUNDLE_NAME) {
expect(data[i].appLabelId).assertEqual(0);
expect(data[i].labelId).assertEqual(0);
expect(data[i].abilityLabelId).assertEqual(0);
expect(data[i].abilityDescriptionId).assertEqual(0);
expect(data[i].abilityIconId).assertEqual(0);
}
expect(data[i].appLabelId >= 0).assertTrue();
expect(data[i].labelId >= 0).assertTrue();
expect(data[i].abilityLabelId >= 0).assertTrue();
expect(data[i].abilityDescriptionId >= 0).assertTrue();
expect(data[i].abilityIconId >= 0).assertTrue();
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0);
......
......@@ -15,37 +15,39 @@
import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var timeout = 500;
describe('ActsAnsNotificationCancel', function () {
console.info("===========ActsAnsNotificationCancel start====================>");
var timesOfOnConsume
function onConsumeCancelAll(data) {
console.info("================onConsumeCancelAll_0100=======================>");
console.info("================onConsumeCancelAll_0100 data: =======================>" + JSON.stringify(data));
async function onConsumeCancelAll(data) {
console.info("================ANS_Cancel_0100 onConsume start=======================>");
console.info("================ANS_Cancel_0100 onConsume data:=================>" + JSON.stringify(data));
timesOfOnConsume = timesOfOnConsume + 1
if (timesOfOnConsume == 2){
notify.cancelAll(cancelAllCallBack);
console.info("============onConsumeCancelAll_0100 cancelAll=======================>");
await notify.cancelAll(cancelAllCallBack);
console.info("================ANS_Cancel_0100 onConsume cancelAll=======================>");
}
console.info("================onConsumeCancelAll_0100 end=======================>");
console.info("================ANS_Cancel_0100 onConsume end=======================>");
}
var timesOfOnCancel
function onCancelCancelAll(data) {
console.info("================onCancelCancelAll_0100=======================>");
console.info("================onCancelCancelAll_0100 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);
expect(data.request.id).assertEqual(1);
} else if (timesOfOnCancel == 2){
expect(data.request.id).assertequal(2);
expect(data.request.id).assertEqual(2);
}
console.info("================onCancel_cancelAll_0100 end=======================>");
console.info("================ANS_Cancel_0100 onCancel end=======================>");
console.info("===========ANS_Cancel_0100 onCancel unsubscribe promise========>");
}
function cancelAllCallBack(err, data){
console.info("==================cancelAllCallBack start=======================>");
console.info("==================cancelAllCallBack data==================>" + JSON.stringify(data));
console.info("==================cancelAllCallBack err==================>" + JSON.stringify(err));
console.info("==================cancelAllCallBack end=======================>");
console.info("========ANS_Cancel_0100 cancelAllCallBack start==============>");
console.info("========ANS_Cancel_0100 cancelAllCallBack data===============>" + JSON.stringify(data));
console.info("========ANS_Cancel_0100 cancelAllCallBack err================>" + JSON.stringify(err));
console.info("========ANS_Cancel_0100 cancelAllCallBack end================>");
}
/*
......@@ -62,8 +64,6 @@ describe('ActsAnsNotificationCancel', function () {
onConsume:onConsumeCancelAll,
onCancel:onCancelCancelAll,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0100_promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -124,37 +124,42 @@ describe('ActsAnsNotificationCancel', function () {
badgeIconStyle: 1,
showDeliveryTime: true,
}
await notify.subscribe(subscriber);
console.info("===========ANS_Cancel_0100 subscribe promise=======>");
await notify.publish(notificationRequest);
console.info("==================publish_0100_promise==================>");
console.info("===========ANS_Cancel_0100 publish1 promise=======>");
await notify.publish(notificationRequest1);
console.info("==================publish2_0100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0100_promise==================>");
setTimeout((function(){
console.info("==================ANS_Cancel_0100 done==================>");
}),1000);
done();
console.info("===========ANS_Cancel_0100 publish2 promise=======>");
setTimeout((async function(){
console.info("======ANS_Cancel_0100 setTimeout==================>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0100 setTimeout unsubscribe==================>");
done();
}),timeout);
})
function onConsumeCancelAllPromise(data) {
console.info("================onConsume_cancelAll_promise_0200=======================>");
console.info("================onConsume_0200 data: =======================>" + JSON.stringify(data));
timesOfOnConsume = timesOfOnConsume + 1
console.info("================ANS_Cancel_0200 onConsume start===========>");
console.info("================ANS_Cancel_0200 onConsume data:============>" + JSON.stringify(data));
if (timesOfOnConsume == 2){
notify.cancelAll();
console.info("==========cancelAll_promise_0200 end==========>");
console.info("==========ANS_Cancel_0200 onConsume cancelAll promise==========>");
}
console.info("================onConsume_cancelAll_promise_0200 end=======================>");
console.info("================ANS_Cancel_0200 onConsume end===============>");
}
function onCancelCancelAllPromise(data) {
timesOfOnCancel = timesOfOnCancel + 1
console.info("================onCancel_cancelAll_promise_0200=======================>");
console.info("================onCancel_0200 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);
expect(data.request.id).assertEqual(1);
} else if (timesOfOnCancel == 2){
expect(data.request.id).assertequal(2);
expect(data.request.id).assertEqual(2);
}
console.info("================onCancel_cancelAll_promise_0200 end=======================>");
console.info("==========ANS_Cancel_0200 onCancel end=======================>");
}
/*
......@@ -172,7 +177,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelAllPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0200_promise==================>");
console.info("==================ANS_Cancel_0200 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -234,35 +239,33 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish1_0200_promise==================>");
console.info("==========ANS_Cancel_0200 publish1 promise==================>");
await notify.publish(notificationRequest1);
console.info("==================publish2_0200_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_0200 done==================>");
}),1000);
console.info("==========ANS_Cancel_0200 publish2 promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0200 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelAllNoNotify(data) {
console.info("================onConsume_cancelAll_noNotify_0300=======================>");
console.info("================onConsume_0300 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("================onConsume_cancelAll_noNotify_0300 end=======================>");
console.info("================ANS_Cancel_0300 onConsume end=======================>");
}
function onCancelCancelAllNoNotify(data) {
console.info("=================onCancel_cancelAll_0300=======================>");
console.info("=================ANS_Cancel_0300 onCancel start=============>");
expect().assertFail();
console.info("================onCancel_0300 data : =======================>" + JSON.stringify(data));
console.info("================onCancel_0300 end=======================>");
console.info("================ANS_Cancel_0300 onCancel data:==============>" + JSON.stringify(data));
console.info("================ANS_Cancel_0300 onCancel end================>");
}
function cancelAllCallBackNoNotify(err, data){
console.info("================cancelAllCallBack_noNotify_0300 start=======================>");
console.info("==========cancelAllCallBack_0300 data : =======================>" + JSON.stringify(data));
console.info("==========cancelAllCallBack_0300 err : =======================>" + JSON.stringify(err));
console.info("================cancelAllCallBack_noNotify_0300 end=======================>");
console.info("==========ANS_Cancel_0300 cancelAllCallBack start=============>");
console.info("==========ANS_Cancel_0300 cancelAllCallBack data:=============>" + JSON.stringify(data));
console.info("==========ANS_Cancel_0300 cancelAllCallBack err:=============>" + JSON.stringify(err));
console.info("==========ANS_Cancel_0300 cancelAllCallBack end===============>");
}
/*
......@@ -281,27 +284,27 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelAllNoNotify,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0300_promise==================>");
console.info("===============ANS_Cancel_0300 subscribe promise===============>");
await notify.cancelAll(cancelAllCallBackNoNotify);
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0300_promise==================>");
done();
setTimeout((function(){
console.info("==============ANS_Cancel_0300 done==================>");
}),1000);
console.info("===============ANS_Cancel_0300 cancelAll promise===============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0300 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelAllNoNotifyPromise(data) {
console.info("================onConsume_cancelAll_noNotify_promise_0400=======================>");
console.info("================onConsume_promise_0400 data: =======================>" + JSON.stringify(data));
console.info("================ANS_Cancel_0400 onConsume===============>");
console.info("================ANS_Cancel_0400 onConsume data:===========>" + JSON.stringify(data));
expect().assertFail();
console.info("================onConsume_promise_0400 end=======================>");
console.info("================ANS_Cancel_0400 onConsume end===========>");
}
function onCancelCancelAllNoNotifyPromise(data) {
console.info("===============onCancel_cancelAll_noNotify_promise_0400=======================>");
console.info("===============onCancel_promise_0400 data=================>" + JSON.stringify(data));
console.info("===============ANS_Cancel_0400 onCancel ==================>");
console.info("===============ANS_Cancel_0400 onCancel data==============>" + JSON.stringify(data));
expect().assertFail();
console.info("===============onCancel_cancelAll_noNotify_promise_0400 end=======================>");
console.info("===============ANS_Cancel_0400 onCancel end===============>");
}
/*
......@@ -320,48 +323,47 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelAllNoNotifyPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0400_promise==================>");
console.info("================ANS_Cancel_0400 subscribe promise=============>");
await notify.cancelAll();
console.info("==========cancelAll_noNotify_promise_0400 start==========>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0400_promise==================>");
done();
setTimeout((function(){
console.info("==============ANS_Cancel_0400 done==================>");
}),1000);
console.info("================ANS_Cancel_0400 cancelAll promise=============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0400 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelAll2Times(data) {
console.info("================onConsume_cancelAll2Times_0500=======================>");
console.info("================onConsume_cancelAll2Times_0500 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("================onConsume_cancelAll2Times_0500 cancelAll=======================>");
console.info("================onConsume_cancelAll2Times_0500 end=======================>");
console.info("==========ANS_Cancel_0500 onConsume cancelAll=================>");
console.info("==========ANS_Cancel_0500 onConsume end=======================>");
}
function onCancelCancelAll2Times(data) {
console.info("==========================onCancel_cancelAll2Times_0500=======================>");
console.info("onCancel_cancelAll2Times_0500 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);
expect(data.request.id).assertEqual(5);
} else if (timesOfOnCancel){
expect(data.request.id).assertequal(0);
expect(data.request.id).assertEqual(0);
}
console.info("================onCancel_cancelAll2Times_0500 end=======================>");
console.info("==========ANS_Cancel_0500 onCancel end===============>");
}
function cancelAllCallBack2Times1(err){
console.info("cancelAllCallBack2Times1_0500 start=======================>");
console.info("cancelAllCallBack2Times1_0500 err : =======================>" + JSON.stringify(err));
console.info("==========ANS_Cancel_0500 cancelAllCallBack1 start==========>");
console.info("==========ANS_Cancel_0500 cancelAllCallBack1 err:===========>" + JSON.stringify(err));
notify.cancelAll(cancelAllCallBack2Times2);
console.info("==========================cancelAllCallBack2Times1_0500 cancelAll=======================>");
console.info("==========================cancelAllCallBack2Times1_0500 end=======================>");
console.info("==========ANS_Cancel_0500 cancelAllCallBack1 cancelAll======>");
console.info("==========ANS_Cancel_0500 cancelAllCallBack1 end===========>");
}
function cancelAllCallBack2Times2(err){
console.info("==========================cancelAllCallBack2Times2_0500 start=======================>");
console.info("cancelAllCallBack2Times2_0500 err : =======================>" + JSON.stringify(err));
console.info("==========================cancelAllCallBack2Times2_0500 end=======================>");
console.info("==========ANS_Cancel_0500 cancelAllCallBack2 start=============>");
console.info("==========ANS_Cancel_0500 cancelAllCallBack2 err:==============>" + JSON.stringify(err));
console.info("==========ANS_Cancel_0500 cancelAllCallBack2 end===============>");
}
/*
......@@ -372,14 +374,14 @@ describe('ActsAnsNotificationCancel', function () {
and then cancel the notification again
*/
it('ANS_Cancel_0500', 0, async function (done) {
console.info("===============ANS_Cancel_0500 start==========================>");
console.info("============ANS_Cancel_0500 start==================>");
timesOfOnCancel = 0
var subscriber ={
onConsume:onConsumeCancelAll2Times,
onCancel:onCancelCancelAll2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0500_promise==================>");
console.info("============ANS_Cancel_0500 subscribe promise======>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -411,35 +413,33 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_0500 done==================>");
}),1000);
console.info("==============ANS_Cancel_0500 publish promise end==============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0500 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelAll2TimesPromise(data) {
console.info("================onConsume_cancelAll2Times_promise_0600=======================>");
console.info("================onConsume_promise_0600 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("==========cancelAll_promise_2times1_0600 end==========>");
console.info("==========ANS_Cancel_0600 onConsume cancelAll 2times1 end======>");
notify.cancelAll();
console.info("==========cancelAll_promise_2times2_0600 end==========>");
console.info("================onConsume_cancelAll2Times_promise_0600 cancelAll=========>");
console.info("================onConsume_cancelAll2Times_promise_0600 end==========>");
console.info("==========ANS_Cancel_0600 onConsume cancelAll 2times2 end======>");
console.info("==========ANS_Cancel_0600 onConsume end========>");
}
function onCancelCancelAll2TimesPromise(data) {
timesOfOnCancel = timesOfOnCancel + 1
console.info("==============onCancel_cancelAll2Times_promise_0600=======================>");
console.info("==============onCancel_0600 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);
expect(data.request.id).assertEqual(6);
} else if (timesOfOnCancel == 2){
expect(data.request.id).assertequal(0);
expect().assertFail();
}
console.info("================onCancel_cancelAll2Times_promise_0600 end=======================>");
console.info("==========ANS_Cancel_0600 onCancel end=============>");
}
/*
......@@ -456,7 +456,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelAll2TimesPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0600_promise==================>");
console.info("==================ANS_Cancel_0600 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -488,33 +488,32 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0600_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_0600 done==================>");
}),1000);
console.info("==================ANS_Cancel_0600 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0600 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelAllIsUnremovable(data) {
console.info("================onConsume_cancelAll_isUnremovable_0700 start=======================>");
console.info("================onConsume_0700 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("================onConsume_0700 cancelAll=======================>");
console.info("================onConsume__0700 end=======================>");
console.info("========ANS_Cancel_0700 onConsume cancelAll===========>");
console.info("========ANS_Cancel_0700 onConsume end============>");
}
function onCancelCancelAllIsUnremovable(data) {
console.info("================onCancel_cancelAll_isUnremovable_0700 start=======================>");
console.info("================onCancel_0700 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(7);
console.info("================onCancel_cancelAll_isUnremovable_0700 end=======================>");
console.info("================ANS_Cancel_0700 onCancel start=======================>");
console.info("================ANS_Cancel_0700 onCancel data:====================>" + JSON.stringify(data));
expect(data.request.id).assertEqual(7);
console.info("================ANS_Cancel_0700 onCancel end=======================>");
}
function cancelAllCallBackIsUnremovable(err, data){
console.info("================cancelAllCallBack_IsUnremovable_0700 start=======================>");
console.info("================cancelAllCallBack_0700 data:================>" + JSON.stringify(err));
console.info("================cancelAllCallBack_0700 err:==============>" + JSON.stringify(data));
console.info("================cancelAllCallBack_IsUnremovable_0700 end=======================>");
console.info("===========ANS_Cancel_0700 cancelAllCallBack start==========>");
console.info("===========ANS_Cancel_0700 cancelAllCallBack err:===========>" + JSON.stringify(err));
console.info("===========ANS_Cancel_0700 cancelAllCallBack data:==========>" + JSON.stringify(data));
console.info("===========ANS_Cancel_0700 cancelAllCallBack end=======================>");
}
/*
......@@ -531,7 +530,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelAllIsUnremovable,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0700_promise==================>");
console.info("========ANS_Cancel_0700 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -563,27 +562,26 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0700_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0700_promise==================>");
done();
setTimeout((function(){
console.info("==============ANS_Cancel_0700 done==================>");
}),1000);
console.info("===========ANS_Cancel_0700 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0700 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelAllIsUnremovablPromise(data) {
console.info("================onConsume_cancelAll_isUnremovable_0800 start=======================>");
console.info("================onConsume_0800 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("==========cancelAll_promise_isUnremovable_0800 end==========>");
console.info("================onConsume_cancelAll_isUnremovable_0800 end=======================>");
console.info("================ANS_Cancel_0800 cancelAll==========>");
console.info("================ANS_Cancel_0800 onConsume end===============>");
}
function onCancelCancelAllIsUnremovablePromise(data) {
console.info("================onCancel_cancelAll_isUnremovable_promise_0800 start================>");
console.info("================onCancel_promise_0800 data :===============>" + JSON.stringify(data));
expect(data.request.id).assertequal(8);
console.info("================onCancel_cancelAll_isUnremovable_promise_0800 end==================>");
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================>");
}
/*
......@@ -600,7 +598,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelAllIsUnremovablePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0800_promise==================>");
console.info("==================ANS_Cancel_0800 subscribe promsie==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -632,32 +630,31 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0800_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0800_promise==================>");
done();
setTimeout((function(){
console.info("==============ANS_Cancel_0800 done==================>");
}),1000);
console.info("=========ANS_Cancel_0800 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0800 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancel(data) {
console.info("================onConsume_cancel_0900 start=======================>");
console.info("================onConsume_cancel_0900 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("================onConsume_cancel_0900 cancel=======================>");
console.info("================onConsume_cancel_0900 end=======================>");
console.info("=========ANS_Cancel_0900 onConsume cancel=============>");
console.info("=========ANS_Cancel_0900 onConsume end================>");
}
function onCancelCancel(data) {
console.info("===============onCancel_cancel_0900 start=======================>");
console.info("===============onCancel_cancel_0900 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(9);
console.info("===============onCancel_cancel_0900 end=======================>");
console.info("=========ANS_Cancel_0900 onCancel start================>");
console.info("=========ANS_Cancel_0900 onCancel data:================>" + JSON.stringify(data));
expect(data.request.id).assertEqual(9);
console.info("=========ANS_Cancel_0900 onCancel end================>");
}
function cancelCallBackCancel(err){
console.info("===========cancelAllCallBack_cancel_0900 start=======================>");
console.info("===========cancelAllCallBack_0900 err : =======================>" + JSON.stringify(err));
console.info("===========cancelAllCallBack_cancel_0900 end=======================>");
console.info("===========ANS_Cancel_0900 cancelCallBack start================>");
console.info("===========ANS_Cancel_0900 cancelCallBack err:=================>" + JSON.stringify(err));
console.info("===========ANS_Cancel_0900 cancelCallBack end==================>");
}
/*
......@@ -673,7 +670,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancel,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0900_promise==================>");
console.info("==================ANS_Cancel_0900 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -704,34 +701,34 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0900_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0900_promise==================>");
done();
setTimeout((function(){
console.info("==============ANS_Cancel_0900 done==================>");
}),1000);
console.info("==================ANS_Cancel_0900 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_0900 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelWrongId(data) {
console.info("================onConsume_cancel_cancel_wrongId_1000 start=======================>");
console.info("================onConsume_1000 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1000 label: =======================>" + data.request.label);
console.info("================onConsume_1000 id: =======================>" + data.request.id);
console.info("========ANS_Cancel_1000 onConsume start==============>");
console.info("========ANS_Cancel_1000 onConsume data:==============>" + JSON.stringify(data));
console.info("========ANS_Cancel_1000 onConsume label:=============>" + data.request.label);
console.info("========ANS_Cancel_1000 onConsume id:================>" + data.request.id);
notify.cancel(9999,cancelCallBackCancelWrongId);
console.info("================onConsume_cancel_cancel_wrongId_1000 cancel_id=======================>");
console.info("================onConsume_cancel_cancel_wrongId_1000 end=======================>");
console.info("========ANS_Cancel_1000 onConsume cancel==========>");
console.info("========ANS_Cancel_1000 onConsume end============>");
}
function onCancelCancelWrongId(data) {
console.info("================onCancel_cancel_wrongId_1000 start=======================>");
console.info("================onCancel_1000 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(0);
console.info("================onCancel_cancel_wrongId_1000 end=======================>");
console.info("================ANS_Cancel_1000 onCancel start=============>");
console.info("================ANS_Cancel_1000 onCancel data:=============>" + JSON.stringify(data));
expect().assertFail();
console.info("================ANS_Cancel_1000 onCancel end===============>");
}
function cancelCallBackCancelWrongId(err){
console.info("================cancelCallBack_cancel_wrongId_1000 start=======================>");
console.info("================cancelCallBac_1000 err : =======================>" + JSON.stringify(err));
console.info("================cancelCallBack_cancel_wrongId_1000 end=======================>");
console.info("==============ANS_Cancel_1000 cancelCallBack start===============>");
console.info("==============ANS_Cancel_1000 cancelCallBack err:================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("==============ANS_Cancel_1000 cancelCallBack end=================>");
}
/*
......@@ -747,7 +744,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelWrongId,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1000_promise==================>");
console.info("================ANS_Cancel_1000 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -779,34 +776,34 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1000_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1000_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1000 done==================>");
}),1000);
console.info("===========ANS_Cancel_1000 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1000 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelIsUnremovable(data) {
console.info("================onConsume_cancel_isUnremovable_1100 start=======================>");
console.info("================onConsume_1100 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1100 label: =======================>" + data.request.label);
console.info("================onConsume_1100 id: =======================>" + data.request.id);
console.info("============ANS_Cancel_1100 onConsume start===============>");
console.info("============ANS_Cancel_1100 onConsume data:===============>" + JSON.stringify(data));
console.info("============ANS_Cancel_1100 onConsume label:==============>" + data.request.label);
console.info("============ANS_Cancel_1100 onConsume id: =======================>" + data.request.id);
notify.cancel(data.request.id,cancelCallBackCancelIsUnremovable);
console.info("================onConsume_1100 cancel=======================>");
console.info("================onConsume_cancel_isUnremovable_1100 end=======================>");
console.info("============ANS_Cancel_1100 onConsume cancel=======================>");
console.info("============ANS_Cancel_1100 onConsume end=======================>");
}
function onCancelCancelIsUnremovable(data) {
console.info("===============onCancel_cancel_isUnremovable_1100 start=======================>");
console.info("===============onCancel_1100 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(11);
console.info("===============onCancel_cancel_isUnremovable_1100 end=======================>");
console.info("============ANS_Cancel_1100 onCancel start================>");
console.info("============ANS_Cancel_1100 onCancel data:================>" + JSON.stringify(data));
console.info("============ANS_Cancel_1100 onCancel id:================>" + data.request.id);
expect(data.request.id).assertEqual(11);
console.info("============ANS_Cancel_1100 onCancel end=======================>");
}
function cancelCallBackCancelIsUnremovable(err){
console.info("================cancelCallBack_cancel_isUnremovable_1100 start=======================>");
console.info("================cancelCallBack_1100 err : =======================>" + JSON.stringify(err));
console.info("================cancelCallBack_cancel_isUnremovable_1100 end=======================>");
console.info("============ANS_Cancel_1100 cancelCallBack start=================>");
console.info("============ANS_Cancel_1100 cancelCallBack err:==================>" + JSON.stringify(err));
console.info("============ANS_Cancel_1100 cancelCallBack end===================>");
}
/*
......@@ -822,7 +819,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelIsUnremovable,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1100_promise==================>");
console.info("===============ANS_Cancel_1100 subscribe promise=============>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -853,49 +850,50 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1100_promise==================>");
done();
setTimeout((function(){
console.info("==============ANS_Cancel_1100 done==================>");
}),1000);
console.info("============ANS_Cancel_1100 publish promise===========>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1100 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
var id1200
function onConsumeCancel2Times(data) {
console.info("================onConsume_cancel_2Times_1200 start=======================>");
console.info("================onConsume_1200 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1200 label: =======================>" + data.request.label);
console.info("================onConsume_1200 id: =======================>" + data.request.id);
console.info("=========ANS_Cancel_1200 onConsume start=====================>");
console.info("=========ANS_Cancel_1200 onConsume data:=====================>" + JSON.stringify(data));
console.info("=========ANS_Cancel_1200 onConsume label:====================>" + data.request.label);
console.info("=========ANS_Cancel_1200 onConsume id:=======================>" + data.request.id);
id1200 = data.request.id
notify.cancel(id1200, cancelCallBackCancel2Times1);
console.info("================onConsume_cancel_2Times_1200 cancel_2Times1=======================>");
console.info("================onConsume_cancel_2Times_1200 end=======================>");
console.info("=========ANS_Cancel_1200 onConsume cancel====================>");
console.info("=========ANS_Cancel_1200 onConsume end=======================>");
}
function onCancelCancel2Times(data) {
timesOfOnCancel = timesOfOnCancel + 1
console.info("============onCancel_cancel_2Times_1200 start=======================>");
console.info("===========onCancel_cancel_2Times_1200 data : =======================>" + JSON.stringify(data));
console.info("=========ANS_Cancel_1200 onCancel start======================>");
console.info("=========ANS_Cancel_1200 onCancel data:===========>" + JSON.stringify(data));
console.info("=========ANS_Cancel_1200 onCancel timesOfOnCancel========>"+timesOfOnCancel);
if (timesOfOnCancel == 1){
expect(data.request.id).assertequal(12);
expect(data.request.id).assertEqual(12);
console.info("=========ANS_Cancel_1200 onCancel id:======================>" + data.request.id);
notify.cancel(id1200, cancelCallBackCancel2Times2);
console.info("=========ANS_Cancel_1200 onCancel cancelCallBack_cancel 2Times2===========>");
}else if(timesOfOnCancel == 2) {
expect(data.request.id).assertequal(0);
expect().assertFail();
}
console.info("================onCancel_cancel_2Times_1200 end=======================>");
console.info("=========ANS_Cancel_1200 onCancel end=======================>");
}
function cancelCallBackCancel2Times1(err){
console.info("================cancelCallBack_cancel_2Times1_1200 start=======================>");
console.info("================cancelCallBack_1200 err : =======================>" + JSON.stringify(err));
notify.cancelCallBack_cancel(id1200,cancelCallBackCancel2Times2);
console.info("================cancelCallBack_cancel_2Times1_1200 cancel=======================>");
console.info("================cancelCallBack_cancel_2Times1_1200 end=======================>");
console.info("===========ANS_Cancel_1200 cancelCallBack1 start================>");
console.info("===========ANS_Cancel_1200 cancelCallBack1 err:=================>" + JSON.stringify(err));
console.info("===========ANS_Cancel_1200 cancelCallBack1 end=======================>");
}
function cancelCallBackCancel2Times2(err){
console.info("===============cancelCallBack_cancel_2Times2_1200 start=======================>");
console.info("===============cancelCallBack_1200 err : =======================>" + JSON.stringify(err));
console.info("==========================>cancelCallBack_cancel_2Times2_1200 end=======================>");
console.info("===========ANS_Cancel_1200 cancelCallBack2 start===========>");
console.info("===========ANS_Cancel_1200 cancelCallBack2 err:============>" + JSON.stringify(err));
console.info("===========ANS_Cancel_1200 cancelCallBack2 end============>");
}
/*
......@@ -905,14 +903,14 @@ describe('ActsAnsNotificationCancel', function () {
interface is called twice in a row to cancel the notification
*/
it('ANS_Cancel_1200', 0, async function (done) {
console.info("===============ANS_Cancel_1200 start==========================>");
console.info("=============ANS_Cancel_1200 start==========================>");
timesOfOnCancel = 0
var subscriber ={
onConsume:onConsumeCancel2Times,
onCancel:onCancelCancel2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1200_promise==================>");
console.info("=============ANS_Cancel_1200 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -943,35 +941,36 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1200_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1200 done==================>");
}),1000);
console.info("========ANS_Cancel_1200 publish promise=================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1200 setTimeout unsubscribe end==================>");
done();
}),1500);
})
function onConsumeCancelLabel(data) {
console.info("================onConsume_cancel_label_1300 start=======================>");
console.info("================onConsume_1300 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1300 label: =======================>" + data.request.label);
console.info("================onConsume_1300 id: =======================>" + data.request.id);
console.info("============ANS_Cancel_1300 onConsume start=============>");
console.info("============ANS_Cancel_1300 onConsume data:=============>" + JSON.stringify(data));
console.info("============ANS_Cancel_1300 onConsume label: ===========>" + data.request.label);
console.info("============ANS_Cancel_1300 onConsume id: ==============>" + data.request.id);
notify.cancel(data.request.id, data.request.label, cancelCallBackCancelLabel);
console.info("================onConsume_cancel_label_1300 cancel_label=======================>");
console.info("================onConsume_cancel_label_1300 end=======================>");
console.info("============ANS_Cancel_1300 onConsume cance=============>");
console.info("============ANS_Cancel_1300 onConsume end===============>");
}
function onCancelCancelLabel(data) {
console.info("================onCancel_cancel_label_1300 start=======================>");
console.info("================onCancel_1300 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(13);
expect(data.request.label).assertequal("1300");
console.info("================onCancel_cancel_label_1300 end=======================>");
console.info("=========ANS_Cancel_1300 onCancel start============>");
console.info("=========ANS_Cancel_1300 onCancel data:============>" + JSON.stringify(data));
expect(data.request.id).assertEqual(13);
console.info("=========ANS_Cancel_1300 onCancel id:============>" + data.request.id);
expect(data.request.label).assertEqual("1300");
console.info("=========ANS_Cancel_1300 onCancel label:============>" + data.request.label);
console.info("=========ANS_Cancel_1300 onCancel end==============>");
}
function cancelCallBackCancelLabel(err){
console.info("cancelCallBack_cancel_label_1300 start=======================>");
console.info("cancelCallBack_cancel_label_1300 err : =======================>" + JSON.stringify(err));
console.info("cancelCallBack_cancel_label_1300 end=======================>");
console.info("=========ANS_Cancel_1300 cancelCallBack start====================>");
console.info("=========ANS_Cancel_1300 cancelCallBack err:=====================>" + JSON.stringify(err));
console.info("=========ANS_Cancel_1300 cancelCallBack end=====================>");
}
/*
......@@ -988,7 +987,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabel,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1300_promise==================>");
console.info("================ANS_Cancel_1300 subscribe promise==============>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1020,28 +1019,31 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1300_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1300_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1300 done==================>");
}),1000);
console.info("===========ANS_Cancel_1300 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1300 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelLabelPromise(data) {
console.info("================onConsume_cancel_label_promise start=======================>");
console.info("================onConsume_promise data: =======================>" + JSON.stringify(data));
console.info("================onConsume_promise label: =======================>" + data.request.label);
console.info("================onConsume_promise id: =======================>" + data.request.id);
console.info("==========ANS_Cancel_1400 onConsume start=================>");
console.info("==========ANS_Cancel_1400 onConsume data:=================>" + JSON.stringify(data));
console.info("==========ANS_Cancel_1400 onConsume label:================>" + data.request.label);
console.info("==========ANS_Cancel_1400 onConsume id:===================>" + data.request.id);
notify.cancel(data.request.id, data.request.label);
console.info("==========cancel_labe_lpromise_1400 end==========>");
console.info("================onConsume_cancel_label_promise end=======================>");
console.info("==========ANS_Cancel_1400 onConsume cancel==========>");
console.info("==========ANS_Cancel_1400 onConsume end=============>");
}
function onCancelCancelLabelPromise(data) {
console.info("================onCancel_cancel_label_promise_1400 start=======================>");
console.info("================onCancel_1400 data : =======================>" + JSON.stringify(data));
console.info("================onCancel_1400 end=======================>");
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==============>");
}
/*
......@@ -1057,7 +1059,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabelPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1400_promise==================>");
console.info("==========ANS_Cancel_1400 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1089,35 +1091,36 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1400_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1400_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1400 done==================>");
}),1000);
console.info("===============ANS_Cancel_1400 publish promise==============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1400 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelLabelIsUnremoveable(data) {
console.info("onConsume_cancel_label_isUnremoveable_1500 start=======================>");
console.info("================onConsume_1500 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1500 label: =======================>" + data.request.label);
console.info("================onConsume_1500 id: =======================>" + data.request.id);
console.info("========ANS_Cancel_1500 onConsume start=====================>");
console.info("========ANS_Cancel_1500 onConsume data:=====================>" + JSON.stringify(data));
console.info("========ANS_Cancel_1500 onConsume label:====================>" + data.request.label);
console.info("========ANS_Cancel_1500 onConsume id:=======================>" + data.request.id);
notify.cancel(data.request.id, data.request.label, cancelCallBackCancelLabelIsUnremoveable);
console.info("================onConsume_1500 cancel_label=======================>");
console.info("================onConsume_1500 end=======================>");
console.info("========ANS_Cancel_1500 onConsume cancel====================>");
console.info("========ANS_Cancel_1500 onConsume end=======================>");
}
function onCancelCancelLabelIsUnremoveable(data) {
console.info("================onCancel_Cancel_Label_IsUnremoveable_1500 start=======================>");
console.info("================onCancel_1500 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(15);
expect(data.request.label).assertequal("1500");
console.info("================onCancel_Cancel_Label_IsUnremoveable_1500 end=======================>");
console.info("========ANS_Cancel_1500 onCancel start=======================>");
console.info("========ANS_Cancel_1500 onCancel data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertEqual(15);
console.info("========ANS_Cancel_1500 onCancel id : =======================>" + data.request.id);
expect(data.request.label).assertEqual("1500");
console.info("========ANS_Cancel_1500 onCancel label : =======================>" + data.request.label);
console.info("========ANS_Cancel_1500 onCancel end=======================>");
}
function cancelCallBackCancelLabelIsUnremoveable(err){
console.info("===============cancelCallBack_cancel_label_isUnremoveable_1500 start=======================>");
console.info("================cancelCallBack_1500 err : =======================>" + JSON.stringify(err));
console.info("============onConsume_cancel_label_isUnremoveable_1500 end=======================>");
console.info("========ANS_Cancel_1500 cancelCallBack start=========>");
console.info("========ANS_Cancel_1500 cancelCallBack err:==========>" + JSON.stringify(err));
console.info("========ANS_Cancel_1500 cancelCallBack end===========>");
}
/*
......@@ -1133,7 +1136,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabelIsUnremoveable,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1500_promise==================>");
console.info("=======ANS_Cancel_1500 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1165,28 +1168,31 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1500 done==================>");
}),1000);
console.info("===========ANS_Cancel_1500 publish promise=============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1500 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelLabelIsUnremoveablePromise(data) {
console.info("================onConsume_cancel_label_isUnremoveable_1600 start=======================>");
console.info("================onConsume_1600 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1600 label: =======================>" + data.request.label);
console.info("================onConsume_1600 id: =======================>" + data.request.id);
console.info("============ANS_Cancel_1600 onConsume start==================>");
console.info("============ANS_Cancel_1600 onConsume data:==================>" + JSON.stringify(data));
console.info("============ANS_Cancel_1600 onConsume label:=================>" + data.request.label);
console.info("============ANS_Cancel_1600 onConsume id:====================>" + data.request.id);
notify.cancel(data.request.id, data.request.label)
console.info("==========cancel_label_isUnremoveable_promise_1600 end==========>");
console.info("================onConsume_cancel_label_isUnremoveable_1600 end=======================>");
console.info("============ANS_Cancel_1600 onConsume cancel end==========>");
console.info("============ANS_Cancel_1600 onConsume end====================>");
}
function onCancelCancelLabelIsUnremoveablePromise(data) {
console.info("===============onConsume_cancel_label_isUnremoveable_1600 start=======================>");
console.info("===============onConsume_1600 data : =======================>" + JSON.stringify(data));
console.info("===============onConsume_cancel_label_isUnremoveable_1600 end=======================>");
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===================>");
}
/*
......@@ -1202,7 +1208,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabelIsUnremoveablePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1600_promise==================>");
console.info("==============ANS_Cancel_1600 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1234,34 +1240,33 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1600_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1600 done==================>");
}),1000);
console.info("==============ANS_Cancel_1600 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1600 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelWrongLabel(data) {
console.info("================onConsume_cancel_wrongLabel_1700 start=======================>");
console.info("================onConsume_1700 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1700 label: =======================>" + data.request.label);
console.info("================onConsume_1700 id: =======================>" + data.request.id);
console.info("================ANS_Cancel_1700 onConsume start===============>");
console.info("================ANS_Cancel_1700 onConsume data:===============>" + JSON.stringify(data));
console.info("================ANS_Cancel_1700 onConsume label:==============>" + data.request.label);
console.info("================ANS_Cancel_1700 onConsume id:=================>" + data.request.id);
notify.cancel(data.request.id, "9999", cancelCallBackCancelWrongLabel);
console.info("================onConsume_1700 cancel_label=======================>");
console.info("================onConsume_cancel_wrongLabel_1700 end=======================>");
console.info("================ANS_Cancel_1700 onConsume cancel=======================>");
console.info("================ANS_Cancel_1700 onConsume end=======================>");
}
function onCancelCancelWrongLabel(data) {
console.info("================onCancel_cancel_wrongLabel_1700 start=======================>");
console.info("================onCancel_1700 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(0);
expect(data.request.label).assertequal("0");
console.info("=================onCancel_cancel_wrongLabel_1700 end=======================>");
console.info("================ANS_Cancel_1700 onCancel start===============>");
console.info("================ANS_Cancel_1700 onCancel data:===============>" + JSON.stringify(data));
expect().assertFail(0);
console.info("================ANS_Cancel_1700 onCancel end=================>");
}
function cancelCallBackCancelWrongLabel(err){
console.info("================cancelCallBack_cancel_wrongLabel_1700 start=======================>");
console.info("================cancelCallBack_1700 err : =======================>" + JSON.stringify(err));
console.info("================cancelCallBack_cancel_wrongLabel_1700 end=======================>");
console.info("================ANS_Cancel_1700 cancelCallBack start=================>");
console.info("================ANS_Cancel_1700 cancelCallBack err:==================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("================ANS_Cancel_1700 cancelCallBack end===================>");
}
/*
......@@ -1277,7 +1282,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelWrongLabel,
}
await notify.subscribe(subscriber);
console.info("===============subscribe_1700_promise==================>");
console.info("==============ANS_Cancel_1700 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1309,29 +1314,27 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1700_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1700_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1700 done==================>");
}),1000);
console.info("==============ANS_Cancel_1700 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1700 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelWrongLabelPromise(data) {
console.info("onConsume_cancel_wrongLabel_1800 start=======================>");
console.info("onConsume_cancel_wrongLabel_1800 data: =======================>" + JSON.stringify(data));
console.info("onConsume_cancel_wrongLabel_1800 label: =======================>" + data.request.label);
console.info("onConsume_cancel_wrongLabel_1800 id: =======================>" + data.request.id);
console.info("=========ANS_Cancel_1800 onConsume start================>");
console.info("=========ANS_Cancel_1800 onConsume data:================>" + JSON.stringify(data));
console.info("=========ANS_Cancel_1800 onConsume label:===============>" + data.request.label);
console.info("=========ANS_Cancel_1800 onConsume id:==================>" + data.request.id);
notify.cancel(data.request.id, "9999");
console.info("================onConsume_cancel_wrongLabel_1800 end=======================>");
console.info("=========ANS_Cancel_1800 onConsume end=======================>");
}
function onCancelCancelWrongLabelPromise(data) {
console.info("================onCancel_cancel_wrongLabel_1800 start=======================>");
console.info("================onCancel_1800 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(0);
expect(data.request.label).assertequal("0");
console.info("================onCancel_cancel_wrongLabel_1800 end=======================>");
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=======================>");
}
/*
......@@ -1347,7 +1350,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelWrongLabelPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1800_promise==================>");
console.info("==============ANS_Cancel_1800 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1379,35 +1382,34 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1800_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1800_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_1800 done==================>");
}),1000);
console.info("==============ANS_Cancel_1800 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1800 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelLabelNullCharacter(data) {
console.info("================onConsume_cancel_label_nullCharacter_1900 start=======================>");
console.info("================onConsume_1900 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_1900 label: =======================>" + data.request.label);
console.info("================onConsume_1900 id: =======================>" + data.request.id);
console.info("===========ANS_Cancel_1900 onConsume start==================>");
console.info("===========ANS_Cancel_1900 onConsume data:==================>" + JSON.stringify(data));
console.info("===========ANS_Cancel_1900 onConsume label:=================>" + data.request.label);
console.info("===========ANS_Cancel_1900 onConsume id:====================>" + data.request.id);
notify.cancel(data.request.id, "", cancelCallBackCancelNullCharacter);
console.info("================onConsume_cancel_nullCharacte_1900 cancel_label=======================>");
console.info("================onConsume_cancel_nullCharacte_1900 end=======================>");
console.info("===========ANS_Cancel_1900 onConsume cancel=======================>");
console.info("===========ANS_Cancel_1900 onConsume end=======================>");
}
function onCancelCancelLabelNullCharacter(data) {
console.info("onCancel_cancel_label_nullCharacter_1900 start=======================>");
console.info("================onCancel_1900 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(0);
expect(data.request.label).assertequal("0");
console.info("onCancel_cancel_nullCharacter_1900 end=======================>");
console.info("===========ANS_Cancel_1900 onCancel start================>");
console.info("===========ANS_Cancel_1900 onCancel data:================>" + JSON.stringify(data));
expect().assertFail(0);
console.info("===========ANS_Cancel_1900 onCancel end=======================>");
}
function cancelCallBackCancelNullCharacter(err){
console.info("==============cancelCallBack_cancel_nullCharacter_1900 start=======================>");
console.info("==============cancelCallBack_1900 err : =======================>" + JSON.stringify(err));
console.info("==============cancelCallBack_cancel_nullCharacter_1900 end=======================>");
console.info("===========ANS_Cancel_1900 cancelCallBack start=================>");
console.info("===========ANS_Cancel_1900 cancelCallBack err:==================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("===========ANS_Cancel_1900 cancelCallBack end===================>");
}
/*
......@@ -1423,7 +1425,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabelNullCharacter,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1900_promise==================>");
console.info("=============ANS_Cancel_1900 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1455,31 +1457,28 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1900_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1900_promise==================>");
setTimeout((function(){
console.info("==================ANS_Cancel_1900 done==================>");
}),1000);
done();
console.info("==========ANS_Cancel_1900 publish promise==============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_1900 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelNullCharacter(data) {
console.info("==========onConsume_cancel_nullCharacte_2000 start=======================>");
console.info("==========onConsume_2000 data: =======================>" + JSON.stringify(data));
console.info("==========onConsume_2000 label: =======================>" + data.request.label);
console.info("==========onConsume_2000 id: =======================>" + data.request.id);
console.info("==========ANS_Cancel_2000 onConsume start=================>");
console.info("==========ANS_Cancel_2000 onConsume data:=================>" + JSON.stringify(data));
console.info("==========ANS_Cancel_2000 onConsume label:================>" + data.request.label);
console.info("==========ANS_Cancel_2000 onConsume id:===================>" + data.request.id);
notify.cancel(data.request.id, "");
console.info("==========cancel_nullCharacte_2000 end==========>");
console.info("================onConsume_cancel_nullCharacte_2000 end=======================>");
console.info("==========ANS_Cancel_2000 onConsume cancel end==========>");
console.info("==========ANS_Cancel_2000 onConsume end=================>");
}
function onCancelCancelNullCharacter(data) {
console.info("================onCancel_cancel_nullCharacter_2000 start=======================>");
console.info("================onCancel_2000 data : =======================>" + JSON.stringify(data));
console.info("================onCancel_2000 err : =======================>" + JSON.stringify(err));
expect(data.request.id).assertequal(0);
expect(data.request.label).assertequal("0");
console.info("================onCancel_cancel_nullCharacter_2000 end=======================>");
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=======================>");
}
/*
......@@ -1495,7 +1494,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelNullCharacter,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2000_promise==================>");
console.info("=========ANS_Cancel_2000 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1527,51 +1526,52 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2000_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2000_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2000 done==================>");
}),1000);
console.info("============ANS_Cancel_2000 publish promise===============>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2000 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
var id2100
var label2100
function onConsumeCancelLabel2Times(data) {
console.info("onConsume_cancel_label_2Times_2100 start=======================>");
console.info("onConsume_cancel_label_2Times_2100 data:====================>" + JSON.stringify(data));
console.info("onConsume_cancel_label_2Times_2100 label:====================>" + data.request.label);
console.info("onConsume_cancel_label_2Times_2100 id:====================>" + data.request.id);
console.info("=========ANS_Cancel_2100 onConsume start==================>");
console.info("=========ANS_Cancel_2100 onConsume data:==================>" + JSON.stringify(data));
console.info("=========ANS_Cancel_2100 onConsume label:=================>" + data.request.label);
console.info("=========ANS_Cancel_2100 onConsume id:====================>" + data.request.id);
id2100 = data.request.id
label2100 = data.request.label
notify.cancel(id2100, label2100, cancelCallBackCancelLabel2Times1);
console.info("=============onConsume_cancel_label_2Times_2100 cancel_label=======================>");
console.info("=============onConsume_cancel_label_2Times_2100 end=======================>");
console.info("=========ANS_Cancel_2100 onConsume cancel=======================>");
console.info("=========ANS_Cancel_2100 onConsume end=======================>");
}
function onCancelCancelLabel2Times(data) {
timesOfOnCancel = timesOfOnCancel + 1
console.info("===============onCancel_cancel_label_2Times_2100 start=======================>");
console.info("===============onCancel_2100 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.id).assertEqual(21);
expect(data.request.label).assertEqual("2100");
}else if(timesOfOnCancel == 2){
expect().assertFail();
}
console.info("================onCancel_cancel_label_2Times_2100 end=======================>");
console.info("=========ANS_Cancel_2100 onCancel end==========>");
}
function cancelCallBackCancelLabel2Times1(err){
console.info("================cancelCallBack_cancel_label_2Times1_2100 start=======================>");
console.info("================cancelCallBack_2100 err : =======================>" + JSON.stringify(err));
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 start============>");
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 err==============>" + JSON.stringify(err));
expect(err.code).assertEqual(0);
notify.cancel(id2100, label2100, cancelCallBackCancelLabel2Times2);
console.info("===============cancelCallBack_2100 cancel_label_2Times1=======================>");
console.info("===============cancelCallBack_2Times1_2100 end=======================>");
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 cancel =======================>");
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times1 end=======================>");
}
function cancelCallBackCancelLabel2Times2(err){
console.info("================cancelCallBack_cancel_label_2Times2_2100 start=======================>");
console.info("================cancelCallBack_2100 err : =======================>" + JSON.stringify(err));
console.info("================cancelCallBack_cancel_label_2Times2_2100 end=======================>");
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 start================>");
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 err:=================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("=========ANS_Cancel_2100 cancelCallBack 2Times2 end==================>");
}
/*
......@@ -1588,7 +1588,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabel2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2100_promise==================>");
console.info("=============ANS_Cancel_2100 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1620,41 +1620,40 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2100_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2100 done==================>");
}),1000);
console.info("=============ANS_Cancel_2100 publish promise================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2100 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
var id2200
var label2200
function onConsumeCancelLabelPromise2Times(data) {
console.info("================onConsume_cancel_label_2Times_poromise_2200 start=======================>");
console.info("onConsume_cancel_label_2Times_poromise_2200 data:========>" + JSON.stringify(data));
console.info("onConsume_cancel_label_2Times_poromise_2200 label:========>" + data.request.label);
console.info("onConsume_cancel_label_2Times_poromise_2200 id:========>" + data.request.id);
console.info("===========ANS_Cancel_2200 onConsume start=======================>");
console.info("===========ANS_Cancel_2200 onConsume data:=========>" + JSON.stringify(data));
console.info("===========ANS_Cancel_2200 onConsume label:========>" + data.request.label);
console.info("===========ANS_Cancel_2200 onConsume id:===========>" + data.request.id);
id2200 = data.request.id
label2200 = data.request.label
notify.cancel(id2200, label2200);
console.info("==========cancel_label_2Times1_promise_2200 end==========>");
console.info("===========ANS_Cancel_2200 onConsume cancel1==========>");
notify.cancel(id2200, label2200)
console.info("==========cancel_label_2Times2_promise_2200 end==========>");
console.info("================onConsume_cancel_label_2Times_poromise_2200 end=======================>");
console.info("===========ANS_Cancel_2200 onConsume cancel2==========>");
console.info("===========ANS_Cancel_2200 onConsume end==============>");
}
function onCancelCancelLabelPromise2Times(data) {
console.info("onCancel_cancel_label_2Times_2200 start=======================>");
console.info("===========ANS_Cancel_2200 onCancel start===================>");
console.info("===========ANS_Cancel_2200 onCancel data:===================>" + JSON.stringify(data));
timesOfOnCancel = timesOfOnCancel + 1
console.info("onCancel_cancel_label_2Times_2200 data : =======================>" + JSON.stringify(data));
if (timesOfOnCancel == 1){
expect(data.request.id).assertequal(22);
expect(data.request.label).assertequal("2200");
expect(data.request.id).assertEqual(22);
expect(data.request.label).assertEqual("2200");
}else if (timesOfOnCancel == 2){
expect().assertFail();
}
console.info("================onCancel_cancel_label_2Times_2200 end=======================>");
console.info("===========ANS_Cancel_2200 onCancel end=======================>");
}
/*
......@@ -1671,7 +1670,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelLabelPromise2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2200_promise==================>");
console.info("================ANS_Cancel_2200 subscribe_2200_promise=============>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1703,41 +1702,41 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2200_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2200 done==================>");
}),1000);
console.info("================ANS_Cancel_2200 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2200 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelRightLabelWrongId(data) {
console.info("================onConsume_cancel_rightLabel_wrongId_2300 start=======================>");
console.info("================onConsume_2300 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_2300 label: =======================>" + data.request.label);
console.info("================onConsume_2300 id: =======================>" + data.request.id);
console.info("============ANS_Cancel_2300 onConsume start=======================>");
console.info("============ANS_Cancel_2300 onConsume data: =======================>" + JSON.stringify(data));
console.info("============ANS_Cancel_2300 onConsume label: =======================>" + data.request.label);
console.info("============ANS_Cancel_2300 onConsume id: =======================>" + data.request.id);
notify.cancel(11111, data.request.label, cancelCallBackCancelRightLabelWrongId);
console.info("================onConsume_2300 cancel_rightLabel_wrongId=======================>");
console.info("================onConsume_cancel_rightLabel_wrongId_2300 end=======================>");
console.info("============ANS_Cancel_2300 onConsume cancel=======================>");
console.info("============ANS_Cancel_2300 onConsume end=======================>");
}
function onCancelCancelRightLabelWrongId(data) {
console.info("===================onCancel_cancel_rightLabel_wrongId_2300 start=======================>");
console.info("================onCancel_2300 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("================onCancel_cancel_rightLabel_wrongId_2300 end=======================>");
console.info("============ANS_Cancel_2300 onCancel end=======================>");
}
function cancelCallBackCancelRightLabelWrongId(err){
console.info("cancelCallBack_cancel_rightLabel_wrongId_2300 start=======================>");
console.info("cancelCallBack_cancel_rightLabel_wrongId_2300 err:===============>" + JSON.stringify(err));
console.info("cancelCallBack_cancel_rightLabel_wrongId_2300 end===================>");
console.info("============ANS_Cancel_2300 cancelCallBack start=======================>");
console.info("============ANS_Cancel_2300 cancelCallBack err:===============>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("============ANS_Cancel_2300 cancelCallBack end===================>");
}
/*
* @tc.number: ANS_Cancel_2300
* @tc.name: cancel(id: number, label: string, callback: AsyncCallback<void>): void
* @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback<void>):
void interface is called, the label is correct and the ID is correct wrong.
void interface is called, the label is correct and the ID is wrong.
*/
it('ANS_Cancel_2300', 0, async function (done) {
console.info("===============ANS_Cancel_2300 start==========================>");
......@@ -1746,7 +1745,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelRightLabelWrongId,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2300_promise==================>");
console.info("================ANS_Cancel_2300 promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1778,31 +1777,28 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2300_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2300_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2300 done==================>");
}),1000);
console.info("============ANS_Cancel_2300 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2300 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelRightLabelWrongIdPromise(data) {
console.info("onConsume_cancel_rightLabel_wrongId_promise_2400 start=======================>");
console.info("================onConsume_2400 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_2400 label: =======================>" + data.request.label);
console.info("================onConsume_2400 id: =======================>" + data.request.id);
console.info("============ANS_Cancel_2400 onConsume start==============>");
console.info("============ANS_Cancel_2400 onConsume data:==============>" + JSON.stringify(data));
console.info("============ANS_Cancel_2400 onConsume label:=============>" + data.request.label);
console.info("============ANS_Cancel_2400 onConsume id:================>" + data.request.id);
notify.cancel(11111, data.request.label)
console.info("==========cancel_rightLabel_wrongId_promise_2400 end==========>");
console.info("================onConsume_2400 cancel_rightLabel_wrongId=======================>");
console.info("================onConsume_2400 end=======================>");
console.info("============ANS_Cancel_2400 onConsume cancel==========>");
console.info("============ANS_Cancel_2400 onConsume end=============>");
}
function onCancelCancelRightLabelWrongIdPromise(data) {
console.info("================onCancel_cancel_rightLabel_wrongId_2400 start : =======================>");
console.info("================onCancel_2400 data : =======================>" + JSON.stringify(data));
expect(data.request.id).assertequal(0);
expect(data.request.label).assertequal("0");
console.info("================onCancel_cancel_rightLabel_wrongId_2400 end=======================>");
console.info("============ANS_Cancel_2400 onCancel start:==============>");
console.info("============ANS_Cancel_2400 onCancel data:===============>" + JSON.stringify(data));
expect().assertFail();
console.info("============ANS_Cancel_2400 onCancel end=======================>");
}
/*
......@@ -1818,7 +1814,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelRightLabelWrongIdPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2400_promise==================>");
console.info("============ANS_Cancel_2400 subscribe promise========>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1850,34 +1846,34 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2400_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2400_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2400 done==================>");
}),1000);
console.info("============ANS_Cancel_2400 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2400 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelWrongLabelWrongId(data) {
console.info("================onConsume_cancel_wrongLabel_wrongId_2500 start=======================>");
console.info("================onConsume_2500 data: =======================>" + JSON.stringify(data));
console.info("================onConsume_2500 label: =======================>" + data.request.label);
console.info("================onConsume_2500 id: =======================>" + data.request.id);
console.info("==========ANS_Cancel_2500 onConsume start=======================>");
console.info("==========ANS_Cancel_2500 onConsume data:=======================>" + JSON.stringify(data));
console.info("==========ANS_Cancel_2500 onConsume label:======================>" + data.request.label);
console.info("==========ANS_Cancel_2500 onConsume id==========================>" + data.request.id);
notify.cancel(6666, "6666", cancelCallBackCancelWrongLabelWrongId);
console.info("================onConsume__2500 cancel=======================>");
console.info("================onConsume_cancel_wrongLabel_wrongId_2500 end=======================>");
console.info("==========ANS_Cancel_2500 onConsume cancel====================>");
console.info("==========ANS_Cancel_2500 onConsume end=======================>");
}
function onCancelCancelWrongLabelWrongId(data) {
console.info("================onCancel_cancel_wrongLabel_wrongId_2500 start=======================>");
console.info("================onCancel_2500 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("================onCancel_cancel_wrongLabel_wrongId_2500 end=======================>");
console.info("==========ANS_Cancel_2500 onCancel end======================>");
}
function cancelCallBackCancelWrongLabelWrongId(err){
console.info("cancelCallBack_cancel_wrongLabel_wrongId_2500 start=======================>");
console.info("cancelCallBack_cancel_wrongLabel_wrongId_2500 err:================>" + JSON.stringify(err));
console.info("cancelCallBack_cancel_wrongLabel_wrongId_2500 end=======================>");
console.info("==========ANS_Cancel_2500 cancelCallBack start=======================>");
console.info("==========ANS_Cancel_2500 cancelCallBack err:================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("==========ANS_Cancel_2500 cancelCallBack end=======================>");
}
/*
......@@ -1893,7 +1889,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelWrongLabelWrongId,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2500_promise==================>");
console.info("================ANS_Cancel_2500 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1925,29 +1921,28 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2500 done==================>");
}),1000);
console.info("==========ANS_Cancel_2500 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2500 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
function onConsumeCancelWrongLabelWrongIdPromise(data) {
console.info("===========onConsume_cancel_wrongLabel_wrongId_2600 start=======================>");
console.info("onConsume_cancel_2600 data: =======================>" + JSON.stringify(data));
console.info("onConsume_cancel_2600 label: =======================>" + data.request.label);
console.info("onConsume_cancel_2600 id: =======================>" + data.request.id);
console.info("========ANS_Cancel_2600 onConsume start:=============>");
console.info("========ANS_Cancel_2600 onConsume data:==============>" + JSON.stringify(data));
console.info("========ANS_Cancel_2600 onConsume label:=============>" + data.request.label);
console.info("========ANS_Cancel_2600 onConsume id:================>" + data.request.id);
notify.cancel(6666, "6666")
console.info("==========cancel_wrongLabel_wrongId_2600 end==========>");
console.info("================onConsume_cancel_wrongLabel_wrongId_2600 end=======================>");
console.info("========ANS_Cancel_2600 onConsume end================>");
console.info("========ANS_Cancel_2600 onConsume end================>");
}
function onCancelCancelWrongLabelWrongIdPromise(data) {
console.info("================onCancel_cancel_wrongLabel_wrongId_2600 start=======================>");
console.info("onCancel_2600 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("================onCancel_cancel_wrongLabel_wrongId_2600 end=======================>");
console.info("========ANS_Cancel_2600 onCancel end=======================>");
}
/*
......@@ -1963,7 +1958,7 @@ describe('ActsAnsNotificationCancel', function () {
onCancel:onCancelCancelWrongLabelWrongIdPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2600_promise==================>");
console.info("===============ANS_Cancel_2600 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1995,12 +1990,11 @@ describe('ActsAnsNotificationCancel', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2600_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Cancel_2600 done==================>");
}),1000);
console.info("===============ANS_Cancel_2600 publish promise==================>");
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info("======ANS_Cancel_2600 setTimeout unsubscribe end==================>");
done();
}),timeout);
})
})
\ No newline at end of file
......@@ -15,8 +15,7 @@
import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var timeout = 500;
describe('ActsAnsNotificationRemove', function () {
console.info("===========ActsAnsNotificationRemove start====================>");
var subscriber;
......@@ -25,27 +24,27 @@ describe('ActsAnsNotificationRemove', function () {
}
var hashCode;
function onConsumeRemove(data) {
console.info("=============OnConsume_remove_0100=======================>");
console.info("=============OnConsume_remove_0100 data:==================>" + JSON.stringify(data));
console.info("=============OnConsume_remove_0100 hascode:===============>" + data.request.hashCode);
console.info("=============ANS_Remove_0100 onConsume start=======================>");
console.info("=============ANS_Remove_0100 onConsume data:==================>" + JSON.stringify(data));
console.info("=============ANS_Remove_0100 onConsume hascode:===============>" + data.request.hashCode);
hashCode = data.request.hashCode
notify.remove(hashCode,removeCallBack);
console.info("================OnConsume_remove_0100 remove=======================>");
console.info("================OnConsume_remove_0100 end=======================>");
console.info("=============ANS_Remove_0100 onConsume remove=======================>");
console.info("=============ANS_Remove_0100 onConsume end=======================>");
}
function onCancelRemove(data) {
console.info("==========================OnCancel_remove_0100=======================>");
console.info("================OnCancel_remove_0100 data : =======================>" + JSON.stringify(data));
console.info("================OnCancel_remove_0100 hashCode=======================>" + hashCode);
console.info("================OnCancel_0100 data.request.hashCode==========>" + data.request.hashCode);
expect(hashCode).assertequal(data.request.hashCode);
console.info("================OnCancel_remove_0100 end=======================>");
console.info("==========ANS_Remove_0100 onCancel start==================>");
console.info("==========ANS_Remove_0100 onCancel data : ================>" + JSON.stringify(data));
console.info("==========ANS_Remove_0100 onCancel hashCode===============>" + hashCode);
console.info("==========ANS_Remove_0100 onCancel data.request.hashCode==>" + data.request.hashCode);
expect(hashCode).assertEqual(data.request.hashCode);
console.info("==========ANS_Remove_0100 onCancel end=======================>");
}
function removeCallBack(err, data) {
console.info("================removeCallBack_0100 err : =======================>" + JSON.stringify(err));
console.info("================removeCallBack_0100 data : =======================>" + JSON.stringify(data));
console.info("==========ANS_Remove_0100 removeCallBack err=========>" + JSON.stringify(err));
console.info("==========ANS_Remove_0100 removeCallBack data : =======================>" + JSON.stringify(data));
}
function subscriberCallBack(err, data) {
console.info("================subscriberCallBack err : =======================>" + JSON.stringify(err));
......@@ -70,7 +69,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemove,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0100_promise==================>");
console.info("==================ANS_Remove_0100 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -102,33 +101,34 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0100_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0100 done==================>");
}),1000);
console.info("=============ANS_Remove_0100 publish promise===========>");
setTimeout((async function(){
console.info("======ANS_Remove_0100 setTimeout==================>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0100 setTimeout unsubscribe==================>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemovePromise(data) {
console.info("================OnConsume_remove_promise_0200=======================>");
console.info("================OnConsume_remove_promise_0200 data:================>" + JSON.stringify(data));
console.info("================OnConsume_remove_promise_0200 hascode:=============>" + data.request.hashCode);
console.info("================ANS_Remove_0200 onConsume start===============>");
console.info("================ANS_Remove_0200 onConsume data================>" + JSON.stringify(data));
hashCode = data.request.hashCode
console.info("================ANS_Remove_0200 onConsume hascode:========>" + data.request.hashCode);
notify.remove(hashCode);
console.info("================OnConsume_remove_promise_0200 remove=======================>");
console.info("================OnConsume_remove_promise_0200 end=======================>");
console.info("================ANS_Remove_0200 onConsume remove============>");
console.info("================ANS_Remove_0200 onConsume end===============>");
}
function onCancelRemovePromise(data) {
console.info("==========================OnCancel_remove_0200=======================>");
console.info("================OnCancel_remove_0200 data : =======================>" + JSON.stringify(data));
console.info("================OnCancel_remove_0200 hashCode=======================>" + hashCode);
console.info("================OnCancel_remove_0200 data.request.hashCode==========>" + data.request.hashCode);
expect(hashCode).assertequal(data.request.hashCode);
console.info("================OnCancel_remove_0200 end=======================>");
console.info("===========ANS_Remove_0200 onCancel start================>");
console.info("===========ANS_Remove_0200 onCancel data:=================>" + JSON.stringify(data));
console.info("===========ANS_Remove_0200 onCancel hashCode====================>" + hashCode);
console.info("===========ANS_Remove_0200 onCancel data.request.hashCode=======>" + data.request.hashCode);
expect(hashCode).assertEqual(data.request.hashCode);
console.info("===========ANS_Remove_0200 onCancel end===================>");
}
/*
......@@ -145,7 +145,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemovePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0200_promise==================>");
console.info("===============ANS_Remove_0200 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -177,33 +177,34 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0200 done==================>");
}),1000);
console.info("======ANS_Remove_0200 publish==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0200 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0200 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveErrHashCode(data) {
console.info("================OnConsume_removeErrHashCode_0300 start=======================>");
console.info("================OnConsume_removeErrHashCode_0300 data:=============>" + JSON.stringify(data));
console.info("================ANS_Remove_0300 onConsume start=======================>");
console.info("================ANS_Remove_0300 onConsume data:=============>" + JSON.stringify(data));
notify.remove("errorHashCode",removeErrHashCodeCallBack);
console.info("================OnConsume_removeErrHashCode_0300 end=======================>");
console.info("================ANS_Remove_0300 onConsume remove=======================>");
console.info("================ANS_Remove_0300 onConsume end=======================>");
}
function onCancelRemoveErrHashCode() {
console.info("================OnCancel_removeErrHashCode_0300 start=======================>");
console.info("==========================OnCancel_removeErrHashCode_0300=======================>");
console.info("================ANS_Remove_0300 onCancel start=======================>");
expect().assertFail();
console.info("================OnCancel_removeErrHashCode_0300 end=======================>");
console.info("================ANS_Remove_0300 onCancel end=======================>");
}
function removeErrHashCodeCallBack(err,data) {
console.info("================removeErrHashCodeCallBack_0300 start=======================>");
console.info("================removeErrHashCodeCallBack_0300=======================>" + JSON.stringify(err));
console.info("================removeErrHashCodeCallBack_0300=======================>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeErrHashCodeCallBack_0300 end=======================>");
console.info("==========ANS_Remove_0300 removeCallBack start==============>");
console.info("==========ANS_Remove_0300 removeCallBack err====================>" + JSON.stringify(err));
console.info("==========ANS_Remove_0300 removeCallBack data===============>" + JSON.stringify(data));
expect(err.code != 0).assertEqual(true);
console.info("==========ANS_Remove_0300 removeCallBack end=======================>");
}
/*
......@@ -219,7 +220,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveErrHashCode,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0300_promise==================>");
console.info("==================ANS_Remove_0300 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -251,23 +252,28 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0300_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0300_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0300 done==================>");
}),1000);
console.info("==================ANS_Remove_0300 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0300 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0300 setTimeout unsubscribe============>");
await notify.cancelAll()
done();
}),timeout);
})
function onConsumeRemoveErrHashCodePromise(data) {
console.info("===========OnConsume_removeErrHashCode_promise_0400 data:===========>" + JSON.stringify(data));
console.info("===========ANS_Remove_0400 onConsume start:===========>");
console.info("===========ANS_Remove_0400 onConsume data:===========>" + JSON.stringify(data));
notify.remove("errorHashCode");
console.info("================OnConsume_removeErrHashCode_promise_0400 end=======================>");
console.info("===========ANS_Remove_0400 onConsume remove:===========>");
console.info("===========ANS_Remove_0400 onConsume end:===========>");
}
function onCancelRemoveErrHashCodePromise() {
console.info("==========================OnCancel_RemoveErrHashCode_Promise_0400=======================>");
console.info("===========ANS_Remove_0400 onCancel start:===========>");
expect().assertFail();
console.info("===========ANS_Remove_0400 onCancel end:===========>");
}
/*
......@@ -283,7 +289,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveErrHashCodePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0400_promise==================>");
console.info("===============ANS_Remove_0400 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -315,33 +321,36 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0400_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0400_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0400 done==================>");
}),1000);
console.info("==================ANS_Remove_0400 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0400 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0400 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveUseEmptyCharacter(data) {
console.info("================OnConsume_removeUseEmptyCharacter_0500 start=======================>");
console.info("OnConsume_removeUseEmptyCharacter_0500 data:===================>" + JSON.stringify(data));
console.info("================ANS_Remove_0500 onConsume start==============>");
console.info("================ANS_Remove_0500 onConsume data:==============>" + JSON.stringify(data));
notify.remove('',removeCallBackUseEmptyCharacter);
console.info("================OnConsume_removeUseEmptyCharacter_0500 end=======================>");
console.info("================ANS_Remove_0500 onConsume remove=============>");
console.info("================ANS_Remove_0500 onConsume end================>");
}
function onCancelRemoveUseEmptyCharacter(data) {
console.info("OnCancel_removeUseEmptyCharacter_0500 start=======================>");
console.info("================OnCancel_0500 data : =======================>" + JSON.stringify(data));
console.info("=============ANS_Remove_0500 onCancel start===============>");
console.info("=============ANS_Remove_0500 onCancel data:===============>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeUseEmptyCharacter_0500 end=======================>");
console.info("=============ANS_Remove_0500 onCancel end=================>");
}
function removeCallBackUseEmptyCharacter(err) {
console.info("================removeCallBack_UseEmptyCharacter_0500 start=======================>");
console.info("removeCallBack_UseEmptyCharacter_0500 err=======================>" + JSON.stringify(err));
expect(err.code).assertNotEqual(0);
console.info("================removeCallBack_UseEmptyCharacter_0500 end=======================>");
console.info("=============ANS_Remove_0500 removeCallBack start===============>");
console.info("=============ANS_Remove_0500 removeCallBack err=================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("=============ANS_Remove_0500 removeCallBack end=================>");
}
/*
......@@ -358,7 +367,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveUseEmptyCharacter,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0500_promise==================>");
console.info("==================ANS_Remove_0500 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -390,28 +399,29 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0500 done==================>");
}),1000);
console.info("==================ANS_Remove_0500 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0500 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0500 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function OnConsumeRemoveUseEmptyCharacterPromise(data) {
console.info("================OnConsume_removeUseEmptyCharacter_promise_0600 start=======================>");
console.info("OnConsume_removeUseEmptyCharacter_promise_0600 data:==================>" + JSON.stringify(data));
console.info("================ANS_Remove_0600 onConsume start=======================>");
console.info("================ANS_Remove_0600 onConsume data:==================>" + JSON.stringify(data));
notify.remove('',removeCallBackUseEmptyCharacter);
console.info("================OnConsume_removeUseEmptyCharacter_promise_0600 remove=======================>");
console.info("================OnConsume_removeUseEmptyCharacter_promise_0600 end=======================>");
console.info("================ANS_Remove_0600 onConsume remove=======================>");
console.info("================ANS_Remove_0600 onConsume end=======================>");
}
function OnCancelRemoveUseEmptyCharacterPromise(data) {
console.info("==============OnCancel_removeUseEmptyCharacter_0600 start================>");
console.info("OnCancel_removeUseEmptyCharacter_0600 data:=============>" + JSON.stringify(data));
console.info("==============ANS_Remove_0600 onCancel start=============>");
console.info("==============ANS_Remove_0600 onCancel data:=============>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeUseEmptyCharacter_0600 end=======================>");
console.info("==============ANS_Remove_0600 onCancel end===============>");
}
/*
......@@ -421,13 +431,13 @@ describe('ActsAnsNotificationRemove', function () {
remove(hashCode: string): Promise<void> to delete the notification information
*/
it('ANS_Remove_0600', 0, async function (done) {
console.info("===============ANS_Remove_0600==========================>");
console.info("===============ANS_Remove_0600 start==========================>");
var subscriber ={
onConsume:OnConsumeRemoveUseEmptyCharacterPromise,
onCancel:OnCancelRemoveUseEmptyCharacterPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0600_promise==================>");
console.info("==================ANS_Remove_0600 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -459,35 +469,36 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0600_promise==================>");
setTimeout((function(){
console.info("==================ANS_Remove_0600 done==================>");
}),1000);
done();
console.info("==================ANS_Remove_0600 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0600 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0600 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveNotExistHashCode(data) {
console.info("================OnConsume_removeNotExistHashCode_0700=======================>");
console.info("OnConsume_removeNotExistHashCode_0700 data: =======================>" + JSON.stringify(data));
console.info("==============ANS_Remove_0700 onConsume start===================>");
console.info("==============ANS_Remove_0700 onConsume data:===================>" + JSON.stringify(data));
notify.remove("9999_9999_9",removeNotExistHashCodeCallBack);
console.info("================OnConsume_removeNotExistHashCode_0700 remove=======================>");
console.info("================OnConsume_removeNotExistHashCode_0700 end=======================>");
console.info("==============ANS_Remove_0700 onConsume remove===================>");
console.info("==============ANS_Remove_0700 onConsume end===================>");
}
function onCancelRemoveNotExistHashCode(data) {
console.info("===========OnCancel_removeNotExistHashCode_0700 start=======================>");
console.info("OnCancel_removeNotExistHashCode_0700 data:============>" + JSON.stringify(data));
console.info("==============ANS_Remove_0700 onCancel start=======================>");
console.info("==============ANS_Remove_0700 onCancel data:============>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeNotExistHashCode_0700 end=======================>");
console.info("==============ANS_Remove_0700 onCancel end=======================>");
}
function removeNotExistHashCodeCallBack(err) {
console.info("================removeNotExistHashCodeCallBack_0700 start=======================>");
console.info("=============removeNotExistHashCodeCallBack_0700=================>" + JSON.stringify(err));
expect(err.code).assertNotEqual(0);
console.info("================removeNotExistHashCodeCallBack_0700 end=======================>");
console.info("==========ANS_Remove_0700 removeCallBack start==========>");
console.info("==========ANS_Remove_0700 removeCallBack err=================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("==========ANS_Remove_0700 removeCallBack end=======================>");
}
/*
......@@ -504,7 +515,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveNotExistHashCode,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0700_promise==================>");
console.info("================ANS_Remove_0700 subscribe promise=======>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -536,27 +547,29 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0700_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0700_promise==================>");
setTimeout((function(){
console.info("==================ANS_Remove_0700 done==================>");
}),1000);
done();
console.info("============ANS_Remove_0700 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0700 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0700 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveNotExistHashCodePromise(data) {
console.info("================OnConsume_removeNotExistHashCode_promise_0800=======================>");
console.info("OnConsume_removeNotExistHashCode_promise_0800 data:===============>" + JSON.stringify(data));
console.info("================ANS_Remove_0800 onConsume start=======================>");
console.info("================ANS_Remove_0800 onConsume data:===============>" + JSON.stringify(data));
notify.remove("9999_9999_9");
console.info("================OnConsume_removeNotExistHashCode_promise_0800 end=======================>");
console.info("================ANS_Remove_0800 onConsume remove====================>");
console.info("================ANS_Remove_0800 onConsume end=======================>");
}
function onCancelRemoveNotExistHashCodePromise(data) {
console.info("================OnCancelCallback_removeNotExistHashCode_promise_0800=======================>");
console.info("================OnCancelCallback_0800 data : =======================>" + JSON.stringify(data));
console.info("============ANS_Remove_0800 onCancel start===============>");
console.info("============ANS_Remove_0800 onCancel data:===============>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancelCallback_removeNotExistHashCode_promise_0800 end===========>");
console.info("============ANS_Remove_0800 onCancel end=================>");
}
/*
......@@ -572,7 +585,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveNotExistHashCodePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0800_promise==================>");
console.info("================ANS_Remove_0800 subscribe promise=======>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -604,34 +617,37 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0800_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0800_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0800 done==================>");
}),1000);
console.info("==========ANS_Remove_0800 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0800 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0800 setTimeout unsubscribe============>");
await notify.cancelAll()
done();
}),timeout);
})
function onConsumeRemoveNonComplianceHashCode(data) {
console.info("================OnConsumeCallback_removeNonComplianceHashCode_0900 start===================>");
console.info("================OnConsumeCallback_0900 data: =======================>" + JSON.stringify(data));
console.info("================ANS_Remove_0900 onConsume start===================>");
console.info("================ANS_Remove_0900 onConsume data: ==================>" + JSON.stringify(data));
notify.remove("哈希码",removeNonComplianceHashCallBack);
console.info("================OnConsumeCallback_removeNonComplianceHashCode_0900 remove===================>");
console.info("================OnConsumeCallback_removeNonComplianceHashCode_0900 end======================>");
console.info("================ANS_Remove_0900 onConsume remove==================>");
console.info("================ANS_Remove_0900 onConsume end=====================>");
}
function onCancelRemoveNonComplianceHashCode(data) {
console.info("================OnCancelCallback_removeNonComplianceHashCode_0900 start====================>");
console.info("================OnCancelCallback_0900 data: =======================>" + JSON.stringify(data));
console.info("================OnCancelCallback_removeNonComplianceHashCode_0900 end=======================>");
console.info("================ANS_Remove_0900 onCancel start====================>");
console.info("================ANS_Remove_0900 onCancel data:====================>" + JSON.stringify(data));
expect().assertFail();
console.info("================ANS_Remove_0900 onCancel end======================>");
}
function removeNonComplianceHashCallBack(err, data) {
console.info("================removeNonComplianceHashCallBack_0900 start=======================>");
console.info("================removeNonComplianceHashCallBack_0900=================>" + JSON.stringify(err));
console.info("================removeNonComplianceHashCallBack_0900=================>" + JSON.stringify(data));
console.info("================removeNonComplianceHashCallBack_0900 end=======================>");
expect(err.code).assertNotEqual(0);
console.info("================ANS_Remove_0900 removeCallBack start=======================>");
console.info("================ANS_Remove_0900 removeCallBack err=================>" + JSON.stringify(err));
console.info("================ANS_Remove_0900 removeCallBack data=================>" + JSON.stringify(data));
console.info("================ANS_Remove_0900 removeCallBack end=======================>");
expect(err.code != 0).assertEqual(true);
}
/*
......@@ -647,7 +663,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveNonComplianceHashCode,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_0900_promise==================>");
console.info("============ANS_Remove_0900 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -679,26 +695,29 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_0900_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_0900_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_0900 done==================>");
}),1000);
console.info("==================ANS_Remove_0900 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_0900 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_0900 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveNonComplianceHashCodePromise(data) {
console.info("================OnConsumeCallback_removeNonComplianceHashCode_1000 start================>");
console.info("================OnConsumeCallback_1000 data: =======================>" + JSON.stringify(data));
console.info("================ANS_Remove_1000 onConsume start===========>");
console.info("================ANS_Remove_1000 onConsume data:===========>" + JSON.stringify(data));
notify.remove("哈希码");
console.info("================OnConsumeCallback_removeNonComplianceHashCode_1000 end=======================>");
console.info("================ANS_Remove_1000 onConsume remove==========>");
console.info("================ANS_Remove_1000 onConsume end=============>");
}
function onCancelRemoveNonComplianceHashCodePromise(data) {
console.info("OnCancel_removeNonComplianceHashCode_1000 start=======================>");
console.info("================OnCancel_1000 data: =======================>" + JSON.stringify(data));
console.info("================ANS_Remove_1000 onCancel start==================>");
console.info("================ANS_Remove_1000 onCancel data:==================>" + JSON.stringify(data));
expect().assertFail();
console.info("OnCancelCallback_removeNonComplianceHashCode_1000 end=======================>");
console.info("================ANS_Remove_1000 onCancel end====================>");
}
/*
......@@ -714,7 +733,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveNonComplianceHashCodePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1000_promise==================>");
console.info("================ANS_Remove_1000 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -746,44 +765,49 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1000_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1000_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1000 done==================>");
}),1000);
console.info("================ANS_Remove_1000 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1000 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1000 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function removeCallBack2TimesOf2(err) {
console.info("================removeCallBack2TimesOf2_1100 start=======================>");
console.info("================removeCallBack2TimesOf2_1100=======================>" + JSON.stringify(err));
expect(err.code).assertNotEqual(0);
console.info("================removeCallBack2TimesOf2_1100 end=======================>");
console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 start==========>");
console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 err============>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 end==========>");
}
function removeCallBack2TimesOf1(err) {
console.info("================removeCallBack2TimesOf1_1100=======================>");
console.info("================removeCallBack2TimesOf1_1100=======================>" + JSON.stringify(err));
expect(err.code).assertequal(0);
notify.remove(hashCode,removeCallBack2TimesOf2);
console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 start============>");
console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 err========>" + JSON.stringify(err));
expect(err.code).assertEqual(0);
notify.remove(hashCode1100,removeCallBack2TimesOf2);
console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 end============>");
}
var hashCode1100;
function onConsumeCallbackRemove2Times(data) {
console.info("================OnConsumeCallback_remove2Times_1100 start=======================>");
console.info("================OnConsumeCallback_1100 data: =======================>" + JSON.stringify(data));
notify.remove(hashCode,removeCallBack2TimesOf1);
console.info("================OnConsumeCallback_remove2Times_1100 remove=======================>");
console.info("================OnConsumeCallback_remove2Times_1100 end=======================>");
console.info("=====ANS_Remove_1100 onConsume start=================>");
console.info("=====ANS_Remove_1100 onConsume data: ================>" + JSON.stringify(data));
hashCode1100 = data.request.hashCode;
notify.remove(data.request.hashCode,removeCallBack2TimesOf1);
console.info("=====ANS_Remove_1100 onConsume remove================>");
console.info("=====ANS_Remove_1100 onConsume end===================>");
}
var timesOfOnCancelCallbackRemove2Times
function onCancelCallbackRemove2Times(data) {
timesOfOnCancelCallbackRemove2Times = timesOfOnCancelCallbackRemove2Times + 1
console.info("==========================OnCancelCallback_remove2Times_1100=======================>");
console.info("================OnCancelCallback_1100 data : =======================>" + JSON.stringify(data));
console.info("=====ANS_Remove_1100 onCancel start=======================>");
console.info("=====ANS_Remove_1100 onCancel data:=======================>" + JSON.stringify(data));
if (timesOfOnCancelCallbackRemove2Times == 1){
expect(data.request.id).assertequal(1);
expect(data.request.id).assertEqual(11);
} else if (timesOfOnCancelCallbackRemove2Times == 2){
expect().assertFail();
}
console.info("================OnCancelCallback_remove2Times_1100 end=======================>");
console.info("=====ANS_Remove_1100 onCancel end=======================>");
}
/*
......@@ -794,13 +818,14 @@ describe('ActsAnsNotificationRemove', function () {
*/
it('ANS_Remove_1100', 0, async function (done) {
console.info("===============ANS_Remove_1100==========================>");
hashCode1100 = 0;
timesOfOnCancelCallbackRemove2Times = 0
var subscriber ={
onConsume:onConsumeCallbackRemove2Times,
onCancel:onCancelCallbackRemove2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1100_promise==================>");
console.info("===============ANS_Remove_1100 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -832,36 +857,36 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1100_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1100 done==================>");
}),1000);
console.info("==========ANS_Remove_1100 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1100 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1100 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeCallbackRemove2TimesPromise(data) {
console.info("================OnConsumeCallback_remove2Times_promise_1200 start=======================>");
console.info("================OnConsumeCallback_1200 data: =======================>" + JSON.stringify(data));
notify.remove(hashCode);
console.info("================remove_2times1_1200=======================>");
notify.remove(hashCode);
console.info("================remove_2times2_1200=======================>");
console.info("================OnConsumeCallback_remove2Times_promise_1200 remove=======================>");
console.info("================OnConsumeCallback_remove2Times_promise_1200 end=======================>");
console.info("================ANS_Remove_1200 onConsume start=================>");
console.info("================ANS_Remove_1200 onConsume data:==========>" + JSON.stringify(data));
notify.remove(data.request.hashCode);
console.info("================ANS_Remove_1200 onConsume remove_2times1===========>");
notify.remove(data.request.hashCode);
console.info("================ANS_Remove_1200 onConsume remove_2times2===========>");
console.info("================ANS_Remove_1200 onConsume end=================>");
}
var timesOfOnCancelCallbackRemove2TimesPromise
function onCancelCallbackRemove2TimesPromise(data) {
timesOfOnCancelCallbackRemove2TimesPromise = timesOfOnCancelCallbackRemove2TimesPromise + 1
console.info("==========================OnCancelCallback_remove2Times_1200=======================>");
console.info("================OnCancelCallback_1200 data : =======================>" + JSON.stringify(data));
console.info("================ANS_Remove_1200 onCancel start==========>");
console.info("================ANS_Remove_1200 onCancel data:=========>" + JSON.stringify(data));
if (timesOfOnCancelCallbackRemove2TimesPromise == 1){
expect(data.request.id).assertequal(1);
expect(data.request.id).assertEqual(12);
} else if (timesOfOnCancelCallbackRemove2TimesPromise == 2){
expect().assertFail();
}
console.info("================OnCancelCallback_remove2Times_1200 end=======================>");
console.info("================ANS_Remove_1200 onCancel end==============>");
}
/*
......@@ -871,14 +896,14 @@ describe('ActsAnsNotificationRemove', function () {
* delete the notification information
*/
it('ANS_Remove_1200', 0, async function (done) {
console.info("===============ANS_Remove_1200==========================>");
console.info("===============ANS_Remove_1200 start========================>");
timesOfOnCancelCallbackRemove2TimesPromise = 0
var subscriber ={
onConsume:onConsumeCallbackRemove2TimesPromise,
onCancel:onCancelCallbackRemove2TimesPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1200_promise==================>");
console.info("===============ANS_Remove_1200 subscribe promise=============>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -910,36 +935,37 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1200_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1200 done==================>");
}),1000);
console.info("============ANS_Remove_1200 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1200 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1200 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveIsUnremovable(data) {
console.info("OnConsume_removeIsUnremovable_1300 start=================>");
console.info("OnConsume_removeIsUnremovable_1300 data:===================>" + JSON.stringify(data));
console.info("==========ANS_Remove_1300 onConsume start=================>");
console.info("==========ANS_Remove_1300 onConsume data:=================>" + JSON.stringify(data));
notify.remove(data.request.hashCode,removeIsUnremovableCallBack);
console.info("OnConsume_removeIsUnremovable_1300 remove=============>");
console.info("OnConsume_removeIsUnremovable_1300 end=============>");
console.info("==========ANS_Remove_1300 onConsume remove=============>");
console.info("==========ANS_Remove_1300 onConsume end=================>");
}
function onCancelRemoveIsUnremovable(data) {
console.info("=============OnCancel_removeIsUnremovable_1300 start================>");
console.info("=============OnCancel_removeIsUnremovable_1300 data:===========>" + JSON.stringify(data));
console.info("==========ANS_Remove_1300 onCancel start================>");
console.info("==========ANS_Remove_1300 onCancel data:===========>" + JSON.stringify(data));
expect().assertFail();
console.info("=============OnCancel_removeIsUnremovable_1300 end===============>");
console.info("==========ANS_Remove_1300 onCancel end================>");
}
function removeIsUnremovableCallBack(err, data) {
console.info("================removeIsUnremovableCallBack_1300 start=======================>");
console.info("================removeIsUnremovableCallBack_1300=====================>" + JSON.stringify(err));
expect(err.code).assertNotEqual(0);
console.info("================removeIsUnremovableCallBack_1300=====================>" + JSON.stringify(data));
console.info("================removeIsUnremovableCallBack_1300 end=======================>");
console.info("==========ANS_Remove_1300 removeCallBack start=======================>");
console.info("==========ANS_Remove_1300 removeCallBack err=====================>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("==========ANS_Remove_1300 removeCallBack data=====================>" + JSON.stringify(data));
console.info("==========ANS_Remove_1300 removeCallBack end=======================>");
}
/*
......@@ -955,7 +981,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveIsUnremovable,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1300_promise==================>");
console.info("================ANS_Remove_1300 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -987,29 +1013,29 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1300_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1300_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1300 done==================>");
}),1000);
console.info("================ANS_Remove_1300 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1300 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1300 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function OnConsumeRemoveIsUnremovablePromise(data) {
console.info("================OnConsume_removeIsUnremovable_promise_1400 start=======================>");
console.info("================OnConsume_1400 data: =======================>" + JSON.stringify(data));
console.info("==============ANS_Remove_1400 onConsume start==============>");
console.info("==============ANS_Remove_1400 onConsume data:==============>" + JSON.stringify(data));
notify.remove(data.request.hashCode);
console.info("================removeIsUnremovable_promise_1400=======================>");
console.info("================OnConsume_removeIsUnremovable_promise_1400 end=======================>");
console.info("==============ANS_Remove_1400 onConsume remove=============>");
console.info("==============ANS_Remove_1400 onConsume end================>");
}
function OnCancelRemoveIsUnremovablePromise(data) {
console.info("=====OnCancel_removeIsUnremovable_promise_1400 start=======================>");
console.info("================OnCancel_1400 data: =======================>" + JSON.stringify(data));
console.info("==============ANS_Remove_1400 onCancel start==============>");
console.info("==============ANS_Remove_1400 onCancel data:==============>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeIsUnremovable_promise_1400 end=======================>");
console.info("==============ANS_Remove_1400 onCancel end================>");
}
/*
......@@ -1019,13 +1045,13 @@ describe('ActsAnsNotificationRemove', function () {
deletes the notification information that the property isunremovable is true
*/
it('ANS_Remove_1400', 0, async function (done) {
console.info("===============ANS_Remove_1400==========================>");
console.info("===============ANS_Remove_1400 start==========================>");
var subscriber ={
onConsume:OnConsumeRemoveIsUnremovablePromise,
onCancel:OnCancelRemoveIsUnremovablePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1400_promise==================>");
console.info("===============ANS_Remove_1400 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1057,47 +1083,47 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1400_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1400_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1400 done==================>");
}),1000);
console.info("==============ANS_Remove_1400 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1400 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1400 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
var timesOfOnConsumeRemoveAllByBundleOption
function onConsumeRemoveAllByBundleOption(data) {
timesOfOnConsumeRemoveAllByBundleOption = timesOfOnConsumeRemoveAllByBundleOption + 1
console.info("================OnConsume_removeAllByBundleOption_1500 start=======================>");
console.info("================OnConsume_1500 data: ====================>" + JSON.stringify(data));
console.info("==========ANS_Remove_1500 onConsume start=======>");
console.info("==========ANS_Remove_1500 onConsume data:=======>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
}
if (timesOfOnConsumeRemoveAllByBundleOption == 2){
notify.removeAll(bundleOption,removeAllByBundleOptionCallBack);
console.info("================OnConsume_removeAllByBundleOption_1500 remove=======================>");
console.info("=======ANS_Remove_1500 onConsume remove=============>");
}
console.info("================OnConsume_removeAllByBundleOption_1500 end=======================>");
console.info("===========ANS_Remove_1500 onConsume end===========>");
}
var timesOfOnCancelRemoveAllByBundleOption
function onCancelRemoveAllByBundleOption(data) {
timesOfOnCancelRemoveAllByBundleOption = timesOfOnCancelRemoveAllByBundleOption + 1
console.info("==========================OnCancel_removeAllByBundleOption_1500 start=======================>");
console.info("================OnCancel_1500 data: =======================>" + JSON.stringify(data));
console.info("===========ANS_Remove_1500 onCancel start====================>");
console.info("===========ANS_Remove_1500 onCancel data:====================>" + JSON.stringify(data));
if (timesOfOnCancelRemoveAllByBundleOption == 1){
expect(data.request.label).assertequal("1500_1");
expect(data.request.label).assertEqual("1500_1");
}else if (timesOfOnCancelRemoveAllByBundleOption == 2){
expect(data.request.label).assertequal("1500_2");
expect(data.request.label).assertEqual("1500_2");
}
console.info("================OnCancel_removeIsUnremovable_1500 end=======================>");
console.info("===========ANS_Remove_1500 onCancel end=======================>");
}
function removeAllByBundleOptionCallBack(data) {
console.info("================removeAllByBundleOptionCallBack_1500 start=======================>");
console.info("================removeAllByBundleOptionCallBack_1500==================>" + JSON.stringify(data));
console.info("================removeAllByBundleOptionCallBack_1500 end=======================>");
console.info("===========ANS_Remove_1500 removeAllCallBack start=================>");
console.info("===========ANS_Remove_1500 removeAllCallBack data==================>" + JSON.stringify(data));
console.info("===========ANS_Remove_1500 removeAllCallBack end===================>");
}
/*
......@@ -1107,7 +1133,7 @@ describe('ActsAnsNotificationRemove', function () {
* deletes all notification information through BundleOption
*/
it('ANS_Remove_1500', 0, async function (done) {
console.info("===============ANS_Remove_1500==========================>");
console.info("===============ANS_Remove_1500 start==========================>");
timesOfOnCancelRemoveAllByBundleOption = 0
timesOfOnConsumeRemoveAllByBundleOption = 0
var subscriber ={
......@@ -1115,7 +1141,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveAllByBundleOption,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1500_promise==================>");
console.info("===============ANS_Remove_1500 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1177,22 +1203,22 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish1_1500_promise==================>");
console.info("=============ANS_Remove_1500 publish1 promise==================>");
await notify.publish(notificationRequest1);
console.info("==================publish2_1500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1500 done==================>");
}),1000);
console.info("=============ANS_Remove_1500 publish2 promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1500 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1500 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
var timesOfOnConsumeRemoveAllByBundleOptionNullUid
function onConsumeRemoveAllByBundleOptionNullUid(data) {
console.info("OnConsume_removeAllByBundleOption_nullUid_1600 start==========>");
console.info("OnConsume_removeAllByBundleOption_nullUid_1600 data:========>" + JSON.stringify(data));
console.info("===============ANS_Remove_1600 onConsume start================>");
console.info("===============ANS_Remove_1600 onConsume data:========>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -1200,27 +1226,27 @@ describe('ActsAnsNotificationRemove', function () {
timesOfOnConsumeRemoveAllByBundleOptionNullUid = timesOfOnConsumeRemoveAllByBundleOptionNullUid + 1
if (timesOfOnConsumeRemoveAllByBundleOptionNullUid == 2){
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullUid);
console.info("================OnConsume_removeAllByBundleOption_nullUid_1600 remove==================>");
console.info("===============ANS_Remove_1600 onConsume remove==================>");
}
console.info("================OnConsume_removeAllByBundleOption_nullUid_1600 end=======================>");
console.info("===============ANS_Remove_1600 onConsume end================>");
}
var timesOfOnCancelRemoveAllByBundleOptionNullUid
function onCancelRemoveAllByBundleOptionNullUid(data) {
timesOfOnCancelRemoveAllByBundleOptionNullUid = timesOfOnCancelRemoveAllByBundleOptionNullUid + 1
console.info("================OnCancel_removeAllByBundleOption_nullUid_1600 start=======================>");
console.info("================OnCancel_1600 data: =======================>" + JSON.stringify(data));
console.info("===============ANS_Remove_1600 onCancel start===================>");
console.info("===============ANS_Remove_1600 onCancel data:===================>" + JSON.stringify(data));
if (timesOfOnCancelRemoveAllByBundleOptionNullUid == 1){
expect(data.request.label).assertequal("1600_1");
expect(data.request.label).assertEqual("1600_1");
}else if (timesOfOnCancelRemoveAllByBundleOptionNullUid == 2){
expect(data.request.label).assertequal("1600_2");
expect(data.request.label).assertEqual("1600_2");
}
console.info("================OnCancel_removeAllByBundleOption_nullUid_1600 end=======================>");
console.info("===============ANS_Remove_1600 onCancel end====================>");
}
function removeAllByBundleOptionCallBackNullUid(err, data) {
console.info("================removeAllByBundleOptionCallBack_nullUid_1600 start=======================>");
console.info("================removeAllByBundleOption_1600=======================>" + JSON.stringify(err));
console.info("================removeAllByBundleOption_1600=======================>" + JSON.stringify(data));
console.info("================removeAllByBundleOptionCallBack_nullUid_1600 end=======================>");
console.info("=========ANS_Remove_1600 removeAllCallBack start=============>");
console.info("=========ANS_Remove_1600 removeAllCallBack err===============>" + JSON.stringify(err));
console.info("=========ANS_Remove_1600 removeAllCallBack data==============>" + JSON.stringify(data));
console.info("=========ANS_Remove_1600 removeAllCallBack end===============>");
}
/*
......@@ -1238,7 +1264,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveAllByBundleOptionNullUid,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1600_promise==================>");
console.info("==================ANS_Remove_1600 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1300,41 +1326,40 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish1_1600_promise==================>");
console.info("==================ANS_Remove_1600 publish1 promise==================>");
await notify.publish(notificationRequest1);
console.info("==================publish2_1600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1600_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1600 done==================>");
}),1000);
console.info("==================ANS_Remove_1600 publish2 promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1600 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1600 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveAllByBundleOptionWrongUid(data) {
console.info("================OnConsume_removeAllByBundleOption_wrongUid_1700 start=======================>");
console.info("================OnConsume_1700 data: =======================>" + JSON.stringify(data));
console.info("========ANS_Remove_1700 onConsume start==============>");
console.info("========ANS_Remove_1700 onConsume data:==============>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:123456789
}
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongUid);
console.info("================OnConsume_removeAllByBundleOption_wrongUid_1700 remove====================>");
console.info("================OnConsume_removeAllByBundleOption_wrongUid_1700 end=======================>");
console.info("========ANS_Remove_1700 onConsume remove============>");
console.info("========ANS_Remove_1700 onConsume end===============>");
}
function onCancelRemoveAllByBundleOptionWrongUid(data) {
console.info("================OnCancel_removeAllByBundleOption_wrongUid_1700 start======================>");
console.info("================OnCancel_1700 data: =======================>" + JSON.stringify(data));
console.info("==========ANS_Remove_1700 onCancel start====================>");
console.info("==========ANS_Remove_1700 onCancel data:====================>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeAllByBundleOption_wrongUid_1700 end=======================>");
console.info("==========ANS_Remove_1700 onCancel end======================>");
}
function removeAllByBundleOptionCallBackWrongUid(err, data) {
console.info("================removeAllByBundleOptionCallBack_wrongUid_1700 start=======================>");
console.info("================removeAllByBundleOption_1700=======================>" + JSON.stringify(err));
console.info("================removeAllByBundleOption_1700=======================>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeAllByBundleOptionCallBack_wrongUid_1700 end=======================>");
console.info("==========ANS_Remove_1700 removeAllCallBack start=============>");
console.info("==========ANS_Remove_1700 removeAllCallBack err===============>" + JSON.stringify(err));
console.info("==========ANS_Remove_1700 removeAllCallBack data==============>" + JSON.stringify(data));
console.info("==========ANS_Remove_1700 removeAllCallBack end=======================>");
}
/*
......@@ -1350,7 +1375,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveAllByBundleOptionWrongUid,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1700_promise==================>");
console.info("=============ANS_Remove_1700 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1382,40 +1407,39 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1700_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1700_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1700 done==================>");
}),1000);
console.info("===============ANS_Remove_1700 publish promise===============>");
setTimeout((async function(){
console.info("======ANS_Remove_1700 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1700 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid(data) {
console.info("OnConsume_removeAllByBundleOption_wrongBundle_correctUid_1800 start=============>");
console.info("================OnConsume_1800 data: =======================>" + JSON.stringify(data));
console.info("==============ANS_Remove_1800 onConsume start=============>");
console.info("==============ANS_Remove_1800 onConsume data:=============>" + JSON.stringify(data));
var bundleOption = {
bundle:"wrongBundleName",
uid:data.request.creatorUid,
}
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongBundleCorrectUid);
console.info("================OnConsume_wrongBundle_correctUid_1800 remove=======================>");
console.info("================OnConsume_wrongBundle_correctUid_1800 end=======================>");
console.info("==============ANS_Remove_1800 onConsume remove=============>");
console.info("==============ANS_Remove_1800 onConsume end================>");
}
function onCancelremoveAllByBundleOptionwrongBundleCorrectUid(data) {
console.info("OnCancel_removeAllByBundleOption_wrongBundle_correctUid_1800 start==================>");
console.info("================OnCancel_1800 data: =======================>" + JSON.stringify(data));
console.info("==============ANS_Remove_1800 onCancel start===============>");
console.info("==============ANS_Remove_1800 onCancel data:===============>" + JSON.stringify(data));
expect().assertFail();
console.info("OnCancel_removeAllByBundleOption_wrongBundle_correctUid_1800 end==================>");
console.info("==============ANS_Remove_1800 onCancel end===============>");
}
function removeAllByBundleOptionCallBackWrongBundleCorrectUid(err, data) {
console.info("================removeAllByBundleOptionCallBack_wrongBundle_correctUid_1800 start==========>");
console.info("================wrongBundle_correctUid_1800=======================>" + JSON.stringify(err));
console.info("================wrongBundle_correctUid_1800=======================>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeAllByBundleOptionCallBack_wrongBundle_correctUid_1800 end============>");
console.info("=========ANS_Remove_1800 removeAllCallBack start==========>");
console.info("=========ANS_Remove_1800 removeAllCallBack err============>" + JSON.stringify(err));
console.info("=========ANS_Remove_1800 removeAllCallBack data===========>" + JSON.stringify(data));
console.info("=========ANS_Remove_1800 removeAllCallBack end==========>");
}
/*
......@@ -1425,13 +1449,13 @@ describe('ActsAnsNotificationRemove', function () {
* deletes all notification information through BundleOption wrong bundle, correct uid.
*/
it('ANS_Remove_1800', 0, async function (done) {
console.info("===============ANS_Remove_1800==========================>");
console.info("===============ANS_Remove_1800 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid,
onCancel:onCancelremoveAllByBundleOptionwrongBundleCorrectUid,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1800_promise==================>");
console.info("================ANS_Remove_1800 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1463,39 +1487,38 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1800_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1800_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1800 done==================>");
}),1000);
console.info("============ANS_Remove_1800 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1800 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1800 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid(data) {
console.info("================OnConsume_nullCharacterBundle_correctUid_1900 start=======================>");
console.info("================OnConsume_correctUid_1900 data: ============>" + JSON.stringify(data));
console.info("===========ANS_Remove_1900 onConsume start===============>");
console.info("===========ANS_Remove_1900 onConsume data:===============>" + JSON.stringify(data));
var bundleOption = {
bundle:"",
uid:data.request.creatorUid,
}
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullCharacterBundleCorrectUid);
console.info("================OnConsume_nullCharacterBundle_correctUid_1900 remove====================>");
console.info("================OnConsume_nullCharacterBundle_correctUid_1900 end=======================>");
console.info("===========ANS_Remove_1900 onConsume removeAll===========>");
console.info("===========ANS_Remove_1900 onConsume end=================>");
}
function onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid(data) {
console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_correctUid_1900 start===========>");
console.info("OnCancel_1900 data:==========>" + JSON.stringify(data));
console.info("===========ANS_Remove_1900 onCancel start===========>");
console.info("===========ANS_Remove_1900 onCancel data:==========>" + JSON.stringify(data));
expect().assertFail();
console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_correctUid_1900 end=============>");
console.info("===========ANS_Remove_1900 onCancel end===========>");
}
function removeAllByBundleOptionCallBackNullCharacterBundleCorrectUid(err, data) {
console.info("================nullCharacterBundle_correctUid_1900 start=======================>");
console.info("================nullCharacterBundle_correctUid_1900===================>" + JSON.stringify(err));
console.info("================nullCharacterBundle_correctUid_1900==================>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeAllByBundleOptionCallBack_nullCharacterBundle_correctUid_1900 end=====>");
console.info("========ANS_Remove_1900 removeAllCallback start===========>");
console.info("========ANS_Remove_1900 removeAllCallback err=============>" + JSON.stringify(err));
console.info("========ANS_Remove_1900 removeAllCallback data=========>" + JSON.stringify(data));
console.info("========ANS_Remove_1900 removeAllCallback end=======================>");
}
/*
......@@ -1505,13 +1528,13 @@ describe('ActsAnsNotificationRemove', function () {
* deletes all notification information through BundleOption null character bundle, correct uid.
*/
it('ANS_Remove_1900', 0, async function (done) {
console.info("===============ANS_Remove_1900==========================>");
console.info("===============ANS_Remove_1900 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid,
onCancel:onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_1900_promise==================>");
console.info("===============ANS_Remove_1900 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1543,38 +1566,38 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_1900_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_1900_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_1900 done==================>");
}),1000);
console.info("===============ANS_Remove_1900 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_1900 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_1900 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveAllByBundleOptionWrongBundleWrongUid(data) {
console.info("OnConsume_removeAllByBundleOption_wrongBundle_wrongUid_2000 start=======================>");
console.info("OnConsume_2000 data: =======================>" + JSON.stringify(data));
console.info("============ANS_Remove_2000 onConsume start================>");
console.info("============ANS_Remove_2000 onConsume data:================>" + JSON.stringify(data));
var bundleOption = {
bundle:"wrongBundleName",
uid:123456789,
}
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongBundleWrongUid);
console.info("================OnConsume_2000 remove=======================>");
console.info("OnConsume_removeAllByBundleOption_wrongBundle_wrongUid_2000 end=======================>");
console.info("============ANS_Remove_2000 onConsume remove================>");
console.info("============ANS_Remove_2000 onConsume end===================>");
}
function onCancelRemoveAllByBundleOptionWrongBundleWrongUid(data) {
console.info("================OnCancel_wrongBundle_wrongUid_2000 start======================>");
console.info("================OnCancel_wrongUid_2000 data: =======================>" + JSON.stringify(data));
console.info("============ANS_Remove_2000 onCancel start=================>");
console.info("============ANS_Remove_2000 onCancel data:=================>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeAllByBundleOption_wrongBundle_wrongUid_2000 end==============>");
console.info("============ANS_Remove_2000 onCancel end==============>");
}
function removeAllByBundleOptionCallBackWrongBundleWrongUid(err, data) {
console.info("================removeAllByBundleOptionCallBack_wrongBundle_wrongUid_2000 start=============>");
console.info("================wrongBundle_wrongUid_2000=======================>" + JSON.stringify(err));
console.info("================wrongBundle_wrongUid_2000=======================>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeAllByBundleOptionCallBack_wrongBundle_wrongUid_2000 end===============>");
console.info("============ANS_Remove_2000 removeAllCallBack start============>");
console.info("============ANS_Remove_2000 removeAllCallBack err==============>" + JSON.stringify(err));
console.info("============ANS_Remove_2000 removeAllCallBack data=============>" + JSON.stringify(data));
console.info("============ANS_Remove_2000 removeAllCallBack end=============>");
}
/*
......@@ -1584,13 +1607,13 @@ describe('ActsAnsNotificationRemove', function () {
* deletes all notification information through BundleOption wrong bundle, wrong uid.
*/
it('ANS_Remove_2000', 0, async function (done) {
console.info("===============ANS_Remove_2000==========================>");
console.info("===============ANS_Remove_2000 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveAllByBundleOptionWrongBundleWrongUid,
onCancel:onCancelRemoveAllByBundleOptionWrongBundleWrongUid,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2000_promise==================>");
console.info("==============ANS_Remove_2000 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1622,38 +1645,38 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2000_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2000_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2000 done==================>");
}),1000);
console.info("==============ANS_Remove_2000 publish promise==============>");
setTimeout((async function(){
console.info("======ANS_Remove_2000 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2000 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid(data) {
console.info("OnConsume_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 start===================>");
console.info("OnConsume_2100 data:======>" + JSON.stringify(data));
console.info("=========ANS_Remove_2100 onConsume start===================>");
console.info("=========ANS_Remove_2100 onConsume data:======>" + JSON.stringify(data));
var bundleOption = {
bundle:"",
uid:123456789,
}
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullCharacterBundleWrongUid);
console.info("OnConsume_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 remove==============>");
console.info("OnConsume_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 end=================>");
console.info("=========ANS_Remove_2100 onConsume remove===================>");
console.info("=========ANS_Remove_2100 onConsume end===================>");
}
function onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid(data) {
console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 start============>");
console.info("OnCancel_2100 data:==========>" + JSON.stringify(data));
console.info("=========ANS_Remove_2100 onCancel start==========>");
console.info("=========ANS_Remove_2100 onCancel data:==========>" + JSON.stringify(data));
expect().assertFail();
console.info("OnCancel_removeAllByBundleOption_nullCharacterBundle_wrongUid_2100 end=====================>");
console.info("=========ANS_Remove_2100 onCancel end============>");
}
function removeAllByBundleOptionCallBackNullCharacterBundleWrongUid(err, data) {
console.info("removeAllByBundleOptionCallBack_nullCharacterBundle_wrongUid_2100 start====================>");
console.info("CallBack_2100=========>" + JSON.stringify(err));
console.info("CallBack_2100=========>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("removeAllByBundleOptionCallBac_nullCharacterBundle_wrongUid_2100 end=======================>");
console.info("=========ANS_Remove_2100 removeAllCallBack start===============>");
console.info("=========ANS_Remove_2100 err=========>" + JSON.stringify(err));
console.info("=========ANS_Remove_2100 data=========>" + JSON.stringify(data));
console.info("=========ANS_Remove_2100 removeAllCallBack end===============>");
}
/*
......@@ -1663,13 +1686,13 @@ describe('ActsAnsNotificationRemove', function () {
* deletes all notification information through BundleOption null character bundle, wrong uid.
*/
it('ANS_Remove_2100', 0, async function (done) {
console.info("===============ANS_Remove_2100==========================>");
console.info("===============ANS_Remove_2100 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid,
onCancel:onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2100_promise==================>");
console.info("============ANS_Remove_2100 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1701,37 +1724,38 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2100_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2100 done==================>");
}),1000);
console.info("=========ANS_Remove_2100 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_2100 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2100 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveAllByBundleOptionIsUnremovable(data) {
console.info("================OnConsume_removeAllByBundleOption_isUnremovable_2200 start==================>");
console.info("================OnConsume_2200 data: ==================>" + JSON.stringify(data));
console.info("==========ANS_Remove_2200 onConsume start==================>");
console.info("==========ANS_Remove_2200 onConsume data:=================>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.bundle,
uid:data.request.creatorUidss,
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
}
notify.removeAll(bundleOption,removeAllByBundleOptionCallBackIsUnremovable);
console.info("================OnConsume_removeAllByBundleOption_isUnremovable_2200 removeAll==============>");
console.info("================OnConsume_removeAllByBundleOption_isUnremovable_2200 end====================>");
console.info("==========ANS_Remove_2200 onConsume removeAll==================>");
console.info("==========ANS_Remove_2200 onConsume end==================>");
}
function onCancelRemoveAllByBundleOptionIsUnremovable(data) {
console.info("================OnCancel_2200 start=======================>");
console.info("================OnCancel_2200 data: =======================>" + JSON.stringify(data));
console.info("==========ANS_Remove_2200 onCancel start=================>");
console.info("==========ANS_Remove_2200 onCancel data:=================>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_2200 end=======================>");
console.info("==========ANS_Remove_2200 onCancel end===================>");
}
function removeAllByBundleOptionCallBackIsUnremovable(err, data) {
console.info("removeAllByBundleOptionCallBack_nullCharacterBundle_wrongUid_2200 start=====================>");
console.info("================Callback_2200=======================>" + JSON.stringify(err));
console.info("================Callback_2200=======================>" + JSON.stringify(data));
console.info("================removeAllByBundleOptionCallBac_nullCharacterBundle_wrongUid_2200 end========>");
console.info("==========ANS_Remove_2200 removeAllCallBack start==========>");
console.info("==========ANS_Remove_2200 removeAllCallBack err============>" + JSON.stringify(err));
console.info("==========ANS_Remove_2200 removeAllCallBack data===========>" + JSON.stringify(data));
console.info("==========ANS_Remove_2200 removeAllCallBack end============>");
}
/*
......@@ -1741,13 +1765,13 @@ describe('ActsAnsNotificationRemove', function () {
interface is called to delete the notification information whose attribute isUnremovable is true
*/
it('ANS_Remove_2200', 0, async function (done) {
console.info("===============ANS_Remove_2200==========================>");
console.info("===============ANS_Remove_2200 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveAllByBundleOptionIsUnremovable,
onCancel:onCancelRemoveAllByBundleOptionIsUnremovable,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2200_promise==================>");
console.info("==============ANS_Remove_2200 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1779,48 +1803,48 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2200_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2200 done==================>");
}),1000);
done();
console.info("=============ANS_Remove_2200 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_2200 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2200 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function removeAllCallBack(err,data) {
console.info("================removeAllCallBack_2300 start: =======================>");
console.info("================removeAllCallBack_2300 err: =======================>" + JSON.stringify(err));
console.info("================removeAllCallBack_2300 data: =======================>" + JSON.stringify(data));
console.info("================removeAllCallBack_2300 end: =======================>");
console.info("================ANS_Remove_2300 removeAllCallBack start:========>");
console.info("================ANS_Remove_2300 removeAllCallBack err:==========>" + JSON.stringify(err));
console.info("================ANS_Remove_2300 removeAllCallBack data:=========>" + JSON.stringify(data));
console.info("================ANS_Remove_2300 removeAllCallBack end:==========>")
}
var timesOfOnConsumeRemoveAll
function onConsumeRemoveAll(data) {
timesOfOnConsumeRemoveAll = timesOfOnConsumeRemoveAll + 1
console.info("================OnConsume_removeAll_2300 start=======================>");
console.info("================OnConsume_removeAll_2300 data: =======================>" + JSON.stringify(data));
console.info("================ANS_Remove_2300 onConsume start==================>");
console.info("================ANS_Remove_2300 onConsume data: =================>" + JSON.stringify(data));
if (timesOfOnConsumeRemoveAll == 2)
{
notify.removeAll(removeAllCallBack);
console.info("================OnConsume_removeAll_2300 removeAll=======================>");
console.info("============ANS_Remove_2300 onConsume removeAll==========>");
}
console.info("================OnConsume_removeAll_2300 end=======================>");
console.info("================ANS_Remove_2300 onConsume end====================>");
}
var timesOfOnCancelRemoveAll
function onCancelRemoveAll(data) {
timesOfOnCancelRemoveAll = timesOfOnCancelRemoveAll + 1
console.info("==========================OnCancel_removeAll_2300=======================>");
console.info("================OnCancel_removeAll_2300 data : =======================>" + JSON.stringify(data));
console.info("==================ANS_Remove_2300 onCancel start===========>");
console.info("==================ANS_Remove_2300 onCancel data============>" + JSON.stringify(data));
if (timesOfOnCancelRemoveAll == 1)
{
expect(data.request.label).assertequal("2300_1");
expect(data.request.label).assertEqual("2300_1");
}
if (timesOfOnCancelRemoveAll == 2)
{
expect(data.request.label).assertequal("2300_2");
expect(data.request.label).assertEqual("2300_2");
}
console.info("================cancelCallback_removeAll_0200 end=======================>");
console.info("==================ANS_Remove_2300 onCancel end=============>");
}
/*
......@@ -1830,7 +1854,7 @@ describe('ActsAnsNotificationRemove', function () {
* notification information
*/
it('ANS_Remove_2300', 0, async function (done) {
console.info("===============ANS_Remove_2300==========================>");
console.info("===============ANS_Remove_2300 start==========================>");
timesOfOnConsumeRemoveAll = 0;
timesOfOnCancelRemoveAll = 0;
var subscriber ={
......@@ -1838,7 +1862,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveAll,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2300_promise==================>");
console.info("=============ANS_Remove_2300 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -1900,43 +1924,44 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish1_2300_promise==================>");
console.info("===========ANS_Remove_2300 publish1 promise================>");
await notify.publish(notificationRequest1);
console.info("==================publish2_2300_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2300_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2300 done==================>");
}),1000);
console.info("============ANS_Remove_2300 publish2 promise===============>");
setTimeout((async function(){
console.info("======ANS_Remove_2300 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2300 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
var timesOfOnConsumeRemoveAll
function onConsumeRemoveAllPromise(data) {
timesOfOnConsumeRemoveAll = timesOfOnConsumeRemoveAll + 1
console.info("================OnConsume_removeAll_promise_2400 start=======================>");
console.info("================OnConsume_removeAll_promise_2400 data: =============>" + JSON.stringify(data));
console.info("===========ANS_Remove_2400 onConsume start==============>");
console.info("===========ANS_Remove_2400 onConsume data:==============>" + JSON.stringify(data));
if (timesOfOnConsumeRemoveAll == 2)
{
notify.removeAll();
console.info("================OnConsume_removeAll_promise_2400 removeAll=======================>");
console.info("===========ANS_Remove_2400 onConsume removeAll==========>");
}
console.info("================OnConsume_removeAll_promise_2400 end=======================>");
console.info("===========ANS_Remove_2400 onConsume end==============>");
}
var timesOfOnCancelRemoveAll
function onCancelRemoveAllPromise(data) {
timesOfOnCancelRemoveAll = timesOfOnCancelRemoveAll + 1
console.info("==========================OnCancel_removeAll_promise_2400 start=======================>");
console.info("================OnCancel_removeAll_promise_2400 data : =============>" + JSON.stringify(data));
console.info("===========ANS_Remove_2400 onCancel start=======================>");
console.info("===========ANS_Remove_2400 onCancel data : =============>" + JSON.stringify(data));
if (timesOfOnCancelRemoveAll == 1)
{
expect(data.request.label).assertequal("2400_1");
expect(data.request.label).assertEqual("2400_1");
}
if (timesOfOnCancelRemoveAll == 2)
{
expect(data.request.label).assertequal("2400_2");
expect(data.request.label).assertEqual("2400_2");
}
console.info("================OnCancel_removeAll_promise_2400 end=======================>");
console.info("===========ANS_Remove_2400 onCancel end=======================>");
}
/*
......@@ -1946,7 +1971,7 @@ describe('ActsAnsNotificationRemove', function () {
* notification information
*/
it('ANS_Remove_2400', 0, async function (done) {
console.info("===============ANS_Remove_2400==========================>");
console.info("===============ANS_Remove_2400 start==========================>");
timesOfOnConsumeRemoveAll = 0
timesOfOnCancelRemoveAll = 0
var subscriber ={
......@@ -1954,7 +1979,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveAllPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2400_promise==================>");
console.info("==============ANS_Remove_2400 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2016,34 +2041,35 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish1_2400_promise==================>");
console.info("===ANS_Remove_2400 publish1 promise============>");
await notify.publish(notificationRequest1);
console.info("==================publish2_2400_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2400_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2400 done==================>");
}),1000);
console.info("===ANS_Remove_2400 publish2 promise============>");
setTimeout((async function(){
console.info("======ANS_Remove_2400 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2400 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function removeAllCallBackIsUnremovable(err,data) {
console.info("================removeAllCallBack_isUnremovable_2500 start=======================>");
console.info("================removeAllCallBack_2500 JSON.stringify(err): ===========>" + JSON.stringify(err));
console.info("================removeAllCallBack_2500 JSON.stringify(data): =========>" + JSON.stringify(data));
console.info("================removeAllCallBack_isUnremovable_2500 end=======================>");
console.info("=========ANS_Remove_2500 removeAllCallBack start=========>");
console.info("=========ANS_Remove_2500 removeAllCallBack err:==========>" + JSON.stringify(err));
console.info("=========ANS_Remove_2500 removeAllCallBack data:=========>" + JSON.stringify(data));
console.info("=========ANS_Remove_2500 removeAllCallBack end===========>");
}
function onConsumeRemoveAllIsUnremovable(data) {
console.info("================OnConsume_removeAll_isUnremovable_2500 start=======================>");
console.info("================OnConsume_2500 data: =======================>" + JSON.stringify(data));
console.info("=========ANS_Remove_2500 onConsume start===========>");
console.info("=========ANS_Remove_2500 onConsumedata:============>" + JSON.stringify(data));
notify.removeAll(removeAllCallBackIsUnremovable);
console.info("================removeAll_isUnremovable_2500 =======================>");
console.info("================OnConsume_removeAll_isUnremovable_2500 end=======================>");
console.info("=========ANS_Remove_2500 onConsume removeAll=======>");
console.info("=========ANS_Remove_2500 onConsume end=============>");
}
function onCancelCallbackRemoveAllIsUnremovable(data) {
console.info("================OnCancelCallback_removeAll_isUnremovable_2500 start=======================>");
console.info("================OnCancelCallback_2500 data : =======================>" + JSON.stringify(data));
console.info("================OnCancelCallback_removeAll_isUnremovable_2500 end=======================>");
console.info("=========ANS_Remove_2500 onCancel start==============>");
console.info("=========ANS_Remove_2500 onCancel data:==============>" + JSON.stringify(data));
console.info("=========ANS_Remove_2500 onCancel end================>");
}
/*
......@@ -2053,13 +2079,13 @@ describe('ActsAnsNotificationRemove', function () {
* notification information whose attribute isUnremovable is true
*/
it('ANS_Remove_2500', 0, async function (done) {
console.info("===============ANS_Remove_2500==========================>");
console.info("===============ANS_Remove_2500 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveAllIsUnremovable,
onCancel:onCancelCallbackRemoveAllIsUnremovable,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2500_promise==================>");
console.info("======ANS_Remove_2500 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2091,26 +2117,27 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2500 done==================>");
}),1000);
console.info("============ANS_Remove_2500 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_2500 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2500 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function OnConsumeRemoveAllIsUnremovablePromise(data) {
console.info("================OnConsume_removeAll_isUnremovable_promise_2600 start=======================>");
console.info("================OnConsume_2600 data=======================>" + JSON.stringify(data));
console.info("===========ANS_Remove_2600 onConsume start===========>");
console.info("===========ANS_Remove_2600 onConsume data============>" + JSON.stringify(data));
notify.removeAll()
console.info("================removeAll_isUnremovable_2600 end=======================>");
console.info("================OnConsume_removeAll_isUnremovable_promise_2600 end=======================>");
console.info("===========ANS_Remove_2600 onConsume removeAll=======>");
console.info("===========ANS_Remove_2600 onConsume end=============>");
}
function OnCancelCallbackRemoveAllIsUnremovablePromise(data) {
console.info("================OnCancelCallback_removeAll_isUnremovable_promise_2600 start================>");
console.info("================OnCancelCallback_2600 data : =======================>" + JSON.stringify(data));
console.info("================OnCancelCallback_2600 end=======================>");
console.info("===========ANS_Remove_2600 onCancel start================>");
console.info("===========ANS_Remove_2600 onCancel data : ==============>" + JSON.stringify(data));
console.info("===========ANS_Remove_2600 onCancel end==================>");
}
/*
......@@ -2120,13 +2147,13 @@ describe('ActsAnsNotificationRemove', function () {
* notification information whose attribute isUnremovable is true
*/
it('ANS_Remove_2600', 0, async function (done) {
console.info("===============ANS_Remove_2600==========================>");
console.info("===============ANS_Remove_2600 start==========================>");
var subscriber ={
onConsume:OnConsumeRemoveAllIsUnremovablePromise,
onCancel:OnCancelCallbackRemoveAllIsUnremovablePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2600_promise==================>");
console.info("============ANS_Remove_2600 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2158,49 +2185,49 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2600_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2600 done==================>");
}),1000);
console.info("==========ANS_Remove_2600 publish promise==============>");
setTimeout((async function(){
console.info("======ANS_Remove_2600 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2600 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function removeAllCallBack2TimesOf2(err,data) {
console.info("================removeAllCallBack2TimesOf2_2700 start=======================>");
console.info("================removeAllCallBack2TimesOf2_2700 err=================>" + JSON.stringify(err));
console.info("================removeAllCallBack2TimesOf2_2700 data===============>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeAllCallBack2TimesOf2_2700 end=======================>");
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 start===========>");
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 err=============>" + JSON.stringify(err));
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 data============>" + JSON.stringify(data));
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 end=============>");
}
function removeAllCallBack2TimesOf1(err,data) {
console.info("================removeAllCallBack2TimesOf1_2700 start=======================>");
console.info("================removeAllCallBack2TimesOf1_2700 err===================>" + JSON.stringify(err));
console.info("================removeAllCallBack2TimesOf1_2700 data=================>" + JSON.stringify(data));
expect(err.code).assertequal(0);
notify.removeAll(removeCallBack2TimesOf2);
console.info("================removeAllCallBack2TimesOf1_2700 removeCallBack2TimesOf2====================>");
console.info("================removeAllCallBack2TimesOf1_2700 end=======================>");
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 start==========>");
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 err============>" + JSON.stringify(err));
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 data===========>" + JSON.stringify(data));
expect(err.code).assertEqual(0);
notify.removeAll(removeAllCallBack2TimesOf2);
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 removeAll=====>");
console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 end==========>");
}
function onConsumeRemoveAll2Times(data) {
console.info("================OnConsumeCallback_removeAll2Times_2700 start=======================>");
console.info("================OnConsumeCallback_removeAll2Times_2700 data: ========>" + JSON.stringify(data));
notify.removeAll(removeCallBack2TimesOf1);
console.info("================OnConsumeCallback_removeAll2Times_2700 remove=======================>");
console.info("================OnConsumeCallback_removeAll2Times_2700 end=======================>");
console.info("=======ANS_Remove_2700 onConsume start=========>");
console.info("=======ANS_Remove_2700 onConsume data:=========>" + JSON.stringify(data));
notify.removeAll(removeAllCallBack2TimesOf1);
console.info("=======ANS_Remove_2700 onConsume remove========>");
console.info("=======ANS_Remove_2700 onConsume end===========>");
}
var timesOfOnCancelCallbackRemoveAll2Times
function onCancelRemoveAll2Times(data) {
timesOfOnCancelCallbackRemoveAll2Times = timesOfOnCancelCallbackRemoveAll2Times + 1
console.info("================OnCancelCallback_removeAll2Times_2700 start=======================>");
console.info("================OnCancelCallback_2700 data : =======================>" + JSON.stringify(data));
console.info("=======ANS_Remove_2700 onCancel start============>");
console.info("=======ANS_Remove_2700 onCancel data:============>" + JSON.stringify(data));
if (timesOfOnCancelCallbackRemoveAll2Times == 1){
expect(data.request.id).assertequal(1);
expect(data.request.id).assertEqual(27);
} else if (timesOfOnCancelCallbackRemoveAll2Times == 2){
expect().assertFail();
}
console.info("================OnCancelCallback_removeAll2Times_2700 end=======================>");
console.info("=======ANS_Remove_2700 onCancel end============>");
}
/*
......@@ -2210,14 +2237,14 @@ describe('ActsAnsNotificationRemove', function () {
* twice in a row to delete the notification information
*/
it('ANS_Remove_2700', 0, async function (done) {
console.info("===============ANS_Remove_2700==========================>");
console.info("===============ANS_Remove_2700 start==========================>");
timesOfOnCancelCallbackRemoveAll2Times = 0
var subscriber ={
onConsume:onConsumeRemoveAll2Times,
onCancel:onCancelRemoveAll2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2700_promise==================>");
console.info("============ANS_Remove_2700 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2249,36 +2276,36 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2700_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2700_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2700 done==================>");
}),1000);
console.info("=========ANS_Remove_2700 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_2700 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2700 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeCallbackRemoveAll2TimesPromise(data) {
console.info("================OnConsumeCallback_removeAll2Times_promise_2800 start=======================>");
console.info("================OnConsumeCallback_2800 data: =======================>" + JSON.stringify(data));
console.info("=============ANS_Remove_2800 onConsume start=============>");
console.info("=============ANS_Remove_2800 onConsume data: =======================>" + JSON.stringify(data));
notify.removeAll()
console.info("================removeAll_2times2_2800 end=======================>");
console.info("=============ANS_Remove_2800 onConsume removeAll1=======================>");
notify.removeAll()
console.info("================removeAll_2times2_2800 end=======================>");
console.info("================OnConsumeCallback_removeAll2Times_promise_2800 remove=======================>");
console.info("================OnConsumeCallback_removeAll2Times_promise_2800 end=======================>");
console.info("=============ANS_Remove_2800 onConsume removeAll2=======================>");
console.info("=============ANS_Remove_2800 onConsume end=============>");
}
var timesOfOnCancelCallbackRemoveAll2TimesPromise
function onCancelCallbackRemoveAll2TimesPromise(data) {
timesOfOnCancelCallbackRemoveAll2TimesPromise = timesOfOnCancelCallbackRemoveAll2TimesPromise + 1
console.info("==========================OnCancelCallback_removeAll2Times_2800 start=======================>");
console.info("================OnCancelCallback_removeAll2Times_2800 data : ========>" + JSON.stringify(data));
console.info("===================ANS_Remove_2800 onCancel start=======================>");
console.info("===================ANS_Remove_2800 onCancel data : ========>" + JSON.stringify(data));
if (timesOfOnCancelCallbackRemoveAll2TimesPromise == 1){
expect(data.request.id).assertequal(1);
expect(data.request.id).assertEqual(28);
} else if (timesOfOnCancelCallbackRemoveAll2TimesPromise == 2){
expect().assertFail();
}
console.info("================OnCancelCallback_removeAll2Times_2800 end=======================>");
console.info("===================ANS_Remove_2800 onCancel end=======================>");
}
/*
......@@ -2288,14 +2315,14 @@ describe('ActsAnsNotificationRemove', function () {
* to delete the notification information
*/
it('ANS_Remove_2800', 0, async function (done) {
console.info("===============ANS_Remove_2800==========================>");
console.info("===============ANS_Remove_2800 start==========================>");
timesOfOnCancelCallbackRemoveAll2TimesPromise = 0
var subscriber ={
onConsume:onConsumeCallbackRemoveAll2TimesPromise,
onCancel:onCancelCallbackRemoveAll2TimesPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2800_promise==================>");
console.info("================ANS_Remove_2800 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2327,22 +2354,23 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2800_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2800_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2800 done==================>");
}),1000);
console.info("================ANS_Remove_2800 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_2800 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2800 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveByNotificationKey(data) {
console.info("================OnConsume_removeByNotificationKey_2900 start=======================>");
console.info("================OnConsume_2900 data: =======================>" + JSON.stringify(data));
console.info("OnConsume_2900 creatorBundleName: =======================>" + data.request.creatorBundleName);
console.info("================OnConsume_2900 creatorUid: =======================>" + data.request.creatorUid);
console.info("================OnConsume_2900 id: =======================>" + data.request.id);
console.info("================OnConsume_2900 label: =======================>" + data.request.label);
console.info("=======ANS_Remove_2900 onConsume start=======================>");
console.info("=======ANS_Remove_2900 onConsume data: =======================>" + JSON.stringify(data));
console.info("=======ANS_Remove_2900 onConsume creatorBundleName:====>" + data.request.creatorBundleName);
console.info("=======ANS_Remove_2900 onConsume creatorUid:==============>" + data.request.creatorUid);
console.info("=======ANS_Remove_2900 onConsume id: =======================>" + data.request.id);
console.info("=======ANS_Remove_2900 onConsume label: =======================>" + data.request.label);
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2352,21 +2380,23 @@ describe('ActsAnsNotificationRemove', function () {
label:data.request.label
}
notify.remove(bundleOption,notificationKey,removeByNotificationKeyCB);
console.info("================OnConsume_removeByNotificationKey_2900 remove=======================>");
console.info("================OnConsume_removeByNotificationKey_2900 end=======================>");
console.info("=============ANS_Remove_2900 onConsume remove=======================>");
console.info("=============ANS_Remove_2900 onConsume end=======================>");
}
function onCancelRemoveByNotificationKey(data) {
console.info("================OnCancel_removeByNotificationKey_2900 start=======================>");
console.info("================OnCancel_removeByNotificationKey_2900 data: ==========>" + JSON.stringify(data));
expect(data.request.label).assertequal("2900");
expect(data.request.id).assertequal(29);
console.info("================OnCancel_removeByNotificationKey_2900 end=======================>");
console.info("=============ANS_Remove_2900 onCancel start================>");
console.info("=============ANS_Remove_2900 onCancel data:==========>" + JSON.stringify(data));
expect(data.request.label).assertEqual("2900");
console.info("=============ANS_Remove_2900 onCancel label:==========>" + JSON.stringify(data.request.label));
expect(data.request.id).assertEqual(29);
console.info("=============ANS_Remove_2900 onCancel id:==========>" + JSON.stringify(data.request.id));
console.info("=============ANS_Remove_2900 onCancel end================>");
}
function removeByNotificationKeyCB(err, data) {
console.info("================removeByNotificationKeyCB_2900 start=======================>");
console.info("================removeByNotificationKeyCB_2900=======================>" + JSON.stringify(err));
console.info("================removeByNotificationKeyCB_2900=======================>" + JSON.stringify(data));
console.info("================removeByNotificationKeyCB_2900 end=======================>");
console.info("==========ANS_Remove_2900 removeCalback start============>");
console.info("==========ANS_Remove_2900 removeCalback err==============>" + JSON.stringify(err));
console.info("==========ANS_Remove_2900 removeCalback data=============>" + JSON.stringify(data));
console.info("==========ANS_Remove_2900 removeCalback end============>");
}
/*
......@@ -2377,13 +2407,13 @@ describe('ActsAnsNotificationRemove', function () {
* NotificationKey
*/
it('ANS_Remove_2900', 0, async function (done) {
console.info("===============ANS_Remove_2900==========================>");
console.info("===============ANS_Remove_2900 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveByNotificationKey,
onCancel:onCancelRemoveByNotificationKey,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_2900_promise==================>");
console.info("================ANS_Remove_2900 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2415,18 +2445,19 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_2900_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_2900_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_2900 done==================>");
}),1000);
console.info("==============ANS_Remove_2900 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_2900 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_2900 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveByNotificationKeyPromise(data) {
console.info("================OnConsume_removeByNotificationKey_promise_3000 start=======================>");
console.info("================OnConsume_3000 data: =======================>" + JSON.stringify(data));
console.info("==========ANS_Remove_3000 onConsume start==============>");
console.info("==========ANS_Remove_3000 data: =======================>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2436,15 +2467,15 @@ describe('ActsAnsNotificationRemove', function () {
label:"3000"
}
notify.remove(bundleOption,notificationKey)
console.info("================OnConsume_removeByNotificationKey_promise_3000 remove=======================>");
console.info("================OnConsume_removeByNotificationKey_promise_3000 end=======================>");
console.info("==========ANS_Remove_3000 onConsume remove==============>");
console.info("==========ANS_Remove_3000 onConsume end=================>");
}
function onCancelRemoveByNotificationKeyPromise(data) {
console.info("================OnCancel_removeByNotificationKey_promise_3000 start=======================>");
console.info("================OnCancel_3000 data: =======================>" + JSON.stringify(data));
expect(data.request.label).assertequal("3000");
expect(data.request.id).assertequal(30);
console.info("================OnCancel_removeByNotificationKey_promise_3000 end=======================>");
console.info("========ANS_Remove_3000 onCancel start========>");
console.info("========ANS_Remove_3000 onCancel data:========>" + JSON.stringify(data));
expect(data.request.label).assertEqual("3000");
expect(data.request.id).assertEqual(30);
console.info("========ANS_Remove_3000 onCancel end==========>");
}
/*
......@@ -2455,13 +2486,13 @@ describe('ActsAnsNotificationRemove', function () {
deletes notification information through BundleOption and NotificationKey
*/
it('ANS_Remove_3000', 0, async function (done) {
console.info("===============ANS_Remove_3000==========================>");
console.info("===============ANS_Remove_3000 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveByNotificationKeyPromise,
onCancel:onCancelRemoveByNotificationKeyPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3000_promise==================>");
console.info("===============ANS_Remove_3000 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2493,18 +2524,19 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3000_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3000_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3000 done==================>");
}),1000);
console.info("=============ANS_Remove_3000 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_3000 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3000 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveByNotificationKeyWrongKey(data) {
console.info("================OnConsume_removeByNotificationKey_wrongKey_3100 start=======================>");
console.info("================OnConsume_3100 data: =======================>" + JSON.stringify(data));
console.info("==========ANS_Remove_3100 onConsume start=============>");
console.info("==========ANS_Remove_3100 onConsume data:=============>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2514,21 +2546,21 @@ describe('ActsAnsNotificationRemove', function () {
label:"wrongLabel"
}
notify.remove(bundleOption,notificationKey,removeByNotificationKeyCBWrongKey);
console.info("================OnConsume_removeByNotificationKey_wrongKey_3100 remove=======================>");
console.info("================OnConsume_removeByNotificationKey_wrongKey_3100 end=======================>");
console.info("==========ANS_Remove_3100 onConsume remove==========>");
console.info("==========ANS_Remove_3100 onConsume end=============>");
}
function onCancelRemoveByNotificationKeyWrongKey(data) {
console.info("================OnCancel_removeByNotificationKey_wrongKey_3100 start=======================>");
console.info("================OnCancel_3100 data: =======================>" + JSON.stringify(data));
console.info("==========ANS_Remove_3100 onCancel start===========>");
console.info("==========ANS_Remove_3100 onCancel data:===========>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeByNotificationKey_wrongKey_3100 end=======================>");
}
console.info("==========ANS_Remove_3100 onCancel end===========>");
}
function removeByNotificationKeyCBWrongKey(err, data) {
console.info("================removeByNotificationKeyCB_3100 start=======================>");
console.info("================removeByNotificationKeyCB_3100=======================>" + JSON.stringify(err));
expect(err.code).assertNotEqual(0);
console.info("================removeByNotificationKeyCB_3100=======================>" + JSON.stringify(data));
console.info("================removeByNotificationKeyCB_3100 end=======================>");
console.info("==========ANS_Remove_3100 removeCallback start===========>");
console.info("==========ANS_Remove_3100 removeCallback err=============>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("==========ANS_Remove_3100 removeCallback data============>" + JSON.stringify(data));
console.info("==========ANS_Remove_3100 removeCallback end===========>");
}
/*
......@@ -2539,13 +2571,13 @@ describe('ActsAnsNotificationRemove', function () {
* NotificationKey correct bundleOption,wrong notificationKey.
*/
it('ANS_Remove_3100', 0, async function (done) {
console.info("===============ANS_Remove_3100==========================>");
console.info("===============ANS_Remove_3100 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveByNotificationKeyWrongKey,
onCancel:onCancelRemoveByNotificationKeyWrongKey,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3100_promise==================>");
console.info("==============ANS_Remove_3100 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2577,18 +2609,19 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3100_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3100_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3100 done==================>");
}),1000);
console.info("=============ANS_Remove_3100 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_3100 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3100 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveByNotificationKeyWrongKeyPromise(data) {
console.info("================OnConsume_removeByNotificationKey_wrongKey_promise_3200 start===============>");
console.info("================OnConsume_3200 data: =======================>" + JSON.stringify(data));
console.info("===========ANS_Remove_3200 onConsume start===============>");
console.info("===========ANS_Remove_3200 onConsume data:===============>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2598,14 +2631,14 @@ describe('ActsAnsNotificationRemove', function () {
label:"wrongLabel"
}
notify.remove(bundleOption, notificationKey);
console.info("================removeByNotificationKey_wrongKey_promise_3200 end=======================>");
console.info("================OnConsume_removeByNotificationKey_wrongKey_promise_3200 end==================>");
console.info("===========ANS_Remove_3200 onConsume remove============>");
console.info("===========ANS_Remove_3200 onConsume end===============>");
}
function onCancelRemoveByNotificationKeyWrongKeyPromise(data) {
console.info("================OnCancel_removeByNotificationKey_wrongKey_promise_3200 start=================>");
console.info("================OnCancel_3200 data: =======================>" + JSON.stringify(data));
console.info("===========ANS_Remove_3200 onCancel start=================>");
console.info("===========ANS_Remove_3200 onCanceldata:==================>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeByNotificationKey_wrongKey_promise_3200 end===================>");
console.info("===========ANS_Remove_3200 onCancel end=================>");
}
/*
......@@ -2616,13 +2649,13 @@ describe('ActsAnsNotificationRemove', function () {
* bundleOption,wrong notificationKey.
*/
it('ANS_Remove_3200', 0, async function (done) {
console.info("===============ANS_Remove_3200==========================>");
console.info("===============ANS_Remove_3200 start=================>");
var subscriber ={
onConsume:onConsumeRemoveByNotificationKeyWrongKeyPromise,
onCancel:onCancelRemoveByNotificationKeyWrongKeyPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3200_promise==================>");
console.info("===============ANS_Remove_3200 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2654,19 +2687,19 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3200_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3200_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3200 done==================>");
}),1000);
done();
console.info("===========ANS_Remove_3200 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_3200 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3200 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function OnConsumeRemoveByNotificationKeyWrongBundle(data) {
console.info("================OnConsume_removeByNotificationKey_wrongBundle_3300 start==================>");
console.info("================OnConsume_3300 data: =======================>" + JSON.stringify(data));
console.info("==============ANS_Remove_3300 onConsume start===============>");
console.info("==============ANS_Remove_3300 onConsume data:===============>" + JSON.stringify(data));
var bundleOption = {
bundle:"wrongBundleName",
uid:0,
......@@ -2676,21 +2709,21 @@ describe('ActsAnsNotificationRemove', function () {
label:"3300"
}
notify.remove(bundleOption,notificationKey,removeByNotificationKeyCBWrongBundle);
console.info("================OnConsume_3300 remove=======================>");
console.info("================OnConsume_removeByNotificationKey_wrongBundle_3300 end=====================>");
console.info("==============ANS_Remove_3300 onConsume remove===============>");
console.info("==============ANS_Remove_3300 onConsume end==================>");
}
function OnCancelRemoveByNotificationKeyWrongBundle(data) {
console.info("OnCancel_removeByNotificationKey_wrongBundle_3300 start==========>");
console.info("OnCancel_removeByNotificationKey_wrongBundle_3300 data:===========>" + JSON.stringify(data));
console.info("==============ANS_Remove_3300 onCancel start=============>");
console.info("==============ANS_Remove_3300 onCancel data:===========>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeByNotificationKey_wrongBundle_3300 end======================>");
console.info("==============ANS_Remove_3300 onCancel end=============>");
}
function removeByNotificationKeyCBWrongBundle(err, data) {
console.info("================removeByNotificationKeyCB_wrongBundle_3300 start=======================>");
console.info("removeByNotificationKeyCB_wrongBundle_3300=======================>" + JSON.stringify(err));
expect(err.code).assertNotEqual(0);
console.info("removeByNotificationKeyCB_wrongBundle_3300=======================>" + JSON.stringify(data));
console.info("================removeByNotificationKeyCB_wrongBundle_3300 end=======================>");
console.info("===========ANS_Remove_3300 removeCallback start==========>");
console.info("===========ANS_Remove_3300 removeCallback err============>" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.info("===========ANS_Remove_3300 removeCallback data===========>" + JSON.stringify(data));
console.info("===========ANS_Remove_3300 removeCallback end============>");
}
/*
......@@ -2701,13 +2734,13 @@ describe('ActsAnsNotificationRemove', function () {
* NotificationKey wrong bundleOption,correct notificationKey.
*/
it('ANS_Remove_3300', 0, async function (done) {
console.info("===============ANS_Remove_3300==========================>");
console.info("===============ANS_Remove_3300 start==========================>");
var subscriber ={
onConsume:OnConsumeRemoveByNotificationKeyWrongBundle,
onCancel:OnCancelRemoveByNotificationKeyWrongBundle,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3300_promise==================>");
console.info("================ANS_Remove_3300 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2739,18 +2772,19 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3300_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3300_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3300 done==================>");
}),1000);
console.info("================ANS_Remove_3300 publish promise=================>");
setTimeout((async function(){
console.info("======ANS_Remove_3300 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3300 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveByNotificationKeyWrongBundlePromise(data) {
console.info("================OnConsume_removeByNotificationKey_wrongBundle_promise_3400 start============>");
console.info("================OnConsume_3400 data: =======================>" + JSON.stringify(data));
console.info("===========ANS_Remove_3400 onConsume start============>");
console.info("===========ANS_Remove_3400 onConsume data:============>" + JSON.stringify(data));
var bundleOption = {
bundle:"wrongBundleName",
uid:0,
......@@ -2760,14 +2794,14 @@ describe('ActsAnsNotificationRemove', function () {
label:"3400"
}
notify.remove(bundleOption, notificationKey)
console.info("================removeByNotificationKey_wrongBundle_promise_3400 end=====================>");
console.info("================OnConsume_removeByNotificationKey_wrongBundle_promise_3400 end==============>");
console.info("===========ANS_Remove_3400 onConsume remove=========>");
console.info("===========ANS_Remove_3400 onConsume end============>");
}
function onCancelRemoveByNotificationKeyWrongBundlePromise(data) {
console.info("================OnCancel_removeByNotificationKey_wrongBundle_promise_3400 start=============>");
console.info("================OnCancel_3400 data: =======================>" + JSON.stringify(data));
console.info("===========ANS_Remove_3400 onCancel start=============>");
console.info("===========ANS_Remove_3400 onCancel data: ============>" + JSON.stringify(data));
expect().assertFail();
console.info("================OnCancel_removeByNotificationKey_wrongBundle_promise_3400 end================>");
console.info("===========ANS_Remove_3400 onCancel end===============>");
}
/*
......@@ -2778,13 +2812,13 @@ describe('ActsAnsNotificationRemove', function () {
* bundleOption,wrong notificationKey.
*/
it('ANS_Remove_3400', 0, async function (done) {
console.info("===============ANS_Remove_3400==========================>");
console.info("===============ANS_Remove_3400 start==========================>");
var subscriber ={
onConsume:onConsumeRemoveByNotificationKeyWrongBundlePromise,
onCancel:onCancelRemoveByNotificationKeyWrongBundlePromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3400_promise==================>");
console.info("============ANS_Remove_3400 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2816,27 +2850,28 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3400_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3400_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3400 done==================>");
}),1000);
console.info("============ANS_Remove_3400 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_3400 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3400 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function removeByNotificationKey2Times2CB(err,data) {
console.info("================removeByNotificationKey2Times2CB_3500 start=======================>");
console.info("================removeByNotificationKey2Times2CB_3500 err==============>" + JSON.stringify(err));
console.info("================removeByNotificationKey2Times2CB_3500 data============>" + JSON.stringify(data));
expect(err.code).assertNotEqual(0);
console.info("================removeByNotificationKey2Times2CB_3500 end=======================>");
console.info("==========ANS_Remove_3500 removeCallback2Times2 start============>");
console.info("==========ANS_Remove_3500 removeCallback2Times2 err==============>" + JSON.stringify(err));
console.info("==========ANS_Remove_3500 removeCallback2Times2 data============>" + JSON.stringify(data));
expect(err.code != 0).assertEqual(true);
console.info("==========ANS_Remove_3500 removeCallback2Times2 end================>");
}
function removeByNotificationKey2Times1CB(err,data) {
console.info("================removeByNotificationKey2Times1CB_3500 start=======================>");
console.info("================removeByNotificationKey2Times1CB_3500 err==============>" + JSON.stringify(err));
console.info("================removeByNotificationKey2Times1CB_3500 data============>" + JSON.stringify(data));
expect(err.code).assertequal(0);
console.info("==========ANS_Remove_3500 removeCallback2Times1 start===========>");
console.info("==========ANS_Remove_3500 removeCallback2Times1 err=============>" + JSON.stringify(err));
console.info("==========ANS_Remove_3500 removeCallback2Times1 data============>" + JSON.stringify(data));
expect(err.code).assertEqual(0);
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2846,12 +2881,12 @@ describe('ActsAnsNotificationRemove', function () {
label:"3500"
}
notify.remove(bundleOption,notificationKey,removeByNotificationKey2Times2CB);
console.info("================removeByNotificationKey2Times1CB_3500 removeCallBack2TimesOf2===============>");
console.info("================removeByNotificationKey2Times1CB_3500 end=======================>");
console.info("==========ANS_Remove_3500 removeCallback2Times1 remove===========>");
console.info("==========ANS_Remove_3500 removeCallback2Times1 end==============>");
}
function onConsumeRemoveByNotificationKey2Times(data) {
console.info("================OnConsume_removeByNotificationKey2Times_3500 start=======================>");
console.info("================OnConsume_3500 data: ========>" + JSON.stringify(data));
console.info("=========ANS_Remove_3500 onConsume start=======================>");
console.info("=========ANS_Remove_3500 onConsume data:=========>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2861,21 +2896,21 @@ describe('ActsAnsNotificationRemove', function () {
label:"3500"
}
notify.remove(bundleOption,notificationKey,removeByNotificationKey2Times1CB);
console.info("================OnConsume_removeByNotificationKey2Times_3500 remove=======================>");
console.info("================OnConsume_removeByNotificationKey2Times_3500 end=======================>");
console.info("=========ANS_Remove_3500 onConsume remove==============>");
console.info("=========ANS_Remove_3500 onConsume end=================>");
}
var timesOfOnCancelRemoveByNotificationKey2Times
function onCancelRemoveByNotificationKey2Times(data) {
timesOfOnCancelRemoveByNotificationKey2Times = timesOfOnCancelRemoveByNotificationKey2Times + 1
console.info("================OnCancelCallback_removeAll2Times_2700 start=======================>");
console.info("================OnCancelCallback_removeAll2Times_2700 data : ========>" + JSON.stringify(data));
console.info("=========ANS_Remove_3500 onCancel start===============>");
console.info("=========ANS_Remove_3500 onCancel data : ========>" + JSON.stringify(data));
if (timesOfOnCancelRemoveByNotificationKey2Times == 1){
expect(data.request.id).assertequal(35);
expect(data.request.label).assertequal("3500");
expect(data.request.id).assertEqual(35);
expect(data.request.label).assertEqual("3500");
} else if (timesOfOnCancelRemoveByNotificationKey2Times == 2){
expect().assertFail();
}
console.info("================OnCancelCallback_removeAll2Times_2700 end=======================>");
console.info("=========ANS_Remove_3500 onCancel end=======================>");
}
/*
......@@ -2885,14 +2920,14 @@ describe('ActsAnsNotificationRemove', function () {
* AsyncCallback<void>): void; void; is called twice in a row to delete the notification information
*/
it('ANS_Remove_3500', 0, async function (done) {
console.info("===============ANS_Remove_3500==========================>");
console.info("===============ANS_Remove_3500 start==========================>");
timesOfOnCancelRemoveByNotificationKey2Times = 0
var subscriber ={
onConsume:onConsumeRemoveByNotificationKey2Times,
onCancel:onCancelRemoveByNotificationKey2Times,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3500_promise==================>");
console.info("===========ANS_Remove_3500 subscribe promise==================>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -2924,18 +2959,19 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3500_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3500_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3500 done==================>");
}),1000);
console.info("============ANS_Remove_3500 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_3500 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3500 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
function onConsumeRemoveByNotificationKey2TimesPromise(data) {
console.info("================OnConsumeCallback_removeByNotificationKey2Times_promise_3600 start===========>");
console.info("================OnConsumeCallback_3600 data: =======================>" + JSON.stringify(data));
console.info("=========ANS_Remove_3600 onConsume start===========>");
console.info("=========ANS_Remove_3600 onConsume data: =======================>" + JSON.stringify(data));
var bundleOption = {
bundle:data.request.creatorBundleName,
uid:data.request.creatorUid,
......@@ -2945,23 +2981,23 @@ describe('ActsAnsNotificationRemove', function () {
label:"3600"
}
notify.remove(bundleOption, notificationKey)
console.info("================removeByNotificationKey2Times1_promise_3600 end=======================>");
console.info("=========ANS_Remove_3600 onConsume remove1===========>");
notify.remove(bundleOption, notificationKey);
console.info("================removeByNotificationKey2Times2_promise_3600 end=====================>");
console.info("================OnConsumeCallback_removeByNotificationKey2Times_promise_3600 end============>");
console.info("=========ANS_Remove_3600 onConsume remove2===========>");
console.info("=========ANS_Remove_3600 onConsume end===========>");
}
var timesOnCancelcbRemoveByKey2TimesPromise
function onCancelRemoveByNotificationKey2TimesPromise(data) {
timesOnCancelcbRemoveByKey2TimesPromise = timesOnCancelcbRemoveByKey2TimesPromise + 1
console.info("OnCancelCallback_removeByNotificationKey2Times_promise_3600 start=======================>");
console.info("OnCancelCallback_removeByNotificationKey2Times_promise_3600 data:====>" + JSON.stringify(data));
console.info("=========ANS_Remove_3600 onCancel start=============>");
console.info("=========ANS_Remove_3600 onCancel data:=============>" + JSON.stringify(data));
if (timesOnCancelcbRemoveByKey2TimesPromise == 1){
expect(data.request.id).assertequal(36);
expect(data.request.label).assertequal("3600");
expect(data.request.id).assertEqual(36);
expect(data.request.label).assertEqual("3600");
} else if (timesOnCancelcbRemoveByKey2TimesPromise == 2){
expect().assertFail();
}
console.info("================OnCancelCallback_removeByNotificationKey2Times_promise_3600 end============>");
console.info("=========ANS_Remove_3600 onCancel end=============>");
}
/*
......@@ -2971,7 +3007,7 @@ describe('ActsAnsNotificationRemove', function () {
* Promise<void> is called twice in a row to delete the notification information
*/
it('ANS_Remove_3600', 0, async function (done) {
console.info("===============ANS_Remove_3600==========================>");
console.info("===============ANS_Remove_3600 start==========================>");
timesOnCancelcbRemoveByKey2TimesPromise = 0
timesOnCancelcbRemoveByKey2TimesPromise = 0
var subscriber ={
......@@ -2979,7 +3015,7 @@ describe('ActsAnsNotificationRemove', function () {
onCancel:onCancelRemoveByNotificationKey2TimesPromise,
}
await notify.subscribe(subscriber);
console.info("==================subscribe_3600_promise==================>");
console.info("========ANS_Remove_3600 subscribe promise=============>");
var notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
......@@ -3011,12 +3047,13 @@ describe('ActsAnsNotificationRemove', function () {
showDeliveryTime: true,
}
await notify.publish(notificationRequest);
console.info("==================publish_3600_promise==================>");
await notify.unsubscribe(subscriber);
console.info("==================unsubscribe_3600_promise==================>");
done();
setTimeout((function(){
console.info("==================ANS_Remove_3600 done==================>");
}),1000);
console.info("============ANS_Remove_3600 publish promise==================>");
setTimeout((async function(){
console.info("======ANS_Remove_3600 setTimeout============>");
await notify.unsubscribe(subscriber);
console.info("======ANS_Remove_3600 setTimeout unsubscribe============>");
await notify.cancelAll();
done();
}),timeout);
})
})
\ No newline at end of file
......@@ -15,9 +15,9 @@
import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var time = 1000
var time = 500
describe('ActsAnsAllActiveTestOne', function () {
console.info("===========ActsAnsAllActiveTestOne start====================>");
console.info("===========ActsAnsAllActiveTestOne start====================>");
function getAllCallback(err, data){
console.log("Ans_GetAllActive_0100 getAllCallback ============>");
var i;
......@@ -76,9 +76,9 @@ describe('ActsAnsAllActiveTestOne', function () {
console.debug("===============Ans_GetAllActive_0100 publish CurrentApp notify end==================>");
notify.getAllActiveNotifications(getAllCallback);
console.debug("===============Ans_GetAllActive_0100 getAllActiveNotifications end==================>");
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0100 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0100 setTimeout==================>");
done();
}, time);
})
......@@ -134,9 +134,9 @@ describe('ActsAnsAllActiveTestOne', function () {
console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label)
}
}
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0200 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0200 setTimeout==================>");
done();
}, time);
})
......@@ -186,9 +186,9 @@ describe('ActsAnsAllActiveTestOne', function () {
await notify.cancel(1, "currentApp_0300");
notify.getAllActiveNotifications(getAllCallbackThree);
console.debug("===============Ans_GetAllActive_0300 getAllActiveNotifications end==================>");
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0300 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0300 setTimeout==================>");
done();
}, time);
})
......@@ -232,9 +232,9 @@ describe('ActsAnsAllActiveTestOne', function () {
console.log("============Ans_GetAllActive_0400 label=====>"+promiseData[i].label)
}
console.debug("===============Ans_GetAllActive_0400 getAllActiveNotifications end==================>");
done();
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0400 done==================>");
console.debug("===============Ans_GetAllActive_0400 setTimeout==================>");
done();
}, time);
})
......@@ -269,9 +269,9 @@ describe('ActsAnsAllActiveTestOne', function () {
await notify.removeAll();
notify.getAllActiveNotifications(getAllCallbackFive);
console.debug("===============Ans_GetAllActive_0500 getAllActiveNotifications end==================>");
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0500 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0500 setTimeout==================>");
done();
}, time);
})
......@@ -303,9 +303,9 @@ describe('ActsAnsAllActiveTestOne', function () {
expect(promiseData.length).assertEqual(0);
console.debug("=======Ans_GetAllActive_0600 promiseData.length==========>"+promiseData.length);
console.debug("=======Ans_GetAllActive_0600 promiseData==========>"+JSON.stringify(promiseData));
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0600 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0600 setTimeout==================>");
done();
}, time);
})
......@@ -324,9 +324,9 @@ describe('ActsAnsAllActiveTestOne', function () {
await notify.removeAll();
notify.getAllActiveNotifications(getAllCallbackSeven);
console.debug("===============Ans_GetAllActive_0700 getAllActiveNotifications end==================>");
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0700 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0700 setTimeout==================>");
done();
}, time);
})
......@@ -341,9 +341,9 @@ describe('ActsAnsAllActiveTestOne', function () {
var promiseData = await notify.getAllActiveNotifications();
console.debug("=========Ans_GetAllActive_0800 promiseData.length=============>"+promiseData.length);
expect(promiseData.length).assertEqual(0);
done();
setTimeout(async function(){
console.debug("===============Ans_GetAllActive_0800 done==================>");
setTimeout(function(){
console.debug("===============Ans_GetAllActive_0800 setTimeout==================>");
done();
}, time);
})
})
......
......@@ -14,7 +14,7 @@
*/
import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var time = 1000
var time = 500
describe('ActsAnsUnSubscriberTest', function () {
console.debug("===============ActsAnsUnSubscriberTest start=================>");
function onConnecteOne() {
......@@ -31,22 +31,19 @@ describe('ActsAnsUnSubscriberTest', function () {
*/
it('Ans_UnSubscriber_0100', 0, async function (done) {
console.info("===========Ans_UnSubscriber_0100 start=============>");
function unSubscribeCallbackOne(err) {
console.debug("===========Ans_UnSubscriber_0100 unSubscribeCallbackOne err.code=================>"+err.code);
expect(err.code).assertEqual(0)
done();
}
var subscriber ={
onConnect:onConnecteOne,
onDisconnect:onDisconnectOne
}
await notify.subscribe(subscriber);
notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0100 subscribe=============>");
await notify.unsubscribe(subscriber, unSubscribeCallbackOne);
console.info("===========Ans_UnSubscriber_0100 unsubscribe=============>");
notify.unsubscribe(subscriber, (err)=>{
console.debug("===========Ans_UnSubscriber_0100 unsubscribe err.code=================>"+err.code);
expect(err.code).assertEqual(0);
});
setTimeout(function(){
console.debug("===========Ans_UnSubscriber_0100 done=============>");
console.debug("===========Ans_UnSubscriber_0100 setTimeout=============>");
done();
}, time);
})
......@@ -68,13 +65,16 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTwo,
onDisconnect:onDisconnectTwo
}
await notify.subscribe(subscriber);
notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0200 subscribe=============>");
await notify.unsubscribe(subscriber);
console.info("===========Ans_UnSubscriber_0200 unsubscribe=============>");
done();
notify.unsubscribe(subscriber).then(()=>{
console.debug("=======Ans_UnSubscriber_0200 subscribe then==========>");
}).catch((err)=>{
console.debug("=======Ans_UnSubscriber_0200 subscribe catch err==========>"+err.code);
});
setTimeout(function(){
console.debug("===========Ans_UnSubscriber_0200 done=============>");
console.debug("===========Ans_UnSubscriber_0200 setTimeout=============>");
done();
}, time);
})
......@@ -85,10 +85,6 @@ describe('ActsAnsUnSubscriberTest', function () {
console.debug("=======Ans_UnSubscriber_0300 onDisconnectThree=================>");
expect().assertFail();
}
function unSubscribeCallbackThree(err){
console.debug("Ans_UnSubscriber_0300 unSubscribeCallbackThree err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
/*
* @tc.number: Ans_UnSubscriber_0300
......@@ -107,11 +103,13 @@ describe('ActsAnsUnSubscriberTest', function () {
}
await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0300 subscribe=============>");
await notify.unsubscribe(subscriberErr,unSubscribeCallbackThree);
console.info("===========Ans_UnSubscriber_0300 unsubscribe=============>");
done();
notify.unsubscribe(subscriberErr,(err)=>{
console.debug("Ans_UnSubscriber_0300 unsubscribe callback err=========>"+err.code);
expect(err.code != 0).assertEqual(true);
});
setTimeout(function(){
console.debug("===========Ans_UnSubscriber_0300 done=============>");
console.debug("===========Ans_UnSubscriber_0300 setTimeout=============>");
done();
}, time);
})
......@@ -141,12 +139,12 @@ describe('ActsAnsUnSubscriberTest', function () {
await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0400 subscribe=============>");
notify.unsubscribe(subscriberErr).then().catch((err)=>{
console.debug("=======Ans_UnSubscriber_0400 subscribe catch err=================>"+err.code);
expect(err.code).assertEqual(67108867)
console.debug("=======Ans_UnSubscriber_0400 subscribe catch err==========>"+err.code);
expect(err.code != 0).assertEqual(true);
});
done();
setTimeout(function(){
console.debug("===========Ans_UnSubscriber_0400 done=============>");
console.debug("===========Ans_UnSubscriber_0400 setTimeout=============>");
done();
}, time);
})
......@@ -157,10 +155,6 @@ describe('ActsAnsUnSubscriberTest', function () {
console.debug("=======Ans_UnSubscriber_0500 onDisconnectFive=================>");
expect().assertFail();
}
function unSubscribeCallbackFive(err){
console.debug("Ans_UnSubscriber_0500 unSubscribeCallbackFive err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
function onConnecteTest() {
console.debug("=======Ans_UnSubscriber_0500 onConnecteTest=================>");
expect().assertFail();
......@@ -185,13 +179,16 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTest,
onDisconnect:onDisconnectTest
}
await notify.subscribe(subscriber);
notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0500 subscribe=============>");
await notify.unsubscribe(subscriberTest,unSubscribeCallbackFive);
notify.unsubscribe(subscriberTest,(err)=>{
console.debug("Ans_UnSubscriber_0500 unsubscribe err.code=================>"+err.code);
expect(err.code != 0).assertEqual(true);
});
console.info("===========Ans_UnSubscriber_0500 unsubscribe=============>");
done();
setTimeout(function(){
console.debug("===========Ans_UnSubscriber_0500 done=============>");
console.debug("===========Ans_UnSubscriber_0500 setTimeout=============>");
done();
}, time);
})
......@@ -226,15 +223,15 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTestTwo,
onDisconnect:onDisconnectTestTwo
}
await notify.subscribe(subscriber);
notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0600 subscribe=============>");
notify.unsubscribe(subscriberTest).then().catch((err)=>{
console.debug("=======Ans_UnSubscriber_0600 unsubscribe catch err=================>"+err.code);
expect(err.code).assertNotEqual(0)
expect(err.code != 0).assertEqual(true);
});
done();
setTimeout(function(){
console.debug("===========Ans_UnSubscriber_0600 done=============>");
console.debug("===========Ans_UnSubscriber_0600 setTimeout=============>");
done();
}, time);
})
......@@ -249,14 +246,6 @@ describe('ActsAnsUnSubscriberTest', function () {
expect().assertFail();
}
}
function unSubscribeCallbackSevenFirst(err){
console.debug("Ans_UnSubscriber_0700 unSubscribeCallbackSevenFirst err.code=================>"+err.code);
expect(err.code).assertEqual(0)
}
function unSubscribeCallbackSevenSecond(err){
console.debug("Ans_UnSubscriber_0700 unSubscribeCallbackSevenSecond err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
/*
* @tc.number: Ans_UnSubscriber_0700
......@@ -265,21 +254,24 @@ describe('ActsAnsUnSubscriberTest', function () {
*/
it('Ans_UnSubscriber_0700', 0, async function (done) {
console.info("===========Ans_UnSubscriber_0700 start=============>");
timesOfOnDis = 0
var subscriber ={
onConnect:onConnecteSeven,
onDisconnect:onDisconnectSeven
}
await notify.subscribe(subscriber);
notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0700 subscribe=============>");
await notify.unsubscribe(subscriber, unSubscribeCallbackSevenFirst);
console.info("===========Ans_UnSubscriber_0700 unsubscribe first end=============>");
await notify.unsubscribe(subscriber, unSubscribeCallbackSevenSecond);
console.info("===========Ans_UnSubscriber_0700 unsubscribe second end=============>");
done();
notify.unsubscribe(subscriber, (err)=>{
console.debug("Ans_UnSubscriber_0700 unsubscribe first err.code=================>"+err.code);
expect(err.code).assertEqual(0);
notify.unsubscribe(subscriber, (err)=>{
console.debug("Ans_UnSubscriber_0700 unsubscribe Second err.code=================>"+err.code);
expect(err.code != 0).assertEqual(true);
});
});
setTimeout(function(){
console.info("===========Ans_UnSubscriber_0700 done=============>");
console.debug("===========Ans_UnSubscriber_0700 setTimeout=============>");
done();
}, time);
})
......@@ -307,22 +299,22 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteEight,
onDisconnect:onDisconnectEight
}
await notify.subscribe(subscriber);
notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0800 subscribe=============>");
notify.unsubscribe(subscriber).then((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe first then err=================>"+err.code);
notify.unsubscribe(subscriber).then((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe second then err=================>"+err.code);
}).catch((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe second catch err=================>"+err.code);
expect(err.code != 0).assertEqual(true);
});
}).catch((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe first catch err=================>"+err.code);
});
notify.unsubscribe(subscriber).then((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe second then err=================>"+err.code);
}).catch((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe second catch err=================>"+err.code);
expect(err.code).assertNotEqual(0)
});
done();
setTimeout(function(){
console.info("===========Ans_UnSubscriber_0800 done=============>");
console.debug("===========Ans_UnSubscriber_0800 setTimeout=============>");
done();
}, time);
})
......@@ -330,14 +322,6 @@ describe('ActsAnsUnSubscriberTest', function () {
console.debug("=======Ans_UnSubscriber_0900 onDisconnectTestNine =================>");
expect().assertFail();
}
function subscribeCallbackNine(err){
console.debug("Ans_UnSubscriber_0900 subscribeCallbackNine err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
function unSubscribeCallbackNine(err){
console.debug("Ans_UnSubscriber_0900 unSubscribeCallbackNine err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
/*
* @tc.number: Ans_UnSubscriber_0900
......@@ -350,11 +334,17 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:"",
onDisconnect:onDisconnectTestNine
}
await notify.subscribe(subscriber, subscribeCallbackNine);
notify.unsubscribe(subscriber, unSubscribeCallbackNine);
done();
notify.subscribe(subscriber, (err)=>{
console.debug("Ans_UnSubscriber_0900 subscribeCallbackNine err.code=================>"+err.code);
expect(err.code != 0).assertEqual(true);
notify.unsubscribe(subscriber, (err)=>{
console.debug("Ans_UnSubscriber_0900 unsubscribe err.code=================>"+err.code);
expect(err.code != 0).assertEqual(true);
});
});
setTimeout(function(){
console.info("===========Ans_UnSubscriber_0900 done=============>");
console.debug("===========Ans_UnSubscriber_0900 setTimeout=============>");
done();
}, time);
})
......@@ -362,10 +352,7 @@ describe('ActsAnsUnSubscriberTest', function () {
console.debug("=======Ans_UnSubscriber_1000 onDisconnectTestTen =================>");
expect().assertFail();
}
function subscribeCallbackTen(err){
console.debug("Ans_UnSubscriber_1000 subscribeCallbackTen err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
/*
* @tc.number: Ans_UnSubscriber_1000
* @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise<void>;
......@@ -377,17 +364,17 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:"",
onDisconnect:onDisconnectTestTen
}
await notify.subscribe(subscriber, subscribeCallbackTen);
console.info("===========Ans_UnSubscriber_1000 subscribe end=============>");
notify.unsubscribe(subscriber).then((err)=>{
console.debug("=======Ans_UnSubscriber_1000 subscribe then err=================>"+err.code);
}).catch((err)=>{
console.debug("=======Ans_UnSubscriber_1000 subscribe catch err=================>"+err.code);
expect(err.code).assertNotEqual(0)
notify.subscribe(subscriber, (err)=>{
notify.unsubscribe(subscriber).then((err)=>{
console.debug("=======Ans_UnSubscriber_1000 subscribe then err=================>"+err.code);
}).catch((err)=>{
console.debug("=======Ans_UnSubscriber_1000 subscribe catch err=================>"+err.code);
expect(err.code != 0).assertEqual(true);
});
});
done();
setTimeout(function(){
console.info("===========Ans_UnSubscriber_1000 done=============>");
console.debug("===========Ans_UnSubscriber_1000 setTimeout=============>");
done();
}, time);
})
......@@ -398,10 +385,6 @@ describe('ActsAnsUnSubscriberTest', function () {
console.debug("============Ans_UnSubscriber_1100 onDisconnectEleven=================>");
expect().assertFail();
}
function unSubscribeCallbackEleven(err){
console.debug("Ans_UnSubscriber_1100 unSubscribeCallbackEleven err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
}
/*
* @tc.number: Ans_UnSubscriber_1100
......@@ -411,7 +394,7 @@ describe('ActsAnsUnSubscriberTest', function () {
*/
it('Ans_UnSubscriber_1100', 0, async function (done) {
console.info("===========Ans_UnSubscriber_1100 start=============>");
await notify.subscribe({
notify.subscribe({
onConnect:onConnecteEleven,
onDisconnect:onDisconnectEleven
});
......@@ -422,11 +405,11 @@ describe('ActsAnsUnSubscriberTest', function () {
},
(err)=>{
console.debug("Ans_UnSubscriber_1100 unSubscribeCallbackEleven err.code=================>"+err.code);
expect(err.code).assertNotEqual(0);
expect(err.code != 0).assertEqual(true);
});
done();
setTimeout(function(){
console.info("===========Ans_UnSubscriber_1100 done=============>");
console.debug("===========Ans_UnSubscriber_1100 setTimeout=============>");
done();
}, time);
})
......@@ -446,7 +429,7 @@ describe('ActsAnsUnSubscriberTest', function () {
*/
it('Ans_UnSubscriber_1200', 0, async function (done) {
console.info("===========Ans_UnSubscriber_1200 start=============>");
await notify.subscribe({
notify.subscribe({
onConnect:onConnecteTwelve,
onDisconnect:onConnecteTwelve
});
......@@ -454,14 +437,15 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTwelve,
onDisconnect:onDisconnectTwelve
}).then((err)=>{
console.info("===========Ans_UnSubscriber_1200 unsubscribe then err=============>"+err);
console.info("===========Ans_UnSubscriber_1200 unsubscribe then err=============>"+err.code);
}).catch((err)=>{
console.info("===========Ans_UnSubscriber_1200 unsubscribe catch err=============>"+err);
expect(err.code).assertNotEqual(0)
console.info("===========Ans_UnSubscriber_1200 unsubscribe catch err=============>"+err.code);
expect(err.code != 0).assertEqual(true);
});
done();
setTimeout(function(){
console.info("===========Ans_UnSubscriber_1200 done=============>");
console.debug("===========Ans_UnSubscriber_1200 setTimeout=============>");
done();
}, time);
});
})
......
......@@ -17,9 +17,8 @@ group("SubscribeAndPublish") {
testonly = true
if (is_standard_system) {
deps = [
"actssubscriberorderedtest:ActsSubscriberOrderTest",
"actssubscriberunordertest:ActsSubscriberUnorderTest",
#"actssubscriberorderedtest:ActsSubscriberOrderTest",
#"actssubscriberunordersystemtest:ActsSubscriberTestUnorderSystem"
]
}
......
......@@ -30,13 +30,6 @@ describe('ActsSubscriberTestOrder', function () {
var commonEventSubscriber0500_1;
var commonEventSubscriber0500_2;
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
function publishCallback(err) {
console.info("===============>publishCallback");
}
......@@ -45,202 +38,6 @@ describe('ActsSubscriberTestOrder', function () {
console.info("===============>unsubscribeCallback");
}
async function subscriberCallBack0100(err, data) {
console.info("===============>subscriberCallBack0100========event: " + data.event);
console.info("===============>subscriberCallBack0100========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0100=========code: " + data.code);
console.info("===============>subscriberCallBack0100=========data: " + data.data);
expect(data.event).assertEqual("publish_event0100");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event1001_init");
expect(data.bundleName).assertEqual("publish_event0100_bundleName");
commonEventSubscriber0100.setCode(2).then(()=>{
console.info("===============>subscriberCallBack0100 setCodeCallBack promise");
})
commonEventSubscriber0100.setData("publish_event1001_change").then(()=>{
console.info("===============>subscriberCallBack0100 setDataCallBack promise");
})
commonEventSubscriber0100.setCodeAndData(2, "publish_event1001_change").then(()=>{
console.info("===============>subscriberCallBack0100 setCodeAndDataCallback promise");
})
commonEventSubscriber0100.getAbortCommonEvent().then(function(data) {
console.info("===============>subscriberCallBack0100 getAbortCommonEventCallback1 promise abort: " + data);
})
commonEventSubscriber0100.clearAbortCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0100 clearAbortCommonEventCallback promise");
})
commonEventSubscriber0100.getAbortCommonEvent().then(function(data) {
console.info("===============>subscriberCallBack0100 getAbortCommonEventCallback2 promise abort: " + data);
})
commonEventSubscriber0100.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0100 finishCommonEvent promise");
})
}
async function subscriberCallBack0101(err, data) {
console.info("===============>subscriberCallBack0101========code: " + err.code);
console.info("===============>subscriberCallBack0101========event: " + data.event);
console.info("===============>subscriberCallBack0101========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0101=========code: " + data.code);
console.info("===============>subscriberCallBack0101=========data: " + data.data);
expect(data.event).assertEqual("publish_event0100");
console.info("===============>subscriberCallBack0101=========1 code "+ data.code);
expect(data.code).assertEqual(2);
commonEventSubscriber0101.getCode().then(function(data) {
console.info("===============>subscriberCallBack0101 getCodeCallBack promise code: "+ data);
})
expect(data.data).assertEqual("publish_event1001_change");
commonEventSubscriber0100.getData().then(function(data) {
console.info("===============>subscriberCallBack0100 getDataCallBack promise data: "+ data);
})
expect(data.bundleName).assertEqual("publish_event0100_bundleName");
commonEventSubscriber0101.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0101 finishCommonEvent promise");
})
}
async function subscriberCallBack0200_1(err, data) {
console.info("===============>subscriberCallBack0200_1========event: " + data.event);
console.info("===============>subscriberCallBack0200_1========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0200_1=========code: " + data.code);
console.info("===============>subscriberCallBack0200_1=========data: " + data.data);
console.info("===============>subscriberCallBack0200_1=========num2: " + num2);
if (num2 == 0) {
num2++;
expect(data.event).assertEqual("publish_event0200");
console.info("===============>subscriberCallBack0200_1=====num2:0====code: " + data.code);
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0200_init");
expect(data.bundleName).assertEqual("publish_event0200_bundleName");
}else {
num2 = 0;
expect(data.event).assertEqual("publish_event0201");
console.info("===============>subscriberCallBack0200_1=====num2:1====code: " + data.code);
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0201_init");
expect(data.bundleName).assertEqual("publish_event0201_bundleName");
commonEventSubscriber0200_1.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0200_1:num:1:finishCommonEventCallBack");
})
}
}
async function subscriberCallBack0200_2(err, data) {
console.info("===============>subscriberCallBack0200_2========event: " + data.event);
console.info("===============>subscriberCallBack0200_2========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0200_2=========code=: " + data.code);
console.info("===============>subscriberCallBack0200_2=========data: " + data.data);
expect(data.event).assertEqual("publish_event0201");
console.info("===============>subscriberCallBack0200_2=========code: " + data.code);
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0201_init");
expect(data.bundleName).assertEqual("publish_event0201_bundleName");
commonEventSubscriber0200_2.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0200_2:finishCommonEventCallBack");
})
}
async function subscriberCallBack0300_1(err, data) {
console.info("===============>subscriberCallBack0300_1========event: " + data.event);
console.info("===============>subscriberCallBack0300_1========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0300_1=========code: " + data.code);
console.info("===============>subscriberCallBack0300_1=========dat: " + data.data);
console.info("===============>subscriberCallBack0300_1=========order: " + order);
expect(data.event).assertEqual("publish_event0301");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0301_init");
expect(data.bundleName).assertEqual("publish_event0301_bundleName");
expect(order).assertEqual(1);
if (order == true) {
order = false;
}
commonEventSubscriber0300_1.isOrderedCommonEvent().then(function(data) {
console.info("========>subscriberCallBack0300_1 publish_event0301 isOrderedCommonEvent promise " + data);
expect(data).assertEqual(1);
})
commonEventSubscriber0300_1.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0300_1 publish_event0301 finishCommonEventCallBack");
})
}
async function subscriberCallBack0300_2(err, data) {
console.info("===============>subscriberCallBack0300_2========event: " + data.event);
console.info("===============>subscriberCallBack0300_2========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0300_2=========code: " + data.code);
console.info("===============>subscriberCallBack0300_2=========data: " + data.data);
console.info("===============>subscriberCallBack0300_2=========order: " + order);
expect(data.event).assertEqual("publish_event0301");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0301_init");
expect(data.bundleName).assertEqual("publish_event0301_bundleName");
if (order == false) {
order = true;
}
commonEventSubscriber0300_2.isOrderedCommonEvent().then(function(data) {
console.info("===============>subscriberCallBack0300_2 isOrderedCommonEvent promise " + data);
expect(data).assertEqual(1);
})
commonEventSubscriber0300_2.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0300_2 publish_event0301 finishCommonEventCallBack");
})
}
async function subscriberCallBack0400_1(err, data) {
console.info("===============>SubscriberPromise0400_1========event: " + data.event);
console.info("===============>SubscriberPromise0400_1========bundleName: " + data.bundleName);
console.info("===============>SubscriberPromise0400_1=========code: " + data.code);
console.info("===============>SubscriberPromise0400_1=========data: " + data.data);
expect(data.event).assertEqual("publish_event0400");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0400_init");
expect(data.bundleName).assertEqual("publish_event0400_bundleName");
commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) {
console.info("====>SubscriberPromise0400_1======>getAbortCommonEventPromise0400_1:1 abort2: " + data);
});
commonEventSubscriber0400_1.abortCommonEvent().then(() => {
console.info("===============>SubscriberPromise0400_1=========>AbortCommonEventPromise0400_1");
});
commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) {
console.info("===>SubscriberPromise0400_1===========>getAbortCommonEventPromise0400_1:2 abort2: " + data);
});
commonEventSubscriber0400_1.finishCommonEvent().then(()=> {
console.info("===============>SubscriberPromise0400_1==========>finishCommonEventPromise0400_1");
});
}
async function subscriberCallBack0400_2(err, data) {
console.info("===============>SubscriberPromise0400_2========event: " + data.event);
expect().assertFail();
}
async function subscriberCallBack0500_1(err, data) {
console.info("===============>SubscriberPromise0500_1========event: " + data.event);
console.info("===============>SubscriberPromise0500_1========bundleName: " + data.bundleName);
console.info("===============>SubscriberPromise0500_1=========code: " + data.code);
console.info("===============>SubscriberPromise0500_1=========data: " + data.data);
expect(data.event).assertEqual("publish_event0500");
expect(data.code).assertEqual(10);
expect(data.data).assertEqual("publish_event0500_init");
expect(data.bundleName).assertEqual("publish_event0500_bundleName");
commonEventSubscriber0500_1.finishCommonEvent().then(() => {
console.info("===============>SubscriberPromise0500_1==========>finishCommonEventPromise0500_1");
});
}
/*
* @tc.number : ActsSubscriberTestOrder_0100
* @tc.name : verify subscribe and publish : Check subscribe same event and publish common ordered event
......@@ -267,6 +64,68 @@ describe('ActsSubscriberTestOrder', function () {
isSticky: false,
}
async function subscriberCallBack0100(err, data) {
console.info("===============>subscriberCallBack0100========event: " + data.event);
console.info("===============>subscriberCallBack0100========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0100=========code: " + data.code);
console.info("===============>subscriberCallBack0100=========data: " + data.data);
expect(data.event).assertEqual("publish_event0100");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event1001_init");
expect(data.bundleName).assertEqual("publish_event0100_bundleName");
commonEventSubscriber0100.setCode(2).then(()=>{
console.info("===============>subscriberCallBack0100 setCodeCallBack promise");
})
commonEventSubscriber0100.setData("publish_event1001_change").then(()=>{
console.info("===============>subscriberCallBack0100 setDataCallBack promise");
})
commonEventSubscriber0100.setCodeAndData(2, "publish_event1001_change").then(()=>{
console.info("===============>subscriberCallBack0100 setCodeAndDataCallback promise");
})
commonEventSubscriber0100.getAbortCommonEvent().then(function(data) {
console.info("===============>subscriberCallBack0100 getAbortCommonEventCallback1 promise abort: " + data);
})
commonEventSubscriber0100.clearAbortCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0100 clearAbortCommonEventCallback promise");
})
commonEventSubscriber0100.getAbortCommonEvent().then(function(data) {
console.info("===============>subscriberCallBack0100 getAbortCommonEventCallback2 promise abort: " + data);
})
commonEventSubscriber0100.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0100 finishCommonEvent promise");
})
}
async function subscriberCallBack0101(err, data) {
console.info("===============>subscriberCallBack0101========code: " + err.code);
console.info("===============>subscriberCallBack0101========event: " + data.event);
console.info("===============>subscriberCallBack0101========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0101=========code: " + data.code);
console.info("===============>subscriberCallBack0101=========data: " + data.data);
expect(data.event).assertEqual("publish_event0100");
console.info("===============>subscriberCallBack0101=========1 code "+ data.code);
expect(data.code).assertEqual(2);
commonEventSubscriber0101.getCode().then(function(data) {
console.info("===============>subscriberCallBack0101 getCodeCallBack promise code: "+ data);
})
expect(data.data).assertEqual("publish_event1001_change");
commonEventSubscriber0100.getData().then(function(data) {
console.info("===============>subscriberCallBack0100 getDataCallBack promise data: "+ data);
})
expect(data.bundleName).assertEqual("publish_event0100_bundleName");
commonEventSubscriber0101.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0101 finishCommonEvent promise");
})
done();
}
Subscriber.createSubscriber(
commonEventSubscribeInfo_1
).then(function (data) {
......@@ -289,8 +148,9 @@ describe('ActsSubscriberTestOrder', function () {
Subscriber.publish("publish_event0100", commonEventPublishData, publishCallback);
});
})
sleep(5);
done();
setTimeout(function (){
console.debug("===================ActsSubscriberTestOrder_0100 end==================");
}, 200000);
})
/*
......@@ -329,6 +189,49 @@ describe('ActsSubscriberTestOrder', function () {
isSticky: false,
}
async function subscriberCallBack0200_1(err, data) {
console.info("===============>subscriberCallBack0200_1========event: " + data.event);
console.info("===============>subscriberCallBack0200_1========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0200_1=========code: " + data.code);
console.info("===============>subscriberCallBack0200_1=========data: " + data.data);
console.info("===============>subscriberCallBack0200_1=========num2: " + num2);
if (num2 == 0) {
num2++;
expect(data.event).assertEqual("publish_event0200");
console.info("===============>subscriberCallBack0200_1=====num2:0====code: " + data.code);
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0200_init");
expect(data.bundleName).assertEqual("publish_event0200_bundleName");
}else {
num2 = 0;
expect(data.event).assertEqual("publish_event0201");
console.info("===============>subscriberCallBack0200_1=====num2:1====code: " + data.code);
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0201_init");
expect(data.bundleName).assertEqual("publish_event0201_bundleName");
commonEventSubscriber0200_1.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0200_1:num:1:finishCommonEventCallBack");
})
}
}
async function subscriberCallBack0200_2(err, data) {
console.info("===============>subscriberCallBack0200_2========event: " + data.event);
console.info("===============>subscriberCallBack0200_2========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0200_2=========code=: " + data.code);
console.info("===============>subscriberCallBack0200_2=========data: " + data.data);
expect(data.event).assertEqual("publish_event0201");
console.info("===============>subscriberCallBack0200_2=========code: " + data.code);
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0201_init");
expect(data.bundleName).assertEqual("publish_event0201_bundleName");
commonEventSubscriber0200_2.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0200_2:finishCommonEventCallBack");
})
done();
}
Subscriber.createSubscriber(
commonEventSubscribeInfo_1,
).then(function (data) {
......@@ -354,8 +257,9 @@ describe('ActsSubscriberTestOrder', function () {
});
})
sleep(5);
done();
setTimeout(function (){
console.debug("===================ActsSubscriberTestOrder_0200 end==================");
}, 200000);
})
/*
......@@ -385,6 +289,58 @@ describe('ActsSubscriberTestOrder', function () {
isSticky: false,
}
async function subscriberCallBack0300_1(err, data) {
console.info("===============>subscriberCallBack0300_1========event: " + data.event);
console.info("===============>subscriberCallBack0300_1========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0300_1=========code: " + data.code);
console.info("===============>subscriberCallBack0300_1=========dat: " + data.data);
console.info("===============>subscriberCallBack0300_1=========order: " + order);
expect(data.event).assertEqual("publish_event0301");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0301_init");
expect(data.bundleName).assertEqual("publish_event0301_bundleName");
expect(order).assertEqual(1);
if (order == true) {
order = false;
}
commonEventSubscriber0300_1.isOrderedCommonEvent().then(function(data) {
console.info("========>subscriberCallBack0300_1 publish_event0301 isOrderedCommonEvent promise " + data);
expect(data).assertEqual(1);
})
commonEventSubscriber0300_1.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0300_1 publish_event0301 finishCommonEventCallBack");
})
done();
}
async function subscriberCallBack0300_2(err, data) {
console.info("===============>subscriberCallBack0300_2========event: " + data.event);
console.info("===============>subscriberCallBack0300_2========bundleName: " + data.bundleName);
console.info("===============>subscriberCallBack0300_2=========code: " + data.code);
console.info("===============>subscriberCallBack0300_2=========data: " + data.data);
console.info("===============>subscriberCallBack0300_2=========order: " + order);
expect(data.event).assertEqual("publish_event0301");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0301_init");
expect(data.bundleName).assertEqual("publish_event0301_bundleName");
if (order == false) {
order = true;
}
commonEventSubscriber0300_2.isOrderedCommonEvent().then(function(data) {
console.info("===============>subscriberCallBack0300_2 isOrderedCommonEvent promise " + data);
expect(data).assertEqual(1);
})
commonEventSubscriber0300_2.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0300_2 publish_event0301 finishCommonEventCallBack");
})
}
Subscriber.createSubscriber(
commonEventSubscribeInfo_1,
).then(function (data) {
......@@ -411,8 +367,9 @@ describe('ActsSubscriberTestOrder', function () {
});
})
sleep(5);
done();
setTimeout(function (){
console.debug("===================ActsSubscriberTestOrder_0300 end==================");
}, 200000);
})
/*
......@@ -442,6 +399,35 @@ describe('ActsSubscriberTestOrder', function () {
isSticky: false,
}
async function subscriberCallBack0400_1(err, data) {
console.info("===============>SubscriberPromise0400_1========event: " + data.event);
console.info("===============>SubscriberPromise0400_1========bundleName: " + data.bundleName);
console.info("===============>SubscriberPromise0400_1=========code: " + data.code);
console.info("===============>SubscriberPromise0400_1=========data: " + data.data);
expect(data.event).assertEqual("publish_event0400");
expect(data.code).assertEqual(1);
expect(data.data).assertEqual("publish_event0400_init");
expect(data.bundleName).assertEqual("publish_event0400_bundleName");
commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) {
console.info("====>SubscriberPromise0400_1======>getAbortCommonEventPromise0400_1:1 abort2: " + data);
});
commonEventSubscriber0400_1.abortCommonEvent().then(() => {
console.info("===============>SubscriberPromise0400_1=========>AbortCommonEventPromise0400_1");
});
commonEventSubscriber0400_1.getAbortCommonEvent().then(function(data) {
console.info("===>SubscriberPromise0400_1===========>getAbortCommonEventPromise0400_1:2 abort2: " + data);
});
commonEventSubscriber0400_1.finishCommonEvent().then(()=> {
console.info("===============>SubscriberPromise0400_1==========>finishCommonEventPromise0400_1");
});
done();
}
async function subscriberCallBack0400_2(err, data) {
console.info("===============>SubscriberPromise0400_2========event: " + data.event);
expect().assertFail();
}
Subscriber.createSubscriber(
commonEventSubscribeInfo_1
).then(function (data) {
......@@ -467,8 +453,9 @@ describe('ActsSubscriberTestOrder', function () {
})
})
sleep(5);
done();
setTimeout(function (){
console.debug("===================ActsSubscriberTestOrder_0400 end==================");
}, 200000);
})
/*
......@@ -498,6 +485,20 @@ describe('ActsSubscriberTestOrder', function () {
isSticky: false,
}
async function subscriberCallBack0500_1(err, data) {
console.info("===============>SubscriberPromise0500_1========event: " + data.event);
console.info("===============>SubscriberPromise0500_1========bundleName: " + data.bundleName);
console.info("===============>SubscriberPromise0500_1=========code: " + data.code);
console.info("===============>SubscriberPromise0500_1=========data: " + data.data);
expect(data.event).assertEqual("publish_event0500");
expect(data.code).assertEqual(10);
expect(data.data).assertEqual("publish_event0500_init");
expect(data.bundleName).assertEqual("publish_event0500_bundleName");
commonEventSubscriber0500_1.finishCommonEvent().then(() => {
console.info("===============>SubscriberPromise0500_1==========>finishCommonEventPromise0500_1");
});
}
async function subscriberCallBack0500_2(err, data) {
console.info("===============>SubscriberPromise0500_2========event: " + data.event);
console.info("===============>SubscriberPromise0500_2========bundleName: " + data.bundleName);
......@@ -536,7 +537,7 @@ describe('ActsSubscriberTestOrder', function () {
})
setTimeout(function (){
console.debug("===================ActsSubscriberTestUnorder_1000 end==================");
}, 30000);
console.debug("===================ActsSubscriberTestOrder_0500 end==================");
}, 200000);
})
})
......@@ -31,7 +31,6 @@ describe('ActsSubscriberTestUnorder', async function (done) {
var commonEventSubscriber010_2;
var commonEventSubscriber011;
var commonEventSubscriber012;
// var commonEventSubscriber013;
function publishCallback(err) {
console.info("==========================>publishCallback");
......@@ -56,7 +55,6 @@ describe('ActsSubscriberTestUnorder', async function (done) {
*/
it('ActsSubscriberTestUnorder_0100', 0, async function (done) {
console.info("===============ActsSubscriberTestUnorder_0100=============================>");
function subscriberCallBack001(err, data) {
console.info("==========================>subscriberCallBack001");
expect(data.event).assertEqual("publish_event0100");
......@@ -78,7 +76,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data){
console.info("===============ActsSubscriberTestUnorder_0100=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber001, subscriberCallBack001);
Subscriber.publish("publish_event0100", publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0100 publish start============");
Subscriber.publish("publish_event0100", publishCallback);
}, 1000);
});
})
......@@ -117,7 +118,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data){
console.info("===============ActsSubscriberTestUnorder_0200=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber002, subscriberCallBack002);
Subscriber.publish("@#¥#3243adsafdf_", publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0200 publish start============");
Subscriber.publish("@#¥#3243adsafdf_", publishCallback);
}, 1000);
});
})
......@@ -170,7 +174,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0300=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber003, subscriberCallBack003);
Subscriber.publish("publish_event0300", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0300 publish start============");
Subscriber.publish("publish_event0300", commonEventPublishData, publishCallback);
}, 1000);
});
})
setTimeout(function (){
......@@ -217,7 +224,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data){
console.info("===============ActsSubscriberTestUnorder_0400=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber004, subscriberCallBack004);
Subscriber.publish("publish_event0400", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0400 publish start============");
Subscriber.publish("publish_event0400", commonEventPublishData, publishCallback);
}, 1000);
});
})
......@@ -272,7 +282,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
console.info("===============ActsSubscriberTestUnorder_0500_2=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber005_2, subscriberCallBack005);
Subscriber.unsubscribe(commonEventSubscriber005_1, unsubscriberCallBack);
Subscriber.publish("publish_event0500", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0500 publish start============");
Subscriber.publish("publish_event0500", commonEventPublishData, publishCallback);
}, 1000);
});
})
......@@ -322,8 +335,11 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0700=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber006, subscriberCallBack006);
Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback);
Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0600 publish start============");
Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback);
Subscriber.publish("publish_event0600", commonEventPublishData, publishCallback);
}, 1000);
});
})
......@@ -367,7 +383,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0700=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber007, subscriberCallBack007);
Subscriber.publish("publish_event0700", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0700 publish start============");
Subscriber.publish("publish_event0700", commonEventPublishData, publishCallback);
}, 1000);
});
});
......@@ -427,7 +446,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0800=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber008, subscriberCallBack008);
Subscriber.publish("publish_event0800", commonEventPublishData, publishCallback);
setTimeout(function (){
console.debug("==========ActsSubscriberTestUnorder_0800 publish start============");
Subscriber.publish("publish_event0800", commonEventPublishData, publishCallback);
}, 1000);
});
});
sleep(5);
......@@ -474,7 +496,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0900=========getSubscribeInfo promise=");
Subscriber.subscribe(commonEventSubscriber009, subscriberCallBack009);
Subscriber.publish("publish_event0900", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0900 publish start============");
Subscriber.publish("publish_event0900", commonEventPublishData, publishCallback);
}, 1000);
});
});
......@@ -569,8 +594,11 @@ describe('ActsSubscriberTestUnorder', async function (done) {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_1000=========getSubscribeInfo promise1000_2");
Subscriber.subscribe(commonEventSubscriber010_2, subscriberCallBack010_2);
Subscriber.publish("publish_event1000_1", commonEventPublishData_1, publishCallback1000_1);
Subscriber.publish("publish_event1000_2", commonEventPublishData_2, publishCallback1000_2);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_1000 publish start============");
Subscriber.publish("publish_event1000_1", commonEventPublishData_1, publishCallback1000_1);
Subscriber.publish("publish_event1000_2", commonEventPublishData_2, publishCallback1000_2);
}, 1000);
});
});
......@@ -603,7 +631,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
console.info("==========================>getSubscribeInfo1100CallBack=======================>");
expect(data.events[0]).assertEqual("publish_event1100");
Subscriber.subscribe(commonEventSubscriber011, subscriberCallBack011);
Subscriber.publish("publish_event1100", publishCallback);
setTimeout(function (){
console.debug("==========ActsSubscriberTestUnorder_1100 publish start============");
Subscriber.publish("publish_event1100", publishCallback);
}, 1000);
}
function createSubscriber1100CallBack(err, data) {
......@@ -658,7 +689,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
console.info("==========================>getSubscribeInfo1200CallBack=======================>");
expect(data.events[0]).assertEqual("publish_event1200");
Subscriber.subscribe(commonEventSubscriber012, subscriberCallBack012);
Subscriber.publish("publish_event1200", commonEventPublishData, publishCallback);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_1200 publish start============");
Subscriber.publish("publish_event1200", commonEventPublishData, publishCallback);
}, 1000);
}
function createSubscriber1200CallBack(err, data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册