KvStoreResultSetJsunit.test.js 41.4 KB
Newer Older
1
/*
2
 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 4 5 6 7 8 9 10 11 12 13 14 15
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
X
xsterling 已提交
16
import factory from '@ohos.data.distributedData';
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128

const TEST_BUNDLE_NAME = 'ohos.acts.distributeddatamgr';
const TEST_STORE_ID = 'storeId';
var kvManager = null;
var kvStore = null;
var resultSet = null;

describe('KvStoreResultSetTest', function() {
    const config = {
        bundleName : TEST_BUNDLE_NAME,
        userInfo : {
            userId : '0',
            userType : factory.UserType.SAME_USER_ID
        }
    }

    const options = {
        createIfMissing : true,
        encrypt : false,
        backup : false,
        autoSync : true,
        kvStoreType : factory.KVStoreType.SINGLE_VERSION,
        schema : '',
        securityLevel : factory.SecurityLevel.S2,
    }

    beforeAll(async function (done) {
        console.log('beforeAll');
        console.log('beforeAll config:' + JSON.stringify(config));
        await factory.createKVManager(config).then((manager) => {
            kvManager = manager;
            console.log('beforeAll createKVManager success');
        }).catch((err) => {
            console.log('beforeAll createKVManager err ' + err);
        });
        await kvManager.getAllKVStoreId(TEST_BUNDLE_NAME).then(async (data) => {
            console.log('beforeAll getAllKVStoreId size = ' + data.length);
            for (var i = 0; i < data.length; i++) {
                await kvManager.deleteKVStore(TEST_BUNDLE_NAME, data[i]).then(() => {
                    console.log('beforeAll deleteKVStore success ' + data[i]);
                }).catch((err) => {
                    console.log('beforeAll deleteKVStore store: ' + data[i]);
                    console.log('beforeAll deleteKVStore error ' + err);
                });
            }
        }).catch((err) => {
            console.log('beforeAll getAllKVStoreId err ' + err);
        });

        console.log('beforeAll end');
        done();
    })

    afterAll(async function (done) {
        console.log('afterAll');
        kvManager = null;
        kvStore = null;
        done();
    })

    beforeEach(async function (done) {
        console.log('beforeEach');
        await kvManager.getKVStore(TEST_STORE_ID, options).then((store) => {
            kvStore = store;
            console.log('beforeEach getKVStore success');
        }).catch((err) => {
            console.log('beforeEach getKVStore err ' + err);
        });
        let entries = [];
        for (var i = 0; i < 10; i++) {
            var key = 'batch_test_string_key';
            var entry = {
                key : key + i,
                value : {
                    type : factory.ValueType.STRING,
                    value : 'batch_test_string_value'
                }
            }
            entries.push(entry);
        }
        await kvStore.putBatch(entries).then(async (err) => {
            console.log('beforeEach putBatch success');
        }).catch((err) => {
            console.log('beforeEach putBatch fail ' + err);
        });
        await kvStore.getResultSet('batch_test_string_key').then((result) => {
            console.log('beforeEach getResultSet success');
            resultSet = result;
        }).catch((err) => {
            console.log('beforeEach getResultSet fail ' + err);
        });
        console.log('beforeEach end');
        done();
    })

    afterEach(async function (done) {
        console.log('afterEach');
        await kvStore.closeResultSet(resultSet).then((err) => {
            console.log('afterEach closeResultSet success');
        }).catch((err) => {
            console.log('afterEach closeResultSet fail ' + err);
        });
        await kvManager.closeKVStore(TEST_BUNDLE_NAME, TEST_STORE_ID, kvStore).then(async () => {
            console.log('afterEach closeKVStore success');
            await kvManager.deleteKVStore(TEST_BUNDLE_NAME, TEST_STORE_ID).then(() => {
                console.log('afterEach deleteKVStore success');
            }).catch((err) => {
                console.log('afterEach deleteKVStore err ' + err);
            });
        }).catch((err) => {
            console.log('afterEach closeKVStore err ' + err);
        });
X
xsterling 已提交
129 130
        kvStore = null;
        resultSet = null;
131 132 133
        done();
    })

134 135 136 137 138
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETCOUNT_0100
     * @tc.name [JS-API8]KvStoreResultSet.GetCount()
     * @tc.desc Test Js Api KvStoreResultSet.GetCount()testcase 001
     */
