提交 bc52b4bd 编写于 作者: L lina123456

<update>

Signed-off-by: Nlina123456 <shilina6@huawei.com>
...@@ -415,11 +415,15 @@ export default function relationalStoreBackupRestoreCallbackTest() { ...@@ -415,11 +415,15 @@ export default function relationalStoreBackupRestoreCallbackTest() {
*/ */
it('RdbBackupRestoreCallbackTest_1200', 0, async function (done) { it('RdbBackupRestoreCallbackTest_1200', 0, async function (done) {
console.info(TAG + "************* RdbBackupRestoreCallbackTest_1200 start *************") console.info(TAG + "************* RdbBackupRestoreCallbackTest_1200 start *************")
RdbStore.backup(DATABASE_BACKUP_NAME, (err, data) => { await RdbStore.backup(DATABASE_BACKUP_NAME);
if(err != null){ await RdbStore.backup(DATABASE_BACKUP_NAME, function(err) {
expect(false).assertTrue() 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(); done();
}) })
console.info(TAG + "************* RdbBackupRestoreCallbackTest_1200 end *************") console.info(TAG + "************* RdbBackupRestoreCallbackTest_1200 end *************")
......
...@@ -386,8 +386,23 @@ describe('relationalStoreBackupRestorePromiseTest', function () { ...@@ -386,8 +386,23 @@ describe('relationalStoreBackupRestorePromiseTest', function () {
it('RdbBackupRestoreTest_0120', 0, async function (done) { it('RdbBackupRestoreTest_0120', 0, async function (done) {
console.info(TAG + "************* RdbBackupRestoreTest_0120 start *************") console.info(TAG + "************* RdbBackupRestoreTest_0120 start *************")
await RdbStore.backup(DATABASE_BACKUP_NAME) await RdbStore.backup(DATABASE_BACKUP_NAME)
await BackupTest(DATABASE_BACKUP_NAME) await RdbStore.backup(DATABASE_BACKUP_NAME).then(()=>{
done(); 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 *************") console.info(TAG + "************* RdbBackupRestoreTest_0120 end *************")
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部