From 2bf1022990a9d4f4d044e882c556f05103e973f3 Mon Sep 17 00:00:00 2001 From: quanli Date: Fri, 14 Jul 2023 10:07:36 +0800 Subject: [PATCH] quanli1@huawei.com Signed-off-by: quanli --- communication/BUILD.gn | 9 +- .../BUILD.gn | 4 +- .../Test.json | 2 +- .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 4 + .../src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../src/main/js/TestAbility/app.js | 0 .../src/main/js/TestAbility/i18n/en-US.json | 0 .../src/main/js/TestAbility/i18n/zh-CN.json | 0 .../main/js/TestAbility/pages/index/index.css | 0 .../main/js/TestAbility/pages/index/index.hml | 0 .../main/js/TestAbility/pages/index/index.js | 0 .../js/TestRunner/OpenHarmonyTestRunner.js | 0 .../main/js/test/BtGattAdvertiser.test.js} | 111 ++---- .../src/main/js/test/BtGattManager.test.js} | 187 ++++----- .../src/main/js/test/BtGattService.test.js} | 114 +++--- .../js/test/BtManagerGattAdvertiser.test.js} | 100 ++--- .../js/test/BtManagerGattManager.test.js} | 158 +++----- .../js/test/BtManagerGattService.test.js} | 205 ++++------ .../src/main/js/test/List.test.js | 19 +- .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin communication/bluetooth_profile/BUILD.gn | 2 +- communication/bluetooth_profile/Test.json | 2 +- .../src/main/js/test/BluetoothA2dp.test.js | 68 ++-- .../src/main/js/test/BluetoothHfp.test.js | 55 +-- .../src/main/js/test/BtManagerA2dp.test.js | 84 ++++ .../src/main/js/test/BtManagerHfp.test.js | 84 ++++ .../src/main/js/test/List.test.js | 12 +- .../BUILD.gn | 4 +- .../Test.json | 2 +- .../signature/openharmony_sx.p7b | Bin 0 -> 3797 bytes .../src/main/config.json | 0 .../src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../src/main/js/TestAbility/app.js | 0 .../src/main/js/TestAbility/i18n/en-US.json | 0 .../src/main/js/TestAbility/i18n/zh-CN.json | 0 .../main/js/TestAbility/pages/index/index.css | 0 .../main/js/TestAbility/pages/index/index.hml | 0 .../main/js/TestAbility/pages/index/index.js | 0 .../js/TestRunner/OpenHarmonyTestRunner.js | 0 .../src/main/js/test/BtBleScanResult.test.js} | 110 ++---- .../src/main/js/test/BtDiscovery.test.js} | 16 +- .../js/test/BtManagerBleScanResult.test.js} | 118 ++---- .../main/js/test/BtManagerDiscovery.test.js | 95 +++++ .../src/main/js/test/BtManagerPair.test.js | 89 +++++ .../src/main/js/test/BtPair.test.js} | 65 +-- .../src/main/js/test/BtScanMode.test.js} | 67 ++-- .../src/main/js/test/List.test.js | 27 +- .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../main/js/test/BtManagerSetSwitch.test.js | 157 ++++++++ .../src/main/js/test/BtManagerSpp.test.js | 188 +++++++++ ...calName.test.js => BtSetLocalName.test.js} | 123 ++---- .../{BRSwitch.test.js => BtSetSwitch.test.js} | 25 +- .../js/test/{BRSpp.test.js => BtSpp.test.js} | 74 ++-- .../src/main/js/test/BtSysSubscBle.test.js} | 9 +- .../src/main/js/test/List.test.js | 23 +- .../BUILD.gn | 4 +- .../Test.json | 2 +- .../signature/openharmony_sx.p7b | Bin 3739 -> 3744 bytes .../src/main/config.json | 145 +++++++ .../src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../src/main/js/TestAbility/app.js | 0 .../src/main/js/TestAbility/i18n/en-US.json | 0 .../src/main/js/TestAbility/i18n/zh-CN.json | 0 .../main/js/TestAbility/pages/index/index.css | 0 .../main/js/TestAbility/pages/index/index.hml | 0 .../main/js/TestAbility/pages/index/index.js | 0 .../js/TestRunner/OpenHarmonyTestRunner.js | 0 .../js/test/BtManagerErrorCode202.test.js | 175 +++++++++ .../src/main/js/test/List.test.js | 19 + .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../BUILD.gn | 4 +- .../btmanager_errorcode401/Test.json | 26 ++ .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../src/main/js/TestAbility/app.js | 0 .../src/main/js/TestAbility/i18n/en-US.json | 0 .../src/main/js/TestAbility/i18n/zh-CN.json | 0 .../main/js/TestAbility/pages/index/index.css | 0 .../main/js/TestAbility/pages/index/index.hml | 0 .../main/js/TestAbility/pages/index/index.js | 0 .../js/TestRunner/OpenHarmonyTestRunner.js | 0 .../js/test/BtMGattAdvertiser401.test.js} | 70 ++-- .../main/js/test/BtMGattManager401.test.js} | 370 +++++++----------- .../src/main/js/test/List.test.js | 10 +- .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin communication/btmanager_switchoff/BUILD.gn | 35 ++ .../Test.json | 2 +- .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 8 +- .../src/main/js/MainAbility/app.js | 23 ++ .../src/main/js/MainAbility/i18n/en-US.json | 6 + .../src/main/js/MainAbility/i18n/zh-CN.json | 6 + .../main/js/MainAbility/pages/index/index.css | 24 ++ .../main/js/MainAbility/pages/index/index.hml | 20 + .../main/js/MainAbility/pages/index/index.js | 32 ++ .../src/main/js/TestAbility/app.js | 31 ++ .../src/main/js/TestAbility/i18n/en-US.json | 8 + .../src/main/js/TestAbility/i18n/zh-CN.json | 8 + .../main/js/TestAbility/pages/index/index.css | 30 ++ .../main/js/TestAbility/pages/index/index.hml | 5 + .../main/js/TestAbility/pages/index/index.js | 26 ++ .../js/TestRunner/OpenHarmonyTestRunner.js | 59 +++ .../src/main/js/test/List.test.js | 4 +- .../js/test/btManagerSwitchOff003.test.js} | 208 ++++------ .../main/resources/base/element/string.json | 28 ++ .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../js/test/WifiManagerStationEvent.test.js | 132 +++---- 133 files changed, 2372 insertions(+), 1560 deletions(-) rename communication/{bluetooth_ble => bluetooth_gatt}/BUILD.gn (92%) rename communication/{bluetooth_ble => bluetooth_gatt}/Test.json (90%) rename communication/{bluetooth_ble => bluetooth_gatt}/signature/openharmony_sx.p7b (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/config.json (94%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/MainAbility/app.js (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/MainAbility/i18n/en-US.json (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/MainAbility/pages/index/index.css (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/MainAbility/pages/index/index.hml (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/MainAbility/pages/index/index.js (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestAbility/app.js (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestAbility/i18n/en-US.json (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestAbility/pages/index/index.css (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestAbility/pages/index/index.hml (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestAbility/pages/index/index.js (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/js/TestRunner/OpenHarmonyTestRunner.js (100%) rename communication/{bluetooth_ble/src/main/js/test/BleAdvertiser.test.js => bluetooth_gatt/src/main/js/test/BtGattAdvertiser.test.js} (90%) rename communication/{bluetooth_ble/src/main/js/test/BleGattManager.test.js => bluetooth_gatt/src/main/js/test/BtGattManager.test.js} (84%) rename communication/{bluetooth_ble/src/main/js/test/BleService.test.js => bluetooth_gatt/src/main/js/test/BtGattService.test.js} (88%) rename communication/{bluetooth_manager/src/main/js/test/BleAdvertiser.test.js => bluetooth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js} (91%) rename communication/{bluetooth_manager/src/main/js/test/BleGattManager.test.js => bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js} (88%) rename communication/{bluetooth_manager/src/main/js/test/BleService.test.js => bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js} (92%) rename communication/{bluetooth_on => bluetooth_gatt}/src/main/js/test/List.test.js (53%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/resources/base/element/string.json (100%) rename communication/{bluetooth_ble => bluetooth_gatt}/src/main/resources/base/media/icon.png (100%) create mode 100644 communication/bluetooth_profile/src/main/js/test/BtManagerA2dp.test.js create mode 100644 communication/bluetooth_profile/src/main/js/test/BtManagerHfp.test.js rename communication/{bluetooth_manager => bluetooth_scanpairing}/BUILD.gn (91%) rename communication/{bluetooth_on => bluetooth_scanpairing}/Test.json (89%) create mode 100644 communication/bluetooth_scanpairing/signature/openharmony_sx.p7b rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/config.json (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/MainAbility/app.js (100%) rename communication/{bluetooth_on => bluetooth_scanpairing}/src/main/js/MainAbility/i18n/en-US.json (100%) rename communication/{bluetooth_on => bluetooth_scanpairing}/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_on => bluetooth_scanpairing}/src/main/js/MainAbility/pages/index/index.css (100%) rename communication/{bluetooth_on => bluetooth_scanpairing}/src/main/js/MainAbility/pages/index/index.hml (100%) rename communication/{bluetooth_on => bluetooth_scanpairing}/src/main/js/MainAbility/pages/index/index.js (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestAbility/app.js (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestAbility/i18n/en-US.json (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestAbility/pages/index/index.css (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestAbility/pages/index/index.hml (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestAbility/pages/index/index.js (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/TestRunner/OpenHarmonyTestRunner.js (100%) rename communication/{bluetooth_on/src/main/js/test/BleScanResult.test.js => bluetooth_scanpairing/src/main/js/test/BtBleScanResult.test.js} (84%) rename communication/{bluetooth_standard/src/main/js/test/BRDiscovery.test.js => bluetooth_scanpairing/src/main/js/test/BtDiscovery.test.js} (91%) rename communication/{bluetooth_manager/src/main/js/test/BleScanResult.test.js => bluetooth_scanpairing/src/main/js/test/BtManagerBleScanResult.test.js} (88%) create mode 100644 communication/bluetooth_scanpairing/src/main/js/test/BtManagerDiscovery.test.js create mode 100644 communication/bluetooth_scanpairing/src/main/js/test/BtManagerPair.test.js rename communication/{bluetooth_on/src/main/js/test/BluetoothPair.test.js => bluetooth_scanpairing/src/main/js/test/BtPair.test.js} (86%) rename communication/{bluetooth_standard/src/main/js/test/BRScanMode.test.js => bluetooth_scanpairing/src/main/js/test/BtScanMode.test.js} (89%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/js/test/List.test.js (52%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/resources/base/element/string.json (100%) rename communication/{bluetooth_manager => bluetooth_scanpairing}/src/main/resources/base/media/icon.png (100%) create mode 100644 communication/bluetooth_standard/src/main/js/test/BtManagerSetSwitch.test.js create mode 100644 communication/bluetooth_standard/src/main/js/test/BtManagerSpp.test.js rename communication/bluetooth_standard/src/main/js/test/{BRSetLocalName.test.js => BtSetLocalName.test.js} (79%) rename communication/bluetooth_standard/src/main/js/test/{BRSwitch.test.js => BtSetSwitch.test.js} (90%) rename communication/bluetooth_standard/src/main/js/test/{BRSpp.test.js => BtSpp.test.js} (84%) rename communication/{bluetooth_on/src/main/js/test/bluetoothSys.test.js => bluetooth_standard/src/main/js/test/BtSysSubscBle.test.js} (94%) rename communication/{bluetooth_on => btmanager_errorcode202}/BUILD.gn (91%) rename communication/{bluetooth_manager => btmanager_errorcode202}/Test.json (89%) rename communication/{bluetooth_switchoff => btmanager_errorcode202}/signature/openharmony_sx.p7b (62%) create mode 100644 communication/btmanager_errorcode202/src/main/config.json rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/MainAbility/app.js (100%) rename communication/{bluetooth_manager => btmanager_errorcode202}/src/main/js/MainAbility/i18n/en-US.json (100%) rename communication/{bluetooth_manager => btmanager_errorcode202}/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_manager => btmanager_errorcode202}/src/main/js/MainAbility/pages/index/index.css (100%) rename communication/{bluetooth_manager => btmanager_errorcode202}/src/main/js/MainAbility/pages/index/index.hml (100%) rename communication/{bluetooth_manager => btmanager_errorcode202}/src/main/js/MainAbility/pages/index/index.js (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestAbility/app.js (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestAbility/i18n/en-US.json (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestAbility/pages/index/index.css (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestAbility/pages/index/index.hml (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestAbility/pages/index/index.js (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/js/TestRunner/OpenHarmonyTestRunner.js (100%) create mode 100644 communication/btmanager_errorcode202/src/main/js/test/BtManagerErrorCode202.test.js create mode 100644 communication/btmanager_errorcode202/src/main/js/test/List.test.js rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/resources/base/element/string.json (100%) rename communication/{bluetooth_on => btmanager_errorcode202}/src/main/resources/base/media/icon.png (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/BUILD.gn (91%) create mode 100644 communication/btmanager_errorcode401/Test.json rename communication/{bluetooth_manager => btmanager_errorcode401}/signature/openharmony_sx.p7b (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/config.json (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/MainAbility/app.js (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/MainAbility/i18n/en-US.json (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/MainAbility/pages/index/index.css (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/MainAbility/pages/index/index.hml (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/MainAbility/pages/index/index.js (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestAbility/app.js (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestAbility/i18n/en-US.json (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestAbility/i18n/zh-CN.json (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestAbility/pages/index/index.css (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestAbility/pages/index/index.hml (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestAbility/pages/index/index.js (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/js/TestRunner/OpenHarmonyTestRunner.js (100%) rename communication/{bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js => btmanager_errorcode401/src/main/js/test/BtMGattAdvertiser401.test.js} (89%) rename communication/{bluetooth_manager/src/main/js/test/BleGattManager401.test.js => btmanager_errorcode401/src/main/js/test/BtMGattManager401.test.js} (85%) rename communication/{bluetooth_ble => btmanager_errorcode401}/src/main/js/test/List.test.js (72%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/resources/base/element/string.json (100%) rename communication/{bluetooth_switchoff => btmanager_errorcode401}/src/main/resources/base/media/icon.png (100%) create mode 100644 communication/btmanager_switchoff/BUILD.gn rename communication/{bluetooth_switchoff => btmanager_switchoff}/Test.json (89%) rename communication/{bluetooth_on => btmanager_switchoff}/signature/openharmony_sx.p7b (100%) rename communication/{bluetooth_on => btmanager_switchoff}/src/main/config.json (96%) create mode 100644 communication/btmanager_switchoff/src/main/js/MainAbility/app.js create mode 100644 communication/btmanager_switchoff/src/main/js/MainAbility/i18n/en-US.json create mode 100644 communication/btmanager_switchoff/src/main/js/MainAbility/i18n/zh-CN.json create mode 100644 communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.css create mode 100644 communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.hml create mode 100644 communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.js create mode 100644 communication/btmanager_switchoff/src/main/js/TestAbility/app.js create mode 100644 communication/btmanager_switchoff/src/main/js/TestAbility/i18n/en-US.json create mode 100644 communication/btmanager_switchoff/src/main/js/TestAbility/i18n/zh-CN.json create mode 100644 communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.css create mode 100644 communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.hml create mode 100644 communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.js create mode 100644 communication/btmanager_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js rename communication/{bluetooth_switchoff => btmanager_switchoff}/src/main/js/test/List.test.js (84%) rename communication/{bluetooth_switchoff/src/main/js/test/SwitchOff003.test.js => btmanager_switchoff/src/main/js/test/btManagerSwitchOff003.test.js} (83%) create mode 100644 communication/btmanager_switchoff/src/main/resources/base/element/string.json create mode 100644 communication/btmanager_switchoff/src/main/resources/base/media/icon.png diff --git a/communication/BUILD.gn b/communication/BUILD.gn index 70cfc42ce..a732eb404 100644 --- a/communication/BUILD.gn +++ b/communication/BUILD.gn @@ -16,12 +16,13 @@ group("communication") { testonly = true if (is_standard_system) { deps = [ - "bluetooth_ble:ActsBluetoothBleJsTest", - "bluetooth_manager:ActsBluetoothBleJs1Test", - "bluetooth_on:ActsBluetoothOnJsTest", + "bluetooth_gatt:ActsBluetoothGattJsTest", "bluetooth_profile:ActsBluetoothProFileJsTest", + "bluetooth_scanpairing:ActsBluetoothScanPairingJsTest", "bluetooth_standard:ActsBluetoothJsTest", - "bluetooth_switchoff:ActsBluetoothSwitchTest", + "btmanager_errorcode202:ActsBtManagerErrorCode202JsTest", + "btmanager_errorcode401:ActsBtManagerErrorCode401JsTest", + "btmanager_switchoff:ActsBtManagerSwitchOff003JsTest", "dsoftbus/rpc:ActsRpcJsTest", "dsoftbus/rpc_request:ActsRpcRequestJsTest", "nfc_Controller:ActsNFCJSTest", diff --git a/communication/bluetooth_ble/BUILD.gn b/communication/bluetooth_gatt/BUILD.gn similarity index 92% rename from communication/bluetooth_ble/BUILD.gn rename to communication/bluetooth_gatt/BUILD.gn index deeda2f5e..31c2f5071 100644 --- a/communication/bluetooth_ble/BUILD.gn +++ b/communication/bluetooth_gatt/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsBluetoothBleJsTest") { +ohos_js_hap_suite("ActsBluetoothGattJsTest") { hap_profile = "./src/main/config.json" deps = [ ":bluetooth_js_assets", @@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsBluetoothBleJsTest") { ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsBluetoothBleHapTest" + hap_name = "ActsBluetoothGattHapTest" part_name = "bluetooth" subsystem_name = "communication" } diff --git a/communication/bluetooth_ble/Test.json b/communication/bluetooth_gatt/Test.json similarity index 90% rename from communication/bluetooth_ble/Test.json rename to communication/bluetooth_gatt/Test.json index 69aefab58..8fbfbb34e 100644 --- a/communication/bluetooth_ble/Test.json +++ b/communication/bluetooth_gatt/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "ActsBluetoothBleHapTest.hap" + "ActsBluetoothGattHapTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/communication/bluetooth_ble/signature/openharmony_sx.p7b b/communication/bluetooth_gatt/signature/openharmony_sx.p7b similarity index 100% rename from communication/bluetooth_ble/signature/openharmony_sx.p7b rename to communication/bluetooth_gatt/signature/openharmony_sx.p7b diff --git a/communication/bluetooth_ble/src/main/config.json b/communication/bluetooth_gatt/src/main/config.json similarity index 94% rename from communication/bluetooth_ble/src/main/config.json rename to communication/bluetooth_gatt/src/main/config.json index ee6ee3d48..2309c7512 100644 --- a/communication/bluetooth_ble/src/main/config.json +++ b/communication/bluetooth_gatt/src/main/config.json @@ -129,6 +129,10 @@ ], "when": "inuse" } + }, + { + "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", + "reason": "" } ], "testRunner": { diff --git a/communication/bluetooth_ble/src/main/js/MainAbility/app.js b/communication/bluetooth_gatt/src/main/js/MainAbility/app.js similarity index 100% rename from communication/bluetooth_ble/src/main/js/MainAbility/app.js rename to communication/bluetooth_gatt/src/main/js/MainAbility/app.js diff --git a/communication/bluetooth_ble/src/main/js/MainAbility/i18n/en-US.json b/communication/bluetooth_gatt/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from communication/bluetooth_ble/src/main/js/MainAbility/i18n/en-US.json rename to communication/bluetooth_gatt/src/main/js/MainAbility/i18n/en-US.json diff --git a/communication/bluetooth_ble/src/main/js/MainAbility/i18n/zh-CN.json b/communication/bluetooth_gatt/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from communication/bluetooth_ble/src/main/js/MainAbility/i18n/zh-CN.json rename to communication/bluetooth_gatt/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/communication/bluetooth_ble/src/main/js/MainAbility/pages/index/index.css b/communication/bluetooth_gatt/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from communication/bluetooth_ble/src/main/js/MainAbility/pages/index/index.css rename to communication/bluetooth_gatt/src/main/js/MainAbility/pages/index/index.css diff --git a/communication/bluetooth_ble/src/main/js/MainAbility/pages/index/index.hml b/communication/bluetooth_gatt/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from communication/bluetooth_ble/src/main/js/MainAbility/pages/index/index.hml rename to communication/bluetooth_gatt/src/main/js/MainAbility/pages/index/index.hml diff --git a/communication/bluetooth_ble/src/main/js/MainAbility/pages/index/index.js b/communication/bluetooth_gatt/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from communication/bluetooth_ble/src/main/js/MainAbility/pages/index/index.js rename to communication/bluetooth_gatt/src/main/js/MainAbility/pages/index/index.js diff --git a/communication/bluetooth_ble/src/main/js/TestAbility/app.js b/communication/bluetooth_gatt/src/main/js/TestAbility/app.js similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestAbility/app.js rename to communication/bluetooth_gatt/src/main/js/TestAbility/app.js diff --git a/communication/bluetooth_ble/src/main/js/TestAbility/i18n/en-US.json b/communication/bluetooth_gatt/src/main/js/TestAbility/i18n/en-US.json similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestAbility/i18n/en-US.json rename to communication/bluetooth_gatt/src/main/js/TestAbility/i18n/en-US.json diff --git a/communication/bluetooth_ble/src/main/js/TestAbility/i18n/zh-CN.json b/communication/bluetooth_gatt/src/main/js/TestAbility/i18n/zh-CN.json similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestAbility/i18n/zh-CN.json rename to communication/bluetooth_gatt/src/main/js/TestAbility/i18n/zh-CN.json diff --git a/communication/bluetooth_ble/src/main/js/TestAbility/pages/index/index.css b/communication/bluetooth_gatt/src/main/js/TestAbility/pages/index/index.css similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestAbility/pages/index/index.css rename to communication/bluetooth_gatt/src/main/js/TestAbility/pages/index/index.css diff --git a/communication/bluetooth_ble/src/main/js/TestAbility/pages/index/index.hml b/communication/bluetooth_gatt/src/main/js/TestAbility/pages/index/index.hml similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestAbility/pages/index/index.hml rename to communication/bluetooth_gatt/src/main/js/TestAbility/pages/index/index.hml diff --git a/communication/bluetooth_ble/src/main/js/TestAbility/pages/index/index.js b/communication/bluetooth_gatt/src/main/js/TestAbility/pages/index/index.js similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestAbility/pages/index/index.js rename to communication/bluetooth_gatt/src/main/js/TestAbility/pages/index/index.js diff --git a/communication/bluetooth_ble/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/communication/bluetooth_gatt/src/main/js/TestRunner/OpenHarmonyTestRunner.js similarity index 100% rename from communication/bluetooth_ble/src/main/js/TestRunner/OpenHarmonyTestRunner.js rename to communication/bluetooth_gatt/src/main/js/TestRunner/OpenHarmonyTestRunner.js diff --git a/communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js b/communication/bluetooth_gatt/src/main/js/test/BtGattAdvertiser.test.js similarity index 90% rename from communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js rename to communication/bluetooth_gatt/src/main/js/test/BtGattAdvertiser.test.js index b52489453..29ff2ac69 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/BtGattAdvertiser.test.js @@ -18,8 +18,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest2() { -describe('bluetoothBLETest2', function() { +export default function btGattAdvertTest() { +describe('btGattAdvertTest', function() { let gattServer = null; function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) @@ -68,15 +68,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0100 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -124,15 +122,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0200 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0200', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -180,15 +176,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0300 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0300', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -236,15 +230,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0400 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0400', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -292,15 +284,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0500 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0500', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -348,15 +338,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0800 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. * @tc.size MEDIUM - * @ since 7 - * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0800', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -404,15 +392,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0900 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_0900', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -460,15 +446,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1000 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1000', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -516,15 +500,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1100 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -572,15 +554,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1200 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1200', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -628,15 +608,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1400 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1400', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -657,7 +635,7 @@ describe('bluetoothBLETest2', function() { manufactureData:[{ manufactureId:4567, manufactureValue:manufactureValueBuffer.buffer - }], + }], serviceData:[{ serviceUuid:"00001888-0000-1000-8000-00805f9b34fb", serviceValue:serviceValueBuffer.buffer @@ -684,15 +662,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1500 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1500', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -740,15 +716,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1600 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1600', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -796,15 +770,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1800 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1800', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -852,15 +824,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1900 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_1900', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -903,15 +873,13 @@ describe('bluetoothBLETest2', function() { /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_2100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_2100 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_2100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_2100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -953,15 +921,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_StartAdvertise_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_2200 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_StartAdvertise_0400', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_GATTADVERT_2200', 0, function () { let isRet = true; try{ gattServer.stopAdvertising(); @@ -975,5 +941,4 @@ describe('bluetoothBLETest2', function() { }) -} - +} \ No newline at end of file diff --git a/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js b/communication/bluetooth_gatt/src/main/js/test/BtGattManager.test.js similarity index 84% rename from communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js rename to communication/bluetooth_gatt/src/main/js/test/BtGattManager.test.js index 0e8cc094e..73467d8fb 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/BtGattManager.test.js @@ -16,8 +16,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest() { -describe('bluetoothBLETest', function() { +export default function btGattManagerTest() { +describe('btGattManagerTest', function() { let gattServer = null; let gattClient = null; function sleep(delay) { @@ -42,7 +42,7 @@ describe('bluetoothBLETest', function() { case 3: console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); bluetooth.enableBluetooth(); - await sleep(1000); + await sleep(10000); break; default: console.info('[bluetooth_js] enable success'); @@ -63,21 +63,18 @@ describe('bluetoothBLETest', function() { }) afterAll(async function (done) { console.info('afterAll called') - await sleep(6000); gattClient.close(); done() }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GattConnect_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTCLICONNECT_0100 * @tc.name test gatt connect and disconnect * @tc.desc Test connect and disconnect api . - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GattConnect_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTCLICONNECT_0100', 0, async function (done) { let ret = gattClient.connect(); await sleep(2000); console.info('[bluetooth_js] gattClient connect' + ret) @@ -89,15 +86,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Connect_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTCLICONNECT_0200 * @tc.name testGetConnectedBLEDevices * @tc.desc Test getConnectedBLEDevices api . - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GattConnect_0200', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_GATTCLICONNECT_0200', 0, function () { let result = bluetooth.BLE.getConnectedBLEDevices(); console.info("[bluetooth_js] getConnDev:" + JSON.stringify(result) + "length:" +result.length); @@ -105,15 +100,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Connect_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTCLICONNECT_0300 * test Client BLEconnectStateChange * @tc.desc Test on and off api - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GattConnect_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTCLICONNECT_0300', 0, async function (done) { function ConnectStateChanged(state) { console.log('bluetooth connect state changed'); let connectState = state.state; @@ -131,15 +124,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GETRSSIVALUE_0100 * @tc.name testgetRssiValue - * @tc.desc Test getRssiValue api by promise. - * @tc.size MEDIUM - * @ since 7 + * @tc.desc Test getRssiValue api by promise * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GETRSSIVALUE_0100', 0, async function (done) { let ret = gattClient.connect(); console.info('[bluetooth_js] gattClient getrssi connect:' + JSON.stringify(ret)) expect(ret).assertTrue(); @@ -152,7 +143,7 @@ describe('bluetoothBLETest', function() { }).catch(error => { console.info('bluetooth getRssiValue has error: '+ JSON.stringify(error)); let b=false; - if(err.code==2900099||err.code==-1) + if(error.code==2900099||error.code==-1) { b=true } @@ -171,15 +162,13 @@ describe('bluetoothBLETest', function() { /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GETRSSIVALUE_0200 * @tc.name testgetRssiValue - * @tc.desc Test testGetDeviceName api by callback. - * @tc.size MEDIUM - * @ since 7 + * @tc.desc Test testGetDeviceName api by callback * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GETRSSIVALUE_0200', 0, async function (done) { let ret = gattClient.connect(); console.info('[bluetooth_js] gattClient getRssi connect' + JSON.stringify(ret)) expect(ret).assertTrue(); @@ -208,15 +197,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetDeviceName_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GETDEVICENAME_0100 * @tc.name testGetDeviceName * @tc.desc Test GetDeviceName api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GetDeviceName_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GETDEVICENAME_0100', 0, async function (done) { let ret = gattClient.connect(); console.info('[bluetooth_js] gattClient getname2 connect' + JSON.stringify(ret)) expect(ret).assertTrue(); @@ -237,15 +224,13 @@ describe('bluetoothBLETest', function() { /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_getDeviceName_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GETDEVICENAME_0200 * @tc.name testGetDeviceName * @tc.desc Test testGetDeviceName api by callback. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GetDeviceName_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GETDEVICENAME_0200', 0, async function (done) { let ret = gattClient.connect(); console.info('[bluetooth_js] gattClient getname1 connect' + JSON.stringify(ret)) expect(ret).assertTrue(); @@ -261,15 +246,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetService_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GETSERVICE_0100 * @tc.name testGetServices * @tc.desc Test GetServices api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GetService_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GETSERVICE_0100', 0, async function (done) { let ret = gattClient.connect(); console.info('[bluetooth_js]gattClient getservices1 connect' + JSON.stringify(ret)) expect(ret).assertTrue(); @@ -288,15 +271,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetService_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GETSERVICE_0200 * @tc.name testGetServices * @tc.desc Test GetServices api by callback. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GetService_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GETSERVICE_0200', 0, async function (done) { let ret = gattClient.connect(); console.info('[bluetooth_js]gattClient getservices2 connect' + JSON.stringify(ret)) gattClient.getServices((code, data)=> { @@ -315,89 +296,78 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0100 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0100', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0100', 0, function () { let ret = gattClient.setBLEMtuSize(100); console.info('[bluetooth_js] bluetooth setBLEMtuSize 128bit ret:' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0200 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0200', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0200', 0, function () { let ret = gattClient.setBLEMtuSize(22); console.info('[bluetooth_js] bluetooth setBLEMtuSize 128bit ret:' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0300 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0300', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0300', 0, function () { let ret = gattClient.setBLEMtuSize(21); console.info('[bluetooth_js] bluetooth setBLEMtuSize 128bit ret:' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0400 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0400', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0400', 0, function () { let ret = gattClient.setBLEMtuSize(512); console.info('[bluetooth_js] bluetooth setBLEMtuSize 128bit ret:' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0500 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0500', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_MTUSIZE_0500', 0, function () { let ret = gattClient.setBLEMtuSize(513); console.info('[bluetooth_js] bluetooth setBLEMtuSize 128bit ret:' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_READCHARACTERISTIC_0100 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by promise. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_READCHARACTERISTIC_0100', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -434,14 +404,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_READCHARACTERISTIC_0200 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0200', 0, async function(done) { + it('SUB_COMMUNICATION_BLUETOOTH_READCHARACTERISTIC_0200', 0, async function(done) { function readCcc(code, BLECharacteristic) { if (code.code != 0) { return; @@ -470,14 +439,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_READCHARACTERISTIC_0300 * @tc.name test characteristicReadOn * @tc.desc Test On and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_READCHARACTERISTIC_0300', 0, async function (done) { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); cccValue[0] = 1123; @@ -501,14 +469,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_READDESCRIPTOR_0100 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by promise. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_READDESCRIPTOR_0100', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -534,14 +501,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_READDESCRIPTOR_0200 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_READDESCRIPTOR_0200', 0, async function (done) { function readDesc(code, BLEDescriptor) { if (code.code != 0) { console.info('[bluetooth_js] descriptor code: ' + BLEDescriptor.descriptorUuid); @@ -563,14 +529,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_READDESCRIPTOR_0300 * @tc.name test ReadDescriptorOn * @tc.desc Test On and Off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_READDESCRIPTOR_0300', 0, async function (done) { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); cccValue[0] = 1011; @@ -600,14 +565,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_WRITECHARACTERISTIC_0100 * @tc.name testWriteCharacteristicValue * @tc.desc Test Client WriteCharacteristicValue api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0100', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_WRITECHARACTERISTIC_0100', 0, function () { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -628,28 +592,26 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_WRITECHARACTERISTIC_0200 * @tc.name testWriteCharacteristicValue * @tc.desc Test Client WriteCharacteristicValue api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0200', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_WRITECHARACTERISTIC_0200', 0, function () { let ret = gattClient.writeCharacteristicValue("123"); console.info('[bluetooth_js] invaild writeCharacteristicValue ret : ' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_WRITECHARACTERISTIC_0300 * @tc.name test characteristicWriteOn * @tc.desc Test on and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_WRITECHARACTERISTIC_0300', 0, async function (done) { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); function WriteCharacteristicReq(CharacteristicWriteReq) { @@ -677,14 +639,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_WRITEDESCRIPTOR_0100 * @tc.name testWriteDescriptorValue * @tc.desc Test Client WriteDescriptorValue api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0100', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_WRITEDESCRIPTOR_0100', 0, function () { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); desValue[0] = 11; @@ -697,28 +658,26 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_WRITEDESCRIPTOR_0200 * @tc.name testWriteDescriptorValue * @tc.desc Test WriteDescriptorValue api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0200', 0, function () { + it('SUB_COMMUNICATION_BLUETOOTH_WRITEDESCRIPTOR_0200', 0, function () { let ret = gattClient.writeDescriptorValue(""); console.info('[bluetooth_js] bluetooth writeDescriptorValue ret : ' + ret); expect(ret).assertEqual(false); }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_WRITEDESCRIPTOR_0300 * @tc.name test WriteDescriptorOn * @tc.desc Test on and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_WRITEDESCRIPTOR_0300', 0, async function (done) { let arrayBufferDesc = new ArrayBuffer(8); let descValue = new Uint8Array(arrayBufferDesc); function WriteDescriptorReq(DescriptorWriteReq) { @@ -752,14 +711,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0100 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test SetNotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0100', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -790,14 +748,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0200 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test SetNotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0200', 0, async function(done) { + it('SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0200', 0, async function(done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -828,14 +785,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0300 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test SetNotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0300', 0, async function (done) { let ret = gattClient.setNotifyCharacteristicChanged(null, false); console.info('[bluetooth_js] setNotifyCharacteristicChanged is null ret:' + ret); expect(ret).assertEqual(false); @@ -843,14 +799,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0400 * @tc.name test BLECharacteristicChangeON * @tc.desc Test On and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SETNOTIFYCHARACTERISTIC_0400', 0, async function (done) { function CharacteristicChange(CharacteristicChangeReq) { let serviceUuid = CharacteristicChangeReq.serviceUuid; let characteristicUuid = CharacteristicChangeReq.characteristicUuid; @@ -887,14 +842,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GattClose_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTCLOSE_0100 * @tc.name test gattClient close * @tc.desc Test close api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_GattClose_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTCLOSE_0100', 0, async function (done) { let gattClient = bluetooth.BLE.createGattClientDevice("11:22:33:44:55:66"); let ret = gattClient.close(); console.info('[bluetooth_js] gattClient close ret:' + ret); @@ -903,7 +857,4 @@ describe('bluetoothBLETest', function() { }) }) -} - - - +} \ No newline at end of file diff --git a/communication/bluetooth_ble/src/main/js/test/BleService.test.js b/communication/bluetooth_gatt/src/main/js/test/BtGattService.test.js similarity index 88% rename from communication/bluetooth_ble/src/main/js/test/BleService.test.js rename to communication/bluetooth_gatt/src/main/js/test/BtGattService.test.js index 3526bc450..3843ed643 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleService.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/BtGattService.test.js @@ -16,8 +16,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest1() { -describe('bluetoothBLETest1', function() { +export default function btGattServiceTest() { +describe('btGattServiceTest', function() { let gattServer = null; let gattClient = null; @@ -69,15 +69,13 @@ describe('bluetoothBLETest1', function() { /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Connect_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_GATTSERCONNECT_0100 * @tc.name test Server connectStateChange * @tc.desc Test on and off api . - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Connect_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_GATTSERCONNECT_0100', 0, async function (done) { function Connected(BLEConnectChangedState) { let deviceId = BLEConnectChangedState.deviceId; let status = BLEConnectChangedState.state; @@ -95,14 +93,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0100 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0100', 0, async function (done) { let service = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB', isPrimary: true, includeServices: []}; let ret = gattServer.addService(service); @@ -117,14 +114,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0200 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0200', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -155,14 +151,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0300 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0300', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -197,14 +192,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0400 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0400', 0, async function (done) { let characteristics = []; let arrayBufferC = new ArrayBuffer(8); let cccV = new Uint8Array(arrayBufferC); @@ -227,14 +221,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0500 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0500', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -265,14 +258,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0600 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0600', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -309,14 +301,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0700 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0700', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -347,14 +338,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0800 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0800', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -385,14 +375,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0900 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_0900', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -423,14 +412,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_1000 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_1000', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -461,14 +449,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_1100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_1100 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_1100', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -497,14 +484,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_1200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_1200 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_AddService_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ADDSERVICE_1200', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -534,14 +520,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_RemoveService_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_REMOVESERVICE_0100 * @tc.name testRemoveService * @tc.desc Test RemoveService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_RemoveService_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_REMOVESERVICE_0100', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -576,14 +561,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_RemoveService_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_REMOVESERVICE_0200 * @tc.name testRemoveService * @tc.desc Test RemoveService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_RemoveService_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_REMOVESERVICE_0200', 0, async function (done) { let ret1=gattServer.removeService('00001800-0000-1000-8000-00805f9b3442'); console.info('[bluetooth_js]removeService ret:'+ret1); expect(ret1).assertFalse(); @@ -591,14 +575,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_RemoveService_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_REMOVESERVICE_0300 * @tc.name testRemoveService * @tc.desc Test RemoveService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_RemoveService_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_REMOVESERVICE_0300', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -633,14 +616,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_NOTIFYCHARACTERISTIC_0100 * @tc.name testNotifyCharacteristicChanged * @tc.desc Test NotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_NOTIFYCHARACTERISTIC_0100', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -663,14 +645,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_NOTIFYCHARACTERISTIC_0200 * @tc.name testNotifyCharacteristicChanged * @tc.desc Test NotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_NOTIFYCHARACTERISTIC_0200', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let descV = new Uint8Array(arrayBuffer); @@ -693,14 +674,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_NOTIFYCHARACTERISTIC_0300 * @tc.name testNotifyCharacteristicChanged * @tc.desc Test NotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_NOTIFYCHARACTERISTIC_0300', 0, async function (done) { console.info('[bluetooth_js] SUB_COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200'); let ret = gattServer.notifyCharacteristicChanged('00:11:22:33:44:55', null); console.info('[bluetooth_js] notifyCharacteristicChanged ret : ' + ret); @@ -709,14 +689,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_sendResponse_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SENDRESPONSE_0100 * @tc.name testSendResponse success * @tc.desc Test SendResponse api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_sendResponse_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SENDRESPONSE_0100', 0, async function (done) { let arrayBuffer = new ArrayBuffer(8); let value = new Uint8Array(arrayBuffer); value[0] = 1; @@ -729,14 +708,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_sendResponse_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SENDRESPONSE_0200 * @tc.name testSendResponse success * @tc.desc Test SendResponse api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_sendResponse_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SENDRESPONSE_0200', 0, async function (done) { let arrayBuffer = new ArrayBuffer(8); let value = new Uint8Array(arrayBuffer); value[0] = 1; @@ -749,6 +727,4 @@ describe('bluetoothBLETest1', function() { }) }) -} - - +} \ No newline at end of file diff --git a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js b/communication/bluetooth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js similarity index 91% rename from communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js rename to communication/bluetooth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js index d9c19a149..18c2f2ba7 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js @@ -18,8 +18,8 @@ import bluetooth from '@ohos.bluetoothManager'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest2() { -describe('bluetoothBLETest2', function() { +export default function btManagerGattAdvertTest() { +describe('btManagerGattAdvertTest', function() { let gattServer = null; function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) @@ -70,15 +70,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0100 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -128,15 +126,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0200 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0200', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -186,15 +182,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0300 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0300', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -244,15 +238,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0400 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0400', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -302,15 +294,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0500 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0500', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -360,15 +350,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0800 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0800', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -416,15 +404,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0900 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_0900', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -474,15 +460,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1000 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1000', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -530,15 +514,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1100 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -588,15 +570,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1200 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1200', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -646,15 +626,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1400 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1400', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -702,15 +680,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1500 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1500', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -760,15 +736,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1800 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1800', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -818,15 +792,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1900 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_1900', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -871,15 +843,13 @@ describe('bluetoothBLETest2', function() { /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_2100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_2100 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_2100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_2100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -923,15 +893,13 @@ describe('bluetoothBLETest2', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_StartAdvertise_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_2200 * @tc.name testStartAdvertising * @tc.desc Test StartAdvertising api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_StartAdvertise_0400', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_2200', 0, function () { let isRet = true; try{ gattServer.stopAdvertising(); diff --git a/communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js b/communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js similarity index 88% rename from communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js rename to communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js index 23791fba8..1f283092e 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js @@ -16,8 +16,8 @@ import bluetooth from '@ohos.bluetoothManager'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest() { -describe('bluetoothBLETest', function() { +export default function btManagerGattManagerTest() { +describe('btManagerGattManagerTest', function() { let gattServer = null; let gattClient = null; function sleep(delay) { @@ -69,15 +69,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GattConnect_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTCONNECT_0100 * @tc.name test gatt connect and disconnect * @tc.desc Test api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GattConnect_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTCONNECT_0100', 0, async function (done) { try { gattClient.connect(); await sleep(2000); @@ -92,15 +90,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Connect_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTCONNECT_0200 * @tc.name testGetConnectedBLEDevices * @tc.desc Test api 201 - Permission denied. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GattConnect_0200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_GATTCONNECT_0200', 0, function () { try { let result = bluetooth.BLE.getConnectedBLEDevices(); console.info("[bluetooth_js] getConnDev:" + JSON.stringify(result) @@ -114,15 +110,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Connect_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTCONNECT_0300 * test Client BLEconnectStateChange * @tc.desc Test on and off api - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GattConnect_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTCONNECT_0300', 0, async function (done) { try { function ConnectStateChanged(state) { console.log('bluetooth connect state changed'); @@ -145,15 +139,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GETRSSIVALUE_0100 * @tc.name testgetRssiValue * @tc.desc Test getRssiValue api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GETRSSIVALUE_0100', 0, async function (done) { try { await gattClient.getRssiValue().then((data) => { console.info('[bluetooth_js] BLE read rssi: ' + JSON.stringify(data)); @@ -180,15 +172,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GETRSSIVALUE_0200 * @tc.name testgetRssiValue * @tc.desc Test testGetDeviceName api by callback. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GETRSSIVALUE_0200', 0, async function (done) { try { function getRssi() { return new Promise((resolve,reject) => { @@ -222,15 +212,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GetDeviceName_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0100 * @tc.name testGetDeviceName * @tc.desc Test GetDeviceName api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GetDeviceName_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0100', 0, async function (done) { await sleep(5000) try { await gattClient.getDeviceName().then((data) => { @@ -251,15 +239,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_getDeviceName_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0200 * @tc.name testGetDeviceName * @tc.desc Test testGetDeviceName api by callback. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_GetDeviceName_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0200', 0, async function (done) { try { gattClient.getDeviceName((err, data)=> { if (err) { @@ -279,15 +265,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GetService_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0100 * @tc.name testGetServices * @tc.desc Test GetServices api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_GetService_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0100', 0, async function (done) { try { await gattClient.getServices().then((GattService) => { console.info('[bluetooth_js] getServices successfully:'+JSON.stringify(GattService)); @@ -307,15 +291,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GetService_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0200 * @tc.name testGetServices * @tc.desc Test GetServices api by callback. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_GetService_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0200', 0, async function (done) { try { gattClient.getServices((code, data)=> { if(code.code==0){ @@ -337,15 +319,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0100 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_MtuSize_0100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0100', 0, function () { try { gattClient.setBLEMtuSize(100); console.info("[bluetooth_js]setBLEMtuSize success") @@ -358,15 +338,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0200 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_MtuSize_0200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0200', 0, function () { try { gattClient.setBLEMtuSize(22); console.info("[bluetooth_js]setBLEMtuSize success") @@ -379,15 +357,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0300 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_MtuSize_0300', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0300', 0, function () { try { gattClient.setBLEMtuSize(21); console.info("[bluetooth_js]setBLEMtuSize success") @@ -400,15 +376,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0400 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_MtuSize_0400', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0400', 0, function () { try { gattClient.setBLEMtuSize(512); console.info("[bluetooth_js]setBLEMtuSize success") @@ -421,15 +395,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0500 * @tc.name testSetBLEMtuSize * @tc.desc Test SetBLEMtuSize api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_MtuSize_0500', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_0500', 0, function () { try { gattClient.setBLEMtuSize(513); console.info("[bluetooth_js]setBLEMtuSize success") @@ -442,14 +414,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_1900 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by promise. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_1900', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -487,14 +458,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_2000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_2000 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_2000', 0, async function(done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_2000', 0, async function(done) { try { function readCcc(code, BLECharacteristic) { if (code.code != 0) { @@ -534,14 +504,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_2100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_2100 * @tc.name test characteristicReadOn * @tc.desc Test On and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_2100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_2100', 0, async function (done) { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -571,14 +540,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_1300 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by promise. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_1300', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -605,14 +573,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_1400 * @tc.name testReadDescriptorValue * @tc.desc Test ReadDescriptorValue api by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_1400', 0, async function (done) { try { function readDesc(code, BLEDescriptor) { if (code.code != 0) { @@ -641,14 +608,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_1500 * @tc.name test ReadDescriptorOn * @tc.desc Test On and Off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_1500', 0, async function (done) { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -684,14 +650,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_1900 * @tc.name testWriteCharacteristicValue * @tc.desc Test Client WriteCharacteristicValue api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1900', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_1900', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -719,14 +684,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_2000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_2000 * @tc.name test characteristicWriteOn * @tc.desc Test on and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_2000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_2000', 0, async function (done) { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -758,14 +722,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_1100 * @tc.name testWriteDescriptorValue * @tc.desc Test Client WriteDescriptorValue api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_1100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_1100', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -785,14 +748,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_1200 * @tc.name test WriteDescriptorOn * @tc.desc Test on and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_1200', 0, async function (done) { try { let arrayBufferDesc = new ArrayBuffer(8); let descValue = new Uint8Array(arrayBufferDesc); @@ -830,14 +792,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_1200 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test SetNotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_1200', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -874,14 +835,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_1300 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test SetNotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_1300', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -918,14 +878,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_1400 * @tc.name test BLECharacteristicChangeON * @tc.desc Test On and off api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_1400', 0, async function (done) { try { function CharacteristicChange(CharacteristicChangeReq) { let serviceUuid = CharacteristicChangeReq.serviceUuid; @@ -962,14 +921,13 @@ describe('bluetoothBLETest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_GattClose_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTCLOSE_0100 * @tc.name test gattClient close * @tc.desc Test close api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_GattClose_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTCLOSE_0100', 0, async function (done) { try { let gattClient = bluetooth.BLE.createGattClientDevice("11:22:33:44:55:66"); gattClient.close(); diff --git a/communication/bluetooth_manager/src/main/js/test/BleService.test.js b/communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js similarity index 92% rename from communication/bluetooth_manager/src/main/js/test/BleService.test.js rename to communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js index 4d81a9243..c730b80f5 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleService.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js @@ -19,8 +19,8 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' let SppOption = {uuid: '00001810-0000-1000-8000-00805F9B34FB', secure: true, type: bluetooth.SppType.SPP_RFCOMM}; -export default function bluetoothBLETest1() { -describe('bluetoothBLETest1', function() { +export default function btManagerGattServiceTest() { +describe('btManagerGattServiceTest', function() { let gattServer = null; let gattClient = null; @@ -74,15 +74,13 @@ describe('bluetoothBLETest1', function() { /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Connect_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTSERCONNECT_0100 * @tc.name test Server connectStateChange * @tc.desc Test on and off api . - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Connect_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTSERCONNECT_0100', 0, async function (done) { try { function Connected(BLEConnectChangedState) { let deviceId = BLEConnectChangedState.deviceId; @@ -105,14 +103,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0100 * @tc.name testAddService * @tc.desc Test api 401 - characteristics of service is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0100', 0, async function (done) { try { let service = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB', isPrimary: true, includeServices: []}; @@ -132,14 +129,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0200 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0200', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -173,14 +169,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0300 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0300', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -219,14 +214,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0400 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0400', 0, async function (done) { try { let characteristics = []; let arrayBufferC = new ArrayBuffer(8); @@ -254,14 +248,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0500 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0500', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -296,14 +289,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0600 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0600', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -343,14 +335,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0700 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0700', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -385,14 +376,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0800 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0800', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -427,14 +417,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0900 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0900', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -470,14 +459,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1000 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1000', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -513,14 +501,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1100 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1100', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -554,14 +541,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1200 * @tc.name testAddService * @tc.desc Test AddService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1200', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -596,14 +582,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2000 * @tc.name testAddService * @tc.desc Test api 401 - null gattService parameters. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2000', 0, async function (done) { try { gattServer.addService(); expect(true).assertFalse(); @@ -618,14 +603,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2100 * @tc.name testAddService * @tc.desc Test api 401 - parameters is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2100', 0, async function (done) { try { gattServer.addService(null); expect(true).assertFalse(); @@ -640,14 +624,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2200 * @tc.name testAddService * @tc.desc Test api 401 - serviceUuid of gattService is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2200', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -682,14 +665,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2300 * @tc.name testAddService * @tc.desc Test api 401 - serviceUuid of gattService is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2300', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -724,14 +706,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2400 * @tc.name testAddService * @tc.desc Test api 401 - isPrimary of gattService is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2400', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -766,14 +747,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2500 * @tc.name testAddService * @tc.desc Test api 401 - isPrimary of gattService is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2500', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -808,14 +788,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AddService_2600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2600 * @tc.name testAddService * @tc.desc Test api 401 - characteristics of gattService is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_AddService_2600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2600', 0, async function (done) { try { let gattService = {serviceUuid:'00001810-0000-1000-8000-00805F9B34FB', isPrimary: true, characteristics:"123sss",includeServices:[]}; @@ -834,14 +813,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_RemoveService_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0100 * @tc.name testRemoveService * @tc.desc Test RemoveService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_RemoveService_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0100', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -879,14 +857,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_RemoveService_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0200 * @tc.name testRemoveService * @tc.desc Test RemoveService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_RemoveService_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0200', 0, async function (done) { try { gattServer.removeService('00001800-0000-1000-8000-00805f9b3442'); expect(true).assertFalse(); @@ -901,14 +878,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_RemoveService_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0300 * @tc.name testRemoveService * @tc.desc Test RemoveService api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_RemoveService_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0300', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -944,14 +920,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_RemoveService_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0400 * @tc.name testRemoveService * @tc.desc Test RemoveService 401-null parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_RemoveService_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0400', 0, async function (done) { try { gattServer.removeService(); expect(true).assertFalse(); @@ -966,14 +941,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_RemoveService_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0500 * @tc.name testRemoveService * @tc.desc Test RemoveService 401-error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_RemoveService_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0500', 0, async function (done) { try { gattServer.removeService("sss"); expect(true).assertFalse(); @@ -987,14 +961,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0100 * @tc.name testNotifyCharacteristicChanged * @tc.desc Test NotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0100', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1024,14 +997,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0200 * @tc.name testNotifyCharacteristicChanged * @tc.desc Test NotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0200', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1061,14 +1033,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0300 * @tc.name testNotifyCharacteristicChanged * @tc.desc Test NotifyCharacteristicChanged api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0300', 0, async function (done) { try { console.info('[bluetooth_js] COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200'); gattServer.notifyCharacteristicChanged('00:11:22:33:44:55', null); @@ -1084,14 +1055,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_sendResponse_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0100 * @tc.name testSendResponse success * @tc.desc Test SendResponse api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_sendResponse_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0100', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let value = new Uint8Array(arrayBuffer); @@ -1111,14 +1081,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_sendResponse_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0200 * @tc.name testSendResponse success * @tc.desc Test SendResponse api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_sendResponse_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0200', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let value = new Uint8Array(arrayBuffer); @@ -1138,14 +1107,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_sendResponse_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0300 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -null parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_sendResponse_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0300', 0, async function (done) { try { gattServer.sendResponse(); expect(true).assertFalse(); @@ -1160,14 +1128,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_sendResponse_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0400 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_BLE_sendResponse_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0400', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let value = new Uint8Array(arrayBuffer); @@ -1187,14 +1154,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0333 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0333 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0333', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0333', 0, async function (done) { let STATE_ON = bluetooth.BluetoothState.STATE_ON; console.info("[bluetooth_js]STATE_ON : " + JSON.stringify(STATE_ON)); expect(true).assertTrue(STATE_ON == 2); @@ -1221,14 +1187,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0555 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0555 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0555', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0555', 0, async function (done) { let SCAN_MODE_NONE = bluetooth.ScanMode.SCAN_MODE_NONE; console.info("[bluetooth_js]SCAN_MODE_NONE : " + JSON.stringify(SCAN_MODE_NONE)); expect(true).assertTrue(SCAN_MODE_NONE == 0); @@ -1257,14 +1222,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0666 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0666 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0666', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0666', 0, async function (done) { let STATE_DISCONNECTED = bluetooth.ProfileConnectionState.STATE_DISCONNECTED; console.info("[bluetooth_js]STATE_DISCONNECTED : " + JSON.stringify(STATE_DISCONNECTED)); expect(true).assertTrue(STATE_DISCONNECTED == 0); @@ -1281,14 +1245,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0777 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0777 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0777', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0777', 0, async function (done) { let SCAN_MODE_LOW_POWER = bluetooth.ScanDuty.SCAN_MODE_LOW_POWER; console.info("[bluetooth_js]STATE_DISCONNECTED : " + JSON.stringify(SCAN_MODE_LOW_POWER)); expect(true).assertTrue(SCAN_MODE_LOW_POWER == 0); @@ -1303,14 +1266,13 @@ describe('bluetoothBLETest1', function() { /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0888 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0888 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0888', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0888', 0, async function (done) { let PROFILE_A2DP_SOURCE = bluetooth.ProfileId.PROFILE_A2DP_SOURCE; console.info("[bluetooth_js]PROFILE_A2DP_SOURCE : " + JSON.stringify(PROFILE_A2DP_SOURCE)); expect(true).assertTrue(PROFILE_A2DP_SOURCE == 1); @@ -1328,14 +1290,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0999 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0999 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0999', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0999', 0, async function (done) { let STATE_NOT_PLAYING = bluetooth.PlayingState.STATE_NOT_PLAYING; console.info("[bluetooth_js]STATE_NOT_PLAYING : " + JSON.stringify(STATE_NOT_PLAYING)); expect(true).assertTrue(STATE_NOT_PLAYING == 0x0000); @@ -1350,14 +1311,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1111 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1111 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1111', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1111', 0, async function (done) { let MAJOR_MISC = bluetooth.MajorClass.MAJOR_MISC; console.info("[bluetooth_js]MAJOR_MISC : " + JSON.stringify(MAJOR_MISC)); expect(true).assertTrue(MAJOR_MISC == 0x0000); @@ -1395,14 +1355,13 @@ describe('bluetoothBLETest1', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1112 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1112 * @tc.name testSendResponse success * @tc.desc Test SendResponse 401 -error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1112', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1112', 0, async function (done) { let COMPUTER_UNCATEGORIZED = bluetooth.MajorMinorClass.COMPUTER_UNCATEGORIZED; console.info("[bluetooth_js]COMPUTER_UNCATEGORIZED : " + JSON.stringify(COMPUTER_UNCATEGORIZED)); diff --git a/communication/bluetooth_on/src/main/js/test/List.test.js b/communication/bluetooth_gatt/src/main/js/test/List.test.js similarity index 53% rename from communication/bluetooth_on/src/main/js/test/List.test.js rename to communication/bluetooth_gatt/src/main/js/test/List.test.js index fc3472cfc..21c625aaf 100644 --- a/communication/bluetooth_on/src/main/js/test/List.test.js +++ b/communication/bluetooth_gatt/src/main/js/test/List.test.js @@ -13,13 +13,18 @@ * limitations under the License. */ - -import bluetoothhostTest2 from './BluetoothPair.test.js' -import bluetoothhostTest4 from './bluetoothSys.test.js' -import bluetoothhostTest from './BleScanResult.test.js' +import btGattAdvertTest from './BtGattAdvertiser.test.js' +import btGattManagerTest from './BtGattManager.test.js' +import btGattServiceTest from './BtGattService.test.js' +import btManagerGattAdvertTest from './BtManagerGattAdvertiser.test.js' +import btManagerGattManagerTest from './BtManagerGattManager.test.js' +import btManagerGattServiceTest from './BtManagerGattService.test.js' export default function testsuite() { + btGattAdvertTest() + btManagerGattServiceTest() + btGattServiceTest() + btManagerGattAdvertTest() + btManagerGattManagerTest() + btGattManagerTest() -bluetoothhostTest2() -bluetoothhostTest4() -bluetoothhostTest() } diff --git a/communication/bluetooth_ble/src/main/resources/base/element/string.json b/communication/bluetooth_gatt/src/main/resources/base/element/string.json similarity index 100% rename from communication/bluetooth_ble/src/main/resources/base/element/string.json rename to communication/bluetooth_gatt/src/main/resources/base/element/string.json diff --git a/communication/bluetooth_ble/src/main/resources/base/media/icon.png b/communication/bluetooth_gatt/src/main/resources/base/media/icon.png similarity index 100% rename from communication/bluetooth_ble/src/main/resources/base/media/icon.png rename to communication/bluetooth_gatt/src/main/resources/base/media/icon.png diff --git a/communication/bluetooth_profile/BUILD.gn b/communication/bluetooth_profile/BUILD.gn index 34a75db60..885db04b3 100644 --- a/communication/bluetooth_profile/BUILD.gn +++ b/communication/bluetooth_profile/BUILD.gn @@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsBluetoothProFileJsTest") { ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsBluetoothProFileJsTest" + hap_name = "ActsBluetoothProFileHapTest" part_name = "bluetooth" subsystem_name = "communication" } diff --git a/communication/bluetooth_profile/Test.json b/communication/bluetooth_profile/Test.json index 98c25cf1f..4ab956907 100644 --- a/communication/bluetooth_profile/Test.json +++ b/communication/bluetooth_profile/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "ActsBluetoothProFileJsTest.hap" + "ActsBluetoothProFileHapTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js b/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js index 908b84606..370ba991e 100644 --- a/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js +++ b/communication/bluetooth_profile/src/main/js/test/BluetoothA2dp.test.js @@ -17,8 +17,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest_host_1() { -describe('bluetoothhostTest_host_1', function () { +export default function btA2dpConnTest() { +describe('btA2dpConnTest', function () { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -65,15 +65,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0100 * @tc.name test bluetooth Profile ConnectionState * @tc.desc Test getBtConnectionState api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0100', 0, async function (done) { let connState = bluetooth.getBtConnectionState(); console.info('[bluetooth_js] get bt connection state result' + JSON.stringify(connState)); expect(connState).assertEqual(bluetooth.ProfileConnectionState.STATE_DISCONNECTED); @@ -84,15 +82,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0200 * @tc.name test A2DP Connect * @tc.desc Test connect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0200', 0, async function (done) { function StateChangeParam(data) { console.info("[bluetooth_js] a2dp state " + JSON.stringify(data) + 'deviceId: ' + data.deviceId + 'state:'+ data.state); @@ -110,15 +106,13 @@ describe('bluetoothhostTest_host_1', function () { /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0300 * @tc.name test A2DP disconnect * @tc.desc Test disconnect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0300', 0, async function (done) { function StateChangeParam(data) { console.info("[bluetooth_js] a2dp state " + JSON.stringify(data) + 'deviceId: ' + data.deviceId + 'state:'+ data.state); @@ -136,15 +130,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0400 * @tc.name test a invaild A2DP disconnect * @tc.desc Test disconnect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0400', 0, async function (done) { let a2dpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]a2dp get profile result:' + JSON.stringify(a2dpSrc)); let conn = a2dpSrc.disconnect('test'); @@ -154,15 +146,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0500 * @tc.name test Get A2DP ConnectionState * @tc.desc Test getProfileConnState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0500', 0, async function (done) { let a2dpSrcConn = bluetooth.getProfileConnState(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]get a2dp result:' + JSON.stringify(a2dpSrcConn)); expect(a2dpSrcConn).assertEqual(bluetooth.ProfileConnectionState.STATE_DISCONNECTED); @@ -170,15 +160,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0600 * @tc.name test a invaild A2DP Connect * @tc.desc Test connect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0600', 0, async function (done) { let a2dpSrc = bluetooth.getProfileInst(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); let conn = a2dpSrc.connect('test'); console.info('[bluetooth_js]a2dp invaild connect:' + JSON.stringify(conn)); @@ -187,15 +175,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0700 * @tc.name test getDevice A2DP State. * @tc.desc Test getDeviceState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0700', 0, async function (done) { let a2dpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]a2dp get profile result:' + JSON.stringify(a2dpSrc)); let ret = a2dpSrc.getDeviceState('11:22:33:44:55:66'); @@ -204,15 +190,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0800 * @tc.name test getDevice A2DP State. * @tc.desc Test getDeviceState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0800', 0, async function (done) { let a2dpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]a2dp get profile result:' + JSON.stringify(a2dpSrc)); let ret = a2dpSrc.getDeviceState('test'); @@ -221,15 +205,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0900 * @tc.name test get A2DP Playing State * @tc.desc Test getPlayingState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_0900', 0, async function (done) { let a2dpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]a2dp get profile result:' + JSON.stringify(a2dpSrc)); let state = a2dpSrc.getPlayingState('11:22:33:44:55:66'); @@ -240,15 +222,13 @@ describe('bluetoothhostTest_host_1', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_1000 * @tc.name test getDevice A2DP State. * @tc.desc Test getDeviceState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_A2DP_Conn_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_A2DPCONN_1000', 0, async function (done) { let a2dpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]a2dp get profile result:' + JSON.stringify(a2dpSrc)); let retArray = a2dpSrc.getConnectionDevices(); @@ -259,6 +239,4 @@ describe('bluetoothhostTest_host_1', function () { }) -} - - +} \ No newline at end of file diff --git a/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js b/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js index 708251f61..bd9f5f45b 100644 --- a/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js +++ b/communication/bluetooth_profile/src/main/js/test/BluetoothHfp.test.js @@ -17,8 +17,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest_host_3() { -describe('bluetoothhostTest_host_3', function () { +export default function btHfpConnTest() { +describe('btHfpConnTest', function () { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -65,15 +65,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1100 * @tc.name test Get HFP ConnectionState * @tc.desc Test getProfileConnState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1100', 0, async function (done) { let hfpSrcConn = bluetooth.getProfileConnState(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); console.info('[bluetooth_js]get hfp result:' + JSON.stringify(hfpSrcConn)); @@ -82,15 +80,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1200 * @tc.name test getDevice HFP State. * @tc.desc Test getDeviceState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1200', 0, async function (done) { let hfpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let ret = hfpSrc.getDeviceState('11:22:33:44:55:66'); console.info('[bluetooth_js]hfp getDeviceState:' + JSON.stringify(ret)); @@ -99,15 +95,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1300 * @tc.name test getDevice HFP State. * @tc.desc Test getDeviceState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1300', 0, async function (done) { let hfpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let ret = hfpSrc.getDeviceState('bluetooth1'); console.info('[bluetooth_js]hfp get valid mac DeviceState:' + JSON.stringify(ret)); @@ -116,15 +110,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1400 * @tc.name test HFP Connect * @tc.desc Test connect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1400', 0, async function (done) { function StateChangeParam(data) { console.info("[bluetooth_js] hfp state " + JSON.stringify(data) + 'deviceId: ' + data.deviceId + 'state:'+ data.state); @@ -141,15 +133,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1500 * @tc.name test HFP disconnect * @tc.desc Test disconnect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1500', 0, async function (done) { function StateChangeParam(data) { console.info("[bluetooth_js] hfp state " + JSON.stringify(data) + 'deviceId: ' + data.deviceId + 'state:'+ data.state); @@ -166,15 +156,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1600 * @tc.name test a invaild HFP Connect * @tc.desc Test connect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1600', 0, async function (done) { let hfpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let conn1 = hfpSrc.connect('test'); console.info('[bluetooth_js]hfp vaild MAC disconnect :' + JSON.stringify(conn1)); @@ -183,15 +171,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1700 * @tc.name test a invaild HFP disconnect * @tc.desc Test disconnect api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1700', 0, async function (done) { let hfpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); console.info('[bluetooth_js]hfp get profile result:' + JSON.stringify(hfpSrc)); let conn = hfpSrc.disconnect('test'); @@ -201,15 +187,13 @@ describe('bluetoothhostTest_host_3', function () { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1800 * @tc.name test getDevice HFP State. * @tc.desc Test getDeviceState api. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_HFP_Conn_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_HFPCONN_1800', 0, async function (done) { let hfpSrc = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let retArray = hfpSrc.getConnectionDevices(); console.info('[bluetooth_js]hfp getConnectionDevices:' + JSON.stringify(retArray)); @@ -220,5 +204,4 @@ describe('bluetoothhostTest_host_3', function () { }) -} - +} \ No newline at end of file diff --git a/communication/bluetooth_profile/src/main/js/test/BtManagerA2dp.test.js b/communication/bluetooth_profile/src/main/js/test/BtManagerA2dp.test.js new file mode 100644 index 000000000..35b09a784 --- /dev/null +++ b/communication/bluetooth_profile/src/main/js/test/BtManagerA2dp.test.js @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetoothManager from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + +export default function btManagerA2dpConnTest() { +describe('btManagerA2dpConnTest', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetoothManager.getState(); + switch (sta) { + case 0: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta1 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turn off:' + JSON.stringify(sta1)); + break; + case 1: + console.info('[bluetooth_js] bt turning on:' + JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:' + JSON.stringify(sta)); + break; + case 3: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta2 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turning off:' + JSON.stringify(sta2)); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_A2DPCONN_0100 + * @tc.name test A2DP Connect + * @tc.desc Test connect api. + * @tc.type Function + * @tc.level Level 1 + */ + it('SUB_COMMUNICATION_BTMANAGER_A2DPCONN_0100', 0, async function (done) { + function onReceiveEvent(data) { + console.info('a2dp state = '+ JSON.stringify(data)); + expect(true).assertEqual(data != null); + } + let a2dpSrc = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_A2DP_SOURCE); + a2dpSrc.on('connectionStateChange', onReceiveEvent); + a2dpSrc.off('connectionStateChange', onReceiveEvent); + done(); + }) +}) +} \ No newline at end of file diff --git a/communication/bluetooth_profile/src/main/js/test/BtManagerHfp.test.js b/communication/bluetooth_profile/src/main/js/test/BtManagerHfp.test.js new file mode 100644 index 000000000..17959e94c --- /dev/null +++ b/communication/bluetooth_profile/src/main/js/test/BtManagerHfp.test.js @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetoothManager from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + +export default function btManagerHfpConnTest() { +describe('btManagerHfpConnTest', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetoothManager.getState(); + switch (sta) { + case 0: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta1 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turn off:' + JSON.stringify(sta1)); + break; + case 1: + console.info('[bluetooth_js] bt turning on:' + JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:' + JSON.stringify(sta)); + break; + case 3: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta2 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turning off:' + JSON.stringify(sta2)); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_HFPCONN_0100 + * @tc.name test HFP Connect + * @tc.desc Test connect api. + * @tc.type Function + * @tc.level Level 1 + */ + it('SUB_COMMUNICATION_BTMANAGER_HFPCONN_0100', 0, async function (done) { + function onReceiveEvent(data) { + console.info('hfp state = '+ JSON.stringify(data)); + expect(true).assertEqual(data != null); + } + let hfpAg = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); + hfpAg.on('connectionStateChange', onReceiveEvent); + hfpAg.off('connectionStateChange', onReceiveEvent); + done(); + }) +}) +} \ No newline at end of file diff --git a/communication/bluetooth_profile/src/main/js/test/List.test.js b/communication/bluetooth_profile/src/main/js/test/List.test.js index 53b065558..94509e607 100644 --- a/communication/bluetooth_profile/src/main/js/test/List.test.js +++ b/communication/bluetooth_profile/src/main/js/test/List.test.js @@ -13,9 +13,13 @@ * limitations under the License. */ -import bluetoothhostTest_host_1 from './BluetoothHfp.test.js' -import bluetoothhostTest_host_3 from './BluetoothA2dp.test.js' +import btHfpConnTest from './BluetoothHfp.test.js' +import btA2dpConnTest from './BluetoothA2dp.test.js' +import btManagerHfpConnTest from './BtManagerHfp.test.js' +import btManagerA2dpConnTest from './BtManagerA2dp.test.js' export default function testsuite() { -bluetoothhostTest_host_1() -bluetoothhostTest_host_3() + btHfpConnTest() + btA2dpConnTest() + btManagerHfpConnTest() + btManagerA2dpConnTest() } diff --git a/communication/bluetooth_manager/BUILD.gn b/communication/bluetooth_scanpairing/BUILD.gn similarity index 91% rename from communication/bluetooth_manager/BUILD.gn rename to communication/bluetooth_scanpairing/BUILD.gn index 80a55acca..ab7a00d2f 100644 --- a/communication/bluetooth_manager/BUILD.gn +++ b/communication/bluetooth_scanpairing/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsBluetoothBleJs1Test") { +ohos_js_hap_suite("ActsBluetoothScanPairingJsTest") { hap_profile = "./src/main/config.json" deps = [ ":bluetooth_js_assets", @@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsBluetoothBleJs1Test") { ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsBluetoothBleManagerHapTest" + hap_name = "ActsBluetoothScanPairingHapTest" part_name = "bluetooth" subsystem_name = "communication" } diff --git a/communication/bluetooth_on/Test.json b/communication/bluetooth_scanpairing/Test.json similarity index 89% rename from communication/bluetooth_on/Test.json rename to communication/bluetooth_scanpairing/Test.json index 52107048f..35729151b 100644 --- a/communication/bluetooth_on/Test.json +++ b/communication/bluetooth_scanpairing/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "ActsBluetoothOnHapTest.hap" + "ActsBluetoothScanPairingHapTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/communication/bluetooth_scanpairing/signature/openharmony_sx.p7b b/communication/bluetooth_scanpairing/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..36b4d13be7073b443ba69f2c5eb1f6a0bcfa1c93 GIT binary patch literal 3797 zcmcgv4R8}>8g70XEYMOd0wO{ikfJ5!+cZg=dYtZGHfgg-^Vc-7Ufd*`WSe9+O*UB) z1hJew5y9geg%i;7k0+pqKb4yil{?|oQwBxmMnObm?m*O2P*Dc%cGC*2Q*Q3Y88Wlk zd4Ill-|u~&?|J6~JrxI3Ww-X4d%r7}jgt5ERO|sg6}#m!8B`9&sLJl{HOpv)QZ55M zs`OT_RhNY6Ux>>EQ2lYTb`;t1ug+;Y?wwg+%G+`#gr8i`q_>v{+D=8%5zzT@)592pqMTU<=xYyKn)G`Yf%S-%{uT zxM&l61>8!)aRP=sI1(dK2hh#yWK9_CLZY^I1m;K-7zMvqZ}D}s@IkF!Pdej*N$_Fq z4u=&(khT!fo^=tXe9&vm(k{f~_nLSy2Nx+=97Qh-LsCEWLPBOFLwRknFpU_Xr>2^AD-Ca}xNs$PUG7n=>hZjNI+Hj&n@9<^WPS%;p*kLa#%*mx8 zB5yMI-2;^~J4qbwf?*QY4XhM!WRBpFaAA&Ouv@CG+2z4ISqy_)k!UoHL~#@12w`vm z_90P0l5yB)48mNC4t9_@iot}qcLa^%VpOhJ1E~U?ECQ1#tc}7X;Xz3UT41`+x-JjI zC(v+9Qz7aJQj7zSM|hpUgyIy|qUUT8$d7SWyMbxRF=97k7K<6nb>($&y(u*(gOZpN zCOmPgYo5o6w$Yp~luA)<0~|?tGe$D)GB^;T!_{rinhLf?oN5(wNbtbnFc8M3ISe3B z#0Jlu+sPIW4Q|6mI7pYz>mc=TF)mY2h4@T;h)X83taKbjN~vcfA?XoMGZT_dIh9I? zhm_^gNh(nkQI0EL}c04F_G*ln@f#NZ=2xnW`i3ubYl_IBJEK&&3zZMVD4BRF|n_tDOV$3iv>kYE-cda@k-#6tYnYq(tf6FaK=U=AECw-Mg=U<9D+j-)?GLT)t|W z?4R3j{mVli9X>Xd+}ik!;@z+Ivhq6j?bBZQYoB99*@QnoqI*ZdF5Nrn@eNMU2BwMW z+%#P|2~1ct{=?pW^@R7wtZVH*a`XIMUzILcuOUE%TU!N|$@NJ-6<{aKL1yceda;Rk6@*QP8!Tb*MjBAn8zomD@R6DO* zTPc`+dExZ>RsEkJ4~Gv&zB#t#?6GAk!`&DEuvT2s*V|P%dU0$se0s)R*3y~>U)#LM z4h~}Ceu z;wH^C^j?B(W;>7_w(2+SKRe3pfcqlkZPK)@YfoCK6A2{@%dA-;wq zNv0Ztq>0Uy>z=;ho)abZZ3kA>?p);;D&8L6Jw>zxgylf+3$@VO-w9iPxpM8Hj^`iV zQM-Bcvi)OUYTh;V{zbRy3!R(RP0>7Y@O4f(o$=N3tL0$E(=&d<-L-A{DChW%%g**a z1X^y-W8Y`-6RC~4wQJ6TmEHCg`9oVK9<1B^4l${>RKyV_;^@R6j;7MD&K;h~RqWmn zGJ^CC+Mzg-#H+)ISAbB>6JP9G`^-fB_6OhG82HCY_~u&W@ySn~d5>R=?%1mOcKesL zlixb@Nco>$YTURm)v;vX!W&aNbDLlMn-h4S|6t`TL)#1e&+J(}dCjIXOO{lgIk2i` z$+>&)e!gznxl?Z(TmFN_vmpeiVdOL-M*a_sjYw|8CX6Ch0%$o%9{yF+;@|UM-uvvi z=2+mVeTFBF@2=c;sOtEFNTvOR*>iNsq8noUmah+<>c9ToQ-`h<$!hO4obXh0dY!X> zrsn($9ot@i?6Jx{iQA4$=$Ufifsbs<(kGTv$5TFjS@ccalec|P5B11k5oB}43mAxB zl{OAe)S-91J_by>bk{3WK%(u(8=?$Mxg?a8LgU1t*Z>TmQJjccU85h&xolNJYGw7w z51U>??f2aH>1*EYTRvZC?QK8Y@^$0A?ro!&1Xr}*vJ;HHG|A;k0^suM?8ofU@$G-y zviy#Qk~6{Mrz$cp?78pg7b{{LWR9BmAFq+ul&t-H&C1W7z31HbguXnzdYK<9>^~fO QG}RxAUs&1t-tj5_0SO4s8vp setTimeout(resovle, delay)) } @@ -64,15 +64,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0100 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0100', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result1 '+JSON.stringify(data)); @@ -87,15 +85,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0200 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0200', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result2'+JSON.stringify(data)); @@ -111,15 +107,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0300 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0300', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result3'+JSON.stringify(data)); @@ -135,15 +129,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0400 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0400', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result4'+JSON.stringify(data)); @@ -159,15 +151,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0500 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0500', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result5'+JSON.stringify(data)); @@ -190,15 +180,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0600 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0600', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result6'+JSON.stringify(data)); @@ -219,15 +207,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0700 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0700', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result7'+JSON.stringify(data)); @@ -249,15 +235,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0900 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_0900', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result9'+JSON.stringify(data)); @@ -280,15 +264,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1000 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1000', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result10'+JSON.stringify(data)); @@ -311,15 +293,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1100 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1100', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result11'+JSON.stringify(data)); @@ -342,15 +322,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1200 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1200', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result12'+JSON.stringify(data)); @@ -373,15 +351,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1300 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1300', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLEscan device result13'+JSON.stringify(data)); @@ -407,15 +383,13 @@ describe('bluetoothhostTest', function() { done(); }) - /* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1400 + /* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1400 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1400', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLE scan device find result14'+ JSON.stringify(data)); @@ -435,15 +409,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1500 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1500', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLE scan device find result15'+ JSON.stringify(data)); @@ -463,15 +435,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1600 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1600', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLE scan device find result16'+ JSON.stringify(data)); @@ -499,15 +469,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1700 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1700', 0, async function (done) { function onReceiveEvent(data) { console.info('[bluetooth_js] BLE scan device find result17'+ JSON.stringify(data)); @@ -537,15 +505,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1800 * @tc.name test gatt connect and disconnect * @tc.desc Test connect and disconnect api . - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_BLESCAN_1800', 0, async function (done) { async function onReceiveEvent(ScanResult) { console.info('[bluetooth_js] BLEscan device result12'+JSON.stringify(ScanResult) @@ -576,6 +542,4 @@ describe('bluetoothhostTest', function() { done() }) }) -} - - +} \ No newline at end of file diff --git a/communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js b/communication/bluetooth_scanpairing/src/main/js/test/BtDiscovery.test.js similarity index 91% rename from communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js rename to communication/bluetooth_scanpairing/src/main/js/test/BtDiscovery.test.js index e993a8599..ef7569c1b 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js +++ b/communication/bluetooth_scanpairing/src/main/js/test/BtDiscovery.test.js @@ -34,8 +34,8 @@ async function grantPerm() { console.info("tokenId" + tokenID + " result1:" + result1); console.info("====grant Permission end===="); } -export default function bluetoothhostTest3() { -describe('bluetoothhostTest3', function() { +export default function btDiscoveryTest() { +describe('btDiscoveryTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -85,15 +85,13 @@ describe('bluetoothhostTest3', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_DISCOVERY_0100 * @tc.name TEST DISCOVERY * @tc.desc TEST DISCOVERY - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 0 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_DISCOVERY_0100', 0, async function (done) { function onReceiveEvent(data){ console.info('[bluetooth_js] Device' + JSON.stringify(data)+ 'length' + data.length); @@ -112,15 +110,13 @@ describe('bluetoothhostTest3', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_DISCOVERY_0300 * @tc.name TEST DISCOVERY * @tc.desc TEST DISCOVERY api 8. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_DISCOVERY_0300', 0, async function (done) { let result1 = bluetooth.setBluetoothScanMode(bluetooth.ScanMode.SCAN_MODE_CONNECTABLE,10); expect(result1).assertTrue(); let getScanMode = bluetooth.getBluetoothScanMode(); diff --git a/communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js b/communication/bluetooth_scanpairing/src/main/js/test/BtManagerBleScanResult.test.js similarity index 88% rename from communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js rename to communication/bluetooth_scanpairing/src/main/js/test/BtManagerBleScanResult.test.js index 46ea77fd2..85c67f45a 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js +++ b/communication/bluetooth_scanpairing/src/main/js/test/BtManagerBleScanResult.test.js @@ -16,8 +16,8 @@ import bluetooth from '@ohos.bluetoothManager'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest6() { -describe('bluetoothBLETest6', function() { +export default function btManagerBleScanTest() { +describe('btManagerBleScanTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -64,15 +64,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0100 * @tc.name testClassicStartBLEScan * @tc.desc Test startBLEScan 401 - Invalid parameter. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0100', 0, async function (done) { try { function onReceiveEvent(data) { @@ -94,15 +92,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0200 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0200', 0, async function (done) { try { function onReceiveEvent(data) { @@ -124,15 +120,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0300 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0300', 0, async function (done) { try { function onReceiveEvent(data) { @@ -154,15 +148,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0400 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0400', 0, async function (done) { try { function onReceiveEvent(data) { @@ -184,15 +176,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0500 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0500', 0, async function (done) { try { function onReceiveEvent(data) { @@ -222,15 +212,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0600 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0600', 0, async function (done) { try { function onReceiveEvent(data) { @@ -258,15 +246,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0700 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0700', 0, async function (done) { try { function onReceiveEvent(data) { @@ -296,15 +282,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0900 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0900', 0, async function (done) { try { function onReceiveEvent(data) { @@ -335,15 +319,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1000 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1000', 0, async function (done) { try { function onReceiveEvent(data) { @@ -373,15 +355,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1100 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1100', 0, async function (done) { try { function onReceiveEvent(data) { @@ -412,15 +392,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1200 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1200', 0, async function (done) { try { function onReceiveEvent(data) { @@ -450,15 +428,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1300 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1300', 0, async function (done) { try { function onReceiveEvent(data) { @@ -492,15 +468,13 @@ describe('bluetoothBLETest6', function() { }) - /* @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1400 + /* @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1400 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1400', 0, async function (done) { try { function onReceiveEvent(data) { @@ -526,15 +500,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1500 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1500', 0, async function (done) { try { function onReceiveEvent(data) { @@ -562,15 +534,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1600 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1600', 0, async function (done) { try { function onReceiveEvent(data) { @@ -606,15 +576,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1700 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 9 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1700', 0, async function (done) { try { function onReceiveEvent(data) { @@ -652,15 +620,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1800 * @tc.name test gatt connect and disconnect * @tc.desc Test connect and disconnect api . - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1800', 0, async function (done) { try { async function onReceiveEvent(ScanResult) { @@ -700,15 +666,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_1900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_1900 * @tc.name testClassicStartBLEScan * @tc.desc Test startBLEScan 401 - Invalid parameter. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_1900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_1900', 0, async function (done) { try { bluetooth.BLE.startBLEScan(123); expect(true).assertFalse(); @@ -723,15 +687,13 @@ describe('bluetoothBLETest6', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_2000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_2000 * @tc.name testClassicStartBLEScan * @tc.desc Test startBLEScan 401 - Invalid parameter. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_2000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_2000', 0, async function (done) { try { bluetooth.BLE.startBLEScan([{ serviceSolicitationUuid:"00000101-0000-1000-8000-00805F9B34FB", diff --git a/communication/bluetooth_scanpairing/src/main/js/test/BtManagerDiscovery.test.js b/communication/bluetooth_scanpairing/src/main/js/test/BtManagerDiscovery.test.js new file mode 100644 index 000000000..7c1cd8aa2 --- /dev/null +++ b/communication/bluetooth_scanpairing/src/main/js/test/BtManagerDiscovery.test.js @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetoothManager from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + +export default function btManagerDiscoveryTest() { +describe('btManagerDiscoveryTest', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetoothManager.getState(); + switch (sta) { + case 0: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta1 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turn off:' + JSON.stringify(sta1)); + break; + case 1: + console.info('[bluetooth_js] bt turning on:' + JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:' + JSON.stringify(sta)); + break; + case 3: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta2 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turning off:' + JSON.stringify(sta2)); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_DISCOVERY_0100 + * @tc.name TEST bluetoothDeviceFind on&off + * @tc.desc TEST bluetoothDeviceFind + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_DISCOVERY_0100', 0, async function (done) { + function onReceiveEvent(data) { + console.info('[bluetooth_js] Device' + JSON.stringify(data) + + 'length' + data.length); + expect(true).assertTrue(data.length > 0); + } + try { + bluetoothManager.on("bluetoothDeviceFind", onReceiveEvent); + let result = bluetoothManager.startBluetoothDiscovery(); + await sleep(3000); + console.info('[bluetooth_js] startDiscovery' + result); + expect(result).assertTrue(); + bluetoothManager.off('bluetoothDeviceFind', onReceiveEvent); + result = bluetoothManager.stopBluetoothDiscovery(); + console.info('[bluetooth_js] stopDiscovery' + result); + expect(true).assertTrue(); + } catch (error) { + console.error(`[bluetooth_js]bluetoothDeviceFin error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) +}) +} \ No newline at end of file diff --git a/communication/bluetooth_scanpairing/src/main/js/test/BtManagerPair.test.js b/communication/bluetooth_scanpairing/src/main/js/test/BtManagerPair.test.js new file mode 100644 index 000000000..3a812967d --- /dev/null +++ b/communication/bluetooth_scanpairing/src/main/js/test/BtManagerPair.test.js @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetoothManager from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + +export default function btManagerPairTest() { +describe('btManagerPairTest', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetoothManager.getState(); + switch (sta) { + case 0: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta1 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turn off:' + JSON.stringify(sta1)); + break; + case 1: + console.info('[bluetooth_js] bt turning on:' + JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:' + JSON.stringify(sta)); + break; + case 3: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta2 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turning off:' + JSON.stringify(sta2)); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_PAIR_0100 + * @tc.name Test pinRequired and setDevicePairing true + * @tc.desc Test pinRequired off api + * @tc.size MEDIUM + * @ since 8 + * @tc.type Function + * @tc.level Level 3 + */ + it('SUB_COMMUNICATION_BTMANAGER_PAIR_0100', 0, async function (done) { + function onReceiveEvent(data) { + console.info('pin required = '+ JSON.stringify(data)); + } + try { + bluetoothManager.on('pinRequired', onReceiveEvent); + bluetoothManager.off('pinRequired', onReceiveEvent); + } catch (error) { + console.error(`[bluetooth_js]PairDevice error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) +}) +} \ No newline at end of file diff --git a/communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js b/communication/bluetooth_scanpairing/src/main/js/test/BtPair.test.js similarity index 86% rename from communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js rename to communication/bluetooth_scanpairing/src/main/js/test/BtPair.test.js index b1230d456..cef575992 100644 --- a/communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js +++ b/communication/bluetooth_scanpairing/src/main/js/test/BtPair.test.js @@ -17,8 +17,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest2() { -describe('bluetoothhostTest2', function() { +export default function btPairTest() { +describe('btPairTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -65,15 +65,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0100 * @tc.name Test pairDevice of use invailded address * @tc.desc Test pairDevice api - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0100', 0, async function (done) { let result = bluetooth.pairDevice("11:22:55:66:33:44"); await sleep(32000); console.info("[bluetooth_js] onStartpair001 -> " + JSON.stringify(result)); @@ -82,15 +80,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0200 * @tc.name testStartpair * @tc.desc Test pairDevice of use vailded address. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 0 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0200', 0, async function (done) { function PinRequiredParam(data) { console.info("[bluetooth_js] pinRequired on:" + JSON.stringify(data.deviceId)+JSON.stringify(data.pinCode)); @@ -105,15 +101,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0300 * @tc.name test getRemoteDeviceName * @tc.desc Test get RemoteDeviceName - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0300', 0, async function (done) { let ret = bluetooth.getRemoteDeviceName("00:00:00:00:00:00"); console.info('[bluetooth_js] getRemoteDeviceName ret2:' + JSON.stringify(ret)); expect(ret.length).assertEqual(0); @@ -121,15 +115,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0400 * @tc.name test getRemoteDeviceClass * @tc.desc Test get RemoteDeviceClass - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0400', 0, async function (done) { let MajorMinorClass = { COMPUTER_UNCATEGORIZED : 0x0100,COMPUTER_DESKTOP : 0x0104, COMPUTER_SERVER : 0x0108,COMPUTER_LAPTOP : 0x010C, @@ -196,15 +188,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0500 * @tc.name test get RemoteDeviceName * @tc.desc Test getRemoteDeviceName api - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0500', 0, async function (done) { let ret = bluetooth.getRemoteDeviceName("1125445"); console.info('[bluetooth_js] getRemoteDeviceName ret2:' + JSON.stringify(ret)); expect(ret.length).assertEqual(0); @@ -212,15 +202,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0600 * @tc.name test get PairedDevices * @tc.desc Test getPairedDevices api - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0600', 0, async function (done) { let ret = bluetooth.getPairedDevices(); console.info('[bluetooth_js] getPairedDevices ret2:' + JSON.stringify(ret)); expect(true).assertEqual(ret.length>=0); @@ -228,15 +216,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0700 * @tc.name Test pinRequired and setDevicePairing false * @tc.desc Test pinRequired ON api - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0700', 0, async function (done) { function PinRequiredParam(data) { console.info("[bluetooth_js] pinRequired on:" + JSON.stringify(data)); bluetooth.setDevicePairingConfirmation(data.deviceId,false); @@ -251,15 +237,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0800 * @tc.name Test pinRequired and setDevicePairing true * @tc.desc Test pinRequired off api - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0800', 0, async function (done) { function PinRequiredParam(data) { console.info("[bluetooth_js] pinRequired on:" + JSON.stringify(data)); bluetooth.setDevicePairingConfirmation(data.deviceId,true); @@ -274,15 +258,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_PAIR_0900 * @tc.name Test On pair StateChange * @tc.desc Test bondStateChange ON api - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Pair_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_PAIR_0900', 0, async function (done) { function BondStateParam(data) { console.info("[bluetooth_js] bondStateChange on:" + JSON.stringify(data) +'bondStateChange deviceId:' + data.deviceId + 'bondStateChange state:' + data.state); @@ -297,9 +279,4 @@ describe('bluetoothhostTest2', function() { }) }) -} - - - - - +} \ No newline at end of file diff --git a/communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js b/communication/bluetooth_scanpairing/src/main/js/test/BtScanMode.test.js similarity index 89% rename from communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js rename to communication/bluetooth_scanpairing/src/main/js/test/BtScanMode.test.js index 979751ab2..93aa5806d 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js +++ b/communication/bluetooth_scanpairing/src/main/js/test/BtScanMode.test.js @@ -16,8 +16,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest2() { -describe('bluetoothhostTest2', function() { +export default function btScanModeTest() { +describe('btScanModeTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -63,15 +63,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0100 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0100', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -100,15 +98,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0200 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0200', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); @@ -137,15 +133,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0300 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0300', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -173,15 +167,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0400 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0400', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -209,14 +201,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0500 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0500', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -244,15 +235,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0600 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ScanMode_0600', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -280,15 +269,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0700 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0700', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -316,15 +303,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0800 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ScanMode_0800', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -352,15 +337,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_0900 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_ScanMode_0900', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -388,15 +371,13 @@ describe('bluetoothhostTest2', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SCANMODE_1000 * @tc.name TEST scanmode * @tc.desc TEST scanmode api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 4 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_ScanMode_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SCANMODE_1000', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] get bluetooth state001'+ JSON.stringify(state)); if(state==bluetooth.BluetoothState.STATE_ON) @@ -419,6 +400,4 @@ describe('bluetoothhostTest2', function() { }) }) -} - - +} \ No newline at end of file diff --git a/communication/bluetooth_manager/src/main/js/test/List.test.js b/communication/bluetooth_scanpairing/src/main/js/test/List.test.js similarity index 52% rename from communication/bluetooth_manager/src/main/js/test/List.test.js rename to communication/bluetooth_scanpairing/src/main/js/test/List.test.js index c92807dcb..283570b7c 100644 --- a/communication/bluetooth_manager/src/main/js/test/List.test.js +++ b/communication/bluetooth_scanpairing/src/main/js/test/List.test.js @@ -13,17 +13,20 @@ * limitations under the License. */ -import bluetoothBLETest from './BleGattManager.test.js' -import bluetoothBLETest4 from './BleGattManager401.test.js' -import bluetoothBLETest1 from './BleService.test.js' -import bluetoothBLETest2 from './BleAdvertiser.test.js' -import bluetoothBLETest5 from './BleAdvertiser401.test.js' -import bluetoothBLETest6 from './BleScanResult.test.js' +import btBleScanTest from './BtBleScanResult.test.js' +import btDiscoveryTest from './BtDiscovery.test.js' +import btManagerBleScanTest from './BtManagerBleScanResult.test.js' +import btPairTest from './BtPair.test.js' +import btScanModeTest from './BtScanMode.test.js' +import btManagerDiscoveryTest from './BtManagerDiscovery.test.js' +import btManagerPairTest from './BtManagerPair.test.js' + export default function testsuite() { -bluetoothBLETest() -bluetoothBLETest1() -bluetoothBLETest2() -bluetoothBLETest4() -bluetoothBLETest5() -bluetoothBLETest6() + btBleScanTest() + btDiscoveryTest() + btManagerBleScanTest() + btPairTest() + btScanModeTest() + btManagerDiscoveryTest() + btManagerPairTest() } diff --git a/communication/bluetooth_manager/src/main/resources/base/element/string.json b/communication/bluetooth_scanpairing/src/main/resources/base/element/string.json similarity index 100% rename from communication/bluetooth_manager/src/main/resources/base/element/string.json rename to communication/bluetooth_scanpairing/src/main/resources/base/element/string.json diff --git a/communication/bluetooth_manager/src/main/resources/base/media/icon.png b/communication/bluetooth_scanpairing/src/main/resources/base/media/icon.png similarity index 100% rename from communication/bluetooth_manager/src/main/resources/base/media/icon.png rename to communication/bluetooth_scanpairing/src/main/resources/base/media/icon.png diff --git a/communication/bluetooth_standard/src/main/js/test/BtManagerSetSwitch.test.js b/communication/bluetooth_standard/src/main/js/test/BtManagerSetSwitch.test.js new file mode 100644 index 000000000..48d2abef1 --- /dev/null +++ b/communication/bluetooth_standard/src/main/js/test/BtManagerSetSwitch.test.js @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetoothManager from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + +export default function btManagerSwitchTest() { +describe('btManagerSwitchTest', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetoothManager.getState(); + switch (sta) { + case 0: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta1 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turn off:' + JSON.stringify(sta1)); + break; + case 1: + console.info('[bluetooth_js] bt turning on:' + JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:' + JSON.stringify(sta)); + break; + case 3: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta2 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turning off:' + JSON.stringify(sta2)); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_STATECHANGE_0100 + * @tc.name Test On pair StateChange + * @tc.desc Test bondStateChange ON api + * @tc.type Function + * @tc.level Level 3 + */ + it('SUB_COMMUNICATION_BTMANAGER_STATECHANGE_0100', 0, async function (done) { + function BondStateParam(data) { + console.info("[bluetooth_js] bondStateChange on:" + JSON.stringify(data) + + 'bondStateChange deviceId:' + data.deviceId + 'bondStateChange state:' + data.state); + } + try { + bluetoothManager.on('bondStateChange', BondStateParam); + let result = bluetoothManager.pairDevice("11:22:55:66:33:44"); + expect(bluetoothManager.BondState.BOND_STATE_INVALID == 0).assertTrue(); + expect(bluetoothManager.BondState.BOND_STATE_BONDING == 1).assertTrue(); + expect(bluetoothManager.BondState.BOND_STATE_BONDED == 2).assertTrue(); + bluetoothManager.off('bondStateChange', BondStateParam); + } catch (error) { + console.error(`[bluetooth_js]bondStateChange error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_STATECHANGE_0200 + * @tc.name test EnableBluetooth and getState + * @tc.desc Test EnableBluetooth + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_STATECHANGE_0200', 0, async function (done) { + function onReceiveEvent(data) { + console.info('bluetoothManager state001 =' + JSON.stringify(data)); + } + try { + await bluetoothManager.on('stateChange', onReceiveEvent); + let state = bluetoothManager.getState(); + console.info('[bluetooth_js] get bluetooth state001' + JSON.stringify(state)); + if (state != bluetoothManager.BluetoothState.STATE_ON) { + let enable = bluetoothManager.enableBluetooth(); + await sleep(10000); + console.info('[bluetooth_js] bluetoothManager enable001' + JSON.stringify(enable)); + expect(enable).assertTrue(); + let state1 = bluetoothManager.getState(); + console.info('[bluetooth_js] enable state001 ' + JSON.stringify(state1)); + expect(state1).assertEqual(bluetoothManager.BluetoothState.STATE_ON); + } + } catch (error) { + console.error(`[bluetooth_js]enable StateChange error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_STATECHANGE_0300 + * @tc.name test disableBluetooth and getState + * @tc.desc Test disableBluetooth api + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_STATECHANGE_0300', 0, async function (done) { + function onReceiveEvent(data) { + console.info('bluetoothManager state001 =' + JSON.stringify(data)); + } + try { + await bluetoothManager.on('stateChange', onReceiveEvent); + await sleep(3000); + await bluetoothManager.off('stateChange', onReceiveEvent); + let state = bluetoothManager.getState(); + console.info('[bluetooth_js] get bluetooth state001' + JSON.stringify(state)); + if (state != bluetoothManager.BluetoothState.STATE_OFF) { + let disable = bluetoothManager.disableBluetooth(); + await sleep(10000); + console.info('[bluetooth_js] bluetoothManager disable001' + JSON.stringify(disable)); + expect(disable).assertTrue(); + let state1 = bluetoothManager.getState(); + console.info('[bluetooth_js] disable state001 ' + JSON.stringify(state1)); + expect(state1).assertEqual(bluetoothManager.BluetoothState.STATE_OFF); + } + } catch (error) { + console.error(`[bluetooth_js]disable StateChange error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) +}) +} \ No newline at end of file diff --git a/communication/bluetooth_standard/src/main/js/test/BtManagerSpp.test.js b/communication/bluetooth_standard/src/main/js/test/BtManagerSpp.test.js new file mode 100644 index 000000000..321ee88af --- /dev/null +++ b/communication/bluetooth_standard/src/main/js/test/BtManagerSpp.test.js @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetoothManager from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + +export default function btManagerSppTest() { +describe('btManagerSppTest', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetoothManager.getState(); + switch (sta) { + case 0: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta1 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turn off:' + JSON.stringify(sta1)); + break; + case 1: + console.info('[bluetooth_js] bt turning on:' + JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:' + JSON.stringify(sta)); + break; + case 3: + bluetoothManager.enableBluetooth(); + await sleep(10000); + let sta2 = bluetoothManager.getState(); + console.info('[bluetooth_js] bt turning off:' + JSON.stringify(sta2)); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_SPP_0100 + * @tc.name test SppListen + * @tc.desc Test SppListen + * @tc.type Function + * @tc.level Level 1 + */ + it('SUB_COMMUNICATION_BTMANAGER_SPP_0100', 0, async function (done) { + let SppOption = { + uuid: '00001810-0000-1000-8000-00805F9B34FB', + secure: false, type: bluetoothManager.SppType.SPP_RFCOMM + }; + let serverNumber = -1; + function serverSocket(code, number) { + if (code) { + console.log('bluetooth error code01: ' + code); + } else { + console.log('bluetooth serverSocket Number:' + JSON.stringify(number)); + serverNumber = number; + expect(true).assertEqual(number != null); + } + } + try { + await bluetoothManager.sppListen('server1', SppOption, serverSocket); + } catch (error) { + console.error(`[bluetooth_js]SPPListen error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_SPP_0200 + * @tc.name testSppAccept + * @tc.desc Test SppAccept api + * @tc.type Function + * @tc.level Level 2 + */ + it('SUB_COMMUNICATION_BTMANAGER_SPP_0200', 0, async function (done) { + let serverNumber = -1; + function serverSocket(code, number) { + console.log('bluetooth error code: ' + code.code); + if (code.code == 0) { + console.log('bluetooth serverSocket Number: ' + number); + serverNumber = number; + } + } + let clientNumber = -1; + function acceptClientSocket(code, number) { + console.log('bluetooth error code: ' + code.code); + if (code.code == 0) { + console.log('bluetooth clientSocket Number: ' + number); + clientNumber = number; + } + } + try { + bluetoothManager.sppAccept(serverNumber, acceptClientSocket); + } catch (error) { + console.error(`[bluetooth_js]SPPAccept error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_SPP_0300 + * @tc.name test SppConnect + * @tc.desc Test SppConnect api 8 + * @tc.type Function + * @tc.level Level 1 + */ + it('SUB_COMMUNICATION_BTMANAGER_SPP_0300', 0, async function (done) { + let sppOption = { + uuid: '00001810-0000-1000-8000-00805F9B34FB', + secure: true, type: 0 + }; + try { + await bluetoothManager.sppConnect('00:11:22:33:44:55', sppOption, function (code, number) { + if (code) { + console.info('[bluetooth_js] code is: ' + JSON.stringify(code)); + } else { + console.log('[bluetooth_js]sppConnect Number:' + + JSON.stringify(number)); + expect(true).assertEqual(number != null); + } + }); + } catch (error) { + console.error(`[bluetooth_js]SPPConnect error, code is ${error.code}, + message is ${error.message}`); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_SPP_0400 + * @tc.name test sppReadOn + * @tc.desc Test On and Off Api + * @tc.type Function + * @tc.level Level 2 + */ + it('SUB_COMMUNICATION_BTMANAGER_SPP_0400', 0, async function (done) { + let clientNumber = -1; + function clientSocket(code, number) { + if (code.code != 0) { + return; + } + console.log('bluetooth serverSocket Number: ' + number); + clientNumber = number; + } + function dataRead(dataBuffer) { + let data = new Uint8Array(dataBuffer); + console.log('bluetooth data is: ' + data[0]); + } + try { + bluetoothManager.on('sppRead', clientNumber, dataRead); + bluetoothManager.off('sppRead', clientNumber); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + done(); + }) +}) +} \ No newline at end of file diff --git a/communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js b/communication/bluetooth_standard/src/main/js/test/BtSetLocalName.test.js similarity index 79% rename from communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js rename to communication/bluetooth_standard/src/main/js/test/BtSetLocalName.test.js index d8aee5fdc..b5028c730 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BtSetLocalName.test.js @@ -39,8 +39,8 @@ let Btname = { +'345678901234567890123456789012345678901234567890123456789012367890123456789012345568' +'012345678901234567890123456789123' } -export default function bluetoothhostTest1() { -describe('bluetoothhostTest1', function() { +export default function btLocalNameTest() { +describe('btLocalNameTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -86,15 +86,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0100 * @tc.name setLocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0100', 0, async function (done) { let result = bluetooth.setLocalName(Btname.LETTERS_TEST); expect(result).assertTrue(); await sleep(1000); @@ -105,15 +103,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0200 * @tc.name setLocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0200', 0, async function (done) { let result = bluetooth.setLocalName(Btname.CHINESES_TEST2); expect(result).assertTrue(); await sleep(1000); @@ -124,15 +120,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0300 * @tc.name setLocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0300', 0, async function (done) { let result = bluetooth.setLocalName(Btname.NUM_TEST); expect(result).assertTrue(); await sleep(1000); @@ -143,15 +137,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0400 * @tc.name setLocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0400', 0, async function (done) { let result = bluetooth.setLocalName(Btname.SYMBOL_TEST); expect(result).assertTrue(); await sleep(1000); @@ -162,15 +154,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0500 * @tc.name setLocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0500', 0, async function (done) { let newName = 'my bluetooth'; let result = bluetooth.setLocalName(newName); expect(result).assertTrue(); @@ -182,15 +172,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0600 * @tc.name setLocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0600', 0, async function (done) { let newName = 'bluetooth1234ABCDEFGH'; let result = bluetooth.setLocalName(newName); expect(result).assertTrue(); @@ -202,15 +190,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0700 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0700', 0, async function (done) { let newName = '蓝牙设备bluetooth'; let result = bluetooth.setLocalName(newName); expect(result).assertTrue(); @@ -222,15 +208,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0800 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0800', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES4); expect(result).assertTrue(); await sleep(1000); @@ -241,15 +225,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0900 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_0900', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES2); expect(result).assertTrue(); await sleep(1000); @@ -260,15 +242,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1000 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1000', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES3); expect(result).assertTrue(); await sleep(1000); @@ -279,15 +259,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1100 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1100', 0, async function (done) { let newName = '蓝牙设备123'; let result = bluetooth.setLocalName(newName); expect(result).assertTrue(); @@ -299,15 +277,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1200 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1200', 0, async function (done) { let newName = '蓝牙设备bluetooth12'; let result = bluetooth.setLocalName(newName); expect(result).assertTrue(); @@ -319,15 +295,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1300 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1300', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES6); expect(result).assertTrue(); await sleep(1000); @@ -338,15 +312,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1400 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1400', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES); expect(result).assertTrue(); await sleep(1000); @@ -358,15 +330,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1500 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1500', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES5); expect(result).assertTrue(); await sleep(1000); @@ -377,15 +347,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1600 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1600', 0, async function (done) { let result = bluetooth.setLocalName(Btname.NUM_TEST1); expect(result).assertTrue(); await sleep(1000); @@ -396,15 +364,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1700 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1700', 0, async function (done) { let result = bluetooth.setLocalName(Btname.MIXES7); expect(result).assertTrue(); await sleep(1000); @@ -415,15 +381,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1800 * @tc.name TEST setLocalName * @tc.desc TEST setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1800', 0, async function (done) { let name = bluetooth.getLocalName(); let set = bluetooth.setLocalName(''); expect(set).assertFalse(); @@ -435,15 +399,13 @@ describe('bluetoothhostTest1', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1900 * @tc.name set LocalName * @tc.desc Test setLocalName api by promise. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_LOCALNAME_1900', 0, async function (done) { let localName = bluetooth.getLocalName(); console.info('[bluetooth_js] LocalName_1900 localName = '+ JSON.stringify(localName)); expect(true).assertEqual(localName!=null); @@ -464,7 +426,4 @@ describe('bluetoothhostTest1', function() { }) }) -} - - - +} \ No newline at end of file diff --git a/communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js b/communication/bluetooth_standard/src/main/js/test/BtSetSwitch.test.js similarity index 90% rename from communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js rename to communication/bluetooth_standard/src/main/js/test/BtSetSwitch.test.js index 628e1d5b6..e2db3212e 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BtSetSwitch.test.js @@ -16,8 +16,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest() { -describe('bluetoothhostTest', function() { +export default function btSwitchTest() { +describe('btSwitchTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -64,15 +64,13 @@ describe('bluetoothhostTest', function() { /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SWITCH_0300 * @tc.name testEnableBluetooth * @tc.desc Test EnableBluetooth api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SWITCH_0300', 0, async function (done) { let enable = bluetooth.enableBluetooth(); let state = bluetooth.getState(); console.info('[bluetooth_js] bt open state1 = '+ JSON.stringify(state)); @@ -92,15 +90,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SWITCH_0100 * @tc.name testEnableBluetooth and getState * @tc.desc Test EnableBluetooth api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SWITCH_0100', 0, async function (done) { function onReceiveEvent(data) { console.info('bluetooth state001 ='+ JSON.stringify(data)); } @@ -121,14 +117,13 @@ describe('bluetoothhostTest', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0444 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SwitchOff_0444 * @tc.name testEnableBluetooth and getState * @tc.desc Test EnableBluetooth api by promise. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0444', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SwitchOff_0444', 0, async function (done) { let STATE_ON = bluetooth.BluetoothState.STATE_ON; console.info("[bluetooth_js]STATE_ON : " + JSON.stringify(STATE_ON)); expect(true).assertTrue(STATE_ON == 2); @@ -153,6 +148,4 @@ describe('bluetoothhostTest', function() { done() }) }) -} - - +} \ No newline at end of file diff --git a/communication/bluetooth_standard/src/main/js/test/BRSpp.test.js b/communication/bluetooth_standard/src/main/js/test/BtSpp.test.js similarity index 84% rename from communication/bluetooth_standard/src/main/js/test/BRSpp.test.js rename to communication/bluetooth_standard/src/main/js/test/BtSpp.test.js index 474839684..44d431ec8 100644 --- a/communication/bluetooth_standard/src/main/js/test/BRSpp.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BtSpp.test.js @@ -17,8 +17,8 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest4() { -describe('bluetoothhostTest4', function() { +export default function btSppTest() { +describe('btSppTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) } @@ -63,14 +63,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0100 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0100 * @tc.name testSppListen * @tc.desc Test secure SppListen - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0100', 0, async function (done) { let SppOption = {uuid: '00001810-0000-1000-8000-00805F9B34FB', secure: true, type: bluetooth.SppType.SPP_RFCOMM}; let serverNumber = -1; @@ -88,14 +87,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0200 * @tc.name testSppListen * @tc.desc Test SppListen api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0200', 0, async function (done) { let sppOption = {uuid: '00001810-0000-1000-8000-00805F9B34FB', secure: false, type: 0}; let serverNumber = -1; @@ -113,14 +111,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0300 * @tc.name testSppListen * @tc.desc Test SppListen api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0300', 0, async function (done) { let sppOption = {uuid: '00000000', secure: true, type: 0}; let serverNumber = -1; @@ -138,14 +135,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0400 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0400 * @tc.name testSppListen * @tc.desc Test SppListen api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0400', 0, async function (done) { let sppOption = {uuid: '00000000-0000-1000-8000-00805F9B34FB', secure: false, type: 0}; let serverNumber = -1; @@ -164,14 +160,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0500 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0500 * @tc.name testSppAccept * @tc.desc Test SppAccept api 8 by callbck. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0500', 0, async function (done) { function acceptClientSocket(code, number) { if (code) { @@ -186,14 +181,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0600 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0600 * @tc.name testSppAccept * @tc.desc Test SppAccept api 8 by callbck. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0600', 0, async function (done) { await bluetooth.sppAccept(-1, function(code, clientSocketNumber) { if (code) { console.info('[bluetooth_js] code is: ' + JSON.stringify(code)); @@ -207,14 +201,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0700 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0700 * @tc.name testSppConnect * @tc.desc Test SppConnect api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0700', 0, async function (done) { let sppOption = {uuid: '00001810-0000-1000-8000-00805F9B34FB', secure: true, type: 0}; await bluetooth.sppConnect('00:11:22:33:44:55', sppOption, function(code, number) { @@ -230,14 +223,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0800 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0800 * @tc.name testSppConnect * @tc.desc Test SppConnect api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0800', 0, async function (done) { let sppOption = {uuid: '0000', secure: false, type: 0}; await bluetooth.sppConnect('ABC', sppOption, function(code, clientSocketNumber) { @@ -253,14 +245,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0900 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_0900 * @tc.name testSppConnect * @tc.desc Test SppConnect api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_0900', 0, async function (done) { let sppOption = {uuid: '00001810-0000-1000-8000-00805F9B34FB', secure: true, type: 0}; await bluetooth.sppConnect('BT', sppOption, function(code, clientSocketNumber) { @@ -276,14 +267,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_1000 * @tc.name testsppCloseServerSocket * @tc.desc Test sppCloseServerSocket api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_1000', 0, async function (done) { let serverNumber = -1; function serverSocket(code, number) { if (code) { @@ -303,14 +293,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1000 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_1100 * @tc.name testsppCloseClientSocket * @tc.desc Test sppCloseClientSocket api 8 by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_1100', 0, async function (done) { let clientNumber = -1; await bluetooth.sppAccept(-1, function(code, clientSocketNumber) { if (code) { @@ -327,14 +316,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1200 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_1200 * @tc.name testSppWrite * @tc.desc Test sppWrite - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_1200', 0, async function (done) { let clientNumber = -1; await bluetooth.sppAccept(-1, function(code, clientSocketNumber) { if (code) { @@ -356,14 +344,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1300 + * @tc.number SUB_COMMUNICATION_BLUETOOTH_SPP_1300 * @tc.name test sppReadOn * @tc.desc Test On and Off Api - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_SPP_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BLUETOOTH_SPP_1300', 0, async function (done) { let clientNumber = -1; function acceptClientSocket(code, number) { if (code) { @@ -386,7 +373,4 @@ describe('bluetoothhostTest4', function() { }) -} - - - +} \ No newline at end of file diff --git a/communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js b/communication/bluetooth_standard/src/main/js/test/BtSysSubscBle.test.js similarity index 94% rename from communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js rename to communication/bluetooth_standard/src/main/js/test/BtSysSubscBle.test.js index 28d8d9421..bc198c500 100644 --- a/communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js +++ b/communication/bluetooth_standard/src/main/js/test/BtSysSubscBle.test.js @@ -17,8 +17,8 @@ import bluetooth from '@ohos.bluetooth'; import bluetoothsys from '@system.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothhostTest4() { -describe('bluetoothhostTest4', function() { +export default function btSubscBleTest() { +describe('btSubscBleTest', function() { function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) @@ -65,14 +65,13 @@ describe('bluetoothhostTest4', function() { }) /** - * @tc.number SUB_COMMUNACATION_bluetooth_SUBSCRIBE_BLEFound_0001 + * @tc.number SUB_COMMUNACATION_BLUETOOTH_BLESUBSFOUND_0100 * @tc.name testsubscribeBLEFound * @tc.desc Test subscribeBLEFound api. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('SUB_COMMUNACATION_bluetooth_SUBSCRIBE_BLEFound_0001', 0, async function (done) { + it('SUB_COMMUNACATION_BLUETOOTH_BLESUBSFOUND_0100', 0, async function (done) { bluetoothsys.startBLEScan({ interval:0, success() { diff --git a/communication/bluetooth_standard/src/main/js/test/List.test.js b/communication/bluetooth_standard/src/main/js/test/List.test.js index 31c715f0a..7c5ca0d62 100644 --- a/communication/bluetooth_standard/src/main/js/test/List.test.js +++ b/communication/bluetooth_standard/src/main/js/test/List.test.js @@ -13,15 +13,18 @@ * limitations under the License. */ -import bluetoothhostTest1 from './BRSetLocalName.test.js' -import bluetoothhostTest2 from './BRScanMode.test.js' -import bluetoothhostTest3 from './BRDiscovery.test.js' -import bluetoothhostTest4 from './BRSpp.test.js' -import bluetoothhostTest from './BRSwitch.test.js' +import btLocalNameTest from './BtSetLocalName.test.js' +import btSwitchTest from './BtSetSwitch.test.js' +import btSppTest from './BtSpp.test.js' +import btSubscBleTest from './BtSysSubscBle.test.js' +import btManagerSppTest from './BtManagerSpp.test.js' +import btManagerSwitchTest from './BtManagerSetSwitch.test.js' + export default function testsuite() { -bluetoothhostTest1() -bluetoothhostTest2() -bluetoothhostTest3() -bluetoothhostTest4() -bluetoothhostTest() + btLocalNameTest() + btSwitchTest() + btSppTest() + btSubscBleTest() + btManagerSppTest() + btManagerSwitchTest() } diff --git a/communication/bluetooth_on/BUILD.gn b/communication/btmanager_errorcode202/BUILD.gn similarity index 91% rename from communication/bluetooth_on/BUILD.gn rename to communication/btmanager_errorcode202/BUILD.gn index ff4368703..8abe2d750 100644 --- a/communication/bluetooth_on/BUILD.gn +++ b/communication/btmanager_errorcode202/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsBluetoothOnJsTest") { +ohos_js_hap_suite("ActsBtManagerErrorCode202JsTest") { hap_profile = "./src/main/config.json" deps = [ ":bluetooth_js_assets", @@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsBluetoothOnJsTest") { ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsBluetoothOnHapTest" + hap_name = "ActsBtManagerErrorCode202HapTest" part_name = "bluetooth" subsystem_name = "communication" } diff --git a/communication/bluetooth_manager/Test.json b/communication/btmanager_errorcode202/Test.json similarity index 89% rename from communication/bluetooth_manager/Test.json rename to communication/btmanager_errorcode202/Test.json index 7f0bc3716..5b4a88c9e 100644 --- a/communication/bluetooth_manager/Test.json +++ b/communication/btmanager_errorcode202/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "ActsBluetoothBleManagerHapTest.hap" + "ActsBtManagerErrorCode202HapTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/communication/bluetooth_switchoff/signature/openharmony_sx.p7b b/communication/btmanager_errorcode202/signature/openharmony_sx.p7b similarity index 62% rename from communication/bluetooth_switchoff/signature/openharmony_sx.p7b rename to communication/btmanager_errorcode202/signature/openharmony_sx.p7b index 9a224618b8d226815a7c692e3b09197a6796b502..988e6f5d8c5855aaee883014fd5f2618e0cbd89c 100644 GIT binary patch delta 587 zcmbO&yFk{#pown|8>d#AN85K^Ms}tJO?z!gC;gx zghIvzO>BBBO>9~l9n2X;L!6x*lg-i{%RQYO(>-0IJRViC^bK(|j>+>4 zi8SyH%a3pg@ig#t0gAdf8bib;2QlpkFLn(GGd1uk56m#Ch%)qY3H2^ zEcfzD@rnqaoX9L9>uBa`8WNi2X69rWlUGt%oL*Q~l$hn2lWE}Y96Wgvb7g&?V|i4% zXN6-xNQpsCiMvUWacW_1dUj?+hEri;Sa?oKrH6BxrM{O>xo1IfML>#sVns-fvr%Mf zdVWk^s$+#^W@MgYpha1LlOxa+9|QjaV-xM%qLT8U0+SFI-$-qr@KA$ti`29ve@9pS zs$et!id3^aBi~Tx3WLO$Jds?Jyxj6U-;AiRfL!0I41>ZzTieaESmYTeUt!goypvUW zGZR|`JFBBX6Qk|qc;2=3W=4hv=7we_Mo|X(@HpXQF;rqvh@UTdDp&T>=YQdSTR94w zkFQJM=aRlPr+)3HUDIcOKm5{wi;V*q+vjXqn3-7I4P2QNV%cvm&Jd#AN85K^Ms}tJO?(|dp%x}aMnhf$ZZ^(@HV?*BW)>z!gC;gh zghIvzO>9~$O>Al#9n2X;U7VdAlg-i{%RQYO(>+~73=Op1LMHbxE>ZHW^mB1EjLGv2 z@ip|#$&YXe@ig#t@vZc&ax{d9O%7t(5pJ39;c6Hh8Jr#wU=fg!6=y>Vls~?kR;FqPHnIBb_WaeXPQsNj{<(KPUSrnd; z8$u?A+mq^zQpGJ|4gCv)>i@2u>?u&DA>FTebd zP=BwOJb#ls{Vb;}3y+GFa>p!J$10D~#A07RQ~i+Q$fT0oio8Upg3v;rk^&E>w35Wg z)N&*5%q;gvAJZaZZLd_L(3m^{-%v}FfWTn0w9;UMsNiJ7>5~87IGHm7ctpRc|vJ zTLe27FrFA~fRSR5J$WH_>g2P$&h^GdCI+U4#-_$m2Kw-b;bbvXVo~U9@w%-Ncfv}b zsWC5~Q~s99ti?(uXOtgTd;IqN`e<#r0T&wwFv`!_vM@8TxEZ)GDda!iCHcGURoMFt zmHnSK>79P*$l3JbVOE?HFIU{g`)rI%3KEN1xR}2*+C4q}?a{JOH&1~TH`jB_+WR-4 M|Kyd-mm$r906{m#1^@s6 diff --git a/communication/btmanager_errorcode202/src/main/config.json b/communication/btmanager_errorcode202/src/main/config.json new file mode 100644 index 000000000..a434e4b00 --- /dev/null +++ b/communication/btmanager_errorcode202/src/main/config.json @@ -0,0 +1,145 @@ +{ + "app": { + "bundleName": "ohos.acts.communication.bluetooth.bluetoothhost", + "vendor": "acts", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5 + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.acts.communication.bluetooth.bluetoothhost", + "name": ".entry", + "deviceType": [ + "tablet", + "default", + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "formsEnabled": false, + "name": ".MainAbility", + "srcLanguage": "js", + "srcPath": "MainAbility", + "icon": "$media:icon", + "description": "$string:MainAbility_desc", + "label": "$string:MainAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + }, + { + "orientation": "unspecified", + "formsEnabled": false, + "name": ".TestAbility", + "srcLanguage": "js", + "srcPath": "TestAbility", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "label": "$string:TestAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.USE_BLUETOOTH", + "reason": "", + "usedScene": { + "ability": [ + "ohos.acts.communication.bluetooth.bluetoothhost.MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.MANAGE_BLUETOOTH", + "reason": "", + "usedScene": { + "ability": [ + "ohos.acts.communication.bluetooth.bluetoothhost.MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", + "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, + { + "name": "ohos.permission.DISCOVER_BLUETOOTH", + "reason": "", + "usedScene": { + "ability": [ + "ohos.acts.communication.bluetooth.bluetoothhost.MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.LOCATION", + "reason": "", + "usedScene": { + "ability": [ + "ohos.acts.communication.bluetooth.bluetoothhost.MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", + "reason": "" + } + ], + "testRunner": { + "name": "OpenHarmonyTestRunner", + "srcPath": "TestRunner" + }, + "mainAbility": ".MainAbility", + "srcPath": "" + } +} \ No newline at end of file diff --git a/communication/bluetooth_on/src/main/js/MainAbility/app.js b/communication/btmanager_errorcode202/src/main/js/MainAbility/app.js similarity index 100% rename from communication/bluetooth_on/src/main/js/MainAbility/app.js rename to communication/btmanager_errorcode202/src/main/js/MainAbility/app.js diff --git a/communication/bluetooth_manager/src/main/js/MainAbility/i18n/en-US.json b/communication/btmanager_errorcode202/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from communication/bluetooth_manager/src/main/js/MainAbility/i18n/en-US.json rename to communication/btmanager_errorcode202/src/main/js/MainAbility/i18n/en-US.json diff --git a/communication/bluetooth_manager/src/main/js/MainAbility/i18n/zh-CN.json b/communication/btmanager_errorcode202/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from communication/bluetooth_manager/src/main/js/MainAbility/i18n/zh-CN.json rename to communication/btmanager_errorcode202/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/communication/bluetooth_manager/src/main/js/MainAbility/pages/index/index.css b/communication/btmanager_errorcode202/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from communication/bluetooth_manager/src/main/js/MainAbility/pages/index/index.css rename to communication/btmanager_errorcode202/src/main/js/MainAbility/pages/index/index.css diff --git a/communication/bluetooth_manager/src/main/js/MainAbility/pages/index/index.hml b/communication/btmanager_errorcode202/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from communication/bluetooth_manager/src/main/js/MainAbility/pages/index/index.hml rename to communication/btmanager_errorcode202/src/main/js/MainAbility/pages/index/index.hml diff --git a/communication/bluetooth_manager/src/main/js/MainAbility/pages/index/index.js b/communication/btmanager_errorcode202/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from communication/bluetooth_manager/src/main/js/MainAbility/pages/index/index.js rename to communication/btmanager_errorcode202/src/main/js/MainAbility/pages/index/index.js diff --git a/communication/bluetooth_on/src/main/js/TestAbility/app.js b/communication/btmanager_errorcode202/src/main/js/TestAbility/app.js similarity index 100% rename from communication/bluetooth_on/src/main/js/TestAbility/app.js rename to communication/btmanager_errorcode202/src/main/js/TestAbility/app.js diff --git a/communication/bluetooth_on/src/main/js/TestAbility/i18n/en-US.json b/communication/btmanager_errorcode202/src/main/js/TestAbility/i18n/en-US.json similarity index 100% rename from communication/bluetooth_on/src/main/js/TestAbility/i18n/en-US.json rename to communication/btmanager_errorcode202/src/main/js/TestAbility/i18n/en-US.json diff --git a/communication/bluetooth_on/src/main/js/TestAbility/i18n/zh-CN.json b/communication/btmanager_errorcode202/src/main/js/TestAbility/i18n/zh-CN.json similarity index 100% rename from communication/bluetooth_on/src/main/js/TestAbility/i18n/zh-CN.json rename to communication/btmanager_errorcode202/src/main/js/TestAbility/i18n/zh-CN.json diff --git a/communication/bluetooth_on/src/main/js/TestAbility/pages/index/index.css b/communication/btmanager_errorcode202/src/main/js/TestAbility/pages/index/index.css similarity index 100% rename from communication/bluetooth_on/src/main/js/TestAbility/pages/index/index.css rename to communication/btmanager_errorcode202/src/main/js/TestAbility/pages/index/index.css diff --git a/communication/bluetooth_on/src/main/js/TestAbility/pages/index/index.hml b/communication/btmanager_errorcode202/src/main/js/TestAbility/pages/index/index.hml similarity index 100% rename from communication/bluetooth_on/src/main/js/TestAbility/pages/index/index.hml rename to communication/btmanager_errorcode202/src/main/js/TestAbility/pages/index/index.hml diff --git a/communication/bluetooth_on/src/main/js/TestAbility/pages/index/index.js b/communication/btmanager_errorcode202/src/main/js/TestAbility/pages/index/index.js similarity index 100% rename from communication/bluetooth_on/src/main/js/TestAbility/pages/index/index.js rename to communication/btmanager_errorcode202/src/main/js/TestAbility/pages/index/index.js diff --git a/communication/bluetooth_on/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/communication/btmanager_errorcode202/src/main/js/TestRunner/OpenHarmonyTestRunner.js similarity index 100% rename from communication/bluetooth_on/src/main/js/TestRunner/OpenHarmonyTestRunner.js rename to communication/btmanager_errorcode202/src/main/js/TestRunner/OpenHarmonyTestRunner.js diff --git a/communication/btmanager_errorcode202/src/main/js/test/BtManagerErrorCode202.test.js b/communication/btmanager_errorcode202/src/main/js/test/BtManagerErrorCode202.test.js new file mode 100644 index 000000000..6815b137a --- /dev/null +++ b/communication/btmanager_errorcode202/src/main/js/test/BtManagerErrorCode202.test.js @@ -0,0 +1,175 @@ + +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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 bluetooth from '@ohos.bluetoothManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' + + +export default function btManagerErrorCode202Test() { +describe('btManagerErrorCode202Test', function() { + function sleep(delay) { + return new Promise(resovle => setTimeout(resovle, delay)) + } + + async function tryToEnableBt() { + let sta = bluetooth.getState(); + switch(sta){ + case 0: + console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta)); + bluetooth.enableBluetooth(); + await sleep(10000); + break; + case 1: + console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta)); + await sleep(3000); + break; + case 2: + console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta)); + break; + case 3: + console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta)); + bluetooth.enableBluetooth(); + await sleep(10000); + break; + default: + console.info('[bluetooth_js] enable success'); + } + } + beforeAll(function () { + console.info('beforeAll called') + }) + beforeEach(async function (done) { + console.info('beforeEach called') + await tryToEnableBt() + done() + }) + afterEach(function () { + console.info('afterEach called') + }) + afterAll(function () { + console.info('afterAll called') + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_PAIR_ERROR202_0100 + * @tc.name test cancelPairedDevice + * @tc.desc Test api 202 - Non-system applications are not allowed to use system APIs. + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_PAIR_ERROR202_0100', 0, async function (done) { + try { + bluetooth.cancelPairedDevice('11:22:33:44:55:66'); + } catch (err) { + console.info('errCode: ' + err.code + ',errMessage: ' + err.message); + expect(err.code).assertEqual("202"); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_HOSTCONN_ERROR202_0200 + * @tc.name test hid host disconnect + * @tc.desc Test api 202 - Non-system applications are not allowed to use system APIs. + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_HOSTCONN_ERROR202_0200', 0, async function (done) { + try { + let hidHostProfile = bluetooth.getProfileInstance(bluetooth.ProfileId.PROFILE_HID_HOST); + hidHostProfile.disconnect('11:22:33:44:55:66'); + } catch (err) { + console.info('errCode: ' + err.code + ',errMessage: ' + err.message); + expect(err.code).assertEqual('202'); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_PANDISCONN_ERROR202_0100 + * @tc.name test pan disconnect + * @tc.desc Test api 202 - Non-system applications are not allowed to use system APIs. + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_PANDISCONN_ERROR202_0100', 0, async function (done) { + try { + let panProfile = bluetooth.getProfileInstance(bluetooth.ProfileId.PROFILE_PAN_NETWORK); + panProfile.disconnect('11:22:33:44:55:66'); + } catch (err) { + console.info('errCode: ' + err.code + ',errMessage: ' + err.message); + expect(err.code).assertEqual('202'); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_TETHERING_ERROR202_0100 + * @tc.name test setTethering + * @tc.desc Test api 202 - Non-system applications are not allowed to use system APIs. + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_TETHERING_ERROR202_0100', 0, async function (done) { + try { + let panProfile = bluetooth.getProfileInstance(bluetooth.ProfileId.PROFILE_PAN_NETWORK); + panProfile.setTethering(true); + } catch (err) { + console.info('errCode: ' + err.code + ',errMessage: ' + err.message); + expect(err.code).assertEqual('202'); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_TETHERING_ERROR202_0200 + * @tc.name test setTethering + * @tc.desc Test api 202 - Non-system applications are not allowed to use system APIs. + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_TETHERING_ERROR202_0200', 0, async function (done) { + try { + let panProfile = bluetooth.getProfileInstance(bluetooth.ProfileId.PROFILE_PAN_NETWORK); + panProfile.setTethering(false); + } catch (err) { + console.info('errCode: ' + err.code + ',errMessage: ' + err.message); + expect(err.code).assertEqual('202'); + } + done(); + }) + + /** + * @tc.number SUB_COMMUNICATION_BTMANAGER_TETHERING_ERROR202_0300 + * @tc.name test isTetheringOn + * @tc.desc Test api 202 - Non-system applications are not allowed to use system APIs. + * @tc.type Function + * @tc.level Level 0 + */ + it('SUB_COMMUNICATION_BTMANAGER_TETHERING_ERROR202_0200', 0, async function (done) { + try { + let panProfile = bluetooth.getProfileInstance(bluetooth.ProfileId.PROFILE_PAN_NETWORK); + let ret = panProfile.isTetheringOn(); + } catch (err) { + console.info('errCode: ' + err.code + ',errMessage: ' + err.message); + expect(err.code).assertEqual('202'); + } + done(); + }) + +}) + +} \ No newline at end of file diff --git a/communication/btmanager_errorcode202/src/main/js/test/List.test.js b/communication/btmanager_errorcode202/src/main/js/test/List.test.js new file mode 100644 index 000000000..e35ac36e0 --- /dev/null +++ b/communication/btmanager_errorcode202/src/main/js/test/List.test.js @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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 btManagerErrorCode202Test from './BtManagerErrorCode202.test.js' +export default function testsuite() { + btManagerErrorCode202Test() +} diff --git a/communication/bluetooth_on/src/main/resources/base/element/string.json b/communication/btmanager_errorcode202/src/main/resources/base/element/string.json similarity index 100% rename from communication/bluetooth_on/src/main/resources/base/element/string.json rename to communication/btmanager_errorcode202/src/main/resources/base/element/string.json diff --git a/communication/bluetooth_on/src/main/resources/base/media/icon.png b/communication/btmanager_errorcode202/src/main/resources/base/media/icon.png similarity index 100% rename from communication/bluetooth_on/src/main/resources/base/media/icon.png rename to communication/btmanager_errorcode202/src/main/resources/base/media/icon.png diff --git a/communication/bluetooth_switchoff/BUILD.gn b/communication/btmanager_errorcode401/BUILD.gn similarity index 91% rename from communication/bluetooth_switchoff/BUILD.gn rename to communication/btmanager_errorcode401/BUILD.gn index 7384c1fb5..658b06f51 100644 --- a/communication/bluetooth_switchoff/BUILD.gn +++ b/communication/btmanager_errorcode401/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsBluetoothSwitchTest") { +ohos_js_hap_suite("ActsBtManagerErrorCode401JsTest") { hap_profile = "./src/main/config.json" deps = [ ":bluetooth_js_assets", @@ -20,7 +20,7 @@ ohos_js_hap_suite("ActsBluetoothSwitchTest") { ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsBluetoothSwitchHapTest" + hap_name = "ActsBtManagerErrorCode401HapTest" part_name = "bluetooth" subsystem_name = "communication" } diff --git a/communication/btmanager_errorcode401/Test.json b/communication/btmanager_errorcode401/Test.json new file mode 100644 index 000000000..4f882f32c --- /dev/null +++ b/communication/btmanager_errorcode401/Test.json @@ -0,0 +1,26 @@ +{ + "description": "Configuration for bluetooth js api Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "shell-timeout": "600000", + "bundle-name": "ohos.acts.communication.bluetooth.bluetoothhost", + "package-name": "ohos.acts.communication.bluetooth.bluetoothhost", + "testcase-timeout": 70000 + }, + "kits": [ + { + "test-file-name": [ + "ActsBtManagerErrorCode401HapTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "svc bluetooth enable" + ] + } + ] +} \ No newline at end of file diff --git a/communication/bluetooth_manager/signature/openharmony_sx.p7b b/communication/btmanager_errorcode401/signature/openharmony_sx.p7b similarity index 100% rename from communication/bluetooth_manager/signature/openharmony_sx.p7b rename to communication/btmanager_errorcode401/signature/openharmony_sx.p7b diff --git a/communication/bluetooth_switchoff/src/main/config.json b/communication/btmanager_errorcode401/src/main/config.json similarity index 100% rename from communication/bluetooth_switchoff/src/main/config.json rename to communication/btmanager_errorcode401/src/main/config.json diff --git a/communication/bluetooth_switchoff/src/main/js/MainAbility/app.js b/communication/btmanager_errorcode401/src/main/js/MainAbility/app.js similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/MainAbility/app.js rename to communication/btmanager_errorcode401/src/main/js/MainAbility/app.js diff --git a/communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/en-US.json b/communication/btmanager_errorcode401/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/en-US.json rename to communication/btmanager_errorcode401/src/main/js/MainAbility/i18n/en-US.json diff --git a/communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/zh-CN.json b/communication/btmanager_errorcode401/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/zh-CN.json rename to communication/btmanager_errorcode401/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.css b/communication/btmanager_errorcode401/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.css rename to communication/btmanager_errorcode401/src/main/js/MainAbility/pages/index/index.css diff --git a/communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.hml b/communication/btmanager_errorcode401/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.hml rename to communication/btmanager_errorcode401/src/main/js/MainAbility/pages/index/index.hml diff --git a/communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.js b/communication/btmanager_errorcode401/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.js rename to communication/btmanager_errorcode401/src/main/js/MainAbility/pages/index/index.js diff --git a/communication/bluetooth_switchoff/src/main/js/TestAbility/app.js b/communication/btmanager_errorcode401/src/main/js/TestAbility/app.js similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestAbility/app.js rename to communication/btmanager_errorcode401/src/main/js/TestAbility/app.js diff --git a/communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/en-US.json b/communication/btmanager_errorcode401/src/main/js/TestAbility/i18n/en-US.json similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/en-US.json rename to communication/btmanager_errorcode401/src/main/js/TestAbility/i18n/en-US.json diff --git a/communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/zh-CN.json b/communication/btmanager_errorcode401/src/main/js/TestAbility/i18n/zh-CN.json similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/zh-CN.json rename to communication/btmanager_errorcode401/src/main/js/TestAbility/i18n/zh-CN.json diff --git a/communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.css b/communication/btmanager_errorcode401/src/main/js/TestAbility/pages/index/index.css similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.css rename to communication/btmanager_errorcode401/src/main/js/TestAbility/pages/index/index.css diff --git a/communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.hml b/communication/btmanager_errorcode401/src/main/js/TestAbility/pages/index/index.hml similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.hml rename to communication/btmanager_errorcode401/src/main/js/TestAbility/pages/index/index.hml diff --git a/communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.js b/communication/btmanager_errorcode401/src/main/js/TestAbility/pages/index/index.js similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.js rename to communication/btmanager_errorcode401/src/main/js/TestAbility/pages/index/index.js diff --git a/communication/bluetooth_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/communication/btmanager_errorcode401/src/main/js/TestRunner/OpenHarmonyTestRunner.js similarity index 100% rename from communication/bluetooth_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js rename to communication/btmanager_errorcode401/src/main/js/TestRunner/OpenHarmonyTestRunner.js diff --git a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js b/communication/btmanager_errorcode401/src/main/js/test/BtMGattAdvertiser401.test.js similarity index 89% rename from communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js rename to communication/btmanager_errorcode401/src/main/js/test/BtMGattAdvertiser401.test.js index b6aa57671..dc8a31b0f 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js +++ b/communication/btmanager_errorcode401/src/main/js/test/BtMGattAdvertiser401.test.js @@ -19,8 +19,8 @@ import bluetooth from '@ohos.bluetoothManager'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest5() { -describe('bluetoothBLETest5', function() { +export default function btManagerAdvertError401Test() { +describe('btManagerAdvertError401Test', function() { let gattServer = null; function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) @@ -70,15 +70,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3000 * @tc.name testStartAdvertising * @tc.desc Test api 401 - parameters setting is null. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3000', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -124,15 +122,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3100 * @tc.name testStartAdvertising * @tc.desc Test api 401 - parameters setting is error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -178,15 +174,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3200 * @tc.name testStartAdvertising * @tc.desc Test api 401 - interval of setting is error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3200', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -226,15 +220,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3300 * @tc.name testStartAdvertising * @tc.desc Test api 401 - txPower of setting is error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3300', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -274,15 +266,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3400 * @tc.name testStartAdvertising * @tc.desc Test api 401 - connectable of setting is error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3400', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -322,15 +312,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3500 * @tc.name testStartAdvertising * @tc.desc Test api 401 - parameters advData is null. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3500', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -359,15 +347,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3600 * @tc.name testStartAdvertising * @tc.desc Test api 401 - serviceUuids of advData is null. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3600', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -406,15 +392,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3700 * @tc.name testStartAdvertising * @tc.desc Test api 401 - manufactureData of advData is null. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3700', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -450,15 +434,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3800 * @tc.name testStartAdvertising * @tc.desc Test api 401 - serviceData of advData is null. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3800', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -494,15 +476,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3900 * @tc.name testStartAdvertising * @tc.desc Test api 401 - manufactureValue of advData is error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_3900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_3900', 0, async function (done) { let serviceValueBuffer = new Uint8Array(4); serviceValueBuffer[0] = 4; serviceValueBuffer[1] = 6; @@ -537,15 +517,13 @@ describe('bluetoothBLETest5', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_4000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_4000 * @tc.name testStartAdvertising * @tc.desc Test api 401 - serviceValue of advData is error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_4000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_GATTADVERT_ERROR_4000', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; diff --git a/communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js b/communication/btmanager_errorcode401/src/main/js/test/BtMGattManager401.test.js similarity index 85% rename from communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js rename to communication/btmanager_errorcode401/src/main/js/test/BtMGattManager401.test.js index 152faeeaf..d5bbd869d 100644 --- a/communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js +++ b/communication/btmanager_errorcode401/src/main/js/test/BtMGattManager401.test.js @@ -17,8 +17,8 @@ import bluetooth from '@ohos.bluetoothManager'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest4() { -describe('bluetoothBLETest4', function() { +export default function btManagerMError401Test() { +describe('btManagerMError401Test', function() { let gattClient = null; function sleep(delay) { return new Promise(resovle => setTimeout(resovle, delay)) @@ -68,15 +68,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_ERROR_0200 * @tc.name testSetBLEMtuSize * @tc.desc Test api 401 - Invalid null parameters. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 1 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_MtuSize_0200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_ERROR_0200', 0, function () { try { gattClient.setBLEMtuSize(); expect(true).assertFalse(); @@ -88,15 +86,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_MtuSize_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_MTUSIZE_ERROR_0300 * @tc.name testSetBLEMtuSize * @tc.desc Test api 401 -error type. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_MtuSize_0300', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_MTUSIZE_ERROR_0300', 0, function () { try { gattClient.setBLEMtuSize(null); expect(true).assertFalse(); @@ -108,14 +104,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0100 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - Invalid null parameters. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0100', 0, async function (done) { try { await gattClient.readCharacteristicValue().then((data) => { if (object != null) { @@ -138,14 +133,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0200 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - Invalid null parameters. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0200', 0, async function (done) { try { await gattClient.readCharacteristicValue(null).then((data) => { console.info('[bluetooth_js] readCharacValue promise data:' @@ -164,14 +158,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0300 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - null serviceUuid. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0300', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -205,14 +198,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0400 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if serviceUuid type is error. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0400', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -246,14 +238,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0500 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - null characteristicUuid. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0500', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -286,14 +277,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0600 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if characteristicUuid is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0600', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -327,14 +317,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0700 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - null characteristicValue. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0700', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -364,14 +353,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0800 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if characteristicValue is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0800', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -402,14 +390,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0900 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - null descriptors. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_0900', 0, async function (done) { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); cccValue[0] = 32; @@ -433,14 +420,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1000 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if descriptors type is error. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1000', 0, async function (done) { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); cccValue[0] = 32; @@ -465,14 +451,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1100 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if serviceUuid of descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1100', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -506,14 +491,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1200 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if serviceUuid of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1200', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -547,14 +531,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1300 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if descriptorUuid of descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1300', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -587,14 +570,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1400 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if descriptorUuid of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1400', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -628,14 +610,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1500 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if descriptorValue of descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1500', 0, async function (done) { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -668,14 +649,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1600 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - if descriptorValue of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1600', 0, async function (done) { let descriptors = []; let descriptor = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB', characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', @@ -706,14 +686,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1700 * @tc.name testReadDescriptorValue * @tc.desc Test 401 -null api by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1700', 0, async function(done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_', 0, async function(done) { try { gattClient.readCharacteristicValue(); expect(true).assertFalse(); @@ -727,14 +706,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1800 * @tc.name testReadDescriptorValue * @tc.desc Test 401 -null readCharacteristicValue by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadCharacteristic_1800', 0, async function(done) { + it('SUB_COMMUNICATION_BTMANAGER_READCHARACTERISTIC_ERROR_1800', 0, async function(done) { try { function readCcc(code, BLECharacteristic) { if (coderror.code != 0) { @@ -758,14 +736,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0100 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - null descriptor. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0100', 0, async function (done) { try { await gattClient.readDescriptorValue().then((object) => { if (object != null) { @@ -787,14 +764,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0200 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - descriptor is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0200', 0, async function (done) { try { await gattClient.readDescriptorValue(null).then((object) => { if (object != null) { @@ -819,14 +795,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0300 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - serviceUuid of descriptor is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0300', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -858,14 +833,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0400 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - serviceUuid of descriptor is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0400', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -897,14 +871,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0500 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - characteristicUuid of descriptor is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0500', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -935,14 +908,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0600 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - characteristicUuid of descriptor is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0600', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -974,14 +946,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0700 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - descriptorUuid of descriptor is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0700', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1012,14 +983,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0800 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - descriptorUuid of descriptor is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0800', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1051,14 +1021,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0900 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - descriptorValue of descriptor is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_0900', 0, async function (done) { try { let descriptor = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB', characteristicUuid: '00001830-0000-1000-8000-00805F9B34FB', @@ -1086,14 +1055,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_1000 * @tc.name testReadDescriptorValue * @tc.desc Test 401 - descriptorValue of descriptor is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_1000', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1125,14 +1093,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_1100 * @tc.name testReadDescriptorValue * @tc.desc Test 401 -null readDescriptorValue by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_1100', 0, async function (done) { try { gattClient.readDescriptorValue(); expect(true).assertFalse(); @@ -1146,14 +1113,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_1200 * @tc.name testReadDescriptorValue * @tc.desc Test 401 -null readDescriptorValue by callback. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_READDESCRIPTOR_ERROR_1200', 0, async function (done) { try { function readDesc(code, BLEDescriptor) { if (code.code != 0) { @@ -1177,14 +1143,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0100 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - api of null parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0100', 0, function () { try { gattClient.writeCharacteristicValue(); expect(true).assertFalse(); @@ -1196,14 +1161,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0200 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - api of error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0200', 0, function () { try { gattClient.writeCharacteristicValue(null); expect(true).assertFalse(); @@ -1215,14 +1179,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0300 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -null serviceUuid. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0300', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0300', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1248,14 +1211,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0400 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -serviceUuid is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0400', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0400', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1281,14 +1243,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0500 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - null characteristicUuid. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0500', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0500', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1313,14 +1274,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0600 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - characteristicUuid is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0600', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0600', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1346,14 +1306,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0700 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - null characteristicValue. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0700', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0700', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1376,14 +1335,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0800 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - characteristicValue is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0800', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0800', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1406,14 +1364,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0900 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 - null descriptors. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_0900', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_0900', 0, function () { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -1431,14 +1388,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1000 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1000', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1000', 0, function () { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -1456,14 +1412,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1100 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -null serviceUuid of descriptors. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1100', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1489,14 +1444,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1200 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -serviceUuid of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1200', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1522,14 +1476,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1300 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -characteristicUuid of descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1300', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1300', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1554,14 +1507,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1400 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -characteristicUuid of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1400', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1400', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1587,14 +1539,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1500 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -descriptorUuid of descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1500', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1500', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1620,14 +1571,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1600 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -descriptorUuid of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1600', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1600', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1653,14 +1603,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1700 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -descriptorValue of descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1700', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1600', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -1686,14 +1635,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1800 * @tc.name testWriteCharacteristicValue * @tc.desc Test 401 -descriptorValue of descriptors is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteCharacteristic_1800', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITECHARACTERISTIC_ERROR_1800', 0, function () { try { let descriptors = []; let descriptor = {serviceUuid:'00001820-0000-1000-8000-00805F9B34FB', @@ -1716,14 +1664,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0100 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - api is null parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0100', 0, function () { try { gattClient.writeDescriptorValue(); expect(true).assertFalse(); @@ -1735,14 +1682,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0200 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - api is error parameter. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0200', 0, function () { try { gattClient.writeDescriptorValue(null); expect(true).assertFalse(); @@ -1754,14 +1700,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0300 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - null serviceUuid. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0300', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0300', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1779,14 +1724,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0400 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - serviceUuid is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0400', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0400', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1804,14 +1748,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0500 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - characteristicUuid is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0500', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0500', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1828,14 +1771,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0600 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - characteristicUuid is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0600', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0600', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1853,14 +1795,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0700 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - descriptorUuid is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0700', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0700', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1877,14 +1818,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0800 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - descriptorUuid is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0800', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0800', 0, function () { try { let arrayBuffer = new ArrayBuffer(8); let desValue = new Uint8Array(arrayBuffer); @@ -1902,14 +1842,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0900 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - descriptorValue is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0900', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_0900', 0, function () { try { let descriptor = {serviceUuid: '00001820-0000-1000-8000-00805F9B34FB', characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', @@ -1924,14 +1863,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_1000 * @tc.name testWriteDescriptorValue * @tc.desc Test 401 - descriptorValue is error type. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_1000', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_WRITEDESCRIPTOR_ERROR_1000', 0, function () { try { let descriptor = {serviceUuid: '00001820-0000-1000-8000-00805F9B34FB', characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', @@ -1946,14 +1884,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0100 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - parameter of api is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0100', 0, function () { try { gattClient.setNotifyCharacteristicChanged(); expect(true).assertFalse(); @@ -1965,14 +1902,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0200 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - first parameter of api is error type . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0200', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0200', 0, function () { try { gattClient.setNotifyCharacteristicChanged(null, true); expect(true).assertFalse(); @@ -1984,14 +1920,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0300 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - second parameter of api is null . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0300', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0300', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2018,14 +1953,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0400 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - serviceUuid is null . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0400', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0400', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2052,14 +1986,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0500 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - serviceUuid is error type . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0500', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0500', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2086,14 +2019,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0600 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - characteristicUuid is null . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0600', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0600', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2119,14 +2051,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0700 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - characteristicUuid is error type . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0700', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0700', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2153,14 +2084,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0800 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - characteristicValue is null . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0800', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0800', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2186,14 +2116,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0900 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - characteristicValue is error type . - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_0900', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_0900', 0, function () { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -2217,14 +2146,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_1000 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - descriptors is null. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1000', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_1000', 0, function () { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -2242,14 +2170,14 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_1100 * @tc.name testSetNotifyCharacteristicChanged * @tc.desc Test 401 - descriptors is error type. * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_BLE_SetNotifyCharacteristic_1100', 0, function () { + it('SUB_COMMUNICATION_BTMANAGER_SETNOTIFYCHARACTERISTIC_ERROR_1100', 0, function () { try { let arrayBufferCCC = new ArrayBuffer(8); let cccValue = new Uint8Array(arrayBufferCCC); @@ -2267,14 +2195,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_createGattClientDevice_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_CREATEGATTCLIDEV_ERROR_0100 * @tc.name test createGattClientDevice * @tc.desc Test createGattClientDevice 401. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_createGattClientDevice_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_CREATEGATTCLIDEV_ERROR_0100', 0, async function (done) { try { let gattClient = bluetooth.BLE.createGattClientDevice(); gattClient.close(); @@ -2289,14 +2216,13 @@ describe('bluetoothBLETest4', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_createGattClientDevice_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_CREATEGATTCLIDEV_ERROR_0200 * @tc.name test createGattClientDevice * @tc.desc Test createGattClientDevice 401. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_createGattClientDevice_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_CREATEGATTCLIDEV_ERROR_0200', 0, async function (done) { try { let gattClient = bluetooth.BLE.createGattClientDevice(null); gattClient.close(); diff --git a/communication/bluetooth_ble/src/main/js/test/List.test.js b/communication/btmanager_errorcode401/src/main/js/test/List.test.js similarity index 72% rename from communication/bluetooth_ble/src/main/js/test/List.test.js rename to communication/btmanager_errorcode401/src/main/js/test/List.test.js index 29919a2e5..82e9e7a38 100644 --- a/communication/bluetooth_ble/src/main/js/test/List.test.js +++ b/communication/btmanager_errorcode401/src/main/js/test/List.test.js @@ -13,11 +13,9 @@ * limitations under the License. */ -import bluetoothBLETest from './BleGattManager.test.js' -import bluetoothBLETest1 from './BleService.test.js' -import bluetoothBLETest2 from './BleAdvertiser.test.js' +import btManagerMError401Test from './BtMGattManager401.test.js' +import btManagerAdvertError401Test from './BtMGattAdvertiser401.test.js' export default function testsuite() { -bluetoothBLETest() -bluetoothBLETest1() -bluetoothBLETest2() + btManagerMError401Test() + btManagerAdvertError401Test() } diff --git a/communication/bluetooth_switchoff/src/main/resources/base/element/string.json b/communication/btmanager_errorcode401/src/main/resources/base/element/string.json similarity index 100% rename from communication/bluetooth_switchoff/src/main/resources/base/element/string.json rename to communication/btmanager_errorcode401/src/main/resources/base/element/string.json diff --git a/communication/bluetooth_switchoff/src/main/resources/base/media/icon.png b/communication/btmanager_errorcode401/src/main/resources/base/media/icon.png similarity index 100% rename from communication/bluetooth_switchoff/src/main/resources/base/media/icon.png rename to communication/btmanager_errorcode401/src/main/resources/base/media/icon.png diff --git a/communication/btmanager_switchoff/BUILD.gn b/communication/btmanager_switchoff/BUILD.gn new file mode 100644 index 000000000..d0dabc33a --- /dev/null +++ b/communication/btmanager_switchoff/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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("//test/xts/tools/build/suite.gni") +ohos_js_hap_suite("ActsBtManagerSwitchOff003JsTest") { + hap_profile = "./src/main/config.json" + deps = [ + ":bluetooth_js_assets", + ":bluetooth_resources", + ] + + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsBtManagerSwitchOff003HapTest" + part_name = "bluetooth" + subsystem_name = "communication" +} +ohos_js_assets("bluetooth_js_assets") { + js2abc = true + hap_profile = "./src/main/config.json" + source_dir = "./src/main/js" +} +ohos_resources("bluetooth_resources") { + sources = [ "./src/main/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/communication/bluetooth_switchoff/Test.json b/communication/btmanager_switchoff/Test.json similarity index 89% rename from communication/bluetooth_switchoff/Test.json rename to communication/btmanager_switchoff/Test.json index bd65ac1a6..b55c8bb89 100644 --- a/communication/bluetooth_switchoff/Test.json +++ b/communication/btmanager_switchoff/Test.json @@ -11,7 +11,7 @@ "kits": [ { "test-file-name": [ - "ActsBluetoothSwitchHapTest.hap" + "ActsBtManagerSwitchOff003HapTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/communication/bluetooth_on/signature/openharmony_sx.p7b b/communication/btmanager_switchoff/signature/openharmony_sx.p7b similarity index 100% rename from communication/bluetooth_on/signature/openharmony_sx.p7b rename to communication/btmanager_switchoff/signature/openharmony_sx.p7b diff --git a/communication/bluetooth_on/src/main/config.json b/communication/btmanager_switchoff/src/main/config.json similarity index 96% rename from communication/bluetooth_on/src/main/config.json rename to communication/btmanager_switchoff/src/main/config.json index 2881d7e36..be7e6e67b 100644 --- a/communication/bluetooth_on/src/main/config.json +++ b/communication/btmanager_switchoff/src/main/config.json @@ -96,10 +96,6 @@ "when": "inuse" } }, - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, { "name": "ohos.permission.MANAGE_BLUETOOTH", "reason": "", @@ -110,6 +106,10 @@ "when": "inuse" } }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", + "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.DISCOVER_BLUETOOTH", "reason": "", diff --git a/communication/btmanager_switchoff/src/main/js/MainAbility/app.js b/communication/btmanager_switchoff/src/main/js/MainAbility/app.js new file mode 100644 index 000000000..363f2555b --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/MainAbility/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/communication/btmanager_switchoff/src/main/js/MainAbility/i18n/en-US.json b/communication/btmanager_switchoff/src/main/js/MainAbility/i18n/en-US.json new file mode 100644 index 000000000..a4c13dcbd --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/MainAbility/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/js/MainAbility/i18n/zh-CN.json b/communication/btmanager_switchoff/src/main/js/MainAbility/i18n/zh-CN.json new file mode 100644 index 000000000..b1c02368f --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/MainAbility/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.css b/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.css new file mode 100644 index 000000000..e84b0d630 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.css @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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. + */ + +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.hml b/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.hml new file mode 100644 index 000000000..43848d302 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.hml @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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. + */ + +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.js b/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.js new file mode 100644 index 000000000..014e63a26 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/MainAbility/pages/index/index.js @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * 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. + */ + + + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + console.info('onShow finish') + }, + onReady() { + console.info('onReady finish') + }, +} + diff --git a/communication/btmanager_switchoff/src/main/js/TestAbility/app.js b/communication/btmanager_switchoff/src/main/js/TestAbility/app.js new file mode 100644 index 000000000..cdc31f3dc --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestAbility/app.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' + +export default { + onCreate() { + console.info('TestApplication onCreate') + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, + onDestroy() { + console.info("TestApplication onDestroy"); + } +}; diff --git a/communication/btmanager_switchoff/src/main/js/TestAbility/i18n/en-US.json b/communication/btmanager_switchoff/src/main/js/TestAbility/i18n/en-US.json new file mode 100644 index 000000000..3cb24b374 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestAbility/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/js/TestAbility/i18n/zh-CN.json b/communication/btmanager_switchoff/src/main/js/TestAbility/i18n/zh-CN.json new file mode 100644 index 000000000..c804e32c0 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestAbility/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.css b/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.css new file mode 100644 index 000000000..b1bcd4338 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.css @@ -0,0 +1,30 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +@media screen and (device-type: phone) and (orientation: landscape) { + .title { + font-size: 60px; + } +} + +@media screen and (device-type: tablet) and (orientation: landscape) { + .title { + font-size: 100px; + } +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.hml b/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.hml new file mode 100644 index 000000000..f629c71a9 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.js b/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.js new file mode 100644 index 000000000..88b083a7f --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestAbility/pages/index/index.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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. + */ + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} + + + diff --git a/communication/btmanager_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/communication/btmanager_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js new file mode 100644 index 000000000..c5fa8620c --- /dev/null +++ b/communication/btmanager_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package', '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key] + } + } + return targetParams.trim() +} + + export default { + onPrepare() { + console.info('OpenHarmonyTestRunner OnPrepare') + }, + onRun() { + console.log('OpenHarmonyTestRunner onRun run') + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + console.info('debug value : '+debug) + if (debug == 'true') + { + cmd += ' -D' + } + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + data.stdResult); + console.info('executeShellCommand : data : ' + data.exitCode); + }) + } +}; diff --git a/communication/bluetooth_switchoff/src/main/js/test/List.test.js b/communication/btmanager_switchoff/src/main/js/test/List.test.js similarity index 84% rename from communication/bluetooth_switchoff/src/main/js/test/List.test.js rename to communication/btmanager_switchoff/src/main/js/test/List.test.js index 66d5e311d..26b085eeb 100644 --- a/communication/bluetooth_switchoff/src/main/js/test/List.test.js +++ b/communication/btmanager_switchoff/src/main/js/test/List.test.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import bluetoothBLETest3 from './SwitchOff003.test.js' +import btManagerError003Test from './btManagerSwitchOff003.test.js' export default function testsuite() { -bluetoothBLETest3() + btManagerError003Test() } diff --git a/communication/bluetooth_switchoff/src/main/js/test/SwitchOff003.test.js b/communication/btmanager_switchoff/src/main/js/test/btManagerSwitchOff003.test.js similarity index 83% rename from communication/bluetooth_switchoff/src/main/js/test/SwitchOff003.test.js rename to communication/btmanager_switchoff/src/main/js/test/btManagerSwitchOff003.test.js index 18fbea875..1433c8e10 100644 --- a/communication/bluetooth_switchoff/src/main/js/test/SwitchOff003.test.js +++ b/communication/btmanager_switchoff/src/main/js/test/btManagerSwitchOff003.test.js @@ -17,8 +17,8 @@ import bluetoothManager from '@ohos.bluetoothManager'; import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function bluetoothBLETest3() { -describe('bluetoothBLETest3', function() { +export default function btManagerError003Test() { +describe('btManagerError003Test', function() { let gattServer = null; let gattClient = null; function sleep(delay) { @@ -68,22 +68,20 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0100 * @tc.name test bluetooth Profile ConnectionState * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0100', 0, async function (done) { await sleep(3000); - let sta = bluetoothManager.getState(); - console.info('[bluetooth_js] bt getState:'+ JSON.stringify(sta)); try { + let sta = bluetoothManager.getState(); + console.info('[bluetooth_js] bt getState:'+ JSON.stringify(sta)); let connState = bluetoothManager.getBtConnectionState(); console.info('[bluetooth_js] get bt connection state result' - + JSON.stringify(connState)); + + JSON.stringify(connState)); expect(true).assertFalse(); done(); } catch (error) { @@ -95,15 +93,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0200 * @tc.name Test pairDevice api * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0200', 0, async function (done) { try { bluetoothManager.pairDevice("11:22:55:66:33:44"); expect(true).assertFalse(); @@ -117,15 +113,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0300 * @tc.name test getRemoteDeviceName * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0300', 0, async function (done) { try { let ret = bluetoothManager.getRemoteDeviceName("00:00:00:00:00:00"); console.info('[bluetooth_js] getRemoteDeviceName ret2:' + JSON.stringify(ret)); @@ -141,15 +135,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0400 * @tc.name test getRemoteDeviceClass * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0400', 0, async function (done) { try { let DeviceClass = bluetoothManager.getRemoteDeviceClass("00:00:00:00:00:00"); console.info('[bluetooth_js] getRemoteDeviceClass ret2 :' + JSON.stringify(DeviceClass) @@ -166,15 +158,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0500 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0500 * @tc.name test get PairedDevices * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0500', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0500', 0, async function (done) { try { let ret = bluetoothManager.getPairedDevices(); console.info('[bluetooth_js] getPairedDevices ret2:' + JSON.stringify(ret)); @@ -189,15 +179,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0600 * @tc.name test Get A2DP ConnectionState * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0600', 0, async function (done) { try { let a2dpSrcConn = bluetoothManager.getProfileConnectionState(bluetoothManager.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]get a2dp result:' + JSON.stringify(a2dpSrcConn)); @@ -212,15 +200,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0700 * @tc.name Test setDevicePairing * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0700', 0, async function (done) { try { bluetoothManager.setDevicePairingConfirmation("11:22:55:66:33:44",false); expect(true).assertFalse(); @@ -234,15 +220,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0800 * @tc.name setLocalName * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0800', 0, async function (done) { try { let newName = 'my bluetooth'; bluetoothManager.setLocalName(newName); @@ -257,15 +241,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0900 * @tc.name TEST setBluetoothScanMode * @tc.desc TEST 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0900', 0, async function (done) { try { bluetoothManager.setBluetoothScanMode(bluetoothManager.ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE,0); expect(true).assertFalse(); @@ -279,15 +261,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1000 * @tc.name TEST getBluetoothScanMode * @tc.desc TEST 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1000', 0, async function (done) { try { let oldScanMode = bluetoothManager.getBluetoothScanMode(); console.info('[bluetooth_js] getBluetoothScanMode = '+ JSON.stringify(oldScanMode)); @@ -302,15 +282,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1100 * @tc.name TEST startBluetoothDiscovery * @tc.desc TEST 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1100', 0, async function (done) { try { bluetoothManager.startBluetoothDiscovery(); expect(true).assertFalse(); @@ -324,15 +302,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1200 * @tc.name TEST stopBluetoothDiscovery * @tc.desc TEST 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1200', 0, async function (done) { try { bluetoothManager.stopBluetoothDiscovery(); expect(true).assertFalse(); @@ -346,15 +322,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1600 * @tc.name test getDevice HFP State. * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1600', 0, async function (done) { try { let hfpSrc = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let retArray = hfpSrc.getConnectionDevices(); @@ -370,15 +344,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1700 * @tc.name test getDeviceState. * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1700', 0, async function (done) { try { let hfpSrc = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); let ret = hfpSrc.getDeviceState('11:22:33:44:55:66'); @@ -394,15 +366,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1800 * @tc.name test A2DP Connect * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1800', 0, async function (done) { try { let a2dpSrc = bluetoothManager.getProfile(bluetoothManager.ProfileId.PROFILE_A2DP_SOURCE); a2dpSrc.connect('11:22:33:44:55:77'); @@ -418,15 +388,13 @@ describe('bluetoothBLETest3', function() { /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_1900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1900 * @tc.name test A2DP disconnect * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_1900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1900', 0, async function (done) { try { let a2dpSrc = bluetoothManager.getProfile(bluetoothManager.ProfileId.PROFILE_A2DP_SOURCE); a2dpSrc.disconnect('11:22:33:44:55:77'); @@ -441,15 +409,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_2000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2000 * @tc.name test get A2DP Playing State * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_2000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2000', 0, async function (done) { try { let a2dpSrc = bluetoothManager.getProfile(bluetoothManager.ProfileId.PROFILE_A2DP_SOURCE); console.info('[bluetooth_js]a2dp get profile result:' + JSON.stringify(a2dpSrc)); @@ -466,15 +432,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_2100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2100 * @tc.name test HFP Connect * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_2100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2100', 0, async function (done) { try { let hfpSrc = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); @@ -490,15 +454,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_2200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2200 * @tc.name test HFP disconnect * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 8 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_2200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2200', 0, async function (done) { try { let hfpSrc = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY); @@ -514,15 +476,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_2800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2800 * @tc.name testClassicStartBLEScan * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_2800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2800', 0, async function (done) { try { bluetoothManager.BLE.startBLEScan( [{ @@ -547,15 +507,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_2900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2900 * @tc.name testClassicStartBLEScan * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_2900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_2900', 0, async function (done) { try { bluetoothManager.BLE.stopBLEScan(); expect(true).assertFalse(); @@ -569,15 +527,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3000 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3000 * @tc.name testStartAdvertising * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3000', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3000', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -628,15 +584,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3100 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3100 * @tc.name teststopAdvertising * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 0 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3100', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3100', 0, async function (done) { let manufactureValueBuffer = new Uint8Array(4); manufactureValueBuffer[0] = 1; manufactureValueBuffer[1] = 2; @@ -681,14 +635,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3200 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3200 * @tc.name testAddService * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3200', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SwitchOff_3200', 0, async function (done) { try { let descriptors = []; let arrayBuffer = new ArrayBuffer(8); @@ -720,14 +673,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3300 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3300 * @tc.name test removeService * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 2 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3300', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3300', 0, async function (done) { try { gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB'); expect(true).assertFalse(); @@ -741,14 +693,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3400 * @tc.name test removeService * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3400', 0, async function (done) { try { gattServer.close(); expect(true).assertFalse(); @@ -762,14 +713,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3600 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3600 * @tc.name testSendResponse success * @tc.desc Test 2900003 - Bluetooth switch is off. - * @tc.size MEDIUM * @tc.type Function * @tc.level Level 1 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3600', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3600', 0, async function (done) { try { let arrayBuffer = new ArrayBuffer(8); let value = new Uint8Array(arrayBuffer); @@ -789,15 +739,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3700 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3700 * @tc.name test gatt connect * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3700', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3700', 0, async function (done) { try { gattClient.connect(); await sleep(2000); @@ -811,15 +759,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3800 * @tc.name test gatt disconnect * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3800', 0, async function (done) { try { gattClient.disconnect(); expect(true).assertFalse(); @@ -832,15 +778,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_3900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3900 * @tc.name test gatt close * @tc.desc Test 2900003 - Bluetooth switch is off - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_SwitchOff_3900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_3900', 0, async function (done) { try { gattClient.close(); expect(true).assertFalse(); @@ -853,15 +797,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0800 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0800 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('COMMUNICATION_BLUETOOTH_BLE_Scan_0800', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0800', 0, async function (done) { try { let state = bluetoothManager.getState(); console.info('[bluetooth_js] bt turn off1:'+ JSON.stringify(state)); @@ -901,15 +843,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0900 + * @tc.number SUB_COMMUNICATION_BTMANAGER_BLESCAN_0900 * @tc.name testClassicStartBLEScan * @tc.desc Test ClassicStartBLEScan api. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0900', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_BLESCAN_0900', 0, async function (done) { bluetooth.disableBluetooth(); await sleep(3000); let state = bluetooth.getState(); @@ -936,15 +876,13 @@ describe('bluetoothBLETest3', function() { }) /** - * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0400 + * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCH_0400 * @tc.name testEnableBluetooth * @tc.desc Test EnableBluetooth api by promise. - * @tc.size MEDIUM - * @ since 7 * @tc.type Function * @tc.level Level 3 */ - it('SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0400', 0, async function (done) { + it('SUB_COMMUNICATION_BTMANAGER_SWITCH_0400', 0, async function (done) { let state = bluetooth.getState(); console.info('[bluetooth_js] getState1 off = '+ JSON.stringify(state)); if(state == bluetooth.BluetoothState.STATE_OFF) { @@ -958,6 +896,4 @@ describe('bluetoothBLETest3', function() { done(); }) }) -} - - +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/resources/base/element/string.json b/communication/btmanager_switchoff/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d4b2a0a05 --- /dev/null +++ b/communication/btmanager_switchoff/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "app_name", + "value": "OsAccountTest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "TestAbility_desc", + "value": "description" + }, + { + "name": "TestAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/communication/btmanager_switchoff/src/main/resources/base/media/icon.png b/communication/btmanager_switchoff/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y { @@ -86,12 +86,12 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_Event_Test_0002 - * @tc.name testWifiConnectionChange - * @tc.desc Test wifiConnectionChange callback - * @tc.type Function - * @tc.level Level 3 - */ + * @tc.number SUB_Communication_WiFi_Event_Test_0002 + * @tc.name testWifiConnectionChange + * @tc.desc Test wifiConnectionChange callback + * @tc.type Function + * @tc.level Level 3 + */ it('SUB_Communication_WiFi_Event_Test_0002', 0, async function (done) { let wifiConnectionState = "wifiConnectionChange"; let wifiConnectionChangeCallback = result => { @@ -104,12 +104,12 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_Event_Test_0003 - * @tc.name testWifiScanStateChange - * @tc.desc Test wifiScanStateChange callback - * @tc.type Function - * @tc.level Level 3 - */ + * @tc.number SUB_Communication_WiFi_Event_Test_0003 + * @tc.name testWifiScanStateChange + * @tc.desc Test wifiScanStateChange callback + * @tc.type Function + * @tc.level Level 3 + */ it('SUB_Communication_WiFi_Event_Test_0003', 0, async function (done) { let wifiScanState = "wifiScanStateChange"; let wifiScanStateChangeCallback = result => { @@ -123,12 +123,12 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_Event_Test_0004 - * @tc.name testWifiRssiChange - * @tc.desc Test wifiRssiChange callback - * @tc.type Function - * @tc.level Level 3 - */ + * @tc.number SUB_Communication_WiFi_Event_Test_0004 + * @tc.name testWifiRssiChange + * @tc.desc Test wifiRssiChange callback + * @tc.type Function + * @tc.level Level 3 + */ it('SUB_Communication_WiFi_Event_Test_0004', 0, async function (done) { let wifiRssiState = "wifiRssiChange"; let wifiRssiChangeCallback = result => { @@ -141,12 +141,12 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_Event_Test_0005 - * @tc.name testHotspotStateChange - * @tc.desc Test hotspotStateChange api. - * @tc.type Function - * @tc.level Level 3 - */ + * @tc.number SUB_Communication_WiFi_Event_Test_0005 + * @tc.name testHotspotStateChange + * @tc.desc Test hotspotStateChange api. + * @tc.type Function + * @tc.level Level 3 + */ it('SUB_Communication_WiFi_Event_Test_0005', 0, async function (done) { let hotspotState = "hotspotStateChange"; let hotspotStateChangeCallback = result => { @@ -159,11 +159,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0008 - * @tc.name testenableHotspot - * @tc.desc Test enableHotspot api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0008 + * @tc.name testenableHotspot + * @tc.desc Test enableHotspot api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0008', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0008 start'); let ret = false; @@ -183,11 +183,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0009 - * @tc.name testdisableHotspot - * @tc.desc Test disableHotspot api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0009 + * @tc.name testdisableHotspot + * @tc.desc Test disableHotspot api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0009', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0009 start'); let ret = false; @@ -207,11 +207,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0010 - * @tc.name testgetSupportedPowerMode - * @tc.desc Test getSupportedPowerMode api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0010 + * @tc.name testgetSupportedPowerMode + * @tc.desc Test getSupportedPowerMode api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0010', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0010 start'); let ret = false; @@ -234,11 +234,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0011 - * @tc.name testgetSupportedPowerMode - * @tc.desc Test getSupportedPowerMode api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0011 + * @tc.name testgetSupportedPowerMode + * @tc.desc Test getSupportedPowerMode api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0011', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0011 start'); let ret = false; @@ -271,11 +271,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0012 - * @tc.name testgetPowerMode - * @tc.desc Test getPowerMode api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0012 + * @tc.name testgetPowerMode + * @tc.desc Test getPowerMode api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0012', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0012 start'); let ret = false; @@ -298,11 +298,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0013 - * @tc.name testgetPowerMode - * @tc.desc Test getPowerMode api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0013 + * @tc.name testgetPowerMode + * @tc.desc Test getPowerMode api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0013', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0013 start'); let ret = false; @@ -335,11 +335,11 @@ export default function actsWifiManagerEventTest() { }) /** - * @tc.number SUB_Communication_WiFi_SysCaps_Test_0014 - * @tc.name testsetPowerModel - * @tc.desc Test setPowerModel api. - * @tc.type Function - */ + * @tc.number SUB_Communication_WiFi_SysCaps_Test_0014 + * @tc.name testsetPowerMode + * @tc.desc Test setPowerMode api. + * @tc.type Function + */ it('SUB_Communication_WiFi_SysCaps_Test_0014', 0, async function (done) { console.info('SUB_Communication_WiFi_SysCaps_Test_0014 start'); let ret = false; @@ -347,7 +347,7 @@ export default function actsWifiManagerEventTest() { var isAccessToken = canIUse("SystemCapability.Communication.wifiMg.AP.Extension"); console.info("SUB_Communication_WiFi_SysCaps_Test_0014 test.syscap.param.001 : " + isAccessToken); if (isAccessToken) { - console.info("[wifi_test] setPowerModel: " + wifiManagerExt.setPowerModel(PowerModel)) + console.info("[wifi_test] setPowerMode: " + wifiManagerExt.setPowerMode(PowerModel)) done(); } expect(isAccessToken).assertFalse(); -- GitLab