From b051a3ab72b3f3976e9c50ef09d2f217bc889e62 Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Wed, 24 Aug 2022 10:53:42 +0800 Subject: [PATCH] =?UTF-8?q?XTS=E6=B5=8B=E8=AF=95=E5=A5=97=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=94=A8=E4=BE=8B=E5=B9=B6=E5=88=A0=E9=99=A4release?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9B=B8=E5=85=B3=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- .../js/test/DataAbilityHelperJsSt.test.js | 150 +----------------- 1 file changed, 4 insertions(+), 146 deletions(-) diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js index a5da7a064..d9bfe3253 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js @@ -59,13 +59,13 @@ describe('ActsDataAbilityHelperTest', function () { console.log('ACTS_AcquireDataAbilityHelper_0100====" + dataAbilityUri) try { - var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri) - console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: ' - + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) if(DAHelper == null){ + var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri) + console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: ' + + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper)) DAHelper = abilityHelper; } - expect(typeof (abilityHelper)).assertEqual("object"); + expect(typeof (DAHelper)).assertEqual("object"); } catch (err) { console.error('=ACTS_GetDataAbilityHelper_0100 acquireDataAbilityHelper catch(err)====>:' + err); expect(false).assertTrue(); @@ -8317,146 +8317,4 @@ describe('ActsDataAbilityHelperTest', function () { done(); } }) - - /* - * @tc.number: ACTS_Release_0100 - * @tc.name: Releases the client resource of the Data ability. - * @tc.desc: Check the return value of the interface (by promise) - */ - it('ACTS_Release_0100', 0, async function (done) { - console.log('ACTS_Release_0100====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0100 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - expect(data).assertEqual(true); - console.log('ACTS_Release_0100==== { - console.debug("=ACTS_Release_0100 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Release_0100====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0100====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release((err, data) => { - console.debug("=ACTS_Release_0200 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('featureAbility getDataAbilityHelper ACTS_Release_0200 data: ' + data) - expect(data).assertEqual(true); - console.log('ACTS_Release_0200====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0200====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - expect(data).assertEqual(true); - rDAHelper.release().then((data) => { - console.debug("=ACTS_Release_0300 then data====>" - + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data); - expect(data).assertEqual(false); - console.log('ACTS_Release_0300==== { - console.debug("=ACTS_Release_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Release_0300==== { - console.debug("=ACTS_Release_0300 catch err ====>" - + ("json err 【") + JSON.stringify(err) + (" 】 ")); - expect(false).assertTrue(); - console.log('ACTS_Release_0300====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0300====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper)); - expect(typeof (rDAHelper)).assertEqual("object"); - rDAHelper.release((err, data) => { - console.debug("=ACTS_Release_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;")); - console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data) - expect(data).assertEqual(true); - rDAHelper.release((err, data) => { - console.debug("=ACTS_Release_0400 err,data=======>" - + ("json err【") + JSON.stringify(err) + (" ,") + JSON.stringify(data) + (" 】;")); - console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data) - expect(data).assertEqual(false); - console.log('ACTS_Release_0400====:' + err); - expect(false).assertTrue(); - console.log('ACTS_Release_0400====