diff --git a/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js index 908564e7d99075fc90229d6f42c2cea18b893c5f..8432654e41521a2892412508f3b98ed17a1335b9 100644 --- a/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js +++ b/notification/ans_standard/publish_test/getwantagentinfo/entry/src/main/js/test/WantAgent.test.js @@ -103,7 +103,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { done(); }), setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0100====>"); + console.info("====>time out ACTS_SetWantInfo_0100====>"); }, time); console.info('----getWantAgenta after----'); }) @@ -167,7 +167,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { }) done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0200====>"); + console.info("====>time out ACTS_SetWantInfo_0200====>"); }, time) }) /* @@ -235,8 +235,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () { (err, data) => { if (err.code == 0) { WantAgentc = data; - console.log("=======WantAgentb======="+JSON.stringify(WantAgentb)) - console.log("=======WantAgentc======="+JSON.stringify(WantAgentc)) + console.info("=======WantAgentb======="+JSON.stringify(WantAgentb)) + console.info("=======WantAgentc======="+JSON.stringify(WantAgentc)) expect(typeof(data)).assertEqual("object"); wantAgent.equal(WantAgentb,WantAgentc, (error,data) => { @@ -269,7 +269,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(typeof(data)).assertEqual("object"); } setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0300====>"); + console.info("====>time out ACTS_SetWantInfo_0300====>"); done(); }, time); }); @@ -309,7 +309,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] } wantAgent.getWantAgent(agentInfoe,(err,data)=>{ - console.log("=======agentInfoe======="+err.code+JSON.stringify(data)) + console.info("=======agentInfoe======="+err.code+JSON.stringify(data)) WantAgentd = data }) @@ -341,11 +341,11 @@ describe('ActsAnsGetWantAgentInfoTest', function () { setTimeout(function(){ wantAgent.getWantAgent(agentInfof, (err, data) => { - console.log("=======agentInfof======="+err.code+JSON.stringify(data)) + console.info("=======agentInfof======="+err.code+JSON.stringify(data)) if (err.code == 0) { WantAgente = data; - console.log("=======WantAgente======="+JSON.stringify(WantAgentd)) - console.log("=======WantAgentf======="+JSON.stringify(WantAgente)) + console.info("=======WantAgente======="+JSON.stringify(WantAgentd)) + console.info("=======WantAgentf======="+JSON.stringify(WantAgente)) wantAgent.equal(WantAgentd,WantAgente).then( (data) => { console.info('----equalc success!----'+data) @@ -366,7 +366,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { } setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0400====>"); + console.info("====>time out ACTS_SetWantInfo_0400====>"); done(); }, time); }); @@ -437,8 +437,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () { (err, data) => { if (err.code == 0) { WantAgente = data; - console.log("=======WantAgente======="+JSON.stringify(WantAgentd)) - console.log("=======WantAgentf======="+JSON.stringify(WantAgente)) + console.info("=======WantAgente======="+JSON.stringify(WantAgentd)) + console.info("=======WantAgentf======="+JSON.stringify(WantAgente)) expect(typeof(data)).assertEqual("object"); wantAgent.equal(WantAgentd,WantAgente).then( (data) => { @@ -467,7 +467,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { } done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0500====>"); + console.info("====>time out ACTS_SetWantInfo_0500====>"); }, time); }); }, 1000); @@ -491,7 +491,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { ) done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0600====>"); + console.info("====>time out ACTS_SetWantInfo_0600====>"); }, time); }); /* @@ -505,7 +505,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined); done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0700====>"); + console.info("====>time out ACTS_SetWantInfo_0700====>"); }, time); }); /* @@ -522,7 +522,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { ) done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0800====>"); + console.info("====>time out ACTS_SetWantInfo_0800====>"); }, time); }); /* @@ -536,7 +536,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(null); done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0900====>"); + console.info("====>time out ACTS_SetWantInfo_0900====>"); }, time); }); /* @@ -553,7 +553,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { ) done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1000====>"); + console.info("====>time out ACTS_SetWantInfo_1000====>"); }, time); }); /* @@ -567,7 +567,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined); done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1100====>"); + console.info("====>time out ACTS_SetWantInfo_1100====>"); }, time); }); /* @@ -576,12 +576,14 @@ describe('ActsAnsGetWantAgentInfoTest', function () { * @tc.desc: verify the function of getWantAgent("")callback */ it('ACTS_SetWantInfo_1200', 0, async function (done) { - console.info('----ACTS_SetWantInfo_0300 begin----'); + console.info('----ACTS_SetWantInfo_1200 begin----'); wantAgent.getWantAgent("",(err,data) => { - console.log("===getWantAgenta==="+err.code+data)}) - done(); + console.info("===getWantAgenta==="+err.code+data) + expect().assertFail() + }) setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1200====>"); + console.info("====>time out ACTS_SetWantInfo_1200====>"); + done(); }, time); }) /* @@ -592,11 +594,11 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_1300', 0, async function (done) { console.info('----ACTS_SetWantInfo_0300 begin----'); var promise = wantAgent.getWantAgent("") - console.log("===getWantAgentb==="+promise) + console.info("===getWantAgentb==="+promise) expect(promise).assertEqual(null); done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1300====>"); + console.info("====>time out ACTS_SetWantInfo_1300====>"); }, time); }) /* @@ -606,11 +608,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_1400', 0, async function (done) { wantAgent.getBundleName("",(err,data) => { - console.info('----getBundleNamea success!----'+err.code+data); - expect(typeof(data)).assertEqual('string')}); - done(); + console.info('----getBundleNamea success!----'+err.code+data); + expect().assertFail() + }); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1400====>"); + console.info("====>time out ACTS_SetWantInfo_1400====>"); + done(); }, time); }) /* @@ -624,7 +627,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined) done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1500====>"); + console.info("====>time out ACTS_SetWantInfo_1500====>"); }, time); }) /* @@ -634,11 +637,11 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_1600', 0, async function (done) { wantAgent.getUid("",(err,data) => { - console.info('----getUida success!----'+err.code+data); - expect(typeof(data)).assertEqual('number')}); - done() + console.info('----getUida success!----'+err.code+data); + expect(typeof(data)).assertEqual('number')}); + done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1600====>"); + console.info("====>time out ACTS_SetWantInfo_1600====>"); }, time); }) /* @@ -652,7 +655,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined) done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1700====>"); + console.info("====>time out ACTS_SetWantInfo_1700====>"); }, time); }) /* @@ -663,11 +666,11 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_1800', 0, async function (done) { wantAgent.getWant("",(err,data) => { console.info('----getWanta success!----'+err.code+data); - expect(typeof(data)).assertEqual('object') + expect().assertFail() }); - done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1800====>"); + console.info("====>time out ACTS_SetWantInfo_1800====>"); + done() }, time); }) /* @@ -681,7 +684,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined) done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1900====>"); + console.info("====>time out ACTS_SetWantInfo_1900====>"); }, time); }) /* @@ -690,13 +693,14 @@ describe('ActsAnsGetWantAgentInfoTest', function () { * @tc.desc: verify the function of getWantAgent(100)callback */ it('ACTS_SetWantInfo_2000', 0, async function (done) { - console.info('----ACTS_SetWantInfo_1000 begin----'); + console.info('----ACTS_SetWantInfo_2000 begin----'); wantAgent.getWantAgent(100,(err,data) => { - console.log('----getWantAgenta success!----'+err.code+data) - }) - done(); + console.info('----getWantAgenta success!----'+err.code+data) + expect().assertFail() + }) setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2000====>"); + console.info("====>time out ACTS_SetWantInfo_2000====>"); + done(); }, time); }) /* @@ -706,11 +710,11 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_2100', 0, async function (done) { var promise = wantAgent.getWantAgent(100) - console.log("----getWantAgentb success!----"+promise) + console.info("----getWantAgentb success!----"+promise) expect(promise).assertEqual(null) done(); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2100====>"); + console.info("====>time out ACTS_SetWantInfo_2100====>"); }, time); }) /* @@ -720,12 +724,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_2200', 0, async function (done) { wantAgent.getBundleName(100,(err,data) => { - console.info('----getBundleNamec success!----'+err.code+data); - expect(typeof(data)).assertEqual('string') - }); - done() + console.info('----getBundleNamec success!----'+err.code+data); + expect().assertFail() + }); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2200====>"); + console.info("====>time out ACTS_SetWantInfo_2200====>"); + done() }, time); }) /* @@ -739,7 +743,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined) done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2300====>"); + console.info("====>time out ACTS_SetWantInfo_2300====>"); }, time); }) /* @@ -749,11 +753,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_2400', 0, async function (done) { wantAgent.getUid(100,(err,data) => { - console.info('----getUidc success!----'+err.code+data); - }); - done() + console.info('----getUidc success!----'+err.code+data); + expect().assertFail() + }); setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2400====>"); + console.info("====>time out ACTS_SetWantInfo_2400====>"); + done() }, time); }) /* @@ -767,7 +772,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined) done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2500====>"); + console.info("====>time out ACTS_SetWantInfo_2500====>"); }, time); }) /* @@ -778,11 +783,11 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_2600', 0, async function (done) { wantAgent.getWant(100,(err,data) => { console.info('----getWantc success!----'+err.code+data); - expect(typeof(data)).assertEqual('object') + expect().assertFail() }); - done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2600====>"); + console.info("====>time out ACTS_SetWantInfo_2600====>"); + done() }, time); }) /* @@ -796,7 +801,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { expect(promise).assertEqual(undefined) done() setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2700====>"); + console.info("====>time out ACTS_SetWantInfo_2700====>"); }, time); }) /* @@ -807,9 +812,10 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_2800', 0, async function (done) { console.info('----ACTS_SetWantInfo_2800 begin----'); wantAgent.getWantAgent({},(err,data) => { - console.log("----getWantAgentc success!----"+err.code+data) - }) - done(); + console.info("----getWantAgentc success!----"+err.code+data) + expect(err.code).assertEqual(0) + done(); + }) }) /* * @tc.number: ACTS_SetWantInfo_2900 @@ -819,10 +825,10 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_2900', 0, async function (done) { console.info('----ACTS_SetWantInfo_2900 begin----'); wantAgent.getWantAgent({}).then((data)=>{ - console.log("----getWantAgentd success!----"+data) - expect(data).assertEqual("object") - }) - done(); + console.info("----getWantAgentd success!----"+data) + expect(typeof(data)).assertEqual("object") + done(); + }) }) /* * @tc.number: ACTS_SetWantInfo_3000 @@ -831,10 +837,13 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_3000', 0, async function (done) { wantAgent.getBundleName({},(err,data) => { - console.info('----getBundleNamee success!----'+err.code+data); - expect(typeof(data)).assertEqual('string') - }); - done() + console.info('----getBundleNamee success!----'+err.code+data); + expect().assertFail() + }); + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_3000====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_3100 @@ -854,9 +863,13 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_3200', 0, async function (done) { wantAgent.getUid({},(err,data) => { - console.info('----getUide success!----'+err.code+data); - }); - done() + console.info('----getUide success!----'+err.code+data); + expect().assertFail() + }); + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_3200====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_3300 @@ -865,9 +878,9 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_3300', 0, async function (done) { var promise = wantAgent.getUid({}) - console.info('----getUidf success!----'+promise); - expect(promise).assertEqual(null) - done() + console.info('----getUidf success!----'+promise); + expect(promise).assertEqual(null) + done() }) /* * @tc.number: ACTS_SetWantInfo_3400 @@ -877,8 +890,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_3400', 0, async function (done) { wantAgent.getWant({},(err,data) => { console.info('----getWante success!----'+err.code+data); + expect().assertFail() }); - done() + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_3400====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_3500 @@ -887,9 +904,9 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_3500', 0, async function (done) { var promise = wantAgent.getWant({}) - console.info('----getWantf success!----'+promise); - expect(promise).assertEqual(null) - done() + console.info('----getWantf success!----'+promise); + expect(promise).assertEqual(null) + done() }) /* * @tc.number: ACTS_SetWantInfo_3600 @@ -899,8 +916,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_3600', 0, async function (done) { wantAgent.cancel({},(err,data) => { console.info('----cancela success!----'+err.code+data); + expect().assertFail() }); - done() + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_3600====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_3700 @@ -909,9 +930,9 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_3700', 0, async function (done) { var promise = await wantAgent.cancel({}) - console.info('----cancelb success!----'+promise); - expect(promise).assertEqual(null) - done() + console.info('----cancelb success!----'+promise); + expect(promise).assertEqual(null) + done() }) /* * @tc.number: ACTS_SetWantInfo_3800 @@ -921,8 +942,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_3800', 0, async function (done) { wantAgent.cancel(100,(err) => { console.info('----cancelc success!----'+err.code); + expect().assertFail() }); - done() + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_3800====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_3900 @@ -931,8 +956,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_3900', 0, async function (done) { var promise =await wantAgent.cancel(100) - console.info('----canceld success!----'+promise); - expect(promise).assertEqual(undefined) + console.info('----canceld success!----'+promise); + expect(promise).assertEqual(undefined) done() }) /* @@ -943,8 +968,12 @@ describe('ActsAnsGetWantAgentInfoTest', function () { it('ACTS_SetWantInfo_4000', 0, async function (done) { wantAgent.cancel("",(err) => { console.info('----cancele success!----'+err.code); + expect().assertFail() }); - done() + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_4000====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_4100 @@ -953,7 +982,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_4100', 0, async function (done) { var promise = await wantAgent.cancel("") - console.info('----cancelf success!----'+promise); + console.info('----cancelf success!----'+promise); expect(promise).assertEqual(undefined) done() }) @@ -963,10 +992,14 @@ describe('ActsAnsGetWantAgentInfoTest', function () { * @tc.desc: verify the function of cancel("%^%^%^")callback */ it('ACTS_SetWantInfo_4200', 0, async function (done) { - wantAgent.cancel("%^%^%^",(err) => { + wantAgent.cancel("%^%^%^",(err, data) => { console.info('----cancelg success!----'+err.code); + expect().assertFail() }); - done() + setTimeout(function(){ + console.info("====>time out ACTS_SetWantInfo_4200====>"); + done() + }, time); }) /* * @tc.number: ACTS_SetWantInfo_4300 @@ -975,10 +1008,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () { */ it('ACTS_SetWantInfo_4300', 0, async function (done) { var promise =await wantAgent.cancel("%^%^%^") - console.info('----cancelh success!----'+promise); + console.info('----cancelh success!----'+promise); expect(promise).assertEqual(undefined) done() }) -}) - - +}) \ No newline at end of file