提交 42635cf0 编写于 作者: L liuhaonan2

<liuhaonan8@huawei.com>

Signed-off-by: Nliuhaonan2 <liuhaonan8@huawei.com>
上级 9194ac45
...@@ -784,14 +784,14 @@ describe('kvStoreBackupCallbackJsunittest', function () { ...@@ -784,14 +784,14 @@ describe('kvStoreBackupCallbackJsunittest', function () {
it('SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200', 0, async function (done) { it('SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200', 0, async function (done) {
try { try {
console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 before putdata"); 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"); console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 going putdata");
await publicget(kvStore,"key").then((data) => { await publicget(kvStore,"key").then((data) => {
console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 going getdata" + JSON.stringify(data)); console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0200 going getdata" + JSON.stringify(data));
expect(true).assertEqual(data == "value"); expect(true).assertEqual(data == "value");
done(); done();
}).catch((err) => { }).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(); expect(err).assertFail();
done(); done();
}) })
...@@ -811,14 +811,14 @@ describe('kvStoreBackupCallbackJsunittest', function () { ...@@ -811,14 +811,14 @@ describe('kvStoreBackupCallbackJsunittest', function () {
it('SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300', 0, async function (done) { it('SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300', 0, async function (done) {
try { try {
console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 before putdata"); 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"); console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 going putdata");
await publicget(kvStore,"putcallback").then((data) => { await publicget(kvStore,"putcallback").then((data) => {
console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 going getdata" + JSON.stringify(data)); console.log("SUB_DDM_DKV_KVBACKUP_PUT_CALLBACK_0300 going getdata" + JSON.stringify(data));
expect(true).assertEqual(false); expect(true).assertEqual(false);
done(); done();
}).catch((err) => { }).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); expect(true).assertEqual(true);
done(); done();
}) })
......
...@@ -779,7 +779,7 @@ describe('kvStoreBackupPromiseJsunittest', function () { ...@@ -779,7 +779,7 @@ describe('kvStoreBackupPromiseJsunittest', function () {
expect(true).assertEqual(data == "value"); expect(true).assertEqual(data == "value");
done(); done();
}).catch((err) => { }).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(); expect(err).assertFail();
done(); done();
}) })
...@@ -799,14 +799,14 @@ describe('kvStoreBackupPromiseJsunittest', function () { ...@@ -799,14 +799,14 @@ describe('kvStoreBackupPromiseJsunittest', function () {
it('SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300', 0, async function (done) { it('SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300', 0, async function (done) {
try { try {
console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 before putdata"); 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"); console.log("KvStoreBackupestDbBuckupPutPromiseTest004t going putdata");
await publicget(kvStore,"PutPromise").then((data) => { await publicget(kvStore,"PutPromise").then((data) => {
console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 going getdata" + JSON.stringify(data)); console.log("SUB_DDM_DKV_KVBACKUP_PUT_PROMISE_0300 going getdata" + JSON.stringify(data));
expect(true).assertEqual(JSON.stringify(data) == '{}'); expect(true).assertEqual(JSON.stringify(data) == '{}');
done(); done();
}).catch((err) => { }).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)); console.log(JSON.stringify(err));
expect(true).assertEqual(err.code == 15100004); expect(true).assertEqual(err.code == 15100004);
done(); done();
......
...@@ -21,8 +21,8 @@ const KEY_TEST_LONG_ELEMENT = 'key_test_long'; ...@@ -21,8 +21,8 @@ const KEY_TEST_LONG_ELEMENT = 'key_test_long';
const KEY_TEST_FLOAT_ELEMENT = 'key_test_float'; const KEY_TEST_FLOAT_ELEMENT = 'key_test_float';
const KEY_TEST_BOOLEAN_ELEMENT = 'key_test_boolean'; const KEY_TEST_BOOLEAN_ELEMENT = 'key_test_boolean';
const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const MAX_KEY_LENGTH = 'X'.repeat(32) const MAX_KEY_LENGTH = 'X'.repeat(80)
const MAX_VALUE_LENGTH = 'y'.repeat(8191) const MAX_VALUE_LENGTH = 'y'.repeat(8192)
var mPref; var mPref;
export default function storagePromiseTest() { export default function storagePromiseTest() {
......
...@@ -114,9 +114,13 @@ export default function rdbStoreBackupRestoreCallbackTest() { ...@@ -114,9 +114,13 @@ export default function rdbStoreBackupRestoreCallbackTest() {
afterEach(async function () { afterEach(async function () {
console.info(TAG + 'afterEach') console.info(TAG + 'afterEach')
await dataRdb.deleteRdbStore(context, STORE_CONFIG.name) try {
await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) await dataRdb.deleteRdbStore(context, STORE_CONFIG.name)
await dataRdb.deleteRdbStore(context, "BackupTest003.db") 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 () { afterAll(async function () {
......
...@@ -112,9 +112,13 @@ export default function rdbStoreBackupRestorePromiseTest() { ...@@ -112,9 +112,13 @@ export default function rdbStoreBackupRestorePromiseTest() {
afterEach(async function () { afterEach(async function () {
console.info(TAG + 'afterEach') console.info(TAG + 'afterEach')
await dataRdb.deleteRdbStore(context, STORE_CONFIG.name) try {
await dataRdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) await dataRdb.deleteRdbStore(context, STORE_CONFIG.name)
await dataRdb.deleteRdbStore(context, "BackupTest003.db") 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 () { afterAll(async function () {
......
...@@ -114,9 +114,13 @@ export default function relationalStoreBackupRestoreCallbackTest() { ...@@ -114,9 +114,13 @@ export default function relationalStoreBackupRestoreCallbackTest() {
afterEach(async function () { afterEach(async function () {
console.info(TAG + 'afterEach') console.info(TAG + 'afterEach')
await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name) try {
await data_Rdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name)
await data_Rdb.deleteRdbStore(context, "BackupTest003.db") 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 () { afterAll(async function () {
......
...@@ -110,12 +110,16 @@ describe('relationalStoreBackupRestorePromiseTest', function () { ...@@ -110,12 +110,16 @@ describe('relationalStoreBackupRestorePromiseTest', function () {
RdbStore = await CreatRdbStore(context, STORE_CONFIG) RdbStore = await CreatRdbStore(context, STORE_CONFIG)
}) })
afterEach(async function () { afterEach(async function () {
console.info(TAG + 'afterEach') console.info(TAG + 'afterEach')
try {
await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name) await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name)
await data_Rdb.deleteRdbStore(context, DATABASE_BACKUP_NAME) await data_Rdb.deleteRdbStore(context, DATABASE_BACKUP_NAME)
await data_Rdb.deleteRdbStore(context, "BackupTest003.db") await data_Rdb.deleteRdbStore(context, "BackupTest003.db")
}) } catch (err) {
console.info(TAG + "deleteRdbStore err" + JSON.stringify(err))
}
})
afterAll(async function () { afterAll(async function () {
console.info(TAG + 'afterAll') console.info(TAG + 'afterAll')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册