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 a5da7a0645c2bcedee40b768e38ee9dd08e4ce10..d9bfe32534d6551494aee724cbd04110d944a467 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====