diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js index f180a1b9ddea655797569204def26335e5fe18c4..7320699bdca72c54a2037a85c29cff07d94f3772 100755 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreRdbstoreJsunit.test.js @@ -120,11 +120,15 @@ describe('rdbStoreTest', function () { */ it('testRdbStore0004', 0, async function (done) { console.log(TAG + "************* testRdbStore0004 start *************"); - - let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 6); + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 1); storePromise.then(async (store) => { try { await store.executeSql(CREATE_TABLE_TEST); + let deletePromise = dataRdb.deleteRdbStore("rdbstore.db") + deletePromise.then(()=>{ + console.log(TAG + "deleteRdbStore promise done" + store); + expect(true).assertTrue(); + }) } catch (e) { expect(null).assertFail(); } @@ -137,5 +141,91 @@ describe('rdbStoreTest', function () { console.log(TAG + "************* testRdbStore0004 end *************"); }) + /** + * @tc.name rdb store deleteRdbStore + * @tc.number SUB_DDM_AppDataFWK_JSRDB_RdbStore_0050 + * @tc.desc rdb store deleteRdbStore + */ + it('testRdbStore0005', 0, async function (done) { + console.log(TAG + "************* testRdbStore0005 start *************"); + + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 2); + storePromise.then(async (store) => { + try { + await store.executeSql(CREATE_TABLE_TEST); + let deletePromise = dataRdb.deleteRdbStore("rdbstore.db") + deletePromise.then(()=>{ + console.log(TAG + "deleteRdbStore promise done" + store); + expect(true).assertTrue(); + }) + } catch (e) { + expect(null).assertFail(); + } + }).catch((err) => { + expect(null).assertFail(); + }) + await storePromise + storePromise = null + done(); + console.log(TAG + "************* testRdbStore0005 end *************"); + }) + + /** + * @tc.name rdb store deleteRdbStore + * @tc.number SUB_DDM_AppDataFWK_JSRDB_RdbStore_0060 + * @tc.desc rdb store deleteRdbStore + */ + it('testRdbStore0006', 0, async function (done) { + console.log(TAG + "************* testRdbStore0006 start *************"); + + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 4); + storePromise.then(async (store) => { + try { + await store.executeSql(CREATE_TABLE_TEST); + let deletePromise = dataRdb.deleteRdbStore("rdbstore.db") + deletePromise.then(()=>{ + console.log(TAG + "deleteRdbStore promise done" + store); + expect(true).assertTrue(); + }) + } catch (e) { + expect(null).assertFail(); + } + }).catch((err) => { + expect(null).assertFail(); + }) + await storePromise + storePromise = null + done(); + console.log(TAG + "************* testRdbStore0006 end *************"); + }) + + /** + * @tc.name rdb store deleteRdbStore + * @tc.number SUB_DDM_AppDataFWK_JSRDB_RdbStore_0070 + * @tc.desc rdb store deleteRdbStore + */ + it('testRdbStore0007', 0, async function (done) { + console.log(TAG + "************* testRdbStore0007 start *************"); + + let storePromise = dataRdb.getRdbStore(STORE_CONFIG, 6); + storePromise.then(async (store) => { + try { + await store.executeSql(CREATE_TABLE_TEST); + let deletePromise = dataRdb.deleteRdbStore("rdbstore.db") + deletePromise.then(()=>{ + console.log(TAG + "deleteRdbStore promise done" + store); + expect(true).assertTrue(); + }) + } catch (e) { + expect(null).assertFail(); + } + }).catch((err) => { + expect(null).assertFail(); + }) + await storePromise + storePromise = null + done(); + console.log(TAG + "************* testRdbStore0007 end *************"); + }) console.log(TAG + "*************Unit Test End*************"); }) \ No newline at end of file