提交 4fde32c2 编写于 作者: L liangzhenyu123

无效用例整改

Signed-off-by: Nliangzhenyu123 <liangzhenyu6@huawei.com>
上级 c66781ce
...@@ -2337,14 +2337,24 @@ describe('SingleKvStoreCallbackTest', function () { ...@@ -2337,14 +2337,24 @@ describe('SingleKvStoreCallbackTest', function () {
*/ */
it('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULT_CALLBACK_8200', 0, async function (done) { it('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULT_CALLBACK_8200', 0, async function (done) {
console.info('SingleKvStoreCloseResultSetCallbackTest004'); console.info('SingleKvStoreCloseResultSetCallbackTest004');
try { let resultSet = null;
console.info('SingleKvStoreCloseResultSetCallbackTest004 success'); await kvStore.getResultSet('batch_test_string_key').then((result) => {
}catch(e) { console.info('SingleKvStoreCloseResultSetCallbackTest004 getResultSet success');
console.error('SingleKvStoreCloseResultSetCallbackTest004 e ' + `, error code is ${e.code}, message is ${e.message}`); resultSet = result;
expect(null).assertFail(); })
try{
kvStore.closeResultSet("",(err, data) => {
console.info('SingleKvStoreCloseResultSetCallbackTest004 close result finish')
expect(null).assertFail();
})
}catch(err){
expect(err.code).assertEqual("401")
} }
done(); done();
}) });
/** /**
* @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETENTRIES_CALLBACK_8300 * @tc.number SUB_DDM_DKV_SINGLEKVSTORE_GETENTRIES_CALLBACK_8300
......
...@@ -2661,7 +2661,7 @@ describe('SingleKvStorePromiseTest', function () { ...@@ -2661,7 +2661,7 @@ describe('SingleKvStorePromiseTest', function () {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 putBatch success'); console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 putBatch success');
expect(err == undefined).assertTrue(); expect(err == undefined).assertTrue();
}).catch((err) => { }).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0500 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail(); expect(null).assertFail();
}); });
var query = new factory.Query(); var query = new factory.Query();
...@@ -2714,7 +2714,7 @@ describe('SingleKvStorePromiseTest', function () { ...@@ -2714,7 +2714,7 @@ describe('SingleKvStorePromiseTest', function () {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 putBatch success'); console.info('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 putBatch success');
expect(err == undefined).assertTrue(); expect(err == undefined).assertTrue();
}).catch((err) => { }).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_SETSYNCRANGE_PROMISE_0100 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`); console.error('SUB_DDM_DKV_SINGLEKVSTORE_GETSECURITYLEVEL_PROMISE_0600 putBatch fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail(); expect(null).assertFail();
}); });
var query = new factory.Query(); var query = new factory.Query();
...@@ -2850,8 +2850,7 @@ describe('SingleKvStorePromiseTest', function () { ...@@ -2850,8 +2850,7 @@ describe('SingleKvStorePromiseTest', function () {
it('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200', 0, async function (done) { it('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200'); console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200');
try { try {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200 success'); let resultSet = undefined;
let resultSet = null;
await kvStore.getResultSet('batch_test_string_key').then((result) => { await kvStore.getResultSet('batch_test_string_key').then((result) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200 getResultSet success'); console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0200 getResultSet success');
resultSet = result; resultSet = result;
...@@ -2904,13 +2903,24 @@ describe('SingleKvStorePromiseTest', function () { ...@@ -2904,13 +2903,24 @@ describe('SingleKvStorePromiseTest', function () {
* @tc.name Test Js Api SingleKvStoreCloseResultSet testcase 004 * @tc.name Test Js Api SingleKvStoreCloseResultSet testcase 004
*/ */
it('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400', 0, async function (done) { it('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400', 0, async function (done) {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400'); let resultSet = undefined;
let errorInfo = undefined;
await kvStore.getResultSet('batch_test_string_key').then((result) => {
console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400 getResultSet success');
resultSet = result;
}).catch((err) => {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400 getResultSet fail ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail();
});
try { try {
kvStore.closeResultSet("")
console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400 success'); console.info('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400 success');
}catch(e) { }catch(err) {
console.error('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400 e ' + `, error code is ${e.code}, message is ${e.message}`); console.error('SUB_DDM_DKV_SINGLEKVSTORE_CLOSERESULTSET_PROMISE_0400 e ' + `, error code is ${err.code}, message is ${err.message}`);
expect(null).assertFail(); errorInfo = err
} }
expect(errorInfo.code).assertEqual("401");
done(); done();
}) })
......
...@@ -2262,13 +2262,22 @@ describe('singleKvStoreCallbackTest', function () { ...@@ -2262,13 +2262,22 @@ describe('singleKvStoreCallbackTest', function () {
* @tc.desc Test Js Api SingleKvStore.CloseResultSet() testcase 104 * @tc.desc Test Js Api SingleKvStore.CloseResultSet() testcase 104
*/ */
it('testSingleKvStoreCloseResultSet104', 0, async function (done) { it('testSingleKvStoreCloseResultSet104', 0, async function (done) {
console.info('testSingleKvStoreCloseResultSet104'); console.info('SingleKvStoreCloseResultSetCallbackTest004');
try { let resultSet = null;
console.info('testSingleKvStoreCloseResultSet104 success'); await kvStore.getResultSet('batch_test_string_key').then((result) => {
}catch(e) { console.info('SingleKvStoreCloseResultSetCallbackTest004 getResultSet success');
console.info('testSingleKvStoreCloseResultSet104 e ' + e); resultSet = result;
expect(null).assertFail(); })
}
kvStore.closeResultSet("",(err, data) => {
if(err != undefined){
console.info(`SingleKvStoreCloseResultSetCallbackTest004 close result error, error is ${err}`)
}else{
expect(null).assertFail();
}
done();
})
await sleep(1000)
done(); done();
}) })
......
...@@ -2470,12 +2470,12 @@ describe('singleKvStorePromiseTest', function () { ...@@ -2470,12 +2470,12 @@ describe('singleKvStorePromiseTest', function () {
*/ */
it('testSingleKvStoreCloseResultSet004', 0, async function (done) { it('testSingleKvStoreCloseResultSet004', 0, async function (done) {
console.info('testSingleKvStoreCloseResultSet004'); console.info('testSingleKvStoreCloseResultSet004');
try { await kvStore.closeResultSet("").then((data) => {
console.info('testSingleKvStoreCloseResultSet004 success'); console.info("testSingleKvStoreCloseResultSet004 close resultSet success")
}catch(e) {
console.info('testSingleKvStoreCloseResultSet004 e ' + e);
expect(null).assertFail(); expect(null).assertFail();
} }).catch((err) => {
console.info(`testSingleKvStoreCloseResultSet004 close resultSet error, error is ${err}`)
})
done(); done();
}) })
......
...@@ -34,13 +34,13 @@ describe('rdbStoreDistributedTest', function () { ...@@ -34,13 +34,13 @@ describe('rdbStoreDistributedTest', function () {
}) })
beforeEach(async function () { beforeEach(async function () {
rdbStore = await dataRdb.getRdbStore(context, config, 1); rdbStore = await dataRdb.getRdbStoreV9(context, config, 1);
await rdbStore.executeSql(CREATE_TABLE_TEST, null) await rdbStore.executeSql(CREATE_TABLE_TEST, null)
console.info(TAG + 'beforeEach') console.info(TAG + 'beforeEach')
}) })
afterEach(async function () { afterEach(async function () {
await dataRdb.deleteRdbStore(context, STORE_NAME); await dataRdb.deleteRdbStoreV9(context, STORE_NAME);
console.info(TAG + 'afterEach') console.info(TAG + 'afterEach')
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册