From 5d5f713a4af01171590bcf7e4bc7795031ec4165 Mon Sep 17 00:00:00 2001 From: liangzhenyu123 Date: Mon, 14 Nov 2022 11:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8C=E6=97=B6?= =?UTF-8?q?=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liangzhenyu123 --- ...dbstoreBackupRestoreCallbackJsunit.test.js | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js index 6c342b4d0..2bbc81b11 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js @@ -270,31 +270,32 @@ export default function rdbStoreBackupRestoreCallbackTest() { }catch(err){ expect(false).assertTrue(); } + dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME).then(() => { + try{ + fileio.accessSync(DATABASE_DIR + DATABASE_BACKUP_NAME) + }catch(err){ + console.info(TAG + 'error2 ' + err) + expect(true).assertTrue(); + } + RdbStore.backup(DATABASE_BACKUP_NAME, (err, data) => { + if(err != null){ + expect(false).assertTrue(0) + }else{ + try{ + console.info(TAG + 'Backup database success') + fileio.accessSync(DATABASE_DIR + DATABASE_BACKUP_NAME) + }catch(err){ + expect(false).assertTrue(); + } + } + done() + console.info(TAG + "************* RdbBackupRestoreCallbackTest_0500 end *************") + }) + }) } }) - await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME).then(() => { - try{ - fileio.accessSync(DATABASE_DIR + DATABASE_BACKUP_NAME) - }catch(err){ - console.info(TAG + 'error2 ' + err) - expect(true).assertTrue(); - } - }) - - RdbStore.backup(DATABASE_BACKUP_NAME, (err, data) => { - if(err != null){ - expect(false).assertTrue(0) - }else{ - try{ - console.info(TAG + 'Backup database success') - fileio.accessSync(DATABASE_DIR + DATABASE_BACKUP_NAME) - }catch(err){ - expect(false).assertTrue(); - } - } - }) - done() - console.info(TAG + "************* RdbBackupRestoreCallbackTest_0500 end *************") + + }) /** -- GitLab