提交 93aeeaab 编写于 作者: X xinxin13

submit code

Signed-off-by: Nxinxin13 <xinxin13@huawei.com>
上级 63e674ec
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -54,6 +54,13 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -54,6 +54,13 @@ export default function ActsNotificationWantAgentNewTest() {
} }
} }
beforeEach(async function (done) {
console.info(`${TAG} beforeEach START`)
WantAgent = {}
console.info(`${TAG} beforeEachEach END`)
done();
})
/* /*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0100 * @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0100
* @tc.name : function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void * @tc.name : function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void
...@@ -62,9 +69,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -62,9 +69,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0100 START`)
WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.ONE_TIME_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.ONE_TIME_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -86,9 +93,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -86,9 +93,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0200 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.NO_BUILD_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.NO_BUILD_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -110,9 +117,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -110,9 +117,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0300', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0300', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0300 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0300 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.CANCEL_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.CANCEL_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -134,9 +141,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -134,9 +141,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0400', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0400', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0400 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0400 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -158,9 +165,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -158,9 +165,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0500', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0500', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0500 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0500 START`)
WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.CONSTANT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.CONSTANT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -182,9 +189,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -182,9 +189,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0600', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0600 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0600 START`)
WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_ELEMENT WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_ELEMENT]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -206,9 +213,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -206,9 +213,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0700', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0700 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0700 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_ACTION WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_ACTION]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -230,9 +237,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -230,9 +237,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0800', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0800', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0800 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0800 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_URI WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_URI]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -254,9 +261,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -254,9 +261,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0900', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0900 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_0900 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_ENTITIES WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_ENTITIES]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -278,9 +285,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -278,9 +285,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1000', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1000 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1000 START`)
WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_BUNDLE WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_BUNDLE]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -302,7 +309,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -302,7 +309,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1100 START`)
WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.ONE_TIME_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.ONE_TIME_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -324,7 +331,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -324,7 +331,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1200 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.NO_BUILD_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.NO_BUILD_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -346,7 +353,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -346,7 +353,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1300', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1300', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1300 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1300 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.CANCEL_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.CANCEL_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -368,7 +375,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -368,7 +375,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1400', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1400', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1400 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1400 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -390,7 +397,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -390,7 +397,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1500', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1500', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1500 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1500 START`)
WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.CONSTANT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.CONSTANT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -412,7 +419,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -412,7 +419,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1600', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1600 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1600 START`)
WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE WantAgentInfo.operationType = wantAgent.OperationType.UNKNOWN_TYPE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_ELEMENT WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_ELEMENT]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -434,7 +441,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -434,7 +441,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1700', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1700 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1700 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_ACTION WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_ACTION]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -456,7 +463,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -456,7 +463,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1800', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1800', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1800 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1800 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITIES
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_URI WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_URI]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -478,7 +485,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -478,7 +485,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1900', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1900 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1900 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE WantAgentInfo.operationType = wantAgent.OperationType.START_SERVICE
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_ENTITIES WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_ENTITIES]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -500,7 +507,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -500,7 +507,7 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2000', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2000 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2000 START`)
WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT WantAgentInfo.operationType = wantAgent.OperationType.SEND_COMMON_EVENT
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.REPLACE_BUNDLE WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.REPLACE_BUNDLE]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
...@@ -522,19 +529,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -522,19 +529,15 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2100 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}
})
wantAgent.cancel(WantAgent, (err) => { wantAgent.cancel(WantAgent, (err) => {
if (err.code) { if (err.code) {
console.info(`${TAG} cancel AsyncCallback err: ${err.code}`) console.info(`${TAG} cancel AsyncCallback err: ${err.code}`)
...@@ -546,6 +549,8 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -546,6 +549,8 @@ export default function ActsNotificationWantAgentNewTest() {
done() done()
} }
}) })
}
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2100 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2100 END`)
}) })
...@@ -557,23 +562,21 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -557,23 +562,21 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2200 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
wantAgent.cancel(WantAgent).then(() => {
console.info(`${TAG} cancel Promise success`)
expect(true).assertTrue() expect(true).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} cancel Promise err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
}) })
wantAgent.cancel(WantAgent).then(() => {
console.info(`${TAG} cancel Promise success`)
expect(true).assertTrue()
done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} cancel Promise err: ${err.code}`) console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
}) })
...@@ -588,19 +591,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -588,19 +591,15 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2300', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2300', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2300 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2300 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}
})
wantAgent.getBundleName(WantAgent, (err, data) => { wantAgent.getBundleName(WantAgent, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`) console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`)
...@@ -612,7 +611,8 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -612,7 +611,8 @@ export default function ActsNotificationWantAgentNewTest() {
done() done()
} }
}) })
}
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2300 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2300 END`)
}) })
...@@ -624,17 +624,10 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -624,17 +624,10 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2400', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2400', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2400 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2400 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
wantAgent.getBundleName(WantAgent) wantAgent.getBundleName(WantAgent)
.then((data) => { .then((data) => {
console.info(`${TAG} getBundleName Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getBundleName Promise success: ${JSON.stringify(data)}`)
...@@ -646,6 +639,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -646,6 +639,11 @@ export default function ActsNotificationWantAgentNewTest() {
expect(false).assertTrue() expect(false).assertTrue()
done() done()
}) })
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2400 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2400 END`)
}) })
...@@ -657,20 +655,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -657,20 +655,16 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2500', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2500', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2500 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2500 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue() wantAgent.getUid(WantAgent, (err, data) => {
done()
}
})
await wantAgent.getUid(WantAgent, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} getUid AsyncCallback err: ${err.code}`) console.info(`${TAG} getUid AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
...@@ -681,6 +675,8 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -681,6 +675,8 @@ export default function ActsNotificationWantAgentNewTest() {
done() done()
} }
}) })
}
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2500 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2500 END`)
}) })
...@@ -692,23 +688,21 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -692,23 +688,21 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2600', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2600 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2600 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
wantAgent.getUid(WantAgent).then((data) => {
console.info(`${TAG} getUid Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue() expect(true).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getUid Promise err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
}) })
await wantAgent.getUid(WantAgent).then((data) => {
console.info(`${TAG} getUid Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getUid Promise err: ${err.code}`) console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
}) })
...@@ -723,9 +717,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -723,9 +717,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2700', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2700 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2700 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -733,7 +727,6 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -733,7 +727,6 @@ export default function ActsNotificationWantAgentNewTest() {
wantAgentData1 = data wantAgentData1 = data
wantAgentData2 = data wantAgentData2 = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.equal(wantAgentData1, wantAgentData2, (err, data) => { wantAgent.equal(wantAgentData1, wantAgentData2, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} equal AsyncCallback err: ${err.code}`) console.info(`${TAG} equal AsyncCallback err: ${err.code}`)
...@@ -758,9 +751,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -758,9 +751,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2800', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2800', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2800 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2800 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -768,7 +761,6 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -768,7 +761,6 @@ export default function ActsNotificationWantAgentNewTest() {
wantAgentData1 = data wantAgentData1 = data
wantAgentData2 = data wantAgentData2 = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.equal(wantAgentData1, wantAgentData2).then((data) => { wantAgent.equal(wantAgentData1, wantAgentData2).then((data) => {
console.info(`${TAG} equal Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} equal Promise success: ${JSON.stringify(data)}`)
expect(data).assertTrue() expect(data).assertTrue()
...@@ -783,7 +775,6 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -783,7 +775,6 @@ export default function ActsNotificationWantAgentNewTest() {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2800 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2800 END`)
}) })
/* /*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900 * @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900
* @tc.name : function getOperationType(agent: WantAgent, callback: AsyncCallback<number>): void * @tc.name : function getOperationType(agent: WantAgent, callback: AsyncCallback<number>): void
...@@ -792,21 +783,17 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -792,21 +783,17 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue() wantAgent.getOperationType(WantAgent, (err, data) => {
done() if (err != null) {
}
})
await wantAgent.getOperationType(WantAgent, (err, data) => {
if (err.code) {
console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`) console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -816,6 +803,8 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -816,6 +803,8 @@ export default function ActsNotificationWantAgentNewTest() {
done() done()
} }
}) })
}
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2900 END`)
}) })
...@@ -827,18 +816,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -827,18 +816,11 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3000', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3000 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3000 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue() wantAgent.getOperationType(WantAgent)
done()
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
await wantAgent.getOperationType(WantAgent)
.then((data) => { .then((data) => {
console.info(`${TAG} getOperationType Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getOperationType Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue() expect(true).assertTrue()
...@@ -849,6 +831,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -849,6 +831,11 @@ export default function ActsNotificationWantAgentNewTest() {
expect(false).assertTrue() expect(false).assertTrue()
done() done()
}) })
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3000 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3000 END`)
}) })
...@@ -860,9 +847,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -860,9 +847,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3100 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -927,9 +914,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -927,9 +914,9 @@ export default function ActsNotificationWantAgentNewTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3200 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => { wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) { if (err != null) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -57,7 +57,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -57,7 +57,7 @@ export default function ActsNotificationWantAgentTest() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info(`${TAG} beforeEach START`) console.info(`${TAG} beforeEach START`)
WantAgent = {} WantAgent = {}
console.info(`${TAG} aftebeforeEachEach END`) console.info(`${TAG} beforeEachEach END`)
done(); done();
}) })
...@@ -538,9 +538,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -538,9 +538,6 @@ export default function ActsNotificationWantAgentTest() {
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}
wantAgent.cancel(WantAgent, (err) => { wantAgent.cancel(WantAgent, (err) => {
if (err.code) { if (err.code) {
console.info(`${TAG} cancel AsyncCallback err: ${err.code}`) console.info(`${TAG} cancel AsyncCallback err: ${err.code}`)
...@@ -551,9 +548,10 @@ export default function ActsNotificationWantAgentTest() { ...@@ -551,9 +548,10 @@ export default function ActsNotificationWantAgentTest() {
expect(true).assertTrue() expect(true).assertTrue()
done() done()
} }
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2100 END`)
}) })
}
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2100 END`)
}) })
/* /*
...@@ -568,7 +566,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -568,7 +566,6 @@ export default function ActsNotificationWantAgentTest() {
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.cancel(WantAgent).then(() => { wantAgent.cancel(WantAgent).then(() => {
console.info(`${TAG} cancel Promise success`) console.info(`${TAG} cancel Promise success`)
expect(true).assertTrue() expect(true).assertTrue()
...@@ -604,7 +601,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -604,7 +601,6 @@ export default function ActsNotificationWantAgentTest() {
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.getBundleName(WantAgent, (err, data) => { wantAgent.getBundleName(WantAgent, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`) console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`)
...@@ -633,7 +629,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -633,7 +629,6 @@ export default function ActsNotificationWantAgentTest() {
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.getBundleName(WantAgent) wantAgent.getBundleName(WantAgent)
.then((data) => { .then((data) => {
console.info(`${TAG} getBundleName Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getBundleName Promise success: ${JSON.stringify(data)}`)
...@@ -671,7 +666,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -671,7 +666,6 @@ export default function ActsNotificationWantAgentTest() {
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.getUid(WantAgent, (err, data) => { wantAgent.getUid(WantAgent, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} getUid AsyncCallback err: ${err.code}`) console.info(`${TAG} getUid AsyncCallback err: ${err.code}`)
...@@ -701,7 +695,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -701,7 +695,6 @@ export default function ActsNotificationWantAgentTest() {
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.getUid(WantAgent).then((data) => { wantAgent.getUid(WantAgent).then((data) => {
console.info(`${TAG} getUid Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getUid Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue() expect(true).assertTrue()
...@@ -738,7 +731,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -738,7 +731,6 @@ export default function ActsNotificationWantAgentTest() {
wantAgentData1 = data wantAgentData1 = data
wantAgentData2 = data wantAgentData2 = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.equal(wantAgentData1, wantAgentData2, (err, data) => { wantAgent.equal(wantAgentData1, wantAgentData2, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} equal AsyncCallback err: ${err.code}`) console.info(`${TAG} equal AsyncCallback err: ${err.code}`)
...@@ -773,7 +765,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -773,7 +765,6 @@ export default function ActsNotificationWantAgentTest() {
wantAgentData1 = data wantAgentData1 = data
wantAgentData2 = data wantAgentData2 = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.equal(wantAgentData1, wantAgentData2).then((data) => { wantAgent.equal(wantAgentData1, wantAgentData2).then((data) => {
console.info(`${TAG} equal Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} equal Promise success: ${JSON.stringify(data)}`)
expect(data).assertTrue() expect(data).assertTrue()
...@@ -788,7 +779,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -788,7 +779,6 @@ export default function ActsNotificationWantAgentTest() {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800 END`)
}) })
/* /*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900 * @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900
* @tc.name : function getOperationType(agent: WantAgent, callback: AsyncCallback<number>): void * @tc.name : function getOperationType(agent: WantAgent, callback: AsyncCallback<number>): void
...@@ -806,7 +796,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -806,7 +796,6 @@ export default function ActsNotificationWantAgentTest() {
} else { } else {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.getOperationType(WantAgent, (err, data) => { wantAgent.getOperationType(WantAgent, (err, data) => {
if (err.code) { if (err.code) {
console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`) console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`)
...@@ -836,7 +825,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -836,7 +825,6 @@ export default function ActsNotificationWantAgentTest() {
wantAgent.getWantAgent(WantAgentInfo).then((data) => { wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
wantAgent.getOperationType(WantAgent) wantAgent.getOperationType(WantAgent)
.then((data) => { .then((data) => {
console.info(`${TAG} getOperationType Promise success: ${JSON.stringify(data)}`) console.info(`${TAG} getOperationType Promise success: ${JSON.stringify(data)}`)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册