diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js index 56374e0941b9cbe532e4e8ccd23ac2a06474a7dc..1926ba7b8f7ddd9d34c7efe7e1c0de0003140fec 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js @@ -784,14 +784,14 @@ describe('kvStoreBackupCallbackJsunittest', function () { it('SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200', 0, async function (done) { try { console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 before putdata"); - publicput(kvStore,"key","value") ; + await publicput(kvStore,"key","value") ; console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 going putdata"); await publicget(kvStore,"key").then((data) => { console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 going getdata" + JSON.stringify(data)); expect(true).assertEqual(data == "value"); done(); }).catch((err) => { - console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 Get fail 1 " + err); + console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 Get fail 1 " + JSON.stringify(err)); expect(err).assertFail(); done(); }) @@ -811,14 +811,14 @@ describe('kvStoreBackupCallbackJsunittest', function () { it('SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300', 0, async function (done) { try { console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 before putdata"); - publicput(kvStore,"putcallback003","value1") ; + await publicput(kvStore,"putcallback003","value1") ; console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 going putdata"); await publicget(kvStore,"putcallback").then((data) => { console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 going getdata" + JSON.stringify(data)); expect(true).assertEqual(false); done(); }).catch((err) => { - console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 Get fail 1 " + err); + console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 Get fail 1 " + JSON.stringify(err)); expect(true).assertEqual(true); done(); }) diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js index ec4c9151129ad756d92907e04bda5534bf150100..a27b43441f5cf8c27a6ce1d3378b36232779fe4b 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js @@ -192,9 +192,6 @@ describe('kvStoreBackupPromiseJsunittest', function () { console.info('afterAll: Test suite-level cleanup condition, ' + 'which is executed after the test suite is executed'); publiccloseKvStore(); - await kvManager.getAllKVStoreId(TEST_BUNDLE_NAME).then((data) => { - console.info(data.length); - }) kvManager = null; console.info("Test kvstore = " + kvStore) }) @@ -779,7 +776,7 @@ describe('kvStoreBackupPromiseJsunittest', function () { expect(true).assertEqual(data == "value"); done(); }).catch((err) => { - console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0200 Get fail 1 " + err); + console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0200 Get fail 1 " + JSON.stringify(err)); expect(err).assertFail(); done(); }) @@ -799,14 +796,14 @@ describe('kvStoreBackupPromiseJsunittest', function () { it('SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300', 0, async function (done) { try { console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 before putdata"); - publicput(kvStore,"PutPromise0004","value1") ; + await publicput(kvStore,"PutPromise0004","value1") ; console.log("KvStoreBackupestDbBuckupPutPromiseTest004t going putdata"); await publicget(kvStore,"PutPromise").then((data) => { console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 going getdata" + JSON.stringify(data)); expect(true).assertEqual(JSON.stringify(data) == '{}'); done(); }).catch((err) => { - console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 Get fail 1 " + err); + console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 Get fail 1 " + JSON.stringify(err)); console.log(JSON.stringify(err)); expect(true).assertEqual(err.code == 15100004); done(); diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/List.test.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/List.test.js index dd20238a3cf18eae7908a4fe20531438afcbaa8f..aa4ce5513a4d55113d49357d8d5cd8d3c7c2b0b0 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/List.test.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/List.test.js @@ -35,8 +35,8 @@ export default function testsuite() { queryTest() SingleKvStoreCallbackTest() FieldNodeTest() - kvStoreBackupCallbackJsunittest() - kvStoreBackupPromiseJsunittest() schemaTest() singleKvStoreEnumTest() + kvStoreBackupPromiseJsunittest() + kvStoreBackupCallbackJsunittest() } diff --git a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js index 0f905a039139f0c14d0875a72858aa1478991f80..ceb9c81005451e1dd3ddbe66a5185b83fbcb2021 100644 --- a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js +++ b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js @@ -21,8 +21,8 @@ const KEY_TEST_LONG_ELEMENT = 'key_test_long'; const KEY_TEST_FLOAT_ELEMENT = 'key_test_float'; const KEY_TEST_BOOLEAN_ELEMENT = 'key_test_boolean'; const KEY_TEST_STRING_ELEMENT = 'key_test_string'; -const MAX_KEY_LENGTH = 'X'.repeat(32) -const MAX_VALUE_LENGTH = 'y'.repeat(8191) +const MAX_KEY_LENGTH = 'X'.repeat(80) +const MAX_VALUE_LENGTH = 'y'.repeat(8192) var mPref; export default function storagePromiseTest() { diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js index b559ba726c58b37f8c46f78328cb996b457901be..94286bd5e452a905c41ed79dfa366766e94f7575 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreCallbackJsunit.test.js @@ -114,9 +114,13 @@ export default function rdbStoreBackupRestoreCallbackTest() { afterEach(async function () { console.info(TAG + 'afterEach') - await dataRdb.deleteRdbStore(context, STORE_CONFIG.name) - await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) - await dataRdb.deleteRdbStore(context, "BackupTest003.db") + try { + await dataRdb.deleteRdbStore(context, STORE_CONFIG.name) + await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) + await dataRdb.deleteRdbStore(context, "BackupTest003.db") + } catch (err) { + console.info(TAG + "deleteRdbStore err" + JSON.stringify(err)) + } }) afterAll(async function () { diff --git a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreWithFAContextJsunit.test.js b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreWithFAContextJsunit.test.js index 6967b399dc50c11ec698d203f7129de16f24eb5b..d518877286d5ef15104f825cc909bf731f607821 100644 --- a/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreWithFAContextJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/RdbJstest/hap/src/main/js/test/RdbstoreBackupRestoreWithFAContextJsunit.test.js @@ -112,9 +112,13 @@ export default function rdbStoreBackupRestorePromiseTest() { afterEach(async function () { console.info(TAG + 'afterEach') - await dataRdb.deleteRdbStore(context, STORE_CONFIG.name) - await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) - await dataRdb.deleteRdbStore(context, "BackupTest003.db") + try { + await dataRdb.deleteRdbStore(context, STORE_CONFIG.name) + await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) + await dataRdb.deleteRdbStore(context, "BackupTest003.db") + } catch (err) { + console.info(TAG + "deleteRdbStore err" + JSON.stringify(err)) + } }) afterAll(async function () { diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreCallbackJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreCallbackJsunit.test.js index 5e3293ec75d5d6436088672d5406ec2f24cf921e..3dcab10ba4e526ec20e35a75c6551baa810219be 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreCallbackJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreCallbackJsunit.test.js @@ -114,9 +114,13 @@ export default function relationalStoreBackupRestoreCallbackTest() { afterEach(async function () { console.info(TAG + 'afterEach') - await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name) - await data_Rdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) - await data_Rdb.deleteRdbStore(context, "BackupTest003.db") + try { + await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name) + await data_Rdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) + await data_Rdb.deleteRdbStore(context, "BackupTest003.db") + } catch (err) { + console.info(TAG + "deleteRdbStore err" + JSON.stringify(err)) + } }) afterAll(async function () { diff --git a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreWithFAContextJsunit.test.js b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreWithFAContextJsunit.test.js index 1a80fc4e34a48d957a86f7b82bcadbd5b92d1ca1..fdb253c7bf333a69103366e128a70723fc9ee59e 100644 --- a/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreWithFAContextJsunit.test.js +++ b/distributeddatamgr/relationalStoretest/relationalStoreJstest/hap/src/main/js/test/RelationalStoreBackupRestoreWithFAContextJsunit.test.js @@ -110,12 +110,16 @@ describe('relationalStoreBackupRestorePromiseTest', function () { RdbStore = await CreatRdbStore(context, STORE_CONFIG) }) - afterEach(async function () { - console.info(TAG + 'afterEach') + afterEach(async function () { + console.info(TAG + 'afterEach') + try { await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name) await data_Rdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) await data_Rdb.deleteRdbStore(context, "BackupTest003.db") - }) + } catch (err) { + console.info(TAG + "deleteRdbStore err" + JSON.stringify(err)) + } + }) afterAll(async function () { console.info(TAG + 'afterAll')