提交 d4ba8ea5 编写于 作者: O openharmony_ci 提交者: Gitee

!1264 Modify xts case bug

Merge pull request !1264 from blackleon/master_1202_xtsces
......@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe('ActsSubscriberTestOrder', function () {
console.info("===========ActsSubscriberTestOrder start====================>");
var num = 0, num2 = 0;
var num2 = 0;
var order = false;
var commonEventSubscriber0100;
var commonEventSubscriber0101;
......@@ -146,7 +146,10 @@ describe('ActsSubscriberTestOrder', function () {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestOrder_0100=========getSubscribeInfo promise2");
Subscriber.subscribe(commonEventSubscriber0101, subscriberCallBack0101);
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0100 delay 100ms==================");
Subscriber.publish("publish_event0100", commonEventPublishData, publishCallback);
}, 100);
});
})
})
......@@ -206,7 +209,7 @@ describe('ActsSubscriberTestOrder', function () {
expect(data.data).assertEqual("publish_event0201_init");
expect(data.bundleName).assertEqual("publish_event0201_bundleName");
commonEventSubscriber0200.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0200:num:1:finishCommonEvent promise");
console.info("===============>subscriberCallBack0200:num2:1:finishCommonEvent promise");
})
}
}
......@@ -247,10 +250,18 @@ describe('ActsSubscriberTestOrder', function () {
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestOrder_0200=========getSubscribeInfo promise2");
Subscriber.subscribe(commonEventSubscriber0201, subscriberCallBack0201);
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0200 delay 100ms==================");
Subscriber.unsubscribe(commonEventSubscriber0200, unsubscribeCallback);
}, 100);
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0200 delay 100ms==================");
Subscriber.publish("publish_event0200", commonEventPublishData1, publishCallback);
}, 100);
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0200 delay 100ms==================");
Subscriber.publish("publish_event0201", commonEventPublishData2, publishCallback);
}, 100);
});
})
})
......@@ -281,6 +292,7 @@ describe('ActsSubscriberTestOrder', function () {
isOrdered: true,
}
var callBackNum = 0;
async function subscriberCallBack0300(err, data) {
console.info("===============>subscriberCallBack0300========event: " + data.event);
console.info("===============>subscriberCallBack0300========bundleName: " + data.bundleName);
......@@ -305,8 +317,12 @@ describe('ActsSubscriberTestOrder', function () {
commonEventSubscriber0300.finishCommonEvent().then(()=>{
console.info("===============>subscriberCallBack0300 finishCommonEvent promise");
})
callBackNum++;
if (callBackNum == 3) {
done();
}
}
async function subscriberCallBack0301(err, data) {
console.info("===============>subscriberCallBack0301========event: " + data.event);
......@@ -354,7 +370,10 @@ describe('ActsSubscriberTestOrder', function () {
Subscriber.subscribe(commonEventSubscriber0301, subscriberCallBack0301);
var numindex = 0;
for (; numindex < 3; ++numindex) {
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0300 delay 100ms==================");
Subscriber.publish("publish_event0301", commonEventPublishData2, publishCallback);
}, 100);
}
});
})
......@@ -437,7 +456,10 @@ describe('ActsSubscriberTestOrder', function () {
console.info("===============ActsSubscriberTestOrder_0400=========getSubscribeInfo promise2");
expect(data.events[0]).assertEqual("publish_event0400");
Subscriber.subscribe(commonEventSubscriber0401, subscriberCallBack0401);
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0400 delay 100mss==================");
Subscriber.publish("publish_event0400", commonEventPublishData, publishCallback);
}, 100);
})
})
})
......@@ -518,7 +540,10 @@ describe('ActsSubscriberTestOrder', function () {
console.info("===============ActsSubscriberTestOrder_0500==========getSubscribeInfo promise2");
expect(data.events[0]).assertEqual("publish_event0500");
Subscriber.subscribe(commonEventSubscriber0501, subscriberCallBack0501);
setTimeout(function () {
console.debug("===================ActsSubscriberTestOrder_0500 delay 100ms==================");
Subscriber.publish("publish_event0500", commonEventPublishData, publishCallback);
}, 100);
})
})
})
......
......@@ -34,6 +34,7 @@ export default {
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 100000;
configService.setConfig(this)
require('../../../test/List.test')
......
......@@ -217,9 +217,6 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) {
Subscriber.publish(commonEventSubscribeInfo.events[i], publishCallback);
}
})
setTimeout(function (){
console.debug("===================>ActsSubscriberTestUnorderSystem_0100 end==================");
}, 30000);
})
/*
......@@ -295,9 +292,6 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) {
Subscriber.publish(commonEventSubscribeInfo.events[i], publishCallback);
}
})
setTimeout(function (){
console.debug("===================>ActsSubscriberTestUnorderSystem_0200 end==================");
}, 30000);
})
})
......@@ -21,14 +21,14 @@ describe('ActsSubscriberTestUnorder', async function (done) {
var commonEventSubscriber002;
var commonEventSubscriber003;
var commonEventSubscriber004;
var commonEventSubscriber005_1;
var commonEventSubscriber005_2;
var commonEventSubscriber0051;
var commonEventSubscriber0052;
var commonEventSubscriber006;
var commonEventSubscriber007;
var commonEventSubscriber008;
var commonEventSubscriber009;
var commonEventSubscriber010_1;
var commonEventSubscriber010_2;
var commonEventSubscriber0101;
var commonEventSubscriber0102;
var commonEventSubscriber011;
var commonEventSubscriber012;
......@@ -36,11 +36,11 @@ describe('ActsSubscriberTestUnorder', async function (done) {
console.info("==========================>publishCallback");
}
function publishCallback1000_1(err) {
function publishCallback10001(err) {
console.info("==========================>publishCallback");
}
function publishCallback1000_2(err) {
function publishCallback10002(err) {
console.info("==========================>publishCallback");
}
......@@ -251,10 +251,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
commonEventSubscribeInfo
).then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0500_1=========createSubscriber promise");
commonEventSubscriber005_1 = data;
commonEventSubscriber0051 = data;
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0500_1=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber005_1, subscriberCallBack005);
Subscriber.subscribe(commonEventSubscriber0051, subscriberCallBack005);
});
})
......@@ -262,11 +262,11 @@ describe('ActsSubscriberTestUnorder', async function (done) {
commonEventSubscribeInfo
).then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0500_2=========createSubscriber promise");
commonEventSubscriber005_2 = data;
commonEventSubscriber0052 = data;
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_0500_2=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber005_2, subscriberCallBack005);
Subscriber.unsubscribe(commonEventSubscriber005_1, unsubscriberCallBack);
Subscriber.subscribe(commonEventSubscriber0052, subscriberCallBack005);
Subscriber.unsubscribe(commonEventSubscriber0051, unsubscriberCallBack);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0500 publish start============");
Subscriber.publish("publish_event0500", commonEventPublishData, publishCallback);
......@@ -425,7 +425,8 @@ describe('ActsSubscriberTestUnorder', async function (done) {
}, 1000);
});
});
sleep(5);
sleep(1000);
})
/*
......@@ -487,17 +488,17 @@ describe('ActsSubscriberTestUnorder', async function (done) {
var num = 0;
var commonEventSubscribeInfo_1 = {
var commonEventSubscribeInfo1 = {
events: ["publish_event1000_1"],
priority: 5
};
var commonEventSubscribeInfo_2 = {
var commonEventSubscribeInfo2 = {
events: ["publish_event1000_2"],
priority: 10
};
var commonEventPublishData_1 = {
var commonEventPublishData1 = {
bundleName: "publish_event1000_bundleName1",
code: 3,
data: "publish_event1000_data",
......@@ -505,7 +506,7 @@ describe('ActsSubscriberTestUnorder', async function (done) {
isSticky: false,
}
var commonEventPublishData_2 = {
var commonEventPublishData2 = {
bundleName: "publish_event1000_bundleName2",
code: 5,
data: "publish_event1000_data",
......@@ -513,10 +514,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
isSticky: false,
}
async function subscriberCallBack010_1(err, data) {
console.info("==========================>subscriberCallBack010_1");
console.info("==========================>subscriberCallBack010_1 event:"+data.event);
console.info("==========================>subscriberCallBack010_1 bundleName:"+data.bundleName);
async function subscriberCallBack0101(err, data) {
console.info("==========================>subscriberCallBack0101");
console.info("==========================>subscriberCallBack0101 event:"+data.event);
console.info("==========================>subscriberCallBack0101 bundleName:"+data.bundleName);
expect(data.event).assertEqual("publish_event1000_1");
expect(data.bundleName).assertEqual("publish_event1000_bundleName1");
expect(data.code).assertEqual(3);
......@@ -528,10 +529,10 @@ describe('ActsSubscriberTestUnorder', async function (done) {
}
}
function subscriberCallBack010_2(err, data) {
console.info("==========================>subscriberCallBack010_2");
console.info("==========================>subscriberCallBack010_2 event:"+data.event);
console.info("==========================>subscriberCallBack010_2 bundleName:"+data.bundleName);
function subscriberCallBack0102(err, data) {
console.info("==========================>subscriberCallBack0102");
console.info("==========================>subscriberCallBack0102 event:"+data.event);
console.info("==========================>subscriberCallBack0102 bundleName:"+data.bundleName);
expect(data.event).assertEqual("publish_event1000_2");
expect(data.bundleName).assertEqual("publish_event1000_bundleName2");
expect(data.code).assertEqual(5);
......@@ -544,28 +545,28 @@ describe('ActsSubscriberTestUnorder', async function (done) {
}
Subscriber.createSubscriber(
commonEventSubscribeInfo_1
commonEventSubscribeInfo1
).then(function (data) {
console.info("=================ActsSubscriberTestUnorder_1000=========>createSubscriber Promise1000_1");
commonEventSubscriber010_1 = data;
commonEventSubscriber0101 = data;
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_1000=========getSubscribeInfo promise1000_1");
Subscriber.subscribe(commonEventSubscriber010_1, subscriberCallBack010_1);
Subscriber.subscribe(commonEventSubscriber0101, subscriberCallBack0101);
});
});
Subscriber.createSubscriber(
commonEventSubscribeInfo_2
commonEventSubscribeInfo2
).then(function (data) {
console.info("=================ActsSubscriberTestUnorder_1000=========>createSubscriber Promise1000_2");
commonEventSubscriber010_2 = data;
commonEventSubscriber0102 = data;
data.getSubscribeInfo().then(function (data) {
console.info("===============ActsSubscriberTestUnorder_1000=========getSubscribeInfo promise1000_2");
Subscriber.subscribe(commonEventSubscriber010_2, subscriberCallBack010_2);
Subscriber.subscribe(commonEventSubscriber0102, subscriberCallBack0102);
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);
Subscriber.publish("publish_event1000_1", commonEventPublishData1, publishCallback10001);
Subscriber.publish("publish_event1000_2", commonEventPublishData2, publishCallback10002);
}, 1000);
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册