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 6c342b4d05bdfc9999671a5e123d4380b94f05b2..2bbc81b11b55767d3f761a8c1126b463729dae07 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 *************") + + }) /**