未验证 提交 41bf9425 编写于 作者: O openharmony_ci 提交者: Gitee

!9055 【Distributeddatamgr】【master】rdb多次备份用例修改

Merge pull request !9055 from lina123456/master
......@@ -415,11 +415,15 @@ export default function relationalStoreBackupRestoreCallbackTest() {
*/
it('RdbBackupRestoreCallbackTest_1200', 0, async function (done) {
console.info(TAG + "************* RdbBackupRestoreCallbackTest_1200 start *************")
RdbStore.backup(DATABASE_BACKUP_NAME, (err, data) => {
if(err != null){
expect(false).assertTrue()
await RdbStore.backup(DATABASE_BACKUP_NAME);
await RdbStore.backup(DATABASE_BACKUP_NAME, function(err) {
if(err){
console.error(TAG + `Restore failed, code is ${err.code},message is ${err.message}`);
expect(err !== undefined).assertFail();
done();
}
BackupCallbackTest(DATABASE_BACKUP_NAME)
console.info(TAG + `Restore success.`);
expect(err === undefined).assertTrue();
done();
})
console.info(TAG + "************* RdbBackupRestoreCallbackTest_1200 end *************")
......
......@@ -386,8 +386,23 @@ describe('relationalStoreBackupRestorePromiseTest', function () {
it('RdbBackupRestoreTest_0120', 0, async function (done) {
console.info(TAG + "************* RdbBackupRestoreTest_0120 start *************")
await RdbStore.backup(DATABASE_BACKUP_NAME)
await BackupTest(DATABASE_BACKUP_NAME)
done();
await RdbStore.backup(DATABASE_BACKUP_NAME).then(()=>{
console.info(TAG + `Backup success.`);
RdbStore.restore(DATABASE_BACKUP_NAME, function(err) {
if (err) {
console.error(TAG + `Restore failed, code is ${err.code},message is ${err.message}`);
expect(err !== undefined).assertFail();
done();
}
console.info(TAG + `Restore success.`);
expect(err === undefined).assertTrue();
done();
})
}).catch((err)=>{
console.error(TAG + `Backup failed, code is ${err.code},message is ${err.message}`);
expect(err !== undefined).assertFail();
done();
});
console.info(TAG + "************* RdbBackupRestoreTest_0120 end *************")
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册