Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7d8fa485
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看板
提交
7d8fa485
编写于
11月 27, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify ces js test case
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
72172efa
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
254 addition
and
37 deletion
+254
-37
notification/ces_standard/subscribeandpublish/BUILD.gn
notification/ces_standard/subscribeandpublish/BUILD.gn
+2
-2
notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js
...est/entry/src/main/js/test/ActsSubscriber_test_unorder.js
+252
-35
未找到文件。
notification/ces_standard/subscribeandpublish/BUILD.gn
浏览文件 @
7d8fa485
...
...
@@ -17,9 +17,9 @@ group("SubscribeAndPublish") {
testonly = true
if (is_standard_system) {
deps = [
"actssubscriberunordertest:ActsSubscriberUnorderTest",
#"actssubscriberorderedtest:ActsSubscriberOrderTest",
#"actssubscriberunordersystemtest:ActsSubscriberTestUnorderSystem"
"actssubscriberunordersystemtest:ActsSubscriberTestUnorderSystem",
"actssubscriberunordertest:ActsSubscriberUnorderTest",
]
}
}
notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js
浏览文件 @
7d8fa485
...
...
@@ -17,7 +17,96 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
ActsSubscriberTestUnorderSystem
'
,
async
function
(
done
)
{
console
.
info
(
"
===========ActsSubscriberTestUnorderSystem start====================>
"
);
var
commonEventSubscriber
;
var
commonEventSubscriber1
;
var
commonEventSubscriber2
;
var
array
=
[
Subscriber
.
Support
.
COMMON_EVENT_SHUTDOWN
,
Subscriber
.
Support
.
COMMON_EVENT_BATTERY_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_BATTERY_LOW
,
Subscriber
.
Support
.
COMMON_EVENT_BATTERY_OKAY
,
Subscriber
.
Support
.
COMMON_EVENT_POWER_CONNECTED
,
Subscriber
.
Support
.
COMMON_EVENT_POWER_DISCONNECTED
,
Subscriber
.
Support
.
COMMON_EVENT_SCREEN_OFF
,
Subscriber
.
Support
.
COMMON_EVENT_SCREEN_ON
,
Subscriber
.
Support
.
COMMON_EVENT_USER_PRESENT
,
Subscriber
.
Support
.
COMMON_EVENT_TIME_TICK
,
Subscriber
.
Support
.
COMMON_EVENT_TIME_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_DATE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_TIMEZONE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_CLOSE_SYSTEM_DIALOGS
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_ADDED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_REPLACED
,
Subscriber
.
Support
.
COMMON_EVENT_MY_PACKAGE_REPLACED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_BUNDLE_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_FULLY_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_RESTARTED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_DATA_CLEARED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGES_SUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGES_UNSUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_MY_PACKAGE_SUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_MY_PACKAGE_UNSUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_UID_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_FIRST_LAUNCH
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_VERIFIED
,
Subscriber
.
Support
.
COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE
,
Subscriber
.
Support
.
COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE
,
Subscriber
.
Support
.
COMMON_EVENT_CONFIGURATION_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_LOCALE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_MANAGE_PACKAGE_STORAGE
,
Subscriber
.
Support
.
COMMON_EVENT_DRIVE_MODE
,
Subscriber
.
Support
.
COMMON_EVENT_HOME_MODE
,
Subscriber
.
Support
.
COMMON_EVENT_OFFICE_MODE
,
Subscriber
.
Support
.
COMMON_EVENT_USER_STARTED
,
Subscriber
.
Support
.
COMMON_EVENT_USER_BACKGROUND
,
Subscriber
.
Support
.
COMMON_EVENT_USER_FOREGROUND
,
Subscriber
.
Support
.
COMMON_EVENT_USER_UNLOCKED
,
Subscriber
.
Support
.
COMMON_EVENT_USER_STOPPED
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_LOGIN
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_LOGOUT
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_TOKEN_INVALID
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_LOGOFF
,
Subscriber
.
Support
.
COMMON_EVENT_WIFI_POWER_STATE
,
Subscriber
.
Support
.
COMMON_EVENT_WIFI_CONN_STATE
,
Subscriber
.
Support
.
COMMON_EVENT_WIFI_HOTSPOT_STATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE
,
Subscriber
.
Support
.
COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_DISCHARGING
,
Subscriber
.
Support
.
COMMON_EVENT_CHARGING
,
Subscriber
.
Support
.
COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_POWER_SAVE_MODE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_LOCATION_MODE_STATE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_SLEEP
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_PAUSE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_STANDBY
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_LASTMODE_SAVE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_VOLTAGE_ABNORMAL
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_HIGH_TEMPERATURE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_EXTREME_TEMPERATURE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_VOLTAGE_RECOVERY
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_TEMPERATURE_RECOVERY
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_ACTIVE
,
Subscriber
.
Support
.
COMMON_EVENT_USB_DEVICE_ATTACHED
,
Subscriber
.
Support
.
COMMON_EVENT_USB_DEVICE_DETACHED
,
Subscriber
.
Support
.
COMMON_EVENT_USB_ACCESSORY_ATTACHED
,
Subscriber
.
Support
.
COMMON_EVENT_USB_ACCESSORY_DETACHED
,
Subscriber
.
Support
.
COMMON_EVENT_AIRPLANE_MODE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_SMS_RECEIVE_COMPLETED
,
Subscriber
.
Support
.
COMMON_EVENT_SPN_INFO_UPDATED
,
];
function
publishCallback
(
err
)
{
console
.
info
(
"
==========================>publishCallback
"
);
...
...
@@ -28,58 +117,186 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) {
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{}
}
function
findArray
(
str
)
{
var
value
=
false
;
var
index1
=
0
;
var
length
=
array
.
length
;
for
(;
index1
<
length
;
++
index1
)
{
if
(
array
[
index1
]
==
str
)
{
value
=
true
;
break
;
}
}
return
value
;
}
/*
* @tc.number : ActsSubscriberTestUnorderSystem_0100
* @tc.name : verify subscribe and publish : Check subscribe and publish common event data
* with publishInfo data
* @tc.name : verify subscribe and publish : Check subscribe and publish system event data without permission
* @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise)
*/
it
(
'
ActsSubscriberTestUnorderSystem_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorderSystem_0100==========================>
"
);
console
.
info
(
"
===============ActsSubscriberTestUnorderSystem_0100
start
==========================>
"
);
var
commonEventSubscribeInfo
=
{
events
:
[
"
Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED
"
],
publisherDeviceId
:
"
PublishDeviceId0100
"
,
priority
:
10
,
events
:
[
Subscriber
.
Support
.
COMMON_EVENT_SHUTDOWN
,
Subscriber
.
Support
.
COMMON_EVENT_BATTERY_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_BATTERY_LOW
,
Subscriber
.
Support
.
COMMON_EVENT_BATTERY_OKAY
,
Subscriber
.
Support
.
COMMON_EVENT_POWER_CONNECTED
,
Subscriber
.
Support
.
COMMON_EVENT_POWER_DISCONNECTED
,
Subscriber
.
Support
.
COMMON_EVENT_SCREEN_OFF
,
Subscriber
.
Support
.
COMMON_EVENT_SCREEN_ON
,
Subscriber
.
Support
.
COMMON_EVENT_USER_PRESENT
,
Subscriber
.
Support
.
COMMON_EVENT_TIME_TICK
,
Subscriber
.
Support
.
COMMON_EVENT_TIME_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_DATE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_TIMEZONE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_CLOSE_SYSTEM_DIALOGS
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_ADDED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_REPLACED
,
Subscriber
.
Support
.
COMMON_EVENT_MY_PACKAGE_REPLACED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_BUNDLE_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_FULLY_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_RESTARTED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_DATA_CLEARED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGES_SUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGES_UNSUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_MY_PACKAGE_SUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_MY_PACKAGE_UNSUSPENDED
,
Subscriber
.
Support
.
COMMON_EVENT_UID_REMOVED
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_FIRST_LAUNCH
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION
,
Subscriber
.
Support
.
COMMON_EVENT_PACKAGE_VERIFIED
,
Subscriber
.
Support
.
COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE
,
Subscriber
.
Support
.
COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE
,
Subscriber
.
Support
.
COMMON_EVENT_CONFIGURATION_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_LOCALE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_MANAGE_PACKAGE_STORAGE
,
Subscriber
.
Support
.
COMMON_EVENT_DRIVE_MODE
,
Subscriber
.
Support
.
COMMON_EVENT_HOME_MODE
,
Subscriber
.
Support
.
COMMON_EVENT_OFFICE_MODE
,
Subscriber
.
Support
.
COMMON_EVENT_USER_STARTED
,
Subscriber
.
Support
.
COMMON_EVENT_USER_BACKGROUND
,
Subscriber
.
Support
.
COMMON_EVENT_USER_FOREGROUND
,
Subscriber
.
Support
.
COMMON_EVENT_USER_UNLOCKED
,
Subscriber
.
Support
.
COMMON_EVENT_USER_STOPPED
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_LOGIN
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_LOGOUT
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_TOKEN_INVALID
,
Subscriber
.
Support
.
COMMON_EVENT_HWID_LOGOFF
,
Subscriber
.
Support
.
COMMON_EVENT_WIFI_POWER_STATE
,
Subscriber
.
Support
.
COMMON_EVENT_WIFI_CONN_STATE
,
],
};
var
commonEventPublishData
=
{
isOrdered
:
false
,
bundleName
:
"
PublishBundleName0100
"
,
code
:
55
,
data
:
"
PublishData0100
"
,
}
var
result
=
0
;
function
isOrderedCommonEventCallback001
(
err
,
data
)
{
console
.
info
(
"
==========================>isOrderedCommonEventCallback001
"
);
expect
(
data
).
assertEqual
(
false
);
function
subscriberCallBack001
(
err
,
data
)
{
console
.
info
(
"
==========================>subscriberCallBack001 event =
"
+
data
.
event
);
result
=
findArray
(
data
.
event
);
if
(
result
==
true
)
{
console
.
info
(
"
==========================>subscriberCallBack001 result == true
"
);
if
(
data
.
event
==
Subscriber
.
Support
.
COMMON_EVENT_WIFI_CONN_STATE
)
{
done
();
}
}
console
.
info
(
"
==========================>subscriberCallBack001 end
"
);
}
function
subscriberCallBack001
(
err
,
data
)
{
console
.
info
(
"
==========================>subscriberCallBack001
"
);
expect
(
data
.
event
).
assertEqual
(
"
Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED
"
);
expect
(
data
.
bundleName
).
assertEqual
(
"
PublishBundleName0100
"
);
expect
(
data
.
code
).
assertEqual
(
55
);
expect
(
data
.
data
).
assertEqual
(
"
PublishData0100
"
);
commonEventSubscriber
.
isOrderedCommonEvent
(
isOrderedCommonEventCallback001
);
Subscriber
.
createSubscriber
(
commonEventSubscribeInfo
).
then
(
function
(
data
)
{
console
.
info
(
"
===============>ActsSubscriberTestUnorderSystem_0100=========createSubscriber promise
"
);
commonEventSubscriber1
=
data
;
Subscriber
.
subscribe
(
commonEventSubscriber1
,
subscriberCallBack001
);
for
(
var
i
=
0
;
i
<
50
;
++
i
)
{
sleep
(
1000
);
Subscriber
.
publish
(
commonEventSubscribeInfo
.
events
[
i
],
publishCallback
);
}
})
setTimeout
(
function
(){
console
.
debug
(
"
===================>ActsSubscriberTestUnorderSystem_0100 end==================
"
);
},
30000
);
})
/*
* @tc.number : ActsSubscriberTestUnorderSystem_0200
* @tc.name : verify subscribe and publish : Check subscribe and publish system event data without permission
* @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise)
*/
it
(
'
ActsSubscriberTestUnorderSystem_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorderSystem_0200 start==========================>
"
);
var
commonEventSubscribeInfo
=
{
events
:
[
Subscriber
.
Support
.
COMMON_EVENT_WIFI_HOTSPOT_STATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE
,
Subscriber
.
Support
.
COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE
,
Subscriber
.
Support
.
COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_DISCHARGING
,
Subscriber
.
Support
.
COMMON_EVENT_CHARGING
,
Subscriber
.
Support
.
COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_POWER_SAVE_MODE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_LOCATION_MODE_STATE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_SLEEP
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_PAUSE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_STANDBY
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_LASTMODE_SAVE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_VOLTAGE_ABNORMAL
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_HIGH_TEMPERATURE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_EXTREME_TEMPERATURE
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_VOLTAGE_RECOVERY
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_TEMPERATURE_RECOVERY
,
Subscriber
.
Support
.
COMMON_EVENT_IVI_ACTIVE
,
Subscriber
.
Support
.
COMMON_EVENT_USB_DEVICE_ATTACHED
,
Subscriber
.
Support
.
COMMON_EVENT_USB_DEVICE_DETACHED
,
Subscriber
.
Support
.
COMMON_EVENT_USB_ACCESSORY_ATTACHED
,
Subscriber
.
Support
.
COMMON_EVENT_USB_ACCESSORY_DETACHED
,
Subscriber
.
Support
.
COMMON_EVENT_AIRPLANE_MODE_CHANGED
,
Subscriber
.
Support
.
COMMON_EVENT_SMS_RECEIVE_COMPLETED
,
Subscriber
.
Support
.
COMMON_EVENT_SPN_INFO_UPDATED
,
],
};
var
result
=
0
;
function
subscriberCallBack002
(
err
,
data
)
{
console
.
info
(
"
==========================>subscriberCallBack002 event =
"
+
data
.
event
);
result
=
findArray
(
data
.
event
);
if
(
result
==
true
)
{
console
.
info
(
"
==========================>subscriberCallBack002 result == true
"
);
if
(
data
.
event
==
Subscriber
.
Support
.
COMMON_EVENT_SPN_INFO_UPDATED
)
{
done
();
}
}
console
.
info
(
"
==========================>subscriberCallBack002 end
"
);
}
Subscriber
.
createSubscriber
(
commonEventSubscribeInfo
).
then
(
function
(
data
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorderSystem_0100=========createSubscriber promise
"
);
commonEventSubscriber
=
data
;
data
.
getSubscribeInfo
().
then
(
function
(
data
)
{
console
.
info
(
"
===============ActsSubscriberTestUnorderSystem_0100=========getSubscribeInfo promise
"
);
Subscriber
.
subscribe
(
commonEventSubscriber
,
subscriberCallBack001
);
sleep
(
10
);
Subscriber
.
publish
(
"
Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED
"
,
commonEventPublishData
,
publishCallback
);
});
console
.
info
(
"
===============>ActsSubscriberTestUnorderSystem_0200=========createSubscriber promise
"
);
commonEventSubscriber2
=
data
;
Subscriber
.
subscribe
(
commonEventSubscriber2
,
subscriberCallBack002
);
for
(
var
i
=
0
;
i
<
36
;
++
i
)
{
sleep
(
1000
);
Subscriber
.
publish
(
commonEventSubscribeInfo
.
events
[
i
],
publishCallback
);
}
})
setTimeout
(
function
(){
console
.
debug
(
"
===================
ActsSubscriberTestUnorderSystem_01
00 end==================
"
);
console
.
debug
(
"
===================
>ActsSubscriberTestUnorderSystem_02
00 end==================
"
);
},
30000
);
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录