提交 bc52b4bd 编写于 作者: L lina123456

<update>

Signed-off-by: Nlina123456 <shilina6@huawei.com>
上级 1a650f30
......@@ -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.
先完成此消息的编辑!
想要评论请 注册