Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d4ba8ea5
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d4ba8ea5
编写于
12月 02, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1264 Modify xts case bug
Merge pull request !1264 from blackleon/master_1202_xtsces
上级
4136e9e8
9ef4ab80
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
1516 addition
and
1495 deletion
+1516
-1495
notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/test/ActsSubscriber_test_ordered.js
...est/entry/src/main/js/test/ActsSubscriber_test_ordered.js
+550
-525
notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/default/pages/index/index.js
...systemtest/entry/src/main/js/default/pages/index/index.js
+1
-0
notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js
...est/entry/src/main/js/test/ActsSubscriber_test_unorder.js
+297
-303
notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/test/ActsSubscriber_test_unorder.js
...est/entry/src/main/js/test/ActsSubscriber_test_unorder.js
+668
-667
未找到文件。
notification/ces_standard/subscribeandpublish/actssubscriberorderedtest/entry/src/main/js/test/ActsSubscriber_test_ordered.js
浏览文件 @
d4ba8ea5
...
...
@@ -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
num
2
=
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:num
2: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
);
})
})
})
...
...
notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
d4ba8ea5
...
...
@@ -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
'
)
...
...
notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js
浏览文件 @
d4ba8ea5
...
...
@@ -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
);
})
})
notification/ces_standard/subscribeandpublish/actssubscriberunordertest/entry/src/main/js/test/ActsSubscriber_test_unorder.js
浏览文件 @
d4ba8ea5
...
...
@@ -21,14 +21,14 @@ describe('ActsSubscriberTestUnorder', async function (done) {
var
commonEventSubscriber002
;
var
commonEventSubscriber003
;
var
commonEventSubscriber004
;
var
commonEventSubscriber005
_1
;
var
commonEventSubscriber005
_2
;
var
commonEventSubscriber005
1
;
var
commonEventSubscriber005
2
;
var
commonEventSubscriber006
;
var
commonEventSubscriber007
;
var
commonEventSubscriber008
;
var
commonEventSubscriber009
;
var
commonEventSubscriber010
_1
;
var
commonEventSubscriber010
_2
;
var
commonEventSubscriber010
1
;
var
commonEventSubscriber010
2
;
var
commonEventSubscriber011
;
var
commonEventSubscriber012
;
...
...
@@ -36,11 +36,11 @@ describe('ActsSubscriberTestUnorder', async function (done) {
console
.
info
(
"
==========================>publishCallback
"
);
}
function
publishCallback1000
_1
(
err
)
{
function
publishCallback1000
1
(
err
)
{
console
.
info
(
"
==========================>publishCallback
"
);
}
function
publishCallback1000
_2
(
err
)
{
function
publishCallback1000
2
(
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
;
commonEventSubscriber005
1
=
data
;
data
.
getSubscribeInfo
().
then
(
function
(
data
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorder_0500_1=========getSubscribeInfo promise
"
);
Subscriber
.
subscribe
(
commonEventSubscriber005
_1
,
subscriberCallBack005
);
Subscriber
.
subscribe
(
commonEventSubscriber005
1
,
subscriberCallBack005
);
});
})
...
...
@@ -262,11 +262,11 @@ describe('ActsSubscriberTestUnorder', async function (done) {
commonEventSubscribeInfo
).
then
(
function
(
data
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorder_0500_2=========createSubscriber promise
"
);
commonEventSubscriber005
_2
=
data
;
commonEventSubscriber005
2
=
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
(
commonEventSubscriber005
2
,
subscriberCallBack005
);
Subscriber
.
unsubscribe
(
commonEventSubscriber005
1
,
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
commonEventSubscribeInfo
1
=
{
events
:
[
"
publish_event1000_1
"
],
priority
:
5
};
var
commonEventSubscribeInfo
_2
=
{
var
commonEventSubscribeInfo
2
=
{
events
:
[
"
publish_event1000_2
"
],
priority
:
10
};
var
commonEventPublishData
_1
=
{
var
commonEventPublishData
1
=
{
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
commonEventPublishData
2
=
{
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
subscriberCallBack010
1
(
err
,
data
)
{
console
.
info
(
"
==========================>subscriberCallBack010
1
"
);
console
.
info
(
"
==========================>subscriberCallBack010
1 event:
"
+
data
.
event
);
console
.
info
(
"
==========================>subscriberCallBack010
1 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
subscriberCallBack010
2
(
err
,
data
)
{
console
.
info
(
"
==========================>subscriberCallBack010
2
"
);
console
.
info
(
"
==========================>subscriberCallBack010
2 event:
"
+
data
.
event
);
console
.
info
(
"
==========================>subscriberCallBack010
2 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
commonEventSubscribeInfo
1
).
then
(
function
(
data
)
{
console
.
info
(
"
=================ActsSubscriberTestUnorder_1000=========>createSubscriber Promise1000_1
"
);
commonEventSubscriber010
_1
=
data
;
commonEventSubscriber010
1
=
data
;
data
.
getSubscribeInfo
().
then
(
function
(
data
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorder_1000=========getSubscribeInfo promise1000_1
"
);
Subscriber
.
subscribe
(
commonEventSubscriber010
_1
,
subscriberCallBack010_1
);
Subscriber
.
subscribe
(
commonEventSubscriber010
1
,
subscriberCallBack0101
);
});
});
Subscriber
.
createSubscriber
(
commonEventSubscribeInfo
_2
commonEventSubscribeInfo
2
).
then
(
function
(
data
)
{
console
.
info
(
"
=================ActsSubscriberTestUnorder_1000=========>createSubscriber Promise1000_2
"
);
commonEventSubscriber010
_2
=
data
;
commonEventSubscriber010
2
=
data
;
data
.
getSubscribeInfo
().
then
(
function
(
data
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorder_1000=========getSubscribeInfo promise1000_2
"
);
Subscriber
.
subscribe
(
commonEventSubscriber010
_2
,
subscriberCallBack010_2
);
Subscriber
.
subscribe
(
commonEventSubscriber010
2
,
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
"
,
commonEventPublishData
1
,
publishCallback10001
);
Subscriber
.
publish
(
"
publish_event1000_2
"
,
commonEventPublishData
2
,
publishCallback10002
);
},
1000
);
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录