1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' 16import continuationManager from '@ohos.continuation.continuationManager'; 17 18const TEST_DEVICE_ID = "test_deviceId"; 19const TEST_CONNECT_STATUS = continuationManager.DeviceConnectState.CONNECTED; 20let token = -1; 21import featureAbility from '@ohos.ability.featureAbility'; 22import { UiDriver, BY } from '@ohos.UiTest' 23import abilityConstant from '@ohos.app.ability.AbilityConstant' 24 25export default function continuationManagerTest() { 26 describe('continuationManagerTest', function () { 27 28 function sleep(ms) { 29 return new Promise(resolve => setTimeout(resolve, ms)); 30 } 31 32 async function requestPermission() { 33 try { 34 let context = featureAbility.getContext(); 35 await context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, (data) => { 36 console.info('TestApplication requestPermission data: ' + JSON.stringify(data)); 37 }); 38 } catch (err) { 39 console.error('TestApplication permission' + JSON.stringify(err)); 40 } 41 } 42 43 async function driveFn() { 44 try { 45 let driver = await UiDriver.create(); 46 console.info(`come in driveFn`); 47 console.info(`driver is ${JSON.stringify(driver)}`); 48 await sleep(1000); 49 let button = await driver.findComponent(BY.text('允许')); 50 console.info(`button is ${JSON.stringify(button)}`); 51 await sleep(1000); 52 await button.click(); 53 } catch (err) { 54 console.info('err code is ' + err); 55 return; 56 } 57 } 58 59 beforeAll(async function (done) { 60 console.info('beforeAll'); 61 await requestPermission(); 62 await sleep(1000); 63 await driveFn(); 64 await sleep(1000); 65 done(); 66 }) 67 68 afterAll(async function (done) { 69 console.info('afterAll'); 70 done(); 71 }) 72 73 beforeEach(async function (done) { 74 console.info('beforeEach'); 75 try { 76 await continuationManager.registerContinuation().then((data) => { 77 token = data; 78 console.info('beforeEach registerContinuation success'); 79 done(); 80 }) 81 .catch((e) => { 82 console.info("beforeEach promise error: catch error is" + error); 83 }); 84 } catch (error) { 85 console.info("beforeEach try error: catch error is" + error); 86 } 87 console.info('beforeEach end'); 88 }) 89 90 afterEach(async function (done) { 91 console.info('afterEach'); 92 try { 93 await continuationManager.unregisterContinuation(token).then((data) => { 94 console.info('afterEach unregisterContinuation success'); 95 }) 96 .catch((e) => { 97 console.info("afterEach promise error: catch error is" + error); 98 }); 99 } catch (error) { 100 console.info("afterEach try error: catch error is" + error); 101 } 102 done(); 103 console.info('afterEach end'); 104 }) 105 106 /* 107 * @tc.number SUM_DMS_AbilityConstant_0100 108 * @tc.name Test abilityConstant 109 * @tc.desc Function test 110 * @tc.size MediumTest 111 * @tc.type: Function 112 * @tc.level Level3 113 */ 114 it('SUB_DMS_AbilityConstant_0100', 0 , async (done) => { 115 console.log("----------------------SUB_DMS_AbilityConstant_0100 start----------------------"); 116 try { 117 console.log("--------------------PREPARE_CONTINUATION--------------------" + abilityConstant.LaunchReason.PREPARE_CONTINUATION); 118 expect(10).assertEqual(abilityConstant.LaunchReason.PREPARE_CONTINUATION); 119 } catch (error) { 120 console.log("----------------------SUB_DMS_AbilityConstant_0100----------------------" + error); 121 } 122 console.log("----------------------SUB_DMS_AbilityConstant_0100 end----------------------"); 123 done(); 124 }) 125 126 /* 127 * @tc.number testRegister001 128 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 129 * @tc.desc Function test 130 * @tc.size MediumTest 131 * @tc.type: Function 132 * @tc.level Level0 133 */ 134 it('testRegister001', 0 , async function (done) { 135 console.info("----------------------testRegister001 start----------------------"); 136 try { 137 continuationManager.register(function (err, data) { 138 console.info("testRegister001 err is" + JSON.stringify(err)); 139 console.info("testRegister001 data is" + data); 140 expect(err.code == 0).assertTrue(); 141 done(); 142 }); 143 } catch (error) { 144 console.info("testRegister001 catch error is" + error); 145 expect(null).assertFail(); 146 done(); 147 } 148 console.info("----------------------testRegister001 end----------------------"); 149 }) 150 151 /* 152 * @tc.number testRegister002 153 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 154 * @tc.desc Function test 155 * @tc.size MediumTest 156 * @tc.type: Function 157 * @tc.level Level0 158 */ 159 it('testRegister002', 0, async function (done) { 160 console.info("----------------------testRegister002 start----------------------"); 161 try { 162 let continuationExtraParams = { 163 deviceType: [], 164 targetBundle: "", 165 description: "", 166 filter: "", 167 continuationMode: null, 168 authInfo: {} 169 }; 170 continuationManager.register(continuationExtraParams, function (err) { 171 console.info("testRegister002 err.message is" + err.message); 172 expect(err.message == "Invalidate params.").assertTrue(); 173 done(); 174 }); 175 } catch (error) { 176 console.info("testRegister002 catch error is" + error); 177 expect(null).assertFail(); 178 done(); 179 } 180 console.info("----------------------testRegister002 end----------------------"); 181 }) 182 183 /* 184 * @tc.number testRegister003 185 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 186 * @tc.desc Function test 187 * @tc.size MediumTest 188 * @tc.type: Function 189 * @tc.level Level0 190 */ 191 it('testRegister003', 0, async function (done) { 192 console.info("----------------------testRegister003 start----------------------"); 193 try { 194 let continuationExtraParams = { 195 deviceType: ["00E"], 196 targetBundle: "ohos.example.test", 197 description: "description", 198 filter: { "name": "authInfo", "length": 8 }, 199 continuationMode: 10, 200 authInfo: { "name": "authInfo", "length": 8 } 201 }; 202 continuationManager.register(continuationExtraParams, function (err) { 203 console.info("testRegister003 err is" + JSON.stringify(err)); 204 expect(err.code == 29360216).assertTrue(); 205 done(); 206 }); 207 } catch (error) { 208 console.info("testRegister003 catch error is" + error); 209 expect(null).assertFail(); 210 done(); 211 } 212 console.info("----------------------testRegister003 end----------------------"); 213 }) 214 215 /* 216 * @tc.number testRegister004 217 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 218 * @tc.desc Function test 219 * @tc.size MediumTest 220 * @tc.type: Function 221 * @tc.level Level0 222 */ 223 it('testRegister004', 0, async function (done) { 224 console.info("----------------------testRegister004 start----------------------"); 225 try { 226 let continuationExtraParams = { 227 deviceType: ["00E"], 228 targetBundle: "ohos.example.test", 229 description: "description", 230 filter: { "name": "authInfo", "length": 8 }, 231 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 232 authInfo: { "name": "authInfo", "length": 8 } 233 }; 234 continuationManager.register(continuationExtraParams, function (err) { 235 console.info("testRegister004 err is" + JSON.stringify(err)); 236 expect(err.code == 0).assertTrue(); 237 done(); 238 }); 239 } catch (error) { 240 console.info("testRegister004 catch error is" + error); 241 expect(null).assertFail(); 242 done(); 243 } 244 console.info("----------------------testRegister004 end----------------------"); 245 }) 246 247 /* 248 * @tc.number testRegister005 249 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 250 * @tc.desc Function test 251 * @tc.size MediumTest 252 * @tc.type: Function 253 * @tc.level Level0 254 */ 255 it('testRegister005', 0, async function (done) { 256 console.info("----------------------testRegister005 start----------------------"); 257 try { 258 let continuationExtraParams = { 259 deviceType: ["00E"], 260 targetBundle: "ohos.example.test", 261 description: "description", 262 filter: { "name": "authInfo", "length": 8 }, 263 continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, 264 authInfo: { "name": "authInfo", "length": 8 } 265 }; 266 continuationManager.register(continuationExtraParams, function (err, data) { 267 console.info("testRegister005 err.code is" + err.code); 268 console.info("testRegister005 data is" + data); 269 expect(err.code == 0).assertTrue(); 270 done(); 271 }); 272 } catch (error) { 273 console.info("testRegister005 catch error is" + error); 274 expect(null).assertFail(); 275 done(); 276 } 277 console.info("----------------------testRegister005 end----------------------"); 278 }) 279 280 /* 281 * @tc.number testRegister006 282 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 283 * @tc.desc Function test 284 * @tc.size MediumTest 285 * @tc.type: Function 286 * @tc.level Level0 287 */ 288 it('testRegister006', 0, async function (done) { 289 console.info("----------------------testRegister006 start----------------------"); 290 try { 291 let continuationExtraParams = { 292 deviceType: ["00E"], 293 targetBundle: "ohos.example.test", 294 description: "description", 295 filter: { "name": "authInfo", "length": 8 }, 296 continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, 297 authInfo: { "name": "authInfo", "length": 8 } 298 }; 299 continuationManager.register(continuationExtraParams).then((data) => { 300 console.info("testRegister006 data is" + data); 301 expect(data != -1).assertTrue(); 302 done(); 303 }).catch((err) => { 304 console.info("testRegister006 err is" + JSON.stringify(err)); 305 expect().assertFail(); 306 done(); 307 }); 308 } catch (error) { 309 console.info("testRegister006 catch error is" + error); 310 expect(null).assertFail(); 311 done(); 312 } 313 console.info("----------------------testRegister006 end----------------------"); 314 }) 315 316 317 /* 318 * @tc.number testRegister007 319 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 320 * @tc.desc Function test 321 * @tc.size MediumTest 322 * @tc.type: Function 323 * @tc.level Level0 324 */ 325 it('testRegister007', 0, async function (done) { 326 console.info("----------------------testRegister007 start----------------------"); 327 try { 328 let continuationExtraParams = { 329 deviceType: ["00E"], 330 description: "description", 331 filter: { "name": "authInfo", "length": 8 }, 332 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 333 authInfo: { "name": "authInfo", "length": 8 } 334 }; 335 continuationManager.register(continuationExtraParams).then((data) => { 336 console.log('testRegister007 data is' + data); 337 expect(data != -1).assertTrue(); 338 done(); 339 }).catch((err) => { 340 console.log('testRegister007 err code is' + err.code); 341 expect().assertFail(); 342 done(); 343 }); 344 } catch (error) { 345 console.info("testRegister007 catch error is" + error); 346 expect(null).assertFail(); 347 done(); 348 } 349 console.info("----------------------testRegister007 end----------------------"); 350 }) 351 352 /* 353 * @tc.number testRegister008 354 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 355 * @tc.desc Function test 356 * @tc.size MediumTest 357 * @tc.type: Function 358 * @tc.level Level0 359 */ 360 it('testRegister008', 0, async function (done) { 361 console.info("----------------------testRegister008 start----------------------"); 362 try { 363 let continuationExtraParams = { 364 deviceType: [], 365 description: "", 366 filter: "", 367 continuationMode: null, 368 authInfo: {} 369 }; 370 continuationManager.register(continuationExtraParams).then((data) => { 371 console.log('testRegister008 data is' + data) 372 expect().assertFail(); 373 done(); 374 }).catch((err) => { 375 console.log('testRegister008 err code is' + err.code) 376 expect(err.code == -1).assertTrue(); 377 done(); 378 }); 379 } catch (error) { 380 console.info("testRegister008 catch error is" + error); 381 expect(null).assertFail(); 382 done() 383 } 384 console.info("----------------------testRegister008 end----------------------"); 385 }) 386 387 /* 388 * @tc.number testRegister009 389 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 390 * @tc.desc Function test 391 * @tc.size MediumTest 392 * @tc.type: Function 393 * @tc.level Level0 394 */ 395 it('testRegister009', 0, async function (done) { 396 console.info("----------------------testRegister009 start----------------------"); 397 try { 398 let continuationExtraParams = { 399 deviceType: ["00E"], 400 description: "description", 401 filter: { "name": "authInfo", "length": 8 }, 402 continuationMode: 10, 403 authInfo: { "name": "authInfo", "length": 8 } 404 }; 405 continuationManager.register(continuationExtraParams).then((data) => { 406 console.log('testRegister009 data is' + data); 407 expect().assertFail(); 408 done(); 409 }).catch((err) => { 410 console.log('testRegister009 err code is' + err.code); 411 expect(err.code == 29360216).assertTrue(); 412 done(); 413 }); 414 } catch (error) { 415 console.info("testRegister009 catch error is" + error); 416 expect(null).assertFail(); 417 done(); 418 } 419 console.info("----------------------testRegister009 end----------------------"); 420 }) 421 422 /* 423 * @tc.number testRegister010 424 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 425 * @tc.desc Function test 426 * @tc.size MediumTest 427 * @tc.type: Function 428 * @tc.level Level0 429 */ 430 it('testRegister010', 0, async function (done) { 431 console.info("----------------------testRegister010 start----------------------"); 432 try { 433 continuationManager.register({ 434 deviceType: ["00E"], 435 description: "description", 436 filter: { "name": "authInfo", "length": 8 }, 437 continuationMode: 10, 438 authInfo: { "name": "authInfo", "length": 8 } 439 }).then((data) => { 440 console.log('testRegister010 data is' + data); 441 expect().assertFail(); 442 done(); 443 }).catch((err) => { 444 console.log('testRegister010 err code is' + err.code); 445 expect(err.code == 29360216).assertTrue(); 446 done(); 447 }); 448 } catch (error) { 449 console.info("testRegister010 catch error is" + error); 450 expect(null).assertFail(); 451 done(); 452 } 453 console.info("----------------------testRegister010 end----------------------"); 454 }) 455 456 /* 457 * @tc.number testRegister011 458 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 459 * @tc.desc Function test 460 * @tc.size MediumTest 461 * @tc.type: Function 462 * @tc.level Level0 463 */ 464 it('testRegister011', 0, async function (done) { 465 console.info("----------------------testRegister011 start----------------------"); 466 try { 467 continuationManager.register().then((data) => { 468 console.log('testRegister010 data is' + data); 469 expect(data != -1).assertTrue(); 470 done(); 471 }).catch((err) => { 472 console.log('testRegister011 err code is' + err.code); 473 expect().assertFail(); 474 done(); 475 }); 476 } catch (error) { 477 console.info("testRegister011 catch error is" + error); 478 expect(null).assertFail(); 479 done(); 480 } 481 console.info("----------------------testRegister011 end----------------------"); 482 }) 483 484 /* 485 * @tc.number testRegisterContinuation001 486 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 487 * @tc.desc Function test 488 * @tc.size MediumTest 489 * @tc.type: Function 490 * @tc.level Level0 491 */ 492 it('testRegisterContinuation001', 0, async function (done) { 493 console.info("----------------------testRegisterContinuation001 start----------------------"); 494 try { 495 continuationManager.registerContinuation(function (err, data) { 496 console.info("testRegisterContinuation001 err is" + JSON.stringify(err)); 497 console.info("testRegisterContinuation001 data is" + data); 498 expect(err.code == 0).assertTrue(); 499 done(); 500 }); 501 } catch (error) { 502 console.info("testRegisterContinuation001 catch error is" + error); 503 expect(null).assertFail(); 504 done(); 505 } 506 console.info("----------------------testRegisterContinuation001 end----------------------"); 507 }) 508 509 /* 510 * @tc.number testRegisterContinuation002 511 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 512 * @tc.desc Function test 513 * @tc.size MediumTest 514 * @tc.type: Function 515 * @tc.level Level0 516 */ 517 it('testRegisterContinuation002', 0, async function (done) { 518 console.info("----------------------testRegisterContinuation002 start----------------------"); 519 try { 520 let continuationExtraParams = { 521 deviceType: [], 522 targetBundle: "", 523 description: "", 524 filter: "", 525 continuationMode: null, 526 authInfo: {} 527 }; 528 continuationManager.registerContinuation(continuationExtraParams, function (err) { 529 console.info("testRegisterContinuation002 err is" + JSON.stringify(err)); 530 expect(err.code == 401).assertTrue(); 531 done(); 532 }); 533 } catch (error) { 534 console.info("testRegisterContinuation002 catch error is" + error); 535 expect(error.code == 401).assertTrue(); 536 done(); 537 } 538 console.info("----------------------testRegisterContinuation002 end----------------------"); 539 }) 540 541 /* 542 * @tc.number testRegisterContinuation003 543 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 544 * @tc.desc Function test 545 * @tc.size MediumTest 546 * @tc.type: Function 547 * @tc.level Level0 548 */ 549 it('testRegisterContinuation003', 0, async function (done) { 550 console.info("----------------------testRegisterContinuation003 start----------------------"); 551 try { 552 let continuationExtraParams = { 553 deviceType: ["00E"], 554 targetBundle: "ohos.example.test", 555 description: "description", 556 filter: { "name": "authInfo", "length": 8 }, 557 continuationMode: 10, 558 authInfo: { "name": "authInfo", "length": 8 } 559 }; 560 continuationManager.registerContinuation(continuationExtraParams, function (err) { 561 console.info("testRegisterContinuation003 err is" + JSON.stringify(err)); 562 expect(err.code == 401).assertTrue(); 563 done(); 564 }); 565 } catch (error) { 566 console.info("testRegisterContinuation003 catch error is" + error); 567 expect(null).assertFail(); 568 done(); 569 } 570 console.info("----------------------testRegisterContinuation003 end----------------------"); 571 }) 572 573 /* 574 * @tc.number testRegisterContinuation004 575 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 576 * @tc.desc Function test 577 * @tc.size MediumTest 578 * @tc.type: Function 579 * @tc.level Level0 580 */ 581 it('testRegisterContinuation004', 0, async function (done) { 582 console.info("----------------------testRegisterContinuation004 start----------------------"); 583 try { 584 let continuationExtraParams = { 585 deviceType: ["00E"], 586 targetBundle: "ohos.example.test", 587 description: "description", 588 filter: { "name": "authInfo", "length": 8 }, 589 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 590 authInfo: { "name": "authInfo", "length": 8 } 591 }; 592 continuationManager.registerContinuation(continuationExtraParams, function (err, data) { 593 console.info("testRegisterContinuation004 err is" + JSON.stringify(err)); 594 console.info("testRegisterContinuation004 data is" + data); 595 expect(err.code == 0).assertTrue(); 596 done(); 597 }); 598 } catch (error) { 599 console.info("testRegisterContinuation004 catch error is" + error); 600 expect(null).assertFail(); 601 done(); 602 } 603 console.info("----------------------testRegisterContinuation004 end----------------------"); 604 }) 605 606 /* 607 * @tc.number testRegisterContinuation005 608 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 609 * @tc.desc Function test 610 * @tc.size MediumTest 611 * @tc.type: Function 612 * @tc.level Level0 613 */ 614 it('testRegisterContinuation005', 0, async function (done) { 615 console.info("----------------------testRegisterContinuation005 start----------------------"); 616 try { 617 let continuationExtraParams = { 618 deviceType: ["00E"], 619 targetBundle: "ohos.example.test", 620 description: "description", 621 filter: { "name": "authInfo", "length": 8 }, 622 continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, 623 authInfo: { "name": "authInfo", "length": 8 } 624 }; 625 continuationManager.registerContinuation(continuationExtraParams, function (err, data) { 626 console.info("testRegisterContinuation005 err is" + JSON.stringify(err)); 627 console.info("testRegisterContinuation005 data is" + data); 628 expect(err.code == 0).assertTrue(); 629 done(); 630 }); 631 } catch (error) { 632 console.info("testRegisterContinuation005 catch error is" + error); 633 expect(null).assertFail(); 634 done(); 635 } 636 console.info("----------------------testRegisterContinuation005 end----------------------"); 637 }) 638 639 /* 640 * @tc.number testRegisterContinuation006 641 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 642 * @tc.desc Function test 643 * @tc.size MediumTest 644 * @tc.type: Function 645 * @tc.level Level0 646 */ 647 it('testRegisterContinuation006', 0, async function (done) { 648 console.info("----------------------testRegisterContinuation006 start----------------------"); 649 try { 650 let continuationExtraParams = { 651 deviceType: ["00E"], 652 targetBundle: "ohos.example.test", 653 description: "description", 654 filter: { "name": "authInfo", "length": 8 }, 655 continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, 656 authInfo: { "name": "authInfo", "length": 8 } 657 }; 658 continuationManager.registerContinuation(continuationExtraParams).then((data) => { 659 console.log('testRegisterContinuation006 data is' + data); 660 expect(data != -1).assertTrue(); 661 done(); 662 }).catch((err) => { 663 console.log('testRegisterContinuation006 err code is' + err.code); 664 expect().assertFail(); 665 done(); 666 }); 667 } catch (error) { 668 console.info("testRegisterContinuation006 catch error is" + error); 669 expect(null).assertFail(); 670 done(); 671 } 672 console.info("----------------------testRegisterContinuation006 end----------------------"); 673 }) 674 675 /* 676 * @tc.number testRegisterContinuation007 677 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 678 * @tc.desc Function test 679 * @tc.size MediumTest 680 * @tc.type: Function 681 * @tc.level Level0 682 */ 683 it('testRegisterContinuation007', 0, async function (done) { 684 console.info("----------------------testRegisterContinuation007 start----------------------"); 685 try { 686 let continuationExtraParams = { 687 deviceType: ["00E"], 688 description: "description", 689 filter: { "name": "authInfo", "length": 8 }, 690 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 691 authInfo: { "name": "authInfo", "length": 8 } 692 }; 693 continuationManager.registerContinuation(continuationExtraParams).then((data) => { 694 console.log('testRegisterContinuation007 data is' + data); 695 expect(data != -1).assertTrue(); 696 done(); 697 }).catch((err) => { 698 console.log('testRegisterContinuation007 err code is' + err.code); 699 expect().assertFail(); 700 done(); 701 }); 702 } catch (error) { 703 console.info("testRegisterContinuation007 catch error is" + error); 704 expect(null).assertFail(); 705 done(); 706 } 707 console.info("----------------------testRegisterContinuation007 end----------------------"); 708 }) 709 710 /* 711 * @tc.number testRegisterContinuation008 712 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 713 * @tc.desc Function test 714 * @tc.size MediumTest 715 * @tc.type: Function 716 * @tc.level Level0 717 */ 718 it('testRegisterContinuation008', 0, async function (done) { 719 console.info("----------------------testRegisterContinuation008 start----------------------"); 720 try { 721 let continuationExtraParams = { 722 deviceType: [], 723 description: "", 724 filter: "", 725 continuationMode: null, 726 authInfo: {} 727 }; 728 continuationManager.registerContinuation(continuationExtraParams).then((data) => { 729 console.log('testRegisterContinuation008 data is' + data); 730 expect(data != -1).assertTrue(); 731 done(); 732 }).catch((err) => { 733 console.log('testRegisterContinuation008 err code is' + err.code); 734 expect(err.code == 401).assertTrue(); 735 done(); 736 }); 737 } catch (error) { 738 console.info("testRegisterContinuation008 catch error is" + error); 739 expect(error.code == 401).assertTrue(); 740 done(); 741 } 742 console.info("----------------------testRegisterContinuation008 end----------------------"); 743 }) 744 745 /* 746 * @tc.number testRegisterContinuation009 747 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 748 * @tc.desc Function test 749 * @tc.size MediumTest 750 * @tc.type: Function 751 * @tc.level Level0 752 */ 753 it('testRegisterContinuation009', 0, async function (done) { 754 console.info("----------------------testRegisterContinuation009 start----------------------"); 755 try { 756 let continuationExtraParams = { 757 deviceType: ["00E"], 758 description: "description", 759 filter: { "name": "authInfo", "length": 8 }, 760 continuationMode: 10, 761 authInfo: { "name": "authInfo", "length": 8 } 762 }; 763 continuationManager.registerContinuation(continuationExtraParams).then((data) => { 764 console.log('testRegisterContinuation009 data is' + data); 765 expect().assertFail(); 766 done(); 767 }).catch((err) => { 768 console.log('testRegisterContinuation009 err code is' + err.code); 769 expect(err.code == 401).assertTrue(); 770 done(); 771 }); 772 } catch (error) { 773 console.info("testRegisterContinuation009 catch error is" + error); 774 expect(null).assertFail(); 775 done(); 776 } 777 console.info("----------------------testRegisterContinuation009 end----------------------"); 778 }) 779 780 /* 781 * @tc.number testRegisterContinuation010 782 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 783 * @tc.desc Function test 784 * @tc.size MediumTest 785 * @tc.type: Function 786 * @tc.level Level0 787 */ 788 it('testRegisterContinuation010', 0, async function (done) { 789 console.info("----------------------testRegisterContinuation010 start----------------------"); 790 try { 791 continuationManager.registerContinuation().then((data) => { 792 console.log('testRegisterContinuation010 data is' + data); 793 expect(data != -1).assertTrue(); 794 done(); 795 }).catch((err) => { 796 console.log('testRegisterContinuation010 err code is' + err.code); 797 expect().assertFail(); 798 done(); 799 }); 800 } catch (error) { 801 console.info("testRegisterContinuation010 catch error is" + error); 802 expect(null).assertFail(); 803 done(); 804 } 805 console.info("----------------------testRegisterContinuation010 end----------------------"); 806 }) 807 808 /* 809 * @tc.number testUnregister001 810 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 811 * @tc.desc Function test 812 * @tc.size MediumTest 813 * @tc.type: Function 814 * @tc.level Level0 815 */ 816 it('testUnregister001', 0, async function (done) { 817 console.info("----------------------testUnregister001 start----------------------"); 818 try { 819 continuationManager.unregister(token, function (err, data) { 820 console.info("testUnregister001 err is" + JSON.stringify(err)); 821 console.info("testUnregister001 data is" + data); 822 if (err.code == 0) { 823 console.log("testUnregister001 err is" + JSON.stringify(err)) 824 expect(err.code == 0).assertTrue(); 825 done(); 826 } 827 console.log("testUnregister001 data is" + data) 828 expect(data == undefined).assertTrue(); 829 done(); 830 }) 831 } catch (error) { 832 console.info("testUnregister001 catch error is" + error); 833 expect(null).assertFail(); 834 done(); 835 } 836 console.info("----------------------testUnregister001 end----------------------"); 837 }) 838 839 /* 840 * @tc.number testUnregister002 841 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 842 * @tc.desc Function test 843 * @tc.size MediumTest 844 * @tc.type: Function 845 * @tc.level Level0 846 */ 847 it('testUnregister002', 0, async function (done) { 848 console.info("----------------------testUnregister002 start----------------------"); 849 try { 850 continuationManager.unregister(null, function (err, data) { 851 console.info("testUnregister002 err is" + JSON.stringify(err)); 852 console.info("testUnregister002 data is" + data); 853 expect(err.message == "Invalidate params.").assertTrue(); 854 expect(data == undefined).assertTrue(); 855 done(); 856 }) 857 } catch (error) { 858 console.info("testUnregister002 catch error is" + error); 859 expect(null).assertFail(); 860 done(); 861 } 862 console.info("----------------------testUnregister002 end----------------------"); 863 }) 864 865 866 /* 867 * @tc.number testUnregister003 868 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 869 * @tc.desc Function test 870 * @tc.size MediumTest 871 * @tc.type: Function 872 * @tc.level Level0 873 */ 874 it('testUnregister003', 0, async function (done) { 875 console.info("----------------------testUnregister003 start----------------------"); 876 try { 877 continuationManager.unregister(300, function (err, data) { 878 console.info("testUnregister003 err is" + JSON.stringify(err)); 879 console.info("testUnregister003 data is" + data); 880 expect(err.code == 29360208).assertTrue(); 881 expect(data == undefined).assertTrue(); 882 done(); 883 }) 884 } catch (error) { 885 console.info("testUnregister003 catch error is" + error); 886 expect(null).assertFail(); 887 done(); 888 } 889 console.info("----------------------testUnregister003 end----------------------"); 890 }) 891 892 /* 893 * @tc.number testUnregister004 894 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 895 * @tc.desc Function test 896 * @tc.size MediumTest 897 * @tc.type: Function 898 * @tc.level Level0 899 */ 900 it('testUnregister004', 0, async function (done) { 901 console.info("----------------------testUnregister004 start----------------------"); 902 try { 903 continuationManager.unregister(300, function (err) { 904 console.info("testUnregister004 data is" + err.code); 905 expect(err.code == 29360208).assertTrue(); 906 done(); 907 }) 908 } catch (error) { 909 console.info("testUnregister004 catch error is" + error); 910 expect(null).assertFail(); 911 done(); 912 } 913 console.info("----------------------testUnregister004 end----------------------"); 914 }) 915 916 /* 917 * @tc.number testUnregister005 918 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 919 * @tc.desc Function test 920 * @tc.size MediumTest 921 * @tc.type: Function 922 * @tc.level Level0 923 */ 924 it('testUnregister005', 0, async function (done) { 925 console.info("----------------------testUnregister005 start----------------------"); 926 try { 927 continuationManager.unregister(token, function (err) { 928 console.info("testUnregister005 err.code is" + err.code); 929 expect(err.code == 0).assertTrue(); 930 done(); 931 }) 932 } catch (error) { 933 console.info("testUnregister005 catch error is" + error); 934 expect(null).assertFail(); 935 done(); 936 } 937 console.info("----------------------testUnregister005 end----------------------"); 938 }) 939 940 /* 941 * @tc.number testUnregister006 942 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 943 * @tc.desc Function test 944 * @tc.size MediumTest 945 * @tc.type: Function 946 * @tc.level Level0 947 */ 948 it('testUnregister006', 0, async function (done) { 949 console.info("----------------------testUnregister006 start----------------------"); 950 try { 951 continuationManager.unregister(token).then((data) => { 952 console.log('testUnregister006 data is' + data); 953 expect(data == undefined).assertTrue(); 954 done(); 955 }).catch((err) => { 956 console.log('testUnregister006 err code is' + err.code); 957 expect().assertFail(); 958 done(); 959 }); 960 } catch (error) { 961 console.info("testUnregister006 catch error is" + error); 962 expect(null).assertFail(); 963 done(); 964 } 965 console.info("----------------------testUnregister006 end----------------------"); 966 }) 967 968 /* 969 * @tc.number testUnregisterContinuation001 970 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 971 * @tc.desc Function test 972 * @tc.size MediumTest 973 * @tc.type: Function 974 * @tc.level Level0 975 */ 976 it('testUnregisterContinuation001', 0, async function (done) { 977 console.info("----------------------testUnregisterContinuation001 start----------------------"); 978 try { 979 continuationManager.unregisterContinuation(token, function (err, data) { 980 console.info("testUnregisterContinuation001 err is" + JSON.stringify(err)); 981 console.info("testUnregisterContinuation001 data is" + data); 982 expect(err.code == 0).assertTrue(); 983 expect(data == undefined).assertTrue(); 984 done(); 985 }) 986 } catch (error) { 987 console.info("testUnregisterContinuation001 catch error is" + error); 988 expect(null).assertFail(); 989 done(); 990 } 991 console.info("----------------------testUnregisterContinuation001 end----------------------"); 992 }) 993 994 /* 995 * @tc.number testUnregisterContinuation002 996 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 997 * @tc.desc Function test 998 * @tc.size MediumTest 999 * @tc.type: Function 1000 * @tc.level Level0 1001 */ 1002 it('testUnregisterContinuation002', 0, async function (done) { 1003 console.info("----------------------testUnregisterContinuation002 start----------------------"); 1004 try { 1005 continuationManager.unregisterContinuation("invalid token", function (err, data) { 1006 console.info("testUnregisterContinuation002 err is" + JSON.stringify(err)); 1007 console.info("testUnregisterContinuation002 data is" + data); 1008 expect(err.code == 401).assertTrue(); 1009 expect(data == undefined).assertTrue(); 1010 done(); 1011 }) 1012 } catch (error) { 1013 console.info("testUnregisterContinuation002 catch error is" + error); 1014 expect(error.code == 401).assertTrue(); 1015 done(); 1016 } 1017 console.info("----------------------testUnregisterContinuation002 end----------------------"); 1018 }) 1019 1020 /* 1021 * @tc.number testUnregisterContinuation003 1022 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1023 * @tc.desc Function test 1024 * @tc.size MediumTest 1025 * @tc.type: Function 1026 * @tc.level Level0 1027 */ 1028 it('testUnregisterContinuation003', 0, async function (done) { 1029 console.info("----------------------testUnregisterContinuation003 start----------------------"); 1030 try { 1031 continuationManager.unregisterContinuation(300, function (err, data) { 1032 console.info("testUnregisterContinuation003 err is" + JSON.stringify(err)); 1033 console.info("testUnregisterContinuation003 data is" + data); 1034 expect(err.code == 16600002).assertTrue(); 1035 expect(data == undefined).assertTrue(); 1036 done(); 1037 }) 1038 } catch (error) { 1039 console.info("testUnregisterContinuation003 catch error is" + error); 1040 expect(null).assertFail(); 1041 done(); 1042 } 1043 console.info("----------------------testUnregisterContinuation003 end----------------------"); 1044 }) 1045 1046 /* 1047 * @tc.number testUnregisterContinuation004 1048 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1049 * @tc.desc Function test 1050 * @tc.size MediumTest 1051 * @tc.type: Function 1052 * @tc.level Level0 1053 */ 1054 it('testUnregisterContinuation004', 0, async function (done) { 1055 console.info("----------------------testUnregisterContinuation004 start----------------------"); 1056 try { 1057 continuationManager.unregisterContinuation(300, function (err) { 1058 console.info("testUnregisterContinuation004 err.code is" + err.code); 1059 expect(err.code == 16600002).assertTrue(); 1060 done(); 1061 }) 1062 } catch (error) { 1063 console.info("testUnregisterContinuation004 catch error is" + error); 1064 expect(null).assertFail(); 1065 done(); 1066 } 1067 console.info("----------------------testUnregisterContinuation004 end----------------------"); 1068 }) 1069 1070 /* 1071 * @tc.number testUnregisterContinuation005 1072 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1073 * @tc.desc Function test 1074 * @tc.size MediumTest 1075 * @tc.type: Function 1076 * @tc.level Level0 1077 */ 1078 it('testUnregisterContinuation005', 0, async function (done) { 1079 console.info("----------------------testUnregisterContinuation005 start----------------------"); 1080 try { 1081 continuationManager.unregisterContinuation(token, function (err) { 1082 console.info("testUnregisterContinuation005 err.code is" + err.code); 1083 expect(err.code == 0).assertTrue(); 1084 done(); 1085 }) 1086 } catch (error) { 1087 console.info("testUnregisterContinuation005 catch error is" + error); 1088 expect(null).assertFail(); 1089 done(); 1090 } 1091 console.info("----------------------testUnregisterContinuation005 end----------------------"); 1092 }) 1093 1094 /* 1095 * @tc.number testUnregisterContinuation006 1096 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1097 * @tc.desc Function test 1098 * @tc.size MediumTest 1099 * @tc.type: Function 1100 * @tc.level Level0 1101 */ 1102 it('testUnregisterContinuation006', 0, async function (done) { 1103 console.info("----------------------testUnregisterContinuation006 start----------------------"); 1104 try { 1105 continuationManager.unregisterContinuation(token).then((data) => { 1106 console.info("testUnregisterContinuation006 " + JSON.stringify(data)); 1107 expect(data == null).assertTrue(); 1108 done(); 1109 }).catch((err) => { 1110 console.log('testUnregisterContinuation006 err code is' + err.code); 1111 expect().assertFail(); 1112 done(); 1113 }); 1114 } catch (error) { 1115 console.info("testUnregisterContinuation006 catch error is" + error); 1116 expect(null).assertFail(); 1117 done(); 1118 } 1119 console.info("----------------------testUnregisterContinuation006 end----------------------"); 1120 }) 1121 1122 /* 1123 * @tc.number testOn001 1124 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1125 * @tc.desc Function test 1126 * @tc.size MediumTest 1127 * @tc.type: Function 1128 * @tc.level Level0 1129 */ 1130 it('testOn001', 0, async function (done) { 1131 console.info("----------------------testOn001 start----------------------"); 1132 try { 1133 continuationManager.on("deviceConnect", function (data) { 1134 console.info("testOn001 data is" + data); 1135 expect(data != null).assertFail(); 1136 done() 1137 }); 1138 } catch (error) { 1139 console.info("testOn001 catch error is" + error); 1140 expect(error.toString().includes("must be 3")).assertTrue(); 1141 done(); 1142 } 1143 console.info("----------------------testOn001 end----------------------"); 1144 }) 1145 1146 /* 1147 * @tc.number testOn002 1148 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1149 * @tc.desc Function test 1150 * @tc.size MediumTest 1151 * @tc.type: Function 1152 * @tc.level Level0 1153 */ 1154 it('testOn002', 0, async function (done) { 1155 console.info("----------------------testOn002 start----------------------"); 1156 try { 1157 continuationManager.on("deviceDisconnect", function (data) { 1158 console.info("testOn002 data is" + data); 1159 expect(data != null).assertFail(); 1160 done(); 1161 }); 1162 } catch (error) { 1163 console.info("testOn002 catch error is" + error); 1164 expect(error.toString().includes("must be 3")).assertTrue(); 1165 done(); 1166 } 1167 console.info("----------------------testOn002 end----------------------"); 1168 }) 1169 1170 /* 1171 * @tc.number testOn003 1172 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1173 * @tc.desc Function test 1174 * @tc.size MediumTest 1175 * @tc.type: Function 1176 * @tc.level Level0 1177 */ 1178 it('testOn003', 0, async function (done) { 1179 console.info("----------------------testOn003 start----------------------"); 1180 try { 1181 continuationManager.on("deviceSelected", "invalid token", function (data) { 1182 console.info("testOn003 data is" + data); 1183 expect(data == undefined).assertTrue(); 1184 done(); 1185 }) 1186 } catch (error) { 1187 console.info("testOn003 catch error is" + error); 1188 expect(error.code == 401).assertTrue(); 1189 done(); 1190 } 1191 console.info("----------------------testOn003 end----------------------"); 1192 }) 1193 1194 /* 1195 * @tc.number testOn004 1196 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1197 * @tc.desc Function test 1198 * @tc.size MediumTest 1199 * @tc.type: Function 1200 * @tc.level Level0 1201 */ 1202 it('testOn004', 0, async function (done) { 1203 console.info("----------------------testOn004 start----------------------"); 1204 try { 1205 continuationManager.on("deviceUnselected", "invalid token", function (data) { 1206 console.info("testOn004 data is" + data); 1207 expect(data == undefined).assertTrue(); 1208 done(); 1209 }); 1210 } catch (error) { 1211 console.info("testOn004 catch error is" + error); 1212 expect(error.code == 401).assertTrue(); 1213 done(); 1214 } 1215 console.info("----------------------testOn004 end----------------------"); 1216 }) 1217 1218 /* 1219 * @tc.number testOn005 1220 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1221 * @tc.desc Function test 1222 * @tc.size MediumTest 1223 * @tc.type: Function 1224 * @tc.level Level0 1225 */ 1226 it('testOn005', 0, async function (done) { 1227 console.info("----------------------testOn005 start----------------------"); 1228 try { 1229 continuationManager.on("deviceConnect",continuationManager.ContinuationResult, function (data) { 1230 console.info("testOn005 data is" + data); 1231 expect().assertFail(); 1232 done() 1233 }); 1234 } catch (error) { 1235 console.info("testOn005 catch error is" + error); 1236 expect(error.toString().includes("Parameter error")).assertTrue(); 1237 done(); 1238 } 1239 console.info("----------------------testOn005 end----------------------"); 1240 }) 1241 1242 /* 1243 * @tc.number testOn006 1244 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1245 * @tc.desc Function test 1246 * @tc.size MediumTest 1247 * @tc.type: Function 1248 * @tc.level Level0 1249 */ 1250 it('testOn006', 0, async function (done){ 1251 console.info("----------------------testOn006 start----------------------"); 1252 try { 1253 continuationManager.on("deviceSelected",token, (data) =>{ 1254 console.info('testOn006 continuationManager.on success'); 1255 expect(data == undefined).assertTrue(); 1256 done() 1257 }) 1258 } catch (error) { 1259 console.log("testOn006 catch error is" + error); 1260 expect().assertFail(); 1261 done() 1262 } 1263 console.info("----------------------testOn006 end----------------------"); 1264 done() 1265 }) 1266 1267 /* 1268 * @tc.number testOn007 1269 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1270 * @tc.desc Function test 1271 * @tc.size MediumTest 1272 * @tc.type: Function 1273 * @tc.level Level0 1274 */ 1275 it('testOn007', 0, async function (done){ 1276 console.info("----------------------testOn007 start----------------------"); 1277 try { 1278 continuationManager.on("deviceUnselected",token, (data) =>{ 1279 console.info('testOn006 continuationManager.on success'); 1280 expect(data == undefined).assertTrue(); 1281 done() 1282 }) 1283 } catch (error) { 1284 console.log("testOn007 catch error is" + error); 1285 expect().assertFail(); 1286 done() 1287 } 1288 console.info("----------------------testOn007 end----------------------"); 1289 done() 1290 }) 1291 1292 /* 1293 * @tc.number testOn008 1294 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1295 * @tc.desc Function test 1296 * @tc.size MediumTest 1297 * @tc.type: Function 1298 * @tc.level Level0 1299 */ 1300 it('testOn008', 0, async function (done){ 1301 console.info("----------------------testOn008 start----------------------"); 1302 try { 1303 continuationManager.on("deviceUnselected",(err) =>{ 1304 console.info('testOn008 onDeviceSelected failed: ' + err.code); 1305 expect().assertTrue(); 1306 done() 1307 }) 1308 } catch (error) { 1309 console.info("testOn002 catch error is" + error); 1310 expect(error.toString().includes("must be 3")).assertTrue(); 1311 done(); 1312 } 1313 console.info("----------------------testOn008 end----------------------"); 1314 done() 1315 }) 1316 1317 /* 1318 * @tc.number testOff001 1319 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1320 * @tc.desc Function test 1321 * @tc.size MediumTest 1322 * @tc.type: Function 1323 * @tc.level Level0 1324 */ 1325 it('testOff001', 0, async function (done) { 1326 console.info("----------------------testOff001 start----------------------"); 1327 try { 1328 continuationManager.off("deviceConnect", function (data) { 1329 console.info("testOff001 data is" + data); 1330 expect(data != null).assertFail(); 1331 done(); 1332 }); 1333 } catch (error) { 1334 console.info("testOff001 catch error is" + error); 1335 expect(error.code == 401).assertTrue(); 1336 done(); 1337 } 1338 console.info("----------------------testOff001 end----------------------"); 1339 }) 1340 1341 /* 1342 * @tc.number testOff002 1343 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1344 * @tc.desc Function test 1345 * @tc.size MediumTest 1346 * @tc.type: Function 1347 * @tc.level Level0 1348 */ 1349 it('testOff002', 0, async function (done) { 1350 console.info("----------------------testOff002 start----------------------"); 1351 try { 1352 continuationManager.off("deviceDisconnect", function (data) { 1353 console.info("testOff002 data is" + data); 1354 expect(data != null).assertFail(); 1355 done(); 1356 }); 1357 } catch (error) { 1358 console.info("testOff002 catch error is" + error); 1359 expect(error.code == 401).assertTrue(); 1360 done(); 1361 } 1362 console.info("----------------------testOff002 end----------------------"); 1363 }) 1364 1365 /* 1366 * @tc.number testOff003 1367 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1368 * @tc.desc Function test 1369 * @tc.size MediumTest 1370 * @tc.type: Function 1371 * @tc.level Level0 1372 */ 1373 it('testOff003', 0, async function (done) { 1374 console.info("----------------------testOff003 start----------------------"); 1375 try { 1376 continuationManager.off("deviceSelected", "invalid token"); 1377 done(); 1378 } catch (error) { 1379 console.info("testOff003 catch error is" + error); 1380 expect(error.code == 401).assertTrue(); 1381 done(); 1382 } 1383 console.info("----------------------testOff003 end----------------------"); 1384 }) 1385 1386 /* 1387 * @tc.number testOff004 1388 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1389 * @tc.desc Function test 1390 * @tc.size MediumTest 1391 * @tc.type: Function 1392 * @tc.level Level0 1393 */ 1394 it('testOff004', 0, async function (done) { 1395 console.info("----------------------testOff004 start----------------------"); 1396 try { 1397 continuationManager.off("deviceUnselected", "invalid token"); 1398 done(); 1399 } catch (error) { 1400 console.info("testOff004 catch error is" + error); 1401 expect(error.code == 401).assertTrue(); 1402 done(); 1403 } 1404 console.info("----------------------testOff004 end----------------------"); 1405 }) 1406 1407 /* 1408 * @tc.number testOff005 1409 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1410 * @tc.desc Function test 1411 * @tc.size MediumTest 1412 * @tc.type: Function 1413 * @tc.level Level0 1414 */ 1415 it('testOff005', 0, async function(done){ 1416 console.info("----------------------testOff005 start----------------------"); 1417 try { 1418 continuationManager.off("deviceSelected", token); 1419 console.log('testOff005 off failed'); 1420 expect().assertFail() 1421 done() 1422 } catch (error) { 1423 console.log("testOff005 catch error is" + JSON.stringify(error)); 1424 expect(error.code == 16600002).assertTrue() 1425 done(); 1426 } 1427 console.info("----------------------testOff005 end----------------------"); 1428 done() 1429 }) 1430 1431 /* 1432 * @tc.number testOff006 1433 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1434 * @tc.desc Function test 1435 * @tc.size MediumTest 1436 * @tc.type: Function 1437 * @tc.level Level0 1438 */ 1439 it('testOff006', 0 , async function(done){ 1440 console.info("----------------------testOff006 start----------------------"); 1441 try { 1442 continuationManager.off("deviceUnselected", token); 1443 console.log('testOff006 off failed'); 1444 expect().assertFail() 1445 done() 1446 } catch (error) { 1447 console.log("testOff006 catch error is" + error); 1448 expect(error.toString().includes("callback is not registered")).assertTrue(); 1449 done(); 1450 } 1451 console.info("----------------------testOff006 end----------------------"); 1452 done() 1453 }) 1454 1455 /* 1456 * @tc.number testStartDeviceManager001 1457 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1458 * @tc.desc Function test 1459 * @tc.size MediumTest 1460 * @tc.type: Function 1461 * @tc.level Level0 1462 */ 1463 it('testStartDeviceManager001', 0, async function (done) { 1464 console.info("----------------------testStartDeviceManager001 start----------------------"); 1465 try { 1466 continuationManager.startDeviceManager(token, function (err, data) { 1467 console.info("testStartDeviceManager001 err is" + JSON.stringify(err)); 1468 console.info("testStartDeviceManager001 data is" + data); 1469 expect(err.code != 0).assertTrue(); 1470 expect(data == undefined).assertTrue(); 1471 done(); 1472 }); 1473 } catch (error) { 1474 console.info("testStartDeviceManager001 catch error is" + error); 1475 expect(null).assertFail(); 1476 done(); 1477 } 1478 console.info("----------------------testStartDeviceManager001 end----------------------"); 1479 }) 1480 1481 /* 1482 * @tc.number testStartDeviceManager002 1483 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1484 * @tc.desc Function test 1485 * @tc.size MediumTest 1486 * @tc.type: Function 1487 * @tc.level Level0 1488 */ 1489 it('testStartDeviceManager002', 0, async function (done) { 1490 console.info("----------------------testStartDeviceManager002 start----------------------"); 1491 try { 1492 continuationManager.startDeviceManager(null, function (err, data) { 1493 console.info("testStartDeviceManager002 err is" + JSON.stringify(err)); 1494 console.info("testStartDeviceManager002 data is" + data); 1495 expect(err.code == -1).assertTrue(); 1496 expect(data == undefined).assertTrue(); 1497 done(); 1498 }); 1499 } catch (error) { 1500 console.info("testStartDeviceManager002 catch error is" + error); 1501 expect(null).assertFail(); 1502 done(); 1503 } 1504 console.info("----------------------testStartDeviceManager002 end----------------------"); 1505 }) 1506 1507 /* 1508 * @tc.number testStartDeviceManager003 1509 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1510 * @tc.desc Function test 1511 * @tc.size MediumTest 1512 * @tc.type: Function 1513 * @tc.level Level0 1514 */ 1515 it('testStartDeviceManager003', 0, async function (done) { 1516 console.info("----------------------testStartDeviceManager003 start----------------------"); 1517 try { 1518 let continuationExtraParams = { 1519 deviceType: ["00E"], 1520 description: "description", 1521 filter: { "name": "authInfo", "length": 8 }, 1522 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 1523 authInfo: { "name": "authInfo", "length": 8 } 1524 }; 1525 continuationManager.startDeviceManager(null, continuationExtraParams, function (err, data) { 1526 console.info("testStartDeviceManager003 err is" + JSON.stringify(err)); 1527 console.info("testStartDeviceManager003 data is" + data); 1528 if (err.code == -1) { 1529 console.log('testStartDeviceManager003 err.code is' + err.code) 1530 expect(err.code == -1).assertTrue(); 1531 done(); 1532 } 1533 console.log('testStartDeviceManager003 data is' + data) 1534 expect(data == undefined).assertTrue(); 1535 done(); 1536 }); 1537 } catch (error) { 1538 console.info("testStartDeviceManager003 catch error is" + error); 1539 expect(null).assertFail(); 1540 done(); 1541 } 1542 console.info("----------------------testStartDeviceManager003 end----------------------"); 1543 }) 1544 1545 /* 1546 * @tc.number testStartDeviceManager004 1547 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1548 * @tc.desc Function test 1549 * @tc.size MediumTest 1550 * @tc.type: Function 1551 * @tc.level Level0 1552 */ 1553 it('testStartDeviceManager004', 0, async function (done) { 1554 console.info("----------------------testStartDeviceManager004 start----------------------"); 1555 try { 1556 let continuationExtraParams = { 1557 deviceType: ["00E"], 1558 description: "description", 1559 filter: { "name": "authInfo", "length": 8 }, 1560 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 1561 authInfo: { "name": "authInfo", "length": 8 } 1562 }; 1563 continuationManager.startDeviceManager(52, continuationExtraParams, function (err, data) { 1564 console.info("testStartDeviceManager004 err is" + JSON.stringify(err)); 1565 console.info("testStartDeviceManager004 data is" + data); 1566 expect(err.code == 29360208).assertTrue(); 1567 expect(data == undefined).assertTrue(); 1568 done(); 1569 }); 1570 } catch (error) { 1571 console.info("testStartDeviceManager004 catch error is" + error); 1572 expect(null).assertFail(); 1573 done(); 1574 } 1575 console.info("----------------------testStartDeviceManager004 end----------------------"); 1576 }) 1577 1578 /* 1579 * @tc.number testStartDeviceManager005 1580 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1581 * @tc.desc Function test 1582 * @tc.size MediumTest 1583 * @tc.type: Function 1584 * @tc.level Level0 1585 */ 1586 it('testStartDeviceManager005', 0, async function (done) { 1587 console.info("----------------------testStartDeviceManager005 start----------------------"); 1588 try { 1589 let continuationExtraParams = { 1590 deviceType: ["00E"], 1591 description: "description", 1592 filter: { "name": "authInfo", "length": 8 }, 1593 continuationMode: 30, 1594 authInfo: { "name": "authInfo", "length": 8 } 1595 }; 1596 continuationManager.startDeviceManager(token, continuationExtraParams, function (err, data) { 1597 console.info("testStartDeviceManager005 err is" + JSON.stringify(err)); 1598 console.info("testStartDeviceManager005 data is" + data); 1599 expect(err.code == 29360216).assertTrue(); 1600 expect(data == undefined).assertTrue(); 1601 done(); 1602 }); 1603 } catch (error) { 1604 console.info("testStartDeviceManager005 catch error is" + error); 1605 expect(null).assertFail(); 1606 done(); 1607 } 1608 console.info("----------------------testStartDeviceManager005 end----------------------"); 1609 }) 1610 1611 /* 1612 * @tc.number testStartDeviceManager006 1613 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1614 * @tc.desc Function test 1615 * @tc.size MediumTest 1616 * @tc.type: Function 1617 * @tc.level Level0 1618 */ 1619 it('testStartDeviceManager006', 0, async function (done) { 1620 console.info("----------------------testStartDeviceManager006 start----------------------"); 1621 try { 1622 let continuationExtraParams = { 1623 }; 1624 continuationManager.startDeviceManager(token, continuationExtraParams, function (err, data) { 1625 console.info("testStartDeviceManager006 err is" + JSON.stringify(err)); 1626 console.info("testStartDeviceManager006 data is" + data); 1627 expect(err.code != 0).assertTrue(); 1628 expect(data == undefined).assertTrue(); 1629 done(); 1630 }); 1631 } catch (error) { 1632 console.info("testStartDeviceManager006 catch error is" + error); 1633 expect(null).assertFail(); 1634 done(); 1635 } 1636 console.info("----------------------testStartDeviceManager006 end----------------------"); 1637 }) 1638 1639 /* 1640 * @tc.number testStartDeviceManager007 1641 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1642 * @tc.desc Function test 1643 * @tc.size MediumTest 1644 * @tc.type: Function 1645 * @tc.level Level0 1646 */ 1647 it('testStartDeviceManager007', 0, async function (done) { 1648 console.info("----------------------testStartDeviceManager007 start----------------------"); 1649 try { 1650 let continuationExtraParams = { 1651 deviceType: ["00E"], 1652 description: "description", 1653 filter: { "name": "authInfo", "length": 8 }, 1654 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE, 1655 authInfo: { "name": "authInfo", "length": 8 } 1656 }; 1657 continuationManager.startDeviceManager(token, continuationExtraParams, function (err, data) { 1658 console.info("testStartDeviceManager007 err is" + JSON.stringify(err)); 1659 console.info("testStartDeviceManager007 data is" + data); 1660 expect(err.code != 0).assertTrue(); 1661 expect(data == undefined).assertTrue(); 1662 done(); 1663 }); 1664 } catch (error) { 1665 console.info("testStartDeviceManager007 catch error is" + error); 1666 expect(null).assertFail(); 1667 done(); 1668 } 1669 console.info("----------------------testStartDeviceManager007 end----------------------"); 1670 }) 1671 1672 /* 1673 * @tc.number testStartDeviceManager008 1674 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1675 * @tc.desc Function test 1676 * @tc.size MediumTest 1677 * @tc.type: Function 1678 * @tc.level Level0 1679 */ 1680 it('testStartDeviceManager008', 0, async function (done) { 1681 console.info("----------------------testStartDeviceManager008 start----------------------"); 1682 try { 1683 let continuationExtraParams = { 1684 deviceType: ["00E"], 1685 description: "description", 1686 filter: { "name": "authInfo", "length": 8 }, 1687 continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, 1688 authInfo: { "name": "authInfo", "length": 8 } 1689 }; 1690 continuationManager.startDeviceManager(token, continuationExtraParams).then((data) => { 1691 console.log('testStartDeviceManager008 data is' + data); 1692 expect().assertFail(); 1693 done(); 1694 }).catch((err) => { 1695 console.log('testStartDeviceManager008 err code is' + err.code); 1696 expect(err.code == 29360210).assertTrue(); 1697 done(); 1698 }); 1699 } catch (error) { 1700 console.info("testStartDeviceManager008 catch error is" + error); 1701 expect(null).assertFail(); 1702 done(); 1703 } 1704 console.info("----------------------testStartDeviceManager008 end----------------------"); 1705 }) 1706 1707 /* 1708 * @tc.number testStartDeviceManager009 1709 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1710 * @tc.desc Function test 1711 * @tc.size MediumTest 1712 * @tc.type: Function 1713 * @tc.level Level0 1714 */ 1715 it('testStartDeviceManager009', 0, async function (done) { 1716 console.info("----------------------testStartDeviceManager009 start----------------------"); 1717 try { 1718 continuationManager.startDeviceManager(token).then((data) => { 1719 console.log('testStartDeviceManager009 data is' + data); 1720 expect().assertFail(); 1721 done(); 1722 }).catch((err) => { 1723 console.log('testStartDeviceManager009 err code is' + err.code); 1724 expect(err.code == 29360210).assertTrue(); 1725 done(); 1726 }); 1727 } catch (error) { 1728 console.info("testStartDeviceManager009 catch error is" + error); 1729 expect(null).assertFail(); 1730 done(); 1731 } 1732 console.info("----------------------testStartDeviceManager009 end----------------------"); 1733 }) 1734 1735 /* 1736 * @tc.number testStartContinuationDeviceManager001 1737 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1738 * @tc.desc Function test 1739 * @tc.size MediumTest 1740 * @tc.type: Function 1741 * @tc.level Level0 1742 */ 1743 it('testStartContinuationDeviceManager001', 0, async function (done) { 1744 console.info("----------------------testStartContinuationDeviceManager001 start----------------------"); 1745 try { 1746 continuationManager.startContinuationDeviceManager(token, function (err, data) { 1747 console.info("testStartContinuationDeviceManager001 err is" + JSON.stringify(err)); 1748 console.info("testStartContinuationDeviceManager001 data is" + data); 1749 expect(err.code != 0).assertTrue(); 1750 expect(data == undefined).assertTrue(); 1751 done(); 1752 }); 1753 } catch (error) { 1754 console.info("testStartContinuationDeviceManager001 catch error is" + error); 1755 expect(null).assertFail(); 1756 done(); 1757 } 1758 console.info("----------------------testStartContinuationDeviceManager001 end----------------------"); 1759 }) 1760 1761 /* 1762 * @tc.number testStartContinuationDeviceManager002 1763 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1764 * @tc.desc Function test 1765 * @tc.size MediumTest 1766 * @tc.type: Function 1767 * @tc.level Level0 1768 */ 1769 it('testStartContinuationDeviceManager002', 0, async function (done) { 1770 console.info("----------------------testStartContinuationDeviceManager002 start----------------------"); 1771 try { 1772 continuationManager.startContinuationDeviceManager("invalid token", function (err, data) { 1773 console.info("testStartContinuationDeviceManager002 err is" + JSON.stringify(err)); 1774 console.info("testStartContinuationDeviceManager002 data is" + data); 1775 expect(err.code == 401).assertTrue(); 1776 expect(data == undefined).assertTrue(); 1777 done(); 1778 }); 1779 } catch (error) { 1780 console.info("testStartContinuationDeviceManager002 catch error is" + error); 1781 expect(error.code == 401).assertTrue(); 1782 done(); 1783 } 1784 console.info("----------------------testStartContinuationDeviceManager002 end----------------------"); 1785 }) 1786 1787 /* 1788 * @tc.number testStartContinuationDeviceManager003 1789 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1790 * @tc.desc Function test 1791 * @tc.size MediumTest 1792 * @tc.type: Function 1793 * @tc.level Level0 1794 */ 1795 it('testStartContinuationDeviceManager003', 0, async function (done) { 1796 console.info("----------------------testStartContinuationDeviceManager003 start----------------------"); 1797 try { 1798 let continuationExtraParams = { 1799 deviceType: ["00E"], 1800 description: "description", 1801 filter: { "name": "authInfo", "length": 8 }, 1802 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 1803 authInfo: { "name": "authInfo", "length": 8 } 1804 }; 1805 continuationManager.startContinuationDeviceManager("invalid token", continuationExtraParams, function (err, data) { 1806 console.info("testStartContinuationDeviceManager003 err is" + JSON.stringify(err)); 1807 console.info("testStartContinuationDeviceManager003 data is" + data); 1808 expect(err.code == 401).assertTrue(); 1809 expect(data == undefined).assertTrue(); 1810 done(); 1811 }); 1812 } catch (error) { 1813 console.info("testStartContinuationDeviceManager003 catch error is" + error); 1814 expect(error.code == 401).assertTrue(); 1815 done(); 1816 } 1817 console.info("----------------------testStartContinuationDeviceManager003 end----------------------"); 1818 }) 1819 1820 /* 1821 * @tc.number testStartContinuationDeviceManager004 1822 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1823 * @tc.desc Function test 1824 * @tc.size MediumTest 1825 * @tc.type: Function 1826 * @tc.level Level0 1827 */ 1828 it('testStartContinuationDeviceManager004', 0, async function (done) { 1829 console.info("----------------------testStartContinuationDeviceManager004 start----------------------"); 1830 try { 1831 let continuationExtraParams = { 1832 deviceType: ["00E"], 1833 description: "description", 1834 filter: { "name": "authInfo", "length": 8 }, 1835 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE, 1836 authInfo: { "name": "authInfo", "length": 8 } 1837 }; 1838 continuationManager.startContinuationDeviceManager(52, continuationExtraParams, function (err, data) { 1839 console.info("testStartContinuationDeviceManager004 err is" + JSON.stringify(err)); 1840 console.info("testStartContinuationDeviceManager004 data is" + data); 1841 expect(err.code == 16600002).assertTrue(); 1842 expect(data == undefined).assertTrue(); 1843 done(); 1844 }); 1845 } catch (error) { 1846 console.info("testStartContinuationDeviceManager004 catch error is" + error); 1847 expect(null).assertFail(); 1848 done(); 1849 } 1850 console.info("----------------------testStartContinuationDeviceManager004 end----------------------"); 1851 }) 1852 1853 /* 1854 * @tc.number testStartContinuationDeviceManager005 1855 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1856 * @tc.desc Function test 1857 * @tc.size MediumTest 1858 * @tc.type: Function 1859 * @tc.level Level0 1860 */ 1861 it('testStartContinuationDeviceManager005', 0, async function (done) { 1862 console.info("----------------------testStartContinuationDeviceManager005 start----------------------"); 1863 try { 1864 let continuationExtraParams = { 1865 deviceType: ["00E"], 1866 description: "description", 1867 filter: { "name": "authInfo", "length": 8 }, 1868 continuationMode: 30, 1869 authInfo: { "name": "authInfo", "length": 8 } 1870 }; 1871 continuationManager.startContinuationDeviceManager(token, continuationExtraParams, function (err, data) { 1872 console.info("testStartContinuationDeviceManager005 err is" + JSON.stringify(err)); 1873 console.info("testStartContinuationDeviceManager005 data is" + data); 1874 expect(err.code == 401).assertTrue(); 1875 expect(data == undefined).assertTrue(); 1876 done(); 1877 }); 1878 } catch (error) { 1879 console.info("testStartContinuationDeviceManager005 catch error is" + error); 1880 expect(null).assertFail(); 1881 done(); 1882 } 1883 console.info("----------------------testStartContinuationDeviceManager005 end----------------------"); 1884 }) 1885 1886 /* 1887 * @tc.number testStartContinuationDeviceManager006 1888 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1889 * @tc.desc Function test 1890 * @tc.size MediumTest 1891 * @tc.type: Function 1892 * @tc.level Level0 1893 */ 1894 it('testStartContinuationDeviceManager006', 0, async function (done) { 1895 console.info("----------------------testStartContinuationDeviceManager006 start----------------------"); 1896 try { 1897 let continuationExtraParams = { 1898 }; 1899 continuationManager.startContinuationDeviceManager(token, continuationExtraParams, function (err, data) { 1900 console.info("testStartContinuationDeviceManager006 err is" + JSON.stringify(err)); 1901 console.info("testStartContinuationDeviceManager006 data is" + data); 1902 expect(err.code != 0).assertTrue(); 1903 expect(data == undefined).assertTrue(); 1904 done(); 1905 }); 1906 } catch (error) { 1907 console.info("testStartContinuationDeviceManager006 catch error is" + error); 1908 expect(null).assertFail(); 1909 done(); 1910 } 1911 console.info("----------------------testStartContinuationDeviceManager006 end----------------------"); 1912 }) 1913 1914 /* 1915 * @tc.number testStartContinuationDeviceManager007 1916 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1917 * @tc.desc Function test 1918 * @tc.size MediumTest 1919 * @tc.type: Function 1920 * @tc.level Level0 1921 */ 1922 it('testStartContinuationDeviceManager007', 0, async function (done) { 1923 console.info("----------------------testStartContinuationDeviceManager007 start----------------------"); 1924 try { 1925 let continuationExtraParams = { 1926 deviceType: ["00E"], 1927 description: "description", 1928 filter: { "name": "authInfo", "length": 8 }, 1929 continuationMode: continuationManager.ContinuationMode.COLLABORATION_MUTIPLE, 1930 authInfo: { "name": "authInfo", "length": 8 } 1931 }; 1932 continuationManager.startContinuationDeviceManager(token, continuationExtraParams, function (err, data) { 1933 console.info("testStartContinuationDeviceManager007 err is" + JSON.stringify(err)); 1934 console.info("testStartContinuationDeviceManager007 data is" + data); 1935 expect(err.code != 0).assertTrue(); 1936 expect(data == undefined).assertTrue(); 1937 done(); 1938 }); 1939 } catch (error) { 1940 console.info("testStartContinuationDeviceManager007 catch error is" + error); 1941 expect(null).assertFail(); 1942 done(); 1943 } 1944 console.info("----------------------testStartContinuationDeviceManager007 end----------------------"); 1945 }) 1946 1947 /* 1948 * @tc.number testStartContinuationDeviceManager008 1949 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1950 * @tc.desc Function test 1951 * @tc.size MediumTest 1952 * @tc.type: Function 1953 * @tc.level Level0 1954 */ 1955 it('testStartContinuationDeviceManager008', 0, async function (done) { 1956 console.info("----------------------testStartContinuationDeviceManager008 start----------------------"); 1957 try { 1958 let continuationExtraParams = { 1959 deviceType: ["00E"], 1960 description: "description", 1961 filter: { "name": "authInfo", "length": 8 }, 1962 continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE, 1963 authInfo: { "name": "authInfo", "length": 8 } 1964 }; 1965 continuationManager.startContinuationDeviceManager(token, continuationExtraParams).then((data) => { 1966 console.log('testStartContinuationDeviceManager008 data is' + data); 1967 expect().assertFail(); 1968 done(); 1969 }).catch((err) => { 1970 console.log('testStartContinuationDeviceManager008 err code is' + err.code); 1971 expect(err.code == 16600002).assertTrue(); 1972 done(); 1973 }); 1974 } catch (error) { 1975 console.info("testStartContinuationDeviceManager008 catch error is" + error); 1976 expect(null).assertFail(); 1977 done(); 1978 } 1979 console.info("----------------------testStartContinuationDeviceManager008 end----------------------"); 1980 }) 1981 1982 /* 1983 * @tc.number testStartContinuationDeviceManager009 1984 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 1985 * @tc.desc Function test 1986 * @tc.size MediumTest 1987 * @tc.type: Function 1988 * @tc.level Level0 1989 */ 1990 it('testStartContinuationDeviceManager009', 0, async function (done) { 1991 console.info("----------------------testStartContinuationDeviceManager009 start----------------------"); 1992 try { 1993 continuationManager.startContinuationDeviceManager(token).then((data) => { 1994 console.log('testStartContinuationDeviceManager009 data is' + data); 1995 expect().assertFail(); 1996 done(); 1997 }).catch((err) => { 1998 console.log('testStartContinuationDeviceManager009 err code is' + err.code); 1999 expect(err.code == 16600002).assertTrue(); 2000 done(); 2001 }); 2002 } catch (error) { 2003 console.info("testStartContinuationDeviceManager009 catch error is" + error); 2004 expect(null).assertFail(); 2005 done(); 2006 } 2007 console.info("----------------------testStartContinuationDeviceManager009 end----------------------"); 2008 }) 2009 2010 /* 2011 * @tc.number testUpdateConnectStatus001 2012 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2013 * @tc.desc Function test 2014 * @tc.size MediumTest 2015 * @tc.type: Function 2016 * @tc.level Level0 2017 */ 2018 it('testUpdateConnectStatus001', 0, async function (done) { 2019 console.info("----------------------testUpdateConnectStatus001 start----------------------"); 2020 try { 2021 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, TEST_CONNECT_STATUS, function (err, data) { 2022 console.info("testUpdateConnectStatus001 err is" + JSON.stringify(err)); 2023 console.info("testUpdateConnectStatus001 data is" + data); 2024 expect(err.code != 0).assertTrue(); 2025 expect(data == undefined).assertTrue(); 2026 done(); 2027 }); 2028 } catch (error) { 2029 console.info("testUpdateConnectStatus001 catch error is" + error); 2030 expect(null).assertFail(); 2031 done(); 2032 } 2033 console.info("----------------------testUpdateConnectStatus001 end----------------------"); 2034 }) 2035 2036 /* 2037 * @tc.number testUpdateConnectStatus002 2038 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2039 * @tc.desc Function test 2040 * @tc.size MediumTest 2041 * @tc.type: Function 2042 * @tc.level Level0 2043 */ 2044 it('testUpdateConnectStatus002', 0, async function (done) { 2045 console.info("----------------------testUpdateConnectStatus002 start----------------------"); 2046 try { 2047 continuationManager.updateConnectStatus(null, TEST_DEVICE_ID, TEST_CONNECT_STATUS, function (err, data) { 2048 console.info("testUpdateConnectStatus002 err is" + JSON.stringify(err)); 2049 console.info("testUpdateConnectStatus002 data is" + data); 2050 expect(err.code == -1).assertTrue(); 2051 expect(data == undefined).assertTrue(); 2052 done(); 2053 }); 2054 } catch (error) { 2055 console.info("testUpdateConnectStatus002 catch error is" + error); 2056 expect(null).assertFail(); 2057 done(); 2058 } 2059 console.info("----------------------testUpdateConnectStatus002 end----------------------"); 2060 }) 2061 2062 /* 2063 * @tc.number testUpdateConnectStatus003 2064 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2065 * @tc.desc Function test 2066 * @tc.size MediumTest 2067 * @tc.type: Function 2068 * @tc.level Level0 2069 */ 2070 it('testUpdateConnectStatus003', 0, async function (done) { 2071 console.info("----------------------testUpdateConnectStatus003 start----------------------"); 2072 try { 2073 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, -2, function (err, data) { 2074 console.info("testUpdateConnectStatus003 err is" + JSON.stringify(err)); 2075 console.info("testUpdateConnectStatus003 data is" + data); 2076 expect(err.code == 29360215).assertTrue(); 2077 expect(data == undefined).assertTrue(); 2078 done(); 2079 }); 2080 } catch (error) { 2081 console.info("testUpdateConnectStatus003 catch error is" + error); 2082 expect(null).assertFail(); 2083 done(); 2084 } 2085 console.info("----------------------testUpdateConnectStatus003 end----------------------"); 2086 }) 2087 2088 /* 2089 * @tc.number testUpdateConnectStatus004 2090 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2091 * @tc.desc Function test 2092 * @tc.size MediumTest 2093 * @tc.type: Function 2094 * @tc.level Level0 2095 */ 2096 it('testUpdateConnectStatus004', 0, async function (done) { 2097 console.info("----------------------testUpdateConnectStatus004 start----------------------"); 2098 try { 2099 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, 2100 continuationManager.DeviceConnectState.IDLE).then((data) => { 2101 console.log('testUpdateConnectStatus004 data is' + data); 2102 expect().assertFail(); 2103 done(); 2104 }).catch((err) => { 2105 console.log('testUpdateConnectStatus004 err code is' + err.code); 2106 expect(err.code == 29360210).assertTrue(); 2107 done(); 2108 }); 2109 } catch (error) { 2110 console.info("testUpdateConnectStatus004 catch error is" + error); 2111 expect(null).assertFail(); 2112 done(); 2113 } 2114 console.info("----------------------testUpdateConnectStatus004 end----------------------"); 2115 }) 2116 2117 /* 2118 * @tc.number testUpdateConnectStatus005 2119 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2120 * @tc.desc Function test 2121 * @tc.size MediumTest 2122 * @tc.type: Function 2123 * @tc.level Level0 2124 */ 2125 it('testUpdateConnectStatus005', 0, async function (done) { 2126 console.info("----------------------testUpdateConnectStatus005 start----------------------"); 2127 try { 2128 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, 2129 continuationManager.DeviceConnectState.CONNECTING).then((data) => { 2130 console.log('testUpdateConnectStatus005 data is' + data); 2131 expect().assertFail(); 2132 done(); 2133 }).catch((err) => { 2134 console.log('testUpdateConnectStatus005 err code is' + err.code); 2135 expect(err.code == 29360210).assertTrue(); 2136 done(); 2137 }); 2138 } catch (error) { 2139 console.info("testUpdateConnectStatus005 catch error is" + error); 2140 expect(null).assertFail(); 2141 done(); 2142 } 2143 console.info("----------------------testUpdateConnectStatus005 end----------------------"); 2144 }) 2145 2146 /* 2147 * @tc.number testUpdateConnectStatus006 2148 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2149 * @tc.desc Function test 2150 * @tc.size MediumTest 2151 * @tc.type: Function 2152 * @tc.level Level0 2153 */ 2154 it('testUpdateConnectStatus006', 0, async function (done) { 2155 console.info("----------------------testUpdateConnectStatus006 start----------------------"); 2156 try { 2157 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, 2158 continuationManager.DeviceConnectState.DISCONNECTING).then((data) => { 2159 console.log('testUpdateConnectStatus006 data is' + data); 2160 expect().assertFail(); 2161 done(); 2162 }).catch((err) => { 2163 console.log('testUpdateConnectStatus006 err code is' + err.code); 2164 expect(err.code == 29360210).assertTrue(); 2165 done(); 2166 }); 2167 } catch (error) { 2168 console.info("testUpdateConnectStatus006 catch error is" + error); 2169 expect(null).assertFail(); 2170 done(); 2171 } 2172 console.info("----------------------testUpdateConnectStatus006 end----------------------"); 2173 }) 2174 2175 /* 2176 * @tc.number testUpdateConnectStatus007 2177 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2178 * @tc.desc Function test 2179 * @tc.size MediumTest 2180 * @tc.type: Function 2181 * @tc.level Level0 2182 */ 2183 it('testUpdateConnectStatus007', 0, async function (done) { 2184 console.info("----------------------testUpdateConnectStatus007 start----------------------"); 2185 let token = -1; 2186 try { 2187 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, 2188 continuationManager.DeviceConnectState.DISCONNECTING).then((data) => { 2189 console.log('testUpdateConnectStatus007 data is' + data); 2190 expect().assertFail(); 2191 done(); 2192 }).catch((err) => { 2193 console.log('testUpdateConnectStatus007 err code is' + err.code); 2194 expect(err.code == 29360208).assertTrue(); 2195 done(); 2196 }); 2197 } catch (error) { 2198 console.info("testUpdateConnectStatus007 catch error is" + error); 2199 expect(null).assertFail(); 2200 done(); 2201 } 2202 console.info("----------------------testUpdateConnectStatus007 end----------------------"); 2203 }) 2204 2205 /* 2206 * @tc.number testUpdateConnectStatus008 2207 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2208 * @tc.desc Function test 2209 * @tc.size MediumTest 2210 * @tc.type: Function 2211 * @tc.level Level0 2212 */ 2213 it('testUpdateConnectStatus008', 0, async function (done) { 2214 console.info("----------------------testUpdateConnectStatus008 start----------------------"); 2215 try { 2216 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, 2217 continuationManager.DeviceConnectState.CONNECTED).then((data) => { 2218 console.log('testUpdateConnectStatus008 data is' + data); 2219 expect().assertFail(); 2220 done(); 2221 }).catch((err) => { 2222 console.log('testUpdateConnectStatus008 err code is' + err.code); 2223 expect(err.code == 29360210).assertTrue(); 2224 done(); 2225 }); 2226 } catch (error) { 2227 console.info("testUpdateConnectStatus008 catch error is" + error); 2228 expect(null).assertFail(); 2229 done(); 2230 } 2231 console.info("----------------------testUpdateConnectStatus008 end----------------------"); 2232 }) 2233 2234 /* 2235 * @tc.number testUpdateConnectStatus009 2236 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2237 * @tc.desc Function test 2238 * @tc.size MediumTest 2239 * @tc.type: Function 2240 * @tc.level Level0 2241 */ 2242 it('testUpdateConnectStatus009', 0, async function (done) { 2243 console.info("----------------------testUpdateConnectStatus009 start----------------------"); 2244 try { 2245 continuationManager.updateConnectStatus(token, continuationManager.DeviceConnectState.CONNECTED) 2246 .then((data) => { 2247 console.log('testUpdateConnectStatus009 data is' + data); 2248 expect().assertFail(); 2249 done(); 2250 }).catch((err) => { 2251 console.log('testUpdateConnectStatus009 err code is' + err.code); 2252 expect(err.code == -1).assertTrue(); 2253 done(); 2254 }); 2255 } catch (error) { 2256 console.info("testUpdateConnectStatus009 catch error is" + error); 2257 expect(null).assertFail(); 2258 done(); 2259 } 2260 console.info("----------------------testUpdateConnectStatus009 end----------------------"); 2261 }) 2262 2263 /* 2264 * @tc.number testUpdateConnectStatus010 2265 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2266 * @tc.desc Function test 2267 * @tc.size MediumTest 2268 * @tc.type: Function 2269 * @tc.level Level0 2270 */ 2271 it('testUpdateConnectStatus010', 0, async function (done) { 2272 console.info("----------------------testUpdateConnectStatus010 start----------------------"); 2273 try { 2274 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID) 2275 .then((data) => { 2276 console.log('testUpdateConnectStatus010 data is' + data); 2277 expect().assertFail(); 2278 done(); 2279 }).catch((err) => { 2280 console.log('testUpdateConnectStatus010 err code is' + err.code); 2281 expect(err.code == -1).assertTrue(); 2282 done(); 2283 }); 2284 } catch (error) { 2285 console.info("testUpdateConnectStatus010 catch error is" + error); 2286 expect(null).assertFail(); 2287 done(); 2288 } 2289 console.info("----------------------testUpdateConnectStatus010 end----------------------"); 2290 }) 2291 2292 /* 2293 * @tc.number testUpdateConnectStatus011 2294 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2295 * @tc.desc Function test 2296 * @tc.size MediumTest 2297 * @tc.type: Function 2298 * @tc.level Level0 2299 */ 2300 it('testUpdateConnectStatus011', 0, async function (done) { 2301 console.info("----------------------testUpdateConnectStatus011 start----------------------"); 2302 try { 2303 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, continuationManager.DeviceConnectState.aaaa) 2304 .then((data) => { 2305 console.log('testUpdateConnectStatus011 data is' + data); 2306 expect().assertFail(); 2307 done(); 2308 }).catch((err) => { 2309 console.log('testUpdateConnectStatus011 err code is' + err.code); 2310 expect(err.code == -1).assertTrue(); 2311 done(); 2312 }); 2313 } catch (error) { 2314 console.info("testUpdateConnectStatus011 catch error is" + error); 2315 expect(null).assertFail(); 2316 done(); 2317 } 2318 console.info("----------------------testUpdateConnectStatus011 end----------------------"); 2319 }) 2320 2321 /* 2322 * @tc.number testUpdateConnectStatus012 2323 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2324 * @tc.desc Function test 2325 * @tc.size MediumTest 2326 * @tc.type: Function 2327 * @tc.level Level0 2328 */ 2329 it('testUpdateConnectStatus012', 0, async function (done) { 2330 console.info("----------------------testUpdateConnectStatus012 start----------------------"); 2331 let token = -1; 2332 try { 2333 continuationManager.updateConnectStatus(token, TEST_DEVICE_ID, continuationManager.DeviceConnectState.CONNECTED) 2334 .then((data) => { 2335 console.log('testUpdateConnectStatus012 data is' + data); 2336 expect().assertFail(); 2337 done(); 2338 }).catch((err) => { 2339 console.log('testUpdateConnectStatus012 err code is' + err.code); 2340 expect(err.code == 29360208).assertTrue(); 2341 done(); 2342 }); 2343 } catch (error) { 2344 console.info("testUpdateConnectStatus012 catch error is" + error); 2345 expect(null).assertFail(); 2346 done(); 2347 } 2348 console.info("----------------------testUpdateConnectStatus012 end----------------------"); 2349 }) 2350 2351 /* 2352 * @tc.number testUpdateConnectStatus013 2353 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2354 * @tc.desc Function test 2355 * @tc.size MediumTest 2356 * @tc.type: Function 2357 * @tc.level Level0 2358 */ 2359 it('testUpdateConnectStatus013', 0, async function (done) { 2360 console.info("----------------------testUpdateConnectStatus013 start----------------------"); 2361 try { 2362 continuationManager.updateConnectStatus(TEST_DEVICE_ID, continuationManager.DeviceConnectState.CONNECTED) 2363 .then((data) => { 2364 console.log('testUpdateConnectStatus013 data is' + data); 2365 expect().assertFail(); 2366 done(); 2367 }).catch((err) => { 2368 console.log('testUpdateConnectStatus013 err code is' + err.code); 2369 expect(err.code == -1).assertTrue(); 2370 done(); 2371 }); 2372 } catch (error) { 2373 console.info("testUpdateConnectStatus013 catch error is" + error); 2374 expect(null).assertFail(); 2375 done(); 2376 } 2377 console.info("----------------------testUpdateConnectStatus013 end----------------------"); 2378 }) 2379 2380 /* 2381 * @tc.number testUpdateContinuationState001 2382 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2383 * @tc.desc Function test 2384 * @tc.size MediumTest 2385 * @tc.type: Function 2386 * @tc.level Level0 2387 */ 2388 it('testUpdateContinuationState001', 0, async function (done) { 2389 console.info("----------------------testUpdateContinuationState001 start----------------------"); 2390 try { 2391 continuationManager.updateContinuationState(token, TEST_DEVICE_ID, TEST_CONNECT_STATUS, function (err, data) { 2392 console.info("testUpdateContinuationState001 err is" + JSON.stringify(err)); 2393 console.info("testUpdateContinuationState001 data is" + data); 2394 expect(err.code != 0).assertTrue(); 2395 expect(data == undefined).assertTrue(); 2396 done(); 2397 }); 2398 } catch (error) { 2399 console.info("testUpdateContinuationState001 catch error is" + error); 2400 expect(null).assertFail(); 2401 done(); 2402 } 2403 console.info("----------------------testUpdateContinuationState001 end----------------------"); 2404 }) 2405 2406 /* 2407 * @tc.number testUpdateContinuationState002 2408 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2409 * @tc.desc Function test 2410 * @tc.size MediumTest 2411 * @tc.type: Function 2412 * @tc.level Level0 2413 */ 2414 it('testUpdateContinuationState002', 0, async function (done) { 2415 console.info("----------------------testUpdateContinuationState002 start----------------------"); 2416 try { 2417 continuationManager.updateContinuationState("invalid token", TEST_DEVICE_ID, TEST_CONNECT_STATUS, function (err, data) { 2418 console.info("testUpdateContinuationState002 err is" + JSON.stringify(err)); 2419 console.info("testUpdateContinuationState002 data is" + data); 2420 expect(err.code == 401).assertTrue(); 2421 expect(data == undefined).assertTrue(); 2422 done(); 2423 }); 2424 } catch (error) { 2425 console.info("testUpdateContinuationState002 catch error is" + error); 2426 expect(error.code == 401).assertTrue(); 2427 done(); 2428 } 2429 console.info("----------------------testUpdateContinuationState002 end----------------------"); 2430 }) 2431 2432 /* 2433 * @tc.number testUpdateContinuationState003 2434 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2435 * @tc.desc Function test 2436 * @tc.size MediumTest 2437 * @tc.type: Function 2438 * @tc.level Level0 2439 */ 2440 it('testUpdateContinuationState003', 0, async function (done) { 2441 console.info("----------------------testUpdateContinuationState003 start----------------------"); 2442 try { 2443 continuationManager.updateContinuationState(token, TEST_DEVICE_ID, -2, function (err, data) { 2444 console.info("testUpdateContinuationState003 err is" + JSON.stringify(err)); 2445 console.info("testUpdateContinuationState003 data is" + data); 2446 expect(err.code == 401).assertTrue(); 2447 expect(data == undefined).assertTrue(); 2448 done(); 2449 }); 2450 } catch (error) { 2451 console.info("testUpdateContinuationState003 catch error is" + error); 2452 expect(error.code == 401).assertTrue(); 2453 done(); 2454 } 2455 console.info("----------------------testUpdateContinuationState003 end----------------------"); 2456 }) 2457 2458 /* 2459 * @tc.number testUpdateContinuationState004 2460 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2461 * @tc.desc Function test 2462 * @tc.size MediumTest 2463 * @tc.type: Function 2464 * @tc.level Level0 2465 */ 2466 it('testUpdateContinuationState004', 0, async function (done) { 2467 console.info("----------------------testUpdateContinuationState004 start----------------------"); 2468 try { 2469 continuationManager.updateContinuationState(token, TEST_DEVICE_ID, 2470 continuationManager.DeviceConnectState.IDLE).then((data) => { 2471 console.log('testUpdateContinuationState004 data is' + data); 2472 expect().assertFail(); 2473 done(); 2474 }).catch((err) => { 2475 console.log('testUpdateContinuationState004 err code is' + err.code); 2476 expect(err.code == 16600002).assertTrue(); 2477 done(); 2478 }); 2479 } catch (error) { 2480 console.info("testUpdateContinuationState004 catch error is" + error); 2481 expect(null).assertFail(); 2482 done(); 2483 } 2484 console.info("----------------------testUpdateContinuationState004 end----------------------"); 2485 }) 2486 2487 /* 2488 * @tc.number testUpdateContinuationState005 2489 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2490 * @tc.desc Function test 2491 * @tc.size MediumTest 2492 * @tc.type: Function 2493 * @tc.level Level0 2494 */ 2495 it('testUpdateContinuationState005', 0, async function (done) { 2496 console.info("----------------------testUpdateContinuationState005 start----------------------"); 2497 try { 2498 continuationManager.updateContinuationState(token, TEST_DEVICE_ID, 2499 continuationManager.DeviceConnectState.CONNECTING).then((data) => { 2500 console.log('testUpdateContinuationState005 data is' + data); 2501 expect().assertFail(); 2502 done(); 2503 }).catch((err) => { 2504 console.log('testUpdateContinuationState005 err code is' + err.code); 2505 expect(err.code == 16600002).assertTrue(); 2506 done(); 2507 }); 2508 } catch (error) { 2509 console.info("testUpdateContinuationState005 catch error is" + error); 2510 expect(null).assertFail(); 2511 done(); 2512 } 2513 console.info("----------------------testUpdateContinuationState005 end----------------------"); 2514 }) 2515 2516 /* 2517 * @tc.number testUpdateContinuationState006 2518 * @tc.name Continuation Manager-Modul bietet die Möglichkeit 2519 * @tc.desc Function test 2520 * @tc.size MediumTest 2521 * @tc.type: Function 2522 * @tc.level Level0 2523 */ 2524 it('testUpdateContinuationState006', 0, async function (done) { 2525 console.info("----------------------testUpdateContinuationState006 start----------------------"); 2526 try { 2527 continuationManager.updateContinuationState(token, TEST_DEVICE_ID, 2528 continuationManager.DeviceConnectState.DISCONNECTING).then((data) => { 2529 console.log('testUpdateContinuationState006 data is' + data); 2530 expect().assertFail(); 2531 done(); 2532 }).catch((err) => { 2533 console.log('testUpdateContinuationState006 err code is' + err.code); 2534 expect(err.code == 16600002).assertTrue(); 2535 done(); 2536 }); 2537 } catch (error) { 2538 console.info("testUpdateContinuationState006 catch error is" + error); 2539 expect(null).assertFail(); 2540 done(); 2541 } 2542 console.info("----------------------testUpdateContinuationState006 end----------------------"); 2543 }) 2544 }) 2545} 2546