139 140 141 142 143 144 145 146 147 148 149 150
    it('testKvStoreResultSetGetCount001', 0, async function(done) {
        try {
            var count = resultSet.getCount();
            console.log("testKvStoreResultSetGetCount001 getCount " + count);
            expect(count == 10).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetGetCount001 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

151 152 153 154 155
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETCOUNT_0200
     * @tc.name [JS-API8]KvStoreResultSet.GetCount()
     * @tc.desc Test Js Api KvStoreResultSet.GetCount()testcase 002
     */
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
    it('testKvStoreResultSetGetCount002', 0, async function(done) {
        try {
            var rs;
            await kvStore.getResultSet('test').then((result) => {
                console.log('testKvStoreResultSetGetCount002 getResultSet success');
                rs = result;
                expect(rs.getCount() == 0).assertTrue();
            }).catch((err) => {
                console.log('testKvStoreResultSetGetCount002 getResultSet fail ' + err);
                expect(null).assertFail();
            });
            await kvStore.closeResultSet(rs).then((err) => {
                console.log('testKvStoreResultSetGetCount002 closeResultSet success');
            }).catch((err) => {
                console.log('testKvStoreResultSetGetCount002 closeResultSet fail ' + err);
                expect(null).assertFail();
            });
        } catch (e) {
            console.log('testKvStoreResultSetGetCount002 e ' + e);
            expect(null).assertFail();
        }
        done();
    })

180 181 182 183 184
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETCOUNT_0300
     * @tc.name [JS-API8]KvStoreResultSet.GetCount()
     * @tc.desc Test Js Api KvStoreResultSet.GetCount()testcase 003
     */
185 186 187 188 189 190 191 192 193 194 195
    it('testKvStoreResultSetGetCount003', 0, async function(done) {
        try {
            var count = resultSet.getCount(123);
            console.log("testKvStoreResultSetGetCount003 getCount " + count);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetGetCount003 fail " + e);
        }
        done();
    })

196 197 198 199 200
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETCOUNT_0400
     * @tc.name [JS-API8]KvStoreResultSet.GetCount()
     * @tc.desc Test Js Api KvStoreResultSet.GetCount()testcase 004
     */
201 202 203 204 205 206 207 208 209 210 211
    it('testKvStoreResultSetGetCount004', 0, async function(done) {
        try {
            var count = resultSet.getCount(123, 'test_string');
            console.log("testKvStoreResultSetGetCount004 getCount " + count);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetGetCount004 fail " + e);
        }
        done();
    })

212 213 214 215 216
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETPOSITION_0100
     * @tc.name [JS-API8]KvStoreResultSet.GetPosition()
     * @tc.desc Test Js Api KvStoreResultSet.GetPosition()testcase 001
     */
217 218
    it('testKvStoreResultSetGetPosition001', 0, async function(done) {
        try {
Y
yanglifeng 已提交
219 220 221
            var position = resultSet.getPosition();
            console.log("testKvStoreResultSetGetPosition001 getPosition " + position);
            expect(position == -1).assertTrue();
222 223 224 225 226 227 228
        } catch (e) {
            console.log("testKvStoreResultSetGetPosition001 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

229 230 231 232 233
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETPOSITION_0200
     * @tc.name [JS-API8]KvStoreResultSet.GetPosition()
     * @tc.desc Test Js Api KvStoreResultSet.GetPosition()testcase 002
     */
234 235
    it('testKvStoreResultSetGetPosition002', 0, async function(done) {
        try {
Y
yanglifeng 已提交
236 237 238
            var position = resultSet.getPosition();
            console.log("testKvStoreResultSetGetPosition002 getPosition " + position);
            expect(position).assertEqual(-1);
239 240
            var flag = resultSet.moveToLast();
            expect(flag).assertTrue();
Y
yanglifeng 已提交
241 242
            position = resultSet.getPosition();
            expect(position).assertEqual(9);
243 244 245 246 247 248 249
        } catch (e) {
            console.log("testKvStoreResultSetGetPosition002 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

250 251 252 253 254
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETPOSITION_0300
     * @tc.name [JS-API8]KvStoreResultSet.GetPosition()
     * @tc.desc Test Js Api KvStoreResultSet.GetPosition()testcase 003
     */
255 256
    it('testKvStoreResultSetGetPosition003', 0, async function(done) {
        try {
Y
yanglifeng 已提交
257 258
            var position = resultSet.getPosition(123);
            console.log("testKvStoreResultSetGetPosition003 getPosition " + position);
259 260 261 262 263 264 265
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetGetPosition003 fail " + e);
        }
        done();
    })

266 267 268 269 270
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETPOSITION_0400
     * @tc.name [JS-API8]KvStoreResultSet.GetPosition()
     * @tc.desc Test Js Api KvStoreResultSet.GetPosition()testcase 004
     */
271 272
    it('testKvStoreResultSetGetPosition004', 0, async function(done) {
        try {
Y
yanglifeng 已提交
273 274
            var position = resultSet.getPosition(123, 'test_string');
            console.log("testKvStoreResultSetGetPosition004 getPosition " + position);
275 276 277 278 279 280 281
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetGetPosition004 fail " + e);
        }
        done();
    })

282 283 284 285 286
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOFIRST_0100
     * @tc.name [JS-API8]KvStoreResultSet.MoveToFirst()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToFirst()testcase 001
     */
287 288 289 290 291 292 293 294 295 296 297 298
    it('testKvStoreResultSetMoveToFirst001', 0, async function(done) {
        try {
            var moved = resultSet.moveToFirst();
            console.log("testKvStoreResultSetMoveToFirst001 moveToFirst " + moved);
            expect(moved).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToFirst001 fail " + e);
        }
        done();
    })

299 300 301 302 303
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOFIRST_0200
     * @tc.name [JS-API8]KvStoreResultSet.MoveToFirst()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToFirst()testcase 002
     */
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
    it('testKvStoreResultSetMoveToFirst002', 0, async function(done) {
        try {
            var moved = resultSet.moveToFirst();
            console.log("testKvStoreResultSetMoveToFirst002 moveToFirst " + moved);
            expect(moved).assertTrue();
            var pos = resultSet.getPosition();
            console.log("testKvStoreResultSetMoveToFirst002 getPosition " + pos);
            expect(pos == 0).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToFirst002 fail " + e);
        }
        done();
    })

319 320 321 322 323
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOFIRST_0300
     * @tc.name [JS-API8]KvStoreResultSet.MoveToFirst()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToFirst()testcase 003
     */
324 325 326 327 328 329 330 331 332 333 334
    it('testKvStoreResultSetMoveToFirst003', 0, async function(done) {
        try {
            var moved = resultSet.moveToFirst(123);
            console.log("testKvStoreResultSetMoveToFirst003 moveToFirst " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToFirst003 fail " + e);
        }
        done();
    })

335 336 337 338 339
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOFIRST_0400
     * @tc.name [JS-API8]KvStoreResultSet.MoveToFirst()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToFirst()testcase 004
     */
340 341 342 343 344 345 346 347 348 349 350
    it('testKvStoreResultSetMoveToFirst004', 0, async function(done) {
        try {
            var moved = resultSet.moveToFirst(123, 'test_string');
            console.log("testKvStoreResultSetMoveToFirst004 moveToFirst " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToFirst004 fail " + e);
        }
        done();
    })

351 352 353 354 355
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOFIRST_0500
     * @tc.name [JS-API8]KvStoreResultSet.MoveToFirst()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToFirst()testcase 005
     */
356 357 358 359 360 361 362 363 364 365 366 367 368
    it('testKvStoreResultSetMoveToFirst005', 0, async function(done) {
        try {
            var moved = resultSet.moveToLast();
            console.log("testKvStoreResultSetMoveToFirst004 moveToFirst " + moved);
            expect(moved && (resultSet.getPosition() == 9)).assertTrue();
            moved = resultSet.moveToFirst();
            expect(moved && (resultSet.getPosition() == 0)).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToFirst004 fail " + e);
        }
        done();
    })

369 370 371 372 373
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOLAST_0100
     * @tc.name [JS-API8]KvStoreResultSet.MoveToLast()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToLast()testcase 001
     */
374 375 376 377 378 379 380 381 382 383 384 385
    it('testKvStoreResultSetMoveToLast001', 0, async function(done) {
        try {
            var moved = resultSet.moveToLast();
            console.log("testKvStoreResultSetMoveToLast001 moveToLast " + moved);
            expect(moved).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToLast001 fail " + e);
        }
        done();
    })

386 387 388 389 390
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOLAST_0200
     * @tc.name [JS-API8]KvStoreResultSet.MoveToLast()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToLast()testcase 002
     */
391 392 393 394 395 396 397 398 399 400 401 402
    it('testKvStoreResultSetMoveToLast002', 0, async function(done) {
        try {
            var moved = resultSet.moveToLast();
            console.log("testKvStoreResultSetMoveToLast002 moveToLast " + moved);
            expect(moved && (resultSet.getPosition() == 9)).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToLast002 fail " + e);
        }
        done();
    })

403 404 405 406 407
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOLAST_0300
     * @tc.name [JS-API8]KvStoreResultSet.MoveToLast()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToLast()testcase 003
     */
408 409 410 411 412 413 414 415 416 417 418
    it('testKvStoreResultSetMoveToLast003', 0, async function(done) {
        try {
            var moved = resultSet.moveToLast(123);
            console.log("testKvStoreResultSetMoveToLast003 moveToLast " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToLast003 fail " + e);
        }
        done();
    })

419 420 421 422 423
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOLAST_0400
     * @tc.name [JS-API8]KvStoreResultSet.MoveToLast()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToLast()testcase 004
     */
424 425 426 427 428 429 430 431 432 433 434
    it('testKvStoreResultSetMoveToLast004', 0, async function(done) {
        try {
            var moved = resultSet.moveToLast(123, 'test_string');
            console.log("testKvStoreResultSetMoveToLast004 moveToLast " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToLast004 fail " + e);
        }
        done();
    })

435 436 437 438 439
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETONEXT_0100
     * @tc.name [JS-API8]KvStoreResultSet.MoveToNext()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToNext()testcase 001
     */
440 441 442 443 444 445 446 447 448 449 450 451
    it('testKvStoreResultSetMoveToNext001', 0, async function(done) {
        try {
            var moved = resultSet.moveToNext();
            console.log("testKvStoreResultSetMoveToNext001 moveToNext " + moved);
            expect(moved && (resultSet.getPosition() == 0)).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToNext001 fail " + e);
        }
        done();
    })

452 453 454 455 456
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETONEXT_0200
     * @tc.name [JS-API8]KvStoreResultSet.MoveToNext()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToNext()testcase 002
     */
457 458 459 460 461 462 463 464 465 466 467 468 469 470
    it('testKvStoreResultSetMoveToNext002', 0, async function(done) {
        try {
            var moved = resultSet.moveToNext();
            console.log("testKvStoreResultSetMoveToNext002 moveToNext " + moved);
            expect(moved && (resultSet.getPosition() == 0)).assertTrue();
            moved = resultSet.moveToNext();
            expect(moved && (resultSet.getPosition() == 1)).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToNext002 fail " + e);
        }
        done();
    })

471 472 473 474 475
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETONEXT_0300
     * @tc.name [JS-API8]KvStoreResultSet.MoveToNext()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToNext()testcase 003
     */
476 477 478 479 480 481 482 483 484 485 486
    it('testKvStoreResultSetMoveToNext003', 0, async function(done) {
        try {
            var moved = resultSet.moveToNext(123);
            console.log("testKvStoreResultSetMoveToNext003 moveToNext " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToNext003 fail " + e);
        }
        done();
    })

487 488 489 490 491
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETONEXT_0400
     * @tc.name [JS-API8]KvStoreResultSet.MoveToNext()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToNext()testcase 004
     */
492 493 494 495 496 497 498 499 500 501 502
    it('testKvStoreResultSetMoveToNext004', 0, async function(done) {
        try {
            var moved = resultSet.moveToNext(123, 'test_string');
            console.log("testKvStoreResultSetMoveToNext004 moveToNext " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToNext004 fail " + e);
        }
        done();
    })

503 504 505 506 507
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPREVIOUS_0100
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPrevious()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPrevious()testcase 001
     */
508 509 510 511 512 513 514 515 516 517 518 519
    it('testKvStoreResultSetMoveToPrevious001', 0, async function(done) {
        try {
            var moved = resultSet.moveToPrevious();
            console.log("testKvStoreResultSetMoveToPrevious001 moveToPrevious " + moved);
            expect(!moved).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetMoveToPrevious001 fail " + e);
        }
        done();
    })

520 521 522 523 524
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPREVIOUS_0200
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPrevious()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPrevious()testcase 002
     */
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
    it('testKvStoreResultSetMoveToPrevious002', 0, async function(done) {
        try {
            var moved = resultSet.moveToFirst();
            expect(moved && (resultSet.getPosition() == 0)).assertTrue();
            moved = resultSet.moveToNext();
            console.log("testKvStoreResultSetMoveToPrevious002 moveToNext " + moved);
            expect(moved && (resultSet.getPosition() == 1)).assertTrue();
            moved = resultSet.moveToPrevious();
            console.log("testKvStoreResultSetMoveToPrevious002 moveToPrevious " + moved);
            expect(moved && (resultSet.getPosition() == 0)).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPrevious002 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

542 543 544 545 546
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPREVIOUS_0300
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPrevious()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPrevious()testcase 003
     */
547 548 549 550 551 552 553 554 555 556 557
    it('testKvStoreResultSetMoveToPrevious003', 0, async function(done) {
        try {
            var moved = resultSet.moveToPrevious(123);
            console.log("testKvStoreResultSetMoveToPrevious003 moveToPrevious " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPrevious003 fail " + e);
        }
        done();
    })

558 559 560 561 562
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPREVIOUS_0400
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPrevious()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPrevious()testcase 004
     */
563 564 565 566 567 568 569 570 571 572 573
    it('testKvStoreResultSetMoveToPrevious004', 0, async function(done) {
        try {
            var moved = resultSet.moveToPrevious(123, 'test_string');
            console.log("testKvStoreResultSetMoveToPrevious004 moveToPrevious " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPrevious004 fail " + e);
        }
        done();
    })

574 575 576 577 578
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPREVIOUS_0500
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPrevious()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPrevious()testcase 005
     */
579 580 581 582 583 584
    it('testKvStoreResultSetMoveToPrevious005', 0, async function(done) {
        try {
            var moved = resultSet.moveToFirst();
            expect(moved && (resultSet.getPosition() == 0)).assertTrue();
            moved = resultSet.moveToPrevious();
            console.log("testKvStoreResultSetMoveToPrevious005 from 0 to -1 return" + moved);
X
xsterling 已提交
585
            expect(moved == false).assertTrue();
586 587 588 589
            console.log("testKvStoreResultSetMoveToPrevious005 from 0 to " + resultSet.getPosition());
            expect(-1).assertEqual(resultSet.getPosition());
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPrevious005 fail " + e);
X
xsterling 已提交
590
            expect(null).assertFail();
591 592 593
        }
        done();
    })
594 595 596 597 598 599

    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVE_0100
     * @tc.name [JS-API8]KvStoreResultSet.Move()
     * @tc.desc Test Js Api KvStoreResultSet.Move()testcase 001
     */
600 601 602 603 604 605 606 607 608 609 610
    it('testKvStoreResultSetMove001', 0, async function(done) {
        try {
            var moved = resultSet.move();
            console.log("testKvStoreResultSetMove001 move " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMove001 fail " + e);
        }
        done();
    })

611 612 613 614 615
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVE_0200
     * @tc.name [JS-API8]KvStoreResultSet.Move()
     * @tc.desc Test Js Api KvStoreResultSet.Move()testcase 002
     */
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
    it('testKvStoreResultSetMove002', 0, async function(done) {
        try {
            resultSet.moveToFirst();
            expect(resultSet.getPosition() == 0).assertTrue();
            var moved = resultSet.move(3);
            console.log("testKvStoreResultSetMove002 move " + moved);
            expect(moved).assertTrue();
            expect(3).assertEqual(resultSet.getPosition());
        } catch (e) {
            console.log("testKvStoreResultSetMove002 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

631 632 633 634 635
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVE_0300
     * @tc.name [JS-API8]KvStoreResultSet.Move()
     * @tc.desc Test Js Api KvStoreResultSet.Move()testcase 003
     */
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
    it('testKvStoreResultSetMove003', 0, async function(done) {
        try {
            expect(resultSet.getPosition() == -1).assertTrue();
            var moved = resultSet.move(3);
            console.log("testKvStoreResultSetMove003 move " + moved);
            expect(moved && (resultSet.getPosition() == 2)).assertTrue();
            moved = resultSet.move(2);
            console.log("testKvStoreResultSetMove003 move " + moved);
            expect(moved && (resultSet.getPosition() == 4)).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetMove003 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

652 653 654 655 656
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVE_0400
     * @tc.name [JS-API8]KvStoreResultSet.Move()
     * @tc.desc Test Js Api KvStoreResultSet.Move()testcase 004
     */
657 658 659 660 661 662 663 664 665 666 667
    it('testKvStoreResultSetMove004', 0, async function(done) {
        try {
            var moved = resultSet.move(3, 'test_string');
            console.log("testKvStoreResultSetMove004 move " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMove004 fail " + e);
        }
        done();
    })

668 669 670 671 672
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPOSITION_0100
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPosition()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPosition()testcase 001
     */
673 674 675 676 677 678 679 680 681 682 683
    it('testKvStoreResultSetMoveToPosition001', 0, async function(done) {
        try {
            var moved = resultSet.moveToPosition();
            console.log("testKvStoreResultSetMoveToPosition001 moveToPosition " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPosition001 fail " + e);
        }
        done();
    })

684 685 686 687 688
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPOSITION_0200
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPosition()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPosition()testcase 002
     */
689 690 691 692 693 694 695 696 697 698 699
    it('testKvStoreResultSetMoveToPosition002', 0, async function(done) {
        try {
            var moved = resultSet.moveToPosition(1, 'test_string');
            console.log("testKvStoreResultSetMoveToPosition002 moveToPosition " + moved);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPosition002 fail " + e);
        }
        done();
    })

700 701 702 703 704
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPOSITION_0300
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPosition()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPosition()testcase 003
     */
705 706 707 708 709 710 711 712 713 714 715
    it('testKvStoreResultSetMoveToPosition003', 0, async function(done) {
        try {
            var moved = resultSet.moveToPosition(5);
            console.log("testKvStoreResultSetMoveToPosition003 moveToPosition " + moved);
            expect(moved && (resultSet.getPosition() == 5)).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPosition003 fail " + e);
        }
        done();
    })

716 717 718 719 720
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_MOVETOPOSITION_0400
     * @tc.name [JS-API8]KvStoreResultSet.MoveToPosition()
     * @tc.desc Test Js Api KvStoreResultSet.MoveToPosition()testcase 004
     */
721 722 723 724 725 726 727 728 729 730 731 732 733 734
    it('testKvStoreResultSetMoveToPosition004', 0, async function(done) {
        try {
            var moved = resultSet.move(3);
            console.log("testKvStoreResultSetMoveToPosition004 moveToPosition " + moved);
            expect(moved && (resultSet.getPosition() == 2)).assertTrue();
            moved = resultSet.moveToPosition(5);
            console.log("testKvStoreResultSetMoveToPosition004 moveToPosition " + moved);
            expect(moved && (resultSet.getPosition() == 5)).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetMoveToPosition004 fail " + e);
        }
        done();
    })

735 736 737 738 739
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISFIRST_0100
     * @tc.name [JS-API8]KvStoreResultSet.IsFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsFirst()testcase 001
     */
740 741 742 743 744 745 746 747 748 749 750 751
    it('testKvStoreResultSetIsFirst001', 0, async function(done) {
        try {
            var flag = resultSet.isFirst();
            console.log("testKvStoreResultSetIsFirst001 isFirst " + flag);
            expect(!flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsFirst001 fail " + e);
        }
        done();
    })

752 753 754 755 756
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISFIRST_0200
     * @tc.name [JS-API8]KvStoreResultSet.IsFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsFirst()testcase 002
     */
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772
    it('testKvStoreResultSetIsFirst002', 0, async function(done) {
        try {
            var flag = resultSet.isFirst();
            console.log("testKvStoreResultSetIsFirst002 isFirst " + flag);
            expect(!flag).assertTrue();
            resultSet.move(3);
            flag = resultSet.isFirst();
            console.log("testKvStoreResultSetIsFirst002 isFirst " + flag);
            expect(!flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsFirst002 fail " + e);
        }
        done();
    })

773 774 775 776 777
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISFIRST_0300
     * @tc.name [JS-API8]KvStoreResultSet.IsFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsFirst()testcase 003
     */
778 779 780 781 782 783 784 785 786 787 788
    it('testKvStoreResultSetIsFirst003', 0, async function(done) {
        try {
            var flag = resultSet.isFirst(1);
            console.log("testKvStoreResultSetIsFirst003 isFirst " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsFirst003 fail " + e);
        }
        done();
    })

789 790 791 792 793
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISFIRST_0400
     * @tc.name [JS-API8]KvStoreResultSet.IsFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsFirst()testcase 004
     */
794 795 796 797 798 799 800 801 802 803 804
    it('testKvStoreResultSetIsFirst004', 0, async function(done) {
        try {
            var flag = resultSet.isFirst(1, 'test_string');
            console.log("testKvStoreResultSetIsFirst004 isFirst " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsFirst004 fail " + e);
        }
        done();
    })

805 806 807 808 809
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISLAST_0100
     * @tc.name [JS-API8]KvStoreResultSet.IsLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsLast()testcase 001
     */
810 811 812 813 814 815 816 817 818 819 820 821
    it('testKvStoreResultSetIsLast001', 0, async function(done) {
        try {
            var flag = resultSet.isLast();
            console.log("testKvStoreResultSetIsLast001 isLast " + flag);
            expect(!flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsFirst004 fail " + e);
        }
        done();
    })

822 823 824 825 826
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISLAST_0200
     * @tc.name [JS-API8]KvStoreResultSet.IsLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsLast()testcase 002
     */
827 828 829 830 831 832 833 834 835 836 837 838 839
    it('testKvStoreResultSetIsLast002', 0, async function(done) {
        try {
            resultSet.moveToLast();
            var flag = resultSet.isLast();
            console.log("testKvStoreResultSetIsLast002 isLast " + flag);
            expect(flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsLast002 fail " + e);
        }
        done();
    })

840 841 842 843 844
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISLAST_0300
     * @tc.name [JS-API8]KvStoreResultSet.IsLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsLast()testcase 003
     */
845 846 847 848 849 850 851 852 853 854 855
    it('testKvStoreResultSetIsLast003', 0, async function(done) {
        try {
            var flag = resultSet.isLast(1);
            console.log("testKvStoreResultSetIsLast003 isLast " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsLast003 fail " + e);
        }
        done();
    })

856 857 858 859 860
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISLAST_0400
     * @tc.name [JS-API8]KvStoreResultSet.IsLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsLast()testcase 004
     */
861 862 863 864 865 866 867 868 869 870 871
    it('testKvStoreResultSetIsLast004', 0, async function(done) {
        try {
            var flag = resultSet.isLast(1, 'test_string');
            console.log("testKvStoreResultSetIsLast004 isLast " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsLast004 fail " + e);
        }
        done();
    })

872 873 874 875 876
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISBEFOREFIRST_0100
     * @tc.name [JS-API8]KvStoreResultSet.IsBeforeFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsBeforeFirst()testcase 001
     */
877 878 879 880 881 882 883 884 885 886 887 888
    it('testKvStoreResultSetIsBeforeFirst001', 0, async function(done) {
        try {
            var flag = resultSet.isBeforeFirst();
            console.log("testKvStoreResultSetIsBeforeFirst001 isBeforeFirst " + flag);
            expect(flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsBeforeFirst001 fail " + e);
        }
        done();
    })

889 890 891 892 893
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISBEFOREFIRST_0200
     * @tc.name [JS-API8]KvStoreResultSet.IsBeforeFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsBeforeFirst()testcase 002
     */
894 895 896 897 898 899 900 901 902 903 904 905 906 907
    it('testKvStoreResultSetIsBeforeFirst002', 0, async function(done) {
        try {
            var moved = resultSet.moveToPrevious();
            expect(!moved).assertTrue();
            var flag = resultSet.isBeforeFirst();
            console.log("testKvStoreResultSetIsBeforeFirst002 isBeforeFirst " + flag);
            expect(flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsBeforeFirst002 fail " + e);
        }
        done();
    })

908 909 910 911 912
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISBEFOREFIRST_0300
     * @tc.name [JS-API8]KvStoreResultSet.IsBeforeFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsBeforeFirst()testcase 003
     */
913 914 915 916 917 918 919 920 921 922 923
    it('testKvStoreResultSetIsBeforeFirst003', 0, async function(done) {
        try {
            var flag = resultSet.isBeforeFirst(1);
            console.log("testKvStoreResultSetIsBeforeFirst003 isBeforeFirst " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsBeforeFirst003 fail " + e);
        }
        done();
    })

924 925 926 927 928
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISBEFOREFIRST_0400
     * @tc.name [JS-API8]KvStoreResultSet.IsBeforeFirst()
     * @tc.desc Test Js Api KvStoreResultSet.IsBeforeFirst()testcase 004
     */
929 930 931 932 933 934 935 936 937 938 939
    it('testKvStoreResultSetIsBeforeFirst004', 0, async function(done) {
        try {
            var flag = resultSet.isBeforeFirst(1, 'test_string');
            console.log("testKvStoreResultSetIsBeforeFirst004 isBeforeFirst " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsBeforeFirst004 fail " + e);
        }
        done();
    })

940 941 942 943 944
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISAFTERLAST_0100
     * @tc.name [JS-API8]KvStoreResultSet.IsAfterLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsAfterLast()testcase 001
     */
945 946 947 948 949 950 951 952 953 954 955 956
    it('testKvStoreResultSetIsAfterLast001', 0, async function(done) {
        try {
            var flag = resultSet.isAfterLast();
            console.log("testKvStoreResultSetIsAfterLast001 isAfterLast " + flag);
            expect(!flag).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetIsAfterLast001 fail " + e);
        }
        done();
    })

957 958 959 960 961
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISAFTERLAST_0200
     * @tc.name [JS-API8]KvStoreResultSet.IsAfterLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsAfterLast()testcase 002
     */
962 963 964 965 966 967 968
    it('testKvStoreResultSetIsAfterLast002', 0, async function(done) {
        try {
            var moved = resultSet.moveToLast();
            console.log("testKvStoreResultSetIsAfterLast002  moveToLast  moved=" + moved);
            expect(moved).assertTrue();
            moved = resultSet.moveToNext();
            console.log("testKvStoreResultSetIsAfterLast002  moveToNext  moved=" + moved);
X
xsterling 已提交
969
            expect(moved == false).assertTrue();
970 971 972 973 974 975 976 977 978 979
            var flag = resultSet.isAfterLast();
            console.log("testKvStoreResultSetIsAfterLast002  isAfterLast true=" + flag);
            expect(flag).assertTrue();
        } catch (e) {
            console.log("testKvStoreResultSetIsAfterLast002 fail " + e);
            expect(null).assertFail();
        }
        done();
    })

980 981 982 983 984
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISAFTERLAST_0300
     * @tc.name [JS-API8]KvStoreResultSet.IsAfterLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsAfterLast()testcase 003
     */
985 986 987 988 989 990 991 992 993 994 995
    it('testKvStoreResultSetIsAfterLast003', 0, async function(done) {
        try {
            var flag = resultSet.isAfterLast(1);
            console.log("testKvStoreResultSetIsAfterLast003 isAfterLast " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsAfterLast003 fail " + e);
        }
        done();
    })

996 997 998 999 1000
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_ISAFTERLAST_0400
     * @tc.name [JS-API8]KvStoreResultSet.IsAfterLast()
     * @tc.desc Test Js Api KvStoreResultSet.IsAfterLast()testcase 004
     */
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011
    it('testKvStoreResultSetIsAfterLast004', 0, async function(done) {
        try {
            var flag = resultSet.isAfterLast(1, 'test_string');
            console.log("testKvStoreResultSetIsAfterLast004 isAfterLast " + flag);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetIsAfterLast004 fail " + e);
        }
        done();
    })

1012 1013 1014 1015 1016
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETENTRY_0100
     * @tc.name [JS-API8]KvStoreResultSet.GetEntry()
     * @tc.desc Test Js Api KvStoreResultSet.GetEntry()testcase 001
     */
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
    it('testKvStoreResultSetGetEntry001', 0, async function(done) {
        try {
            var moved = resultSet.moveToNext();
            var entry = resultSet.getEntry();
            console.log("testKvStoreResultSetGetEntry001 getEntry " + entry);
            expect(moved && (entry.key == 'batch_test_string_key0')).assertTrue();
            expect(moved && (entry.value.value == 'batch_test_string_value')).assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetGetEntry001 fail " + e);
        }
        done();
    })

1031 1032 1033 1034 1035
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETENTRY_0200
     * @tc.name [JS-API8]KvStoreResultSet.GetEntry()
     * @tc.desc Test Js Api KvStoreResultSet.GetEntry()testcase 002
     */
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
    it('testKvStoreResultSetGetEntry002', 0, async function(done) {
        try {
            var moved = resultSet.moveToNext();
            var entry = resultSet.getEntry();
            console.log("testKvStoreResultSetGetEntry002 getEntry " + entry);
            expect(entry.key == 'batch_test_string_key0').assertTrue();
            expect(entry.value.value == 'batch_test_string_value').assertTrue();
            moved = resultSet.moveToNext();
            expect(moved).assertTrue();
            entry = resultSet.getEntry();
            console.log("testKvStoreResultSetGetEntry002 getEntry " + entry);
            expect(entry.key == 'batch_test_string_key1').assertTrue();
            expect(entry.value.value == 'batch_test_string_value').assertTrue();
        } catch (e) {
            expect(null).assertFail();
            console.log("testKvStoreResultSetGetEntry002 fail " + e);
        }
        done();
    })

1056 1057 1058 1059 1060
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETENTRY_0300
     * @tc.name [JS-API8]KvStoreResultSet.GetEntry()
     * @tc.desc Test Js Api KvStoreResultSet.GetEntry()testcase 003
     */
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071
    it('testKvStoreResultSetGetEntry003', 0, async function(done) {
        try {
            var entry = resultSet.getEntry(1);
            console.log("testKvStoreResultSetGetEntry003 getEntry " + entry);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetGetEntry003 fail " + e);
        }
        done();
    })

1072 1073 1074 1075 1076
    /**
     * @tc.number SUB_DISTRIBUTEDDATAMGR_KVSTORERESULTSET_GETENTRY_0400
     * @tc.name [JS-API8]KvStoreResultSet.GetEntry()
     * @tc.desc Test Js Api KvStoreResultSet.GetEntry()testcase 004
     */
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
    it('testKvStoreResultSetGetEntry004', 0, async function(done) {
        try {
            var entry = resultSet.getEntry(1, 'test_string');
            console.log("testKvStoreResultSetGetEntry004 getEntry " + entry);
            expect(null).assertFail();
        } catch (e) {
            console.log("testKvStoreResultSetGetEntry004 fail " + e);
        }
        done();
    })
})