提交 272552f0 编写于 作者: C chengxingzhen

fixed b051a3ab from https://gitee.com/chengxingzhen/xts_acts_master/pulls/5139

XTS测试套优化用例并删除release接口相关用例
Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 6b3f822d
......@@ -59,13 +59,13 @@ describe('ActsDataAbilityHelperTest', function () {
console.log('ACTS_AcquireDataAbilityHelper_0100====<begin');
console.debug("=ACTS_AcquireDataAbilityHelper_0100 dataAbilityUri====>" + 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====<begin');
var rDAHelper
try {
rDAHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri);
console.debug('ACTS_beforeAll rDAHelper ====>: ' + 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====<end');
done();
}).catch(err => {
console.debug("=ACTS_Release_0100 catch err ====>"
+ ("json err 【") + JSON.stringify(err) + (""));
expect(false).assertTrue();
console.log('ACTS_Release_0100====<end .catch');
done();
});
} catch (err) {
console.error('=ACTS_Release_0100 release promise catch(err)====>:' + err);
expect(false).assertTrue();
console.log('ACTS_Release_0100====<end catch(err)');
done();
}
})
/*
* @tc.number: ACTS_Release_0200
* @tc.name: Releases the client resource of the Data ability.
* @tc.desc: Check the return value of the interface (by AsyncCallback)
*/
it('ACTS_Release_0200', 0, async function (done) {
console.log('ACTS_Release_0200====<begin');
var rDAHelper
try {
rDAHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri);
console.debug('ACTS_beforeAll rDAHelper ====>: ' + 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====<end');
done();
},
);
} catch (err) {
console.error('=ACTS_Release_0200 release AsyncCallback catch(err)====>:' + err);
expect(false).assertTrue();
console.log('ACTS_Release_0200====<end catch');
done();
}
})
/*
* @tc.number: ACTS_Release_0300
* @tc.name: Releases the client resource of the Data ability.
* @tc.desc: Check the return value of the interface (by promise)
*/
it('ACTS_Release_0300', 0, async function (done) {
console.log('ACTS_Release_0300====<begin');
var rDAHelper
try {
rDAHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri);
console.debug('ACTS_beforeAll rDAHelper ====>: ' + 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====<end');
done();
}).catch(err => {
console.debug("=ACTS_Release_0300 catch err ====>"
+ ("json err 【") + JSON.stringify(err) + (""));
expect(false).assertTrue();
console.log('ACTS_Release_0300====<end .catch');
done();
});
}).catch(err => {
console.debug("=ACTS_Release_0300 catch err ====>"
+ ("json err 【") + JSON.stringify(err) + (""));
expect(false).assertTrue();
console.log('ACTS_Release_0300====<end .catch');
done();
});
} catch (err) {
console.error('=ACTS_Release_0300 release promise catch(err)====>:' + err);
expect(false).assertTrue();
console.log('ACTS_Release_0300====<end catch(err)');
done();
}
})
/*
* @tc.number: ACTS_Release_0400
* @tc.name: Releases the client resource of the Data ability.
* @tc.desc: Check the return value of the interface (by AsyncCallback)
*/
it('ACTS_Release_0400', 0, async function (done) {
console.log('ACTS_Release_0400====<begin');
var rDAHelper
try {
rDAHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri);
console.debug('ACTS_beforeAll rDAHelper ====>: ' + 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====<end');
done();
},
);
},
);
} catch (err) {
console.error('=ACTS_Release_0400 release AsyncCallback catch(err)====>:' + err);
expect(false).assertTrue();
console.log('ACTS_Release_0400====<end catch');
done();
}
})
})}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册