提交 7e1563c8 编写于 作者: Z zhuhan

wantagent xts

Signed-off-by: Nzhuhan <zhuhan10@huawei.com>
Change-Id: Ied0132731cc2aadafc3b90dcae782f5a27908775
上级 c643d71d
...@@ -54,8 +54,8 @@ export default function ActsNotificationPublishTest() { ...@@ -54,8 +54,8 @@ export default function ActsNotificationPublishTest() {
wants: [ wants: [
{ {
deviceId: "deviceId", deviceId: "deviceId",
bundleName: "com.example.actsnotificationSecondDirectory", bundleName: "com.example.actsnotificationpublish",
abilityName: "com.example.actsnotificationSecondDirectory.MainAbility", abilityName: "com.example.actsnotificationpublish.MainAbility",
action: "action1", action: "action1",
entities: ["entity1"], entities: ["entity1"],
type: "MIMETYPE", type: "MIMETYPE",
......
...@@ -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,16 +69,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -62,16 +69,16 @@ 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} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).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() 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,16 +189,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -182,16 +189,16 @@ 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} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).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() expect(false).assertTrue()
done() done()
} }
}) })
...@@ -206,16 +213,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -206,16 +213,16 @@ 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} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).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() expect(false).assertTrue()
done() done()
} }
}) })
...@@ -230,16 +237,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -230,16 +237,16 @@ 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} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).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() expect(false).assertTrue()
done() done()
} }
}) })
...@@ -254,16 +261,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -254,16 +261,16 @@ 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} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).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() expect(false).assertTrue()
done() done()
} }
}) })
...@@ -278,16 +285,16 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -278,16 +285,16 @@ 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} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).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() expect(false).assertTrue()
done() done()
} }
}) })
...@@ -302,15 +309,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -302,15 +309,15 @@ 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)}`)
expect(true).assertTrue() expect(false).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1100 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1100 END`)
...@@ -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)}`)
...@@ -338,6 +345,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -338,6 +345,7 @@ export default function ActsNotificationWantAgentNewTest() {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1200 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1200 END`)
}) })
//TODO
/* /*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1300 * @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1300
* @tc.name : function getWantAgent(info: WantAgentInfo): Promise<WantAgent> * @tc.name : function getWantAgent(info: WantAgentInfo): Promise<WantAgent>
...@@ -346,7 +354,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -346,7 +354,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 +376,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -368,7 +376,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 +398,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -390,7 +398,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,15 +420,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -412,15 +420,15 @@ 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)}`)
expect(true).assertTrue() expect(false).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1600 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1600 END`)
...@@ -434,15 +442,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -434,15 +442,15 @@ 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)}`)
expect(true).assertTrue() expect(false).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1700 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1700 END`)
...@@ -456,15 +464,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -456,15 +464,15 @@ 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)}`)
expect(true).assertTrue() expect(false).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1800 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1800 END`)
...@@ -478,15 +486,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -478,15 +486,15 @@ 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)}`)
expect(true).assertTrue() expect(false).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1900 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_1900 END`)
...@@ -500,15 +508,15 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -500,15 +508,15 @@ 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)}`)
expect(true).assertTrue() expect(false).assertTrue()
done() done()
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code} ,message: ${err.message}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2000 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2000 END`)
...@@ -522,28 +530,26 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -522,28 +530,26 @@ 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() wantAgent.cancel(WantAgent, (err, data) => {
done() if (err) {
} console.info(`${TAG} cancel AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
wantAgent.cancel(WantAgent, (err) => { done()
if (err.code) { } else {
console.info(`${TAG} cancel AsyncCallback err: ${err.code}`) console.info(`${TAG} cancel AsyncCallback success`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
} else { }
console.info(`${TAG} cancel AsyncCallback success`) })
expect(true).assertTrue()
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,26 +563,24 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -557,26 +563,24 @@ 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)}`)
expect(true).assertTrue() wantAgent.cancel(WantAgent).then(() => {
done() console.info(`${TAG} cancel Promise success`)
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(`${TAG} cancel Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent 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) => {
console.info(`${TAG} cancel Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2200 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2200 END`)
}) })
...@@ -588,31 +592,28 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -588,31 +592,28 @@ 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() wantAgent.getBundleName(WantAgent, (err, data) => {
done() if (err) {
} console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
wantAgent.getBundleName(WantAgent, (err, data) => { done()
if (err.code) { } else {
console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`) console.info(`${TAG} getBundleName AsyncCallback success: ${JSON.stringify(data)}`)
expect(false).assertTrue() expect(data).assertEqual('com.example.actsnotificationwantagent')
done() done()
} else { }
console.info(`${TAG} getBundleName AsyncCallback success: ${JSON.stringify(data)}`) })
expect(data).assertEqual('com.example.actsnotificationwantagent')
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,18 +625,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -624,18 +625,11 @@ 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() wantAgent.getBundleName(WantAgent)
done()
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
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)}`)
expect(data).assertEqual('com.example.actsnotificationwantagent') expect(data).assertEqual('com.example.actsnotificationwantagent')
...@@ -646,6 +640,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -646,6 +640,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,28 +656,26 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -657,28 +656,26 @@ 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() if (err) {
} console.info(`${TAG} getUid AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
await wantAgent.getUid(WantAgent, (err, data) => { done()
if (err.code) { } else {
console.info(`${TAG} getUid AsyncCallback err: ${err.code}`) console.info(`${TAG} getUid AsyncCallback success: ${JSON.stringify(data)}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
} else { }
console.info(`${TAG} getUid AsyncCallback success: ${JSON.stringify(data)}`) })
expect(true).assertTrue()
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,26 +689,24 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -692,26 +689,24 @@ 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)}`)
expect(true).assertTrue() wantAgent.getUid(WantAgent).then((data) => {
done() console.info(`${TAG} getUid Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(`${TAG} getUid Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent 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) => {
console.info(`${TAG} getUid Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2600 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_2600 END`)
}) })
...@@ -723,9 +718,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -723,9 +718,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,9 +728,8 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -733,9 +728,8 @@ 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) {
console.info(`${TAG} equal AsyncCallback err: ${err.code}`) console.info(`${TAG} equal AsyncCallback err: ${err.code}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -758,9 +752,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -758,9 +752,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 +762,6 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -768,7 +762,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 +776,6 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -783,7 +776,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,28 +784,26 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -792,28 +784,26 @@ 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) {
} console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
await wantAgent.getOperationType(WantAgent, (err, data) => { done()
if (err.code) { } else {
console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`) console.info(`${TAG} getOperationType AsyncCallback success: ${JSON.stringify(data)}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
} else { }
console.info(`${TAG} getOperationType AsyncCallback success: ${JSON.stringify(data)}`) })
expect(true).assertTrue()
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 +817,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -827,18 +817,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 +832,11 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -849,6 +832,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 +848,9 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -860,9 +848,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()
...@@ -897,7 +885,7 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -897,7 +885,7 @@ export default function ActsNotificationWantAgentNewTest() {
} }
} }
wantAgent.trigger(WantAgent, triggerInfo, (err, data) => { wantAgent.trigger(WantAgent, triggerInfo, (err, data) => {
if (err.code) { if (err) {
console.info(`${TAG} trigger AsyncCallback err: ${JSON.stringify(err)}`) console.info(`${TAG} trigger AsyncCallback err: ${JSON.stringify(err)}`)
expect(false).assertTrue() expect(false).assertTrue()
done() done()
...@@ -918,68 +906,6 @@ export default function ActsNotificationWantAgentNewTest() { ...@@ -918,68 +906,6 @@ export default function ActsNotificationWantAgentNewTest() {
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3100 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3100 END`)
}) })
/*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3200
* @tc.name : function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void
* @tc.desc : Triggers a WantAgent
*/
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`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG
wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue()
done()
} else {
WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
let triggerInfo = {
code: 0,
want: {
deviceId: "deviceId",
bundleName: "com.example.actsnotificationwantagent",
abilityName: "com.example.actsnotificationwantagent.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
parameters:
{
myKey0: 2222,
myKey1: [1, 2, 3],
myKey2: "[1, 2, 3]",
myKey3: "notification",
myKey4: [false, true, false],
myKey5: ["ANS", "WANT", "AGENT"],
myKey6: true,
}
},
permission: '',
extraInfo: {
test: 'this is a test value'
}
}
wantAgent.trigger(WantAgent, triggerInfo, (err, data) => {
console.info(`${TAG} trigger Callback success: ${JSON.stringify(data)}`)
expect(err.code).assertEqual(0)
expect(typeof(data.wantAgent)).assertEqual('object')
expect(data.finalCode).assertEqual(0)
expect(data.finalData).assertEqual('')
expect(typeof(data.extraInfo)).assertEqual('object')
expect(data.want.deviceId).assertEqual('deviceId')
expect(data.want.bundleName).assertEqual('com.example.actsnotificationwantagent')
expect(data.want.abilityName).assertEqual('com.example.actsnotificationwantagent.MainAbility')
done()
})
}
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_NEW_TEST_3200 END`)
})
console.info(TAG + 'SUB_NOTIFICATION_ANS_WANT_AGENT_NEW_TEST END') console.info(TAG + 'SUB_NOTIFICATION_ANS_WANT_AGENT_NEW_TEST END')
}) })
} }
\ No newline at end of file
/* /*
* 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
...@@ -54,6 +54,13 @@ export default function ActsNotificationWantAgentTest() { ...@@ -54,6 +54,13 @@ export default function ActsNotificationWantAgentTest() {
} }
} }
beforeEach(async function (done) {
console.info(`${TAG} beforeEach START`)
WantAgent = {}
console.info(`${TAG} beforeEachEach END`)
done();
})
/* /*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0100 * @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0100
* @tc.name : function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void * @tc.name : function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void
...@@ -62,7 +69,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -62,7 +69,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -86,7 +93,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -86,7 +93,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -110,7 +117,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -110,7 +117,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0300', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0300', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0300 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -134,7 +141,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -134,7 +141,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0400', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0400', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0400 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -158,7 +165,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -158,7 +165,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0500', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0500', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0500 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -182,7 +189,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -182,7 +189,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0600', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0600 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -206,7 +213,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -206,7 +213,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0700', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0700 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -230,7 +237,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -230,7 +237,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0800', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0800', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0800 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -254,7 +261,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -254,7 +261,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0900', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_0900 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -278,7 +285,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -278,7 +285,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1000', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1000 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -302,7 +309,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -302,7 +309,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -324,7 +331,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -346,7 +353,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1300', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1300', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1300 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -368,7 +375,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1400', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1400', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1400 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -390,7 +397,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1500', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1500', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1500 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -412,7 +419,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1600', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1600 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -434,7 +441,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1700', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1700 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -456,7 +463,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1800', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1800', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1800 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -478,7 +485,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1900', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_1900 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 ActsNotificationWantAgentTest() { ...@@ -500,7 +507,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2000', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2000 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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,7 +529,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -522,7 +529,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -531,19 +538,17 @@ export default function ActsNotificationWantAgentTest() { ...@@ -531,19 +538,17 @@ 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.cancel(WantAgent, (err) => {
done() if (err.code) {
} console.info(`${TAG} cancel AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
wantAgent.cancel(WantAgent, (err) => { done()
if (err.code) { } else {
console.info(`${TAG} cancel AsyncCallback err: ${err.code}`) console.info(`${TAG} cancel AsyncCallback success`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
} else { }
console.info(`${TAG} cancel AsyncCallback success`) })
expect(true).assertTrue()
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`)
...@@ -557,26 +562,25 @@ export default function ActsNotificationWantAgentTest() { ...@@ -557,26 +562,25 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2200', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2200', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2200 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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)}`)
expect(true).assertTrue() wantAgent.cancel(WantAgent).then(() => {
done() console.info(`${TAG} cancel Promise success`)
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(`${TAG} cancel Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent 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) => {
console.info(`${TAG} cancel Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2200 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2200 END`)
}) })
...@@ -588,7 +592,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -588,7 +592,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2300', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2300', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2300 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -597,22 +601,19 @@ export default function ActsNotificationWantAgentTest() { ...@@ -597,22 +601,19 @@ 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) => {
done() if (err.code) {
} console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
wantAgent.getBundleName(WantAgent, (err, data) => { done()
if (err.code) { } else {
console.info(`${TAG} getBundleName AsyncCallback err: ${err.code}`) console.info(`${TAG} getBundleName AsyncCallback success: ${JSON.stringify(data)}`)
expect(false).assertTrue() expect(data).assertEqual('com.example.actsnotificationwantagent')
done() done()
} else { }
console.info(`${TAG} getBundleName AsyncCallback success: ${JSON.stringify(data)}`) })
expect(data).assertEqual('com.example.actsnotificationwantagent')
done()
} }
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2300 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2300 END`)
}) })
...@@ -624,18 +625,11 @@ export default function ActsNotificationWantAgentTest() { ...@@ -624,18 +625,11 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2400', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2400', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2400 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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() wantAgent.getBundleName(WantAgent)
done()
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
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)}`)
expect(data).assertEqual('com.example.actsnotificationwantagent') expect(data).assertEqual('com.example.actsnotificationwantagent')
...@@ -646,6 +640,12 @@ export default function ActsNotificationWantAgentTest() { ...@@ -646,6 +640,12 @@ export default function ActsNotificationWantAgentTest() {
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_TEST_2400 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2400 END`)
}) })
...@@ -657,7 +657,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -657,7 +657,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2500', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2500', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2500 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -666,21 +666,20 @@ export default function ActsNotificationWantAgentTest() { ...@@ -666,21 +666,20 @@ 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) => {
done() if (err.code) {
} console.info(`${TAG} getUid AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
await wantAgent.getUid(WantAgent, (err, data) => { done()
if (err.code) { } else {
console.info(`${TAG} getUid AsyncCallback err: ${err.code}`) console.info(`${TAG} getUid AsyncCallback success: ${JSON.stringify(data)}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
} else { }
console.info(`${TAG} getUid AsyncCallback success: ${JSON.stringify(data)}`) })
expect(true).assertTrue()
done()
} }
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2500 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2500 END`)
}) })
...@@ -692,26 +691,25 @@ export default function ActsNotificationWantAgentTest() { ...@@ -692,26 +691,25 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2600', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2600', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2600 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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)}`)
expect(true).assertTrue() wantAgent.getUid(WantAgent).then((data) => {
done() console.info(`${TAG} getUid Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}).catch((err) => {
console.info(`${TAG} getUid Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
}).catch((err) => { }).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`) console.info(`${TAG} getWantAgent 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) => {
console.info(`${TAG} getUid Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2600 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2600 END`)
}) })
...@@ -723,7 +721,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -723,7 +721,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2700', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2700', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2700 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -733,7 +731,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -733,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}`)
...@@ -758,7 +755,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -758,7 +755,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -768,7 +765,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -768,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()
...@@ -783,7 +779,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -783,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
...@@ -792,7 +787,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -792,7 +787,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
...@@ -801,21 +796,20 @@ export default function ActsNotificationWantAgentTest() { ...@@ -801,21 +796,20 @@ 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) => {
done() if (err.code) {
} console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`)
}) expect(false).assertTrue()
await wantAgent.getOperationType(WantAgent, (err, data) => { done()
if (err.code) { } else {
console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`) console.info(`${TAG} getOperationType AsyncCallback success: ${JSON.stringify(data)}`)
expect(false).assertTrue() expect(true).assertTrue()
done() done()
} else { }
console.info(`${TAG} getOperationType AsyncCallback success: ${JSON.stringify(data)}`) })
expect(true).assertTrue()
done()
} }
}) })
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900 END`)
}) })
...@@ -827,18 +821,11 @@ export default function ActsNotificationWantAgentTest() { ...@@ -827,18 +821,11 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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 +836,12 @@ export default function ActsNotificationWantAgentTest() { ...@@ -849,6 +836,12 @@ export default function ActsNotificationWantAgentTest() {
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_TEST_3000 END`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000 END`)
}) })
...@@ -860,7 +853,7 @@ export default function ActsNotificationWantAgentTest() { ...@@ -860,7 +853,7 @@ export default function ActsNotificationWantAgentTest() {
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3100', 0, async function (done) { it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3100', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3100 START`) console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_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.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`) console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册