diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js index fca5a86e32cb27a4744aa0d152146a16ec95485f..376824b1fdcefa76b3c88c5e3b4e289c1d743c07 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStoreCallbackJsunit.test.js @@ -1801,16 +1801,14 @@ describe('deviceKvStoreCallbackTest', function () { await kvStore.removeDeviceData('', function (err,data) { if (err == undefined) { console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData success'); - expect(err == undefined).assertTrue(); - } else { - console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail ' + err); expect(null).assertFail(); + } else { + console.info('testDeviceKvStoreRemoveDeviceData103 removeDeviceData fail'); } done(); }); }catch(e) { console.info('testDeviceKvStoreRemoveDeviceData103 e ' + e); - expect(null).assertFail(); done(); } }) diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js index 239aa54f7f449d8b3d9c25efdb77913f8adc3e40..b57c72e111dc4dc572b0ca705dc498bc56f457e2 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/DeviceKvStorePromiseJsunit.test.js @@ -1987,14 +1987,14 @@ describe('deviceKvStorePromiseTest', function () { * @tc.name [JS-API8]DeviceKvStore.RemoveDeviceData() * @tc.desc Test Js Api DeviceKvStore.RemoveDeviceData() testcase 003 */ - it('testDeviceKvStoreRemoveDeviceData003', 0, async function (done) { + it('testDeviceKvStoreRemoveDeviceData003', 0, async function (done) { console.info('testDeviceKvStoreRemoveDeviceData003'); try { - await kvStore.removeDeviceData('').then(() => { + await kvStore.removeDeviceData('').then((data) => { console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData success'); + expect(null).assertFail(); }).catch((err) => { console.info('testDeviceKvStoreRemoveDeviceData003 removeDeviceData fail ' + err); - expect(null).assertFail(); }); }catch(e) { console.info('testDeviceKvStoreRemoveDeviceData003 e ' + e); @@ -2010,7 +2010,7 @@ describe('deviceKvStorePromiseTest', function () { it('testDeviceKvStoreRemoveDeviceData004', 0, async function (done) { console.info('testDeviceKvStoreRemoveDeviceData004'); try { - await kvStore.removeDeviceData(null).then((err) => { + await kvStore.removeDeviceData(null).then((data) => { console.info('testDeviceKvStoreRemoveDeviceData004 removeDeviceData success'); expect(null).assertFail(); }).catch((err) => { diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js index b4fe5e1c6012253395a47e6d661bebfd65340c20..acda93522ea62bfc281cea4de7d0e0231f438109 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStoreCallbackJsunit.test.js @@ -1760,16 +1760,14 @@ describe('singleKvStoreCallbackTest', function () { await kvStore.removeDeviceData('', function (err,data) { if (err == undefined) { console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData success'); - expect(err == undefined).assertTrue(); - } else { - console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail: ' + err); expect(null).assertFail(); + } else { + console.info('testSingleKvStoreRemoveDeviceData103 removeDeviceData fail'); } done(); }); }catch(e) { console.info('testSingleKvStoreRemoveDeviceData103 e ' + e); - expect(null).assertFail(); done(); } }) diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js index 9e4f302e98aea814775be4b3994d978aa1e9a5a4..0c87d12f5878c20147b05589a9755d380e2deeb9 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/SingleKvStorePromiseJsunit.test.js @@ -1956,14 +1956,14 @@ describe('singleKvStorePromiseTest', function () { * @tc.name [JS-API8]SingleKvStoreRemoveDeviceData. * @tc.desc Test Js Api SingleKvStoreRemoveDeviceData testcase 003 */ - it('testSingleKvStoreRemoveDeviceData003', 0, async function (done) { + it('testSingleKvStoreRemoveDeviceData003', 0, async function (done) { console.info('testSingleKvStoreRemoveDeviceData003'); try { - await kvStore.removeDeviceData('').then(() => { + await kvStore.removeDeviceData('').then((data) => { console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData success'); + expect(null).assertFail(); }).catch((err) => { console.info('testSingleKvStoreRemoveDeviceData003 removeDeviceData fail ' + err); - expect(null).assertFail(); }); }catch(e) { console.info('testSingleKvStoreRemoveDeviceData003 e ' + e); @@ -1971,6 +1971,7 @@ describe('singleKvStorePromiseTest', function () { done(); }) + /** * @tc.number SUB_DISTRIBUTEDDATAMGR_SINGLEKVSTORE_REMOVEDEVICEDATA_0400 * @tc.name [JS-API8]SingleKvStoreRemoveDeviceData. diff --git a/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js b/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js index 4197415cd812cbe7f960d0a1bd4fce465e8ab20e..a2fb7c9ae923be1607f7dd60149312f2e44fb078 100644 --- a/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js +++ b/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbStoreResultSetJsunit.test.js @@ -1832,66 +1832,6 @@ describe('rdbResultSetTest', function () { console.log(TAG + "************* testBigData0001 end *************"); } }) - - /** - * @tc.name big resultSet data test - * @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0251 - * @tc.desc big resultSet data test - */ - it('testBigData0002', 0, async function (done) { - console.log(TAG + "************* testBigData0002 start *************"); - { - await createBigData(500); - let resultSet = await rdbStore.querySql("SELECT * FROM test"); - let count = resultSet.rowCount; - expect(500).assertEqual(count); - - resultSet.goToLastRow(); - let i = resultSet.rowCount; - while (i >= 1) { - expect("test" + --i).assertEqual(resultSet.getString(1)) - resultSet.goToPreviousRow(); - } - - resultSet.close() - expect(true).assertEqual(resultSet.isClosed) - resultSet = null; - done(); - console.log(TAG + "************* testBigData0002 end *************"); - } - }) - - /** - * @tc.name big resultSet data test - * @tc.number SUB_DDM_AppDataFWK_JSRDB_ResultSet_0252 - * @tc.desc big resultSet data test - */ - it('testBigData0003', 0, async function (done) { - console.log(TAG + "************* testBigData0003 start *************"); - { - await createBigData(1); - let resultSet = await rdbStore.querySql("SELECT * FROM test"); - let count = resultSet.rowCount; - expect(1).assertEqual(count); - - resultSet.goToFirstRow(); - expect(true).assertEqual(resultSet.isStarted); - expect("test0").assertEqual(resultSet.getString(1)) - - let rows = [1, 2, -1, -2]; - for (const i of rows) { - resultSet.goToRow(i); - expect(true).assertEqual(resultSet.isStarted); - expect("").assertEqual(resultSet.getString(1)) - } - - resultSet.close() - expect(true).assertEqual(resultSet.isClosed) - resultSet = null; - done(); - console.log(TAG + "************* testBigData0003 end *************"); - } - }) console.info(TAG + '*************Unit Test End*************'); })