未验证 提交 9dd9adf6 编写于 作者: O openharmony_ci 提交者: Gitee

!2724 【XTS】【事件通知子系统】测试套名称规范修改

Merge pull request !2724 from fujiarui/master
...@@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsAnsGetAllActiveTestXts") { ...@@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsAnsGetAllActiveTestXts") {
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsGetAllActiveTestXts" hap_name = "ActsAnsGetAllActiveTest"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./entry/src/main/js/default"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsAnsGetAllActiveTestXts.hap" "ActsAnsGetAllActiveTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsAnsNotificationPublishXts") { ...@@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsAnsNotificationPublishXts") {
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsNotificationPublishXts" hap_name = "ActsAnsNotificationPublishTest"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./entry/src/main/js/default"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsAnsNotificationPublishXts.hap" "ActsAnsNotificationPublishTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsAnsSubTestXts") { ...@@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsAnsSubTestXts") {
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsSubTestXts" hap_name = "ActsAnsSubTest"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./entry/src/main/js/default"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsAnsSubTestXts.hap" "ActsAnsSubTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
import notify from '@ohos.notification'; import notify from '@ohos.notification';
var timeout = 1000; var timeout = 2000;
describe('ActsAnsSubTestXts', function () { describe('ActsAnsSubTestXts', function () {
console.info("==ActsAnsSubscriberTest start==>"); console.info("==ActsAnsSubscriberTest start==>");
//ActsSubscriber_test_0100 //ActsSubscriber_test_0100
...@@ -31,7 +31,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -31,7 +31,7 @@ describe('ActsAnsSubTestXts', function () {
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbacka(err){ function unSubscribeCallbacka(err){
console.debug("==>unSubscribeCallbacka code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0100 unSubscribeCallbacka code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbacka(){ function disconnectCallbacka(){
...@@ -42,7 +42,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -42,7 +42,7 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackb code==>"); console.debug("==>connectCallbackb code==>");
} }
function subscribeCallbackb(err) { function subscribeCallbackb(err) {
console.debug("==>subscribeCallbackb code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0200 subscribeCallbackb code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function subscribeCallbackc(err) { function subscribeCallbackc(err) {
...@@ -50,7 +50,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -50,7 +50,7 @@ describe('ActsAnsSubTestXts', function () {
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackb(err){ function unSubscribeCallbackb(err){
console.debug("==>unSubscribeCallbackb code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0200 unSubscribeCallbackb code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackb(){ function disconnectCallbackb(){
...@@ -64,19 +64,19 @@ describe('ActsAnsSubTestXts', function () { ...@@ -64,19 +64,19 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackd code==>"); console.debug("==>connectCallbackd code==>");
} }
function subscribeCallbackd(err) { function subscribeCallbackd(err) {
console.debug("==>subscribeCallbackd code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0300 subscribeCallbackd code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function subscribeCallbacke(err) { function subscribeCallbacke(err) {
console.debug("==>subscribeCallbacke code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0300 subscribeCallbacke code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackc(err){ function unSubscribeCallbackc(err){
console.debug("==>unSubscribeCallbackc code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0300 unSubscribeCallbackc code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackd(err){ function unSubscribeCallbackd(err){
console.debug("==>unSubscribeCallbackd code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0300 unSubscribeCallbackd code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackc(){ function disconnectCallbackc(){
...@@ -93,23 +93,23 @@ describe('ActsAnsSubTestXts', function () { ...@@ -93,23 +93,23 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackg code==>"); console.debug("==>connectCallbackg code==>");
} }
function subscribeCallbackg(err) { function subscribeCallbackg(err) {
console.debug("==>subscribeCallbackg code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0400 subscribeCallbackg code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function subscribeCallbackh(err) { function subscribeCallbackh(err) {
console.debug("==>subscribeCallbackh code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0400 subscribeCallbackh code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function subscribeCallbacki(err) { function subscribeCallbacki(err) {
console.debug("==>subscribeCallbacki code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0400 subscribeCallbacki code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackf(err){ function unSubscribeCallbackf(err){
console.debug("==>unSubscribeCallbackf code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0400 unSubscribeCallbackf code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackg(err){ function unSubscribeCallbackg(err){
console.debug("==>unSubscribeCallbackg code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0400 unSubscribeCallbackg code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackf(){ function disconnectCallbackf(){
...@@ -127,11 +127,11 @@ describe('ActsAnsSubTestXts', function () { ...@@ -127,11 +127,11 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbacki code==>"); console.debug("==>connectCallbacki code==>");
} }
function subscribeCallbackl(err) { function subscribeCallbackl(err) {
console.debug("==>subscribeCallbackl code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0500 subscribeCallbackl code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbacki(err){ function unSubscribeCallbacki(err){
console.debug("==>unSubscribeCallbacki code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0500 unSubscribeCallbacki code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbacki(){ function disconnectCallbacki(){
...@@ -146,7 +146,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -146,7 +146,7 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackj code==>"); console.debug("==>connectCallbackj code==>");
} }
function unSubscribeCallbackj(err){ function unSubscribeCallbackj(err){
console.debug("==>unSubscribeCallbackj code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0600 unSubscribeCallbackj code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackj(){ function disconnectCallbackj(){
...@@ -161,11 +161,11 @@ describe('ActsAnsSubTestXts', function () { ...@@ -161,11 +161,11 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackm code==>"); console.debug("==>connectCallbackm code==>");
} }
function subscribeCallbackn(err) { function subscribeCallbackn(err) {
console.debug("==>subscribeCallbackn code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0700 subscribeCallbackn code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackl(err){ function unSubscribeCallbackl(err){
console.debug("==>unSubscribeCallbackl code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0700 unSubscribeCallbackl code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackl(){ function disconnectCallbackl(){
...@@ -180,7 +180,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -180,7 +180,7 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackn code==>"); console.debug("==>connectCallbackn code==>");
} }
function unSubscribeCallbackm(err){ function unSubscribeCallbackm(err){
console.debug("==>unSubscribeCallbackm code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_0800 unSubscribeCallbackm code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackm(){ function disconnectCallbackm(){
...@@ -191,11 +191,11 @@ describe('ActsAnsSubTestXts', function () { ...@@ -191,11 +191,11 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbackl code==>"); console.debug("==>connectCallbackl code==>");
} }
function subscribeCallbacko(err){ function subscribeCallbacko(err){
console.debug("==>subscribeCallbacko code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_1300 subscribeCallbacko code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbackn(err){ function unSubscribeCallbackn(err){
console.debug("==>unSubscribeCallbackn code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_1300 unSubscribeCallbackn code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function disconnectCallbackn(){ function disconnectCallbackn(){
...@@ -206,7 +206,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -206,7 +206,7 @@ describe('ActsAnsSubTestXts', function () {
console.debug("==>connectCallbacko code==>"); console.debug("==>connectCallbacko code==>");
} }
function subscribeCallbackp(err){ function subscribeCallbackp(err){
console.debug("==>subscribeCallbackp code==>" +err.code); console.debug("==>ActsSubscriber_test_xts_1400 subscribeCallbackp code==>" +err.code);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
} }
function unSubscribeCallbacko(err){ function unSubscribeCallbacko(err){
...@@ -223,11 +223,15 @@ describe('ActsAnsSubTestXts', function () { ...@@ -223,11 +223,15 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0100', 0, async function (done) { it('ActsSubscriber_test_xts_0100', 0, async function (done) {
console.debug("==ActsSubscriber_test_0100==begin==>"); console.debug("==ActsSubscriber_test_xts_0100==begin==>");
await notify.subscribe(subInfoa, subscribeCallbacka); await notify.subscribe(subInfoa, subscribeCallbacka);
await notify.unsubscribe(subInfoa, unSubscribeCallbacka); setTimeout((async function(){
console.debug("==ActsSubscriber_test_0100==end==>"); await notify.unsubscribe(subInfoa, unSubscribeCallbacka);
done(); }),1000);
setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_0100==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -236,16 +240,20 @@ describe('ActsAnsSubTestXts', function () { ...@@ -236,16 +240,20 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0200', 0, async function (done) { it('ActsSubscriber_test_xts_0200', 0, async function (done) {
console.debug("==ActsSubscriber_test_0200==begin==>"); console.debug("==ActsSubscriber_test_xts_0200==begin==>");
var subInfo ={ var subInfo ={
onConnect:connectCallbackb, onConnect:connectCallbackb,
onDisconnect:disconnectCallbackb, onDisconnect:disconnectCallbackb,
} }
await notify.subscribe(subInfo,subscribeCallbackb); await notify.subscribe(subInfo,subscribeCallbackb);
await notify.subscribe(subInfo,subscribeCallbackc); await notify.subscribe(subInfo,subscribeCallbackc);
await notify.unsubscribe(subInfo, unSubscribeCallbackb); setTimeout((async function(){
console.debug("==ActsSubscriber_test_0200==end==>"); await notify.unsubscribe(subInfo, unSubscribeCallbackb);
done(); }),1000);
setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_0200==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -254,7 +262,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -254,7 +262,7 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0300', 0, async function (done) { it('ActsSubscriber_test_xts_0300', 0, async function (done) {
console.debug("==ActsSubscriber_test_0300==begin==>"); console.debug("==ActsSubscriber_test_xts_0300==begin==>");
var subInfo ={ var subInfo ={
onConnect:connectCallbackc, onConnect:connectCallbackc,
...@@ -266,10 +274,14 @@ describe('ActsAnsSubTestXts', function () { ...@@ -266,10 +274,14 @@ describe('ActsAnsSubTestXts', function () {
} }
await notify.subscribe(subInfo,subscribeCallbackd); await notify.subscribe(subInfo,subscribeCallbackd);
await notify.subscribe(subInfo2,subscribeCallbacke); await notify.subscribe(subInfo2,subscribeCallbacke);
await notify.unsubscribe(subInfo, unSubscribeCallbackc); setTimeout((async function(){
await notify.unsubscribe(subInfo2, unSubscribeCallbackd); await notify.unsubscribe(subInfo, unSubscribeCallbackc);
console.debug("==ActsSubscriber_test_0300==end==>"); await notify.unsubscribe(subInfo2, unSubscribeCallbackd);
done(); }),1000);
setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_0300==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -278,8 +290,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -278,8 +290,7 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0400', 0, async function (done) { it('ActsSubscriber_test_xts_0400', 0, async function (done) {
console.debug("==ActsSubscriber_test_0500==begin==>"); console.debug("==ActsSubscriber_test_xts_0400==begin==>");
var subInfo ={ var subInfo ={
onConnect:connectCallbackf, onConnect:connectCallbackf,
onDisconnect:disconnectCallbackf, onDisconnect:disconnectCallbackf,
...@@ -291,11 +302,14 @@ describe('ActsAnsSubTestXts', function () { ...@@ -291,11 +302,14 @@ describe('ActsAnsSubTestXts', function () {
await notify.subscribe(subInfo,subscribeCallbackg); await notify.subscribe(subInfo,subscribeCallbackg);
await notify.subscribe(subInfo,subscribeCallbackh); await notify.subscribe(subInfo,subscribeCallbackh);
await notify.subscribe(subInfo2,subscribeCallbacki); await notify.subscribe(subInfo2,subscribeCallbacki);
setTimeout((async function(){
await notify.unsubscribe(subInfo, unSubscribeCallbackf); await notify.unsubscribe(subInfo, unSubscribeCallbackf);
await notify.unsubscribe(subInfo2, unSubscribeCallbackg); await notify.unsubscribe(subInfo2, unSubscribeCallbackg);
console.debug("==ActsSubscriber_test_0500==end==>"); }),1000);
done(); setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_0400==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -304,11 +318,15 @@ describe('ActsAnsSubTestXts', function () { ...@@ -304,11 +318,15 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0500', 0, async function (done) { it('ActsSubscriber_test_xts_0500', 0, async function (done) {
console.debug("==ActsSubscriber_test_0500==begin==>"); console.debug("==ActsSubscriber_test_xts_0500==begin==>");
await notify.subscribe(subInfob, {bundleNames:["com.example.actsanspublishtest"]},subscribeCallbackl); await notify.subscribe(subInfob, {bundleNames:["com.example.actsanspublishtest"]},subscribeCallbackl);
await notify.unsubscribe(subInfob, unSubscribeCallbacki); setTimeout((async function(){
console.debug("==ActsSubscriber_test_0500==end3==>"); await notify.unsubscribe(subInfob, unSubscribeCallbacki);
done(); }),1000);
setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_0500==end3==>");
done();
}),timeout);
}) })
/* /*
...@@ -317,13 +335,17 @@ describe('ActsAnsSubTestXts', function () { ...@@ -317,13 +335,17 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0600', 0, async function (done) { it('ActsSubscriber_test_xts_0600', 0, async function (done) {
console.debug("==ActsSubscriber_test_0600==begin==>"); console.debug("==ActsSubscriber_test_xts_0600==begin==>");
await notify.subscribe(subInfoc, {bundleNames:["com.example.actsanspublishtest"]}).then(async()=> { await notify.subscribe(subInfoc, {bundleNames:["com.example.actsanspublishtest"]}).then(async()=> {
console.log("ActsSubscriber_test_0600=======promise") console.log("ActsSubscriber_test_xts_0600=======promise")
await notify.unsubscribe(subInfoc, unSubscribeCallbackj) setTimeout((async function(){
await notify.unsubscribe(subInfoc, unSubscribeCallbackj)
}),1000);
}); });
console.debug("==ActsSubscriber_test_0600==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_0600==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -332,11 +354,18 @@ describe('ActsAnsSubTestXts', function () { ...@@ -332,11 +354,18 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0700', 0, async function (done) { it('ActsSubscriber_test_xts_0700', 0, async function (done) {
console.debug("==ActsSubscriber_test_0700==begin==>"); console.debug("==ActsSubscriber_test_xts_0700==begin==>");
await notify.subscribe(subInfod, {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]},subscribeCallbackn); await notify.subscribe(subInfod,
console.debug("==ActsSubscriber_test_0700==end==>"); {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]},subscribeCallbackn);
await notify.unsubscribe(subInfod, unSubscribeCallbackl); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_0700==end==>");
await notify.unsubscribe(subInfod, unSubscribeCallbackl);
}),1000);
setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_0700==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -345,13 +374,18 @@ describe('ActsAnsSubTestXts', function () { ...@@ -345,13 +374,18 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0800', 0, async function (done) { it('ActsSubscriber_test_xts_0800', 0, async function (done) {
console.debug("==ActsSubscriber_test_0900==begin==>"); console.debug("==ActsSubscriber_test_xts_0800==begin==>");
await notify.subscribe(subInfoe, {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]}).then(async()=> { await notify.subscribe(subInfoe,
console.log("ActsSubscriber_test_0900=======promise") {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]}).then(async()=> {
await notify.unsubscribe(subInfoe, unSubscribeCallbackm) console.log("ActsSubscriber_test_xts_0800=======promise")
setTimeout((async function(){
await notify.unsubscribe(subInfoe, unSubscribeCallbackm)
}),1000);
}); });
console.debug("==ActsSubscriber_test_0900==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_0800==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -360,11 +394,13 @@ describe('ActsAnsSubTestXts', function () { ...@@ -360,11 +394,13 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_0900', 0, async function (done) { it('ActsSubscriber_test_xts_0900', 0, async function (done) {
console.debug("==ActsSubscriber_test_1000==begin==>"); console.debug("==ActsSubscriber_test_xts_0900==begin==>");
var promise = notify.subscribe(100,{bundleNames:["com.example.actsanspublishtest"]}); var promise = notify.subscribe(100,{bundleNames:["com.example.actsanspublishtest"]});
expect(promise).assertEqual(undefined); expect(promise).assertEqual(undefined);
console.debug("==ActsSubscriber_test_1000==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_0900==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -373,12 +409,14 @@ describe('ActsAnsSubTestXts', function () { ...@@ -373,12 +409,14 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_1000', 0, async function (done) { it('ActsSubscriber_test_xts_1000', 0, async function (done) {
console.debug("==ActsSubscriber_test_1000==begin==>"); console.debug("==ActsSubscriber_test_xts_1000==begin==>");
var subInfo = null var subInfo = null
var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]});
expect(promise).assertEqual(undefined); expect(promise).assertEqual(undefined);
console.debug("==ActsSubscriber_test_1000==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_1000==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -387,12 +425,14 @@ describe('ActsAnsSubTestXts', function () { ...@@ -387,12 +425,14 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_1100', 0, async function (done) { it('ActsSubscriber_test_xts_1100', 0, async function (done) {
console.debug("==ActsSubscriber_test_1200==begin==>"); console.debug("==ActsSubscriber_test_xts_1100==begin==>");
var subInfo = "#$#%$%$^&%^%" var subInfo = "#$#%$%$^&%^%"
var promise = notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); var promise = notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]});
expect(promise).assertEqual(undefined); expect(promise).assertEqual(undefined);
console.debug("==ActsSubscriber_test_1200==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_1100==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -401,12 +441,14 @@ describe('ActsAnsSubTestXts', function () { ...@@ -401,12 +441,14 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_1200', 0, async function (done) { it('ActsSubscriber_test_xts_1200', 0, async function (done) {
console.debug("==ActsSubscriber_test_1200==begin==>"); console.debug("==ActsSubscriber_test_xts_1200==begin==>");
var subInfo = "" var subInfo = ""
var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]});
expect(promise).assertEqual(undefined); expect(promise).assertEqual(undefined);
console.debug("==ActsSubscriber_test_1200==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_1200==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -415,16 +457,19 @@ describe('ActsAnsSubTestXts', function () { ...@@ -415,16 +457,19 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_1300', 0, async function (done) { it('ActsSubscriber_test_xts_1300', 0, async function (done) {
console.debug("==ActsSubscriber_test_1300==begin==>"); console.debug("==ActsSubscriber_test_xts_1300==begin==>");
var subInfo ={ var subInfo ={
onConnect:connectCallbackl, onConnect:connectCallbackl,
onDisconnect:disconnectCallbackn, onDisconnect:disconnectCallbackn,
} }
await notify.subscribe(subInfo,{bundleNames:["wrongBudleName"]},subscribeCallbacko); await notify.subscribe(subInfo,{bundleNames:["wrongBudleName"]},subscribeCallbacko);
await notify.unsubscribe(subInfo, unSubscribeCallbackn); setTimeout((async function(){
console.debug("==ActsSubscriber_test_1300==end==>"); await notify.unsubscribe(subInfo, unSubscribeCallbackn);
done(); }),1000);
setTimeout((async function(){
console.debug("==ActsSubscriber_test_xts_1300==end==>");
done();
}),timeout);
}) })
/* /*
...@@ -433,7 +478,7 @@ describe('ActsAnsSubTestXts', function () { ...@@ -433,7 +478,7 @@ describe('ActsAnsSubTestXts', function () {
* @tc.desc: verify the function of subscribe * @tc.desc: verify the function of subscribe
*/ */
it('ActsSubscriber_test_xts_1400', 0, async function (done) { it('ActsSubscriber_test_xts_1400', 0, async function (done) {
console.debug("==ActsSubscriber_test_1400==begin==>"); console.debug("==ActsSubscriber_test_xts_1400==begin==>");
var subInfo ={ var subInfo ={
onConnect:connectCallbacko, onConnect:connectCallbacko,
onDisconnect:disconnectCallbacko, onDisconnect:disconnectCallbacko,
...@@ -441,10 +486,12 @@ describe('ActsAnsSubTestXts', function () { ...@@ -441,10 +486,12 @@ describe('ActsAnsSubTestXts', function () {
try{ try{
await notify.subscribe(subInfo, {bundleNames: []}, subscribeCallbackp); await notify.subscribe(subInfo, {bundleNames: []}, subscribeCallbackp);
}catch(err){ }catch(err){
console.debug("==ActsSubscriber_test_1400==err==>"+err); console.debug("==ActsSubscriber_test_xts_1400==err==>"+err);
} }
console.debug("==ActsSubscriber_test_1400==end==>"); setTimeout((async function(){
done(); console.debug("==ActsSubscriber_test_xts_1400==end==>");
done();
}),timeout);
}) })
}) })
...@@ -19,7 +19,7 @@ ohos_js_hap_suite("ActsPublish") { ...@@ -19,7 +19,7 @@ ohos_js_hap_suite("ActsPublish") {
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsPublish" hap_name = "ActsPublishAsUserTest"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./entry/src/main/js/default"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"actsPublish.hap" "ActsPublishAsUserTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